From 179597b65e06d8d30f4e316dbf0c136e0715f518 Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbx@openadk.org>
Date: Mon, 6 Jan 2014 12:48:20 +0100
Subject: fix lemote yeelong compile

---
 package/libvpx/Makefile                            |  2 +-
 package/libvpx/patches/patch-build_make_Makefile   | 12 ++++----
 .../libvpx/patches/patch-build_make_configure_sh   | 33 ++++++++++++++++++++--
 package/libvpx/patches/patch-build_make_rtcd_sh    | 18 ++++++++++++
 package/libvpx/patches/patch-configure             | 18 ++++++++++++
 5 files changed, 74 insertions(+), 9 deletions(-)
 create mode 100644 package/libvpx/patches/patch-build_make_rtcd_sh
 create mode 100644 package/libvpx/patches/patch-configure

(limited to 'package/libvpx')

diff --git a/package/libvpx/Makefile b/package/libvpx/Makefile
index 8e59ff3e4..97dec8bcb 100644
--- a/package/libvpx/Makefile
+++ b/package/libvpx/Makefile
@@ -70,7 +70,7 @@ ifeq ($(ADK_TARGET_SYSTEM_FON_FON2100),y)
 CONFIGURE_ARGS+=	--target=mips32-linux-gcc
 endif
 ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
-CONFIGURE_ARGS+=	--target=mips32-linux-gcc
+CONFIGURE_ARGS+=	--target=mips64-linux-gcc
 endif
 ifeq ($(ADK_TARGET_SYSTEM_BROADCOM_BCM47XX),y)
 CONFIGURE_ARGS+=	--target=mips32-linux-gcc
diff --git a/package/libvpx/patches/patch-build_make_Makefile b/package/libvpx/patches/patch-build_make_Makefile
index e1a6d5fa8..8a7c04d2d 100644
--- a/package/libvpx/patches/patch-build_make_Makefile
+++ b/package/libvpx/patches/patch-build_make_Makefile
@@ -1,6 +1,6 @@
---- libvpx-v0.9.7-p1.orig/build/make/Makefile	2011-08-15 23:02:45.000000000 +0200
-+++ libvpx-v0.9.7-p1/build/make/Makefile	2011-09-17 18:03:25.467990966 +0200
-@@ -193,8 +193,8 @@ endif
+--- libvpx-v1.2.0.orig/build/make/Makefile	2013-10-14 20:16:36.000000000 +0200
++++ libvpx-v1.2.0/build/make/Makefile	2014-01-06 11:06:33.806841128 +0100
+@@ -210,8 +210,8 @@ endif
  define linker_template
  $(1): $(filter-out -%,$(2))
  $(1):
@@ -9,9 +9,9 @@
 +	$(if $(quiet),@echo    "    [CC] $$@")
 +	$(qexec)$$(CC) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
  endef
- # make-3.80 has a bug with expanding large input strings to the eval function,
- # which was triggered in some cases by the following component of
-@@ -227,8 +227,8 @@ define so_template
+ define linkerxx_template
+ $(1): $(filter-out -%,$(2))
+@@ -250,8 +250,8 @@ define so_template
  #
  # This needs further abstraction for dealing with non-GNU linkers.
  $(1):
diff --git a/package/libvpx/patches/patch-build_make_configure_sh b/package/libvpx/patches/patch-build_make_configure_sh
index 829ede0c8..c080a4c05 100644
--- a/package/libvpx/patches/patch-build_make_configure_sh
+++ b/package/libvpx/patches/patch-build_make_configure_sh
@@ -1,5 +1,5 @@
---- libvpx-v1.2.0.orig/build/make/configure.sh	2013-09-04 20:49:22.000000000 +0200
-+++ libvpx-v1.2.0/build/make/configure.sh	2013-10-14 20:15:20.000000000 +0200
+--- libvpx-v1.2.0.orig/build/make/configure.sh	2013-10-14 20:16:36.000000000 +0200
++++ libvpx-v1.2.0/build/make/configure.sh	2014-01-06 11:27:27.889747488 +0100
 @@ -305,7 +305,7 @@ check_cpp() {
  check_ld() {
      log check_ld "$@"
@@ -9,3 +9,32 @@
  }
  
  check_header(){
+@@ -952,7 +952,7 @@ process_common_toolchain() {
+ 
+         esac
+     ;;
+-    mips*)
++    mips32*)
+         link_with_cc=gcc
+         setup_gnu_toolchain
+         tune_cflags="-mtune="
+@@ -964,6 +964,19 @@ process_common_toolchain() {
+         check_add_asflags -march=${tgt_isa}
+         check_add_asflags -KPIC
+     ;;
++    mips64*)
++        link_with_cc=gcc
++        setup_gnu_toolchain
++        tune_cflags="-mtune="
++        if enabled dspr2; then
++            check_add_cflags -mips32r2 -mdspr2
++            disable fast_unaligned
++        fi
++	# use cflags from adk
++        #check_add_cflags -march=${tgt_isa}
++        #check_add_asflags -march=${tgt_isa}
++        check_add_asflags -KPIC
++    ;;
+     ppc*)
+         enable ppc
+         bits=${tgt_isa##ppc}
diff --git a/package/libvpx/patches/patch-build_make_rtcd_sh b/package/libvpx/patches/patch-build_make_rtcd_sh
new file mode 100644
index 000000000..75ddffe61
--- /dev/null
+++ b/package/libvpx/patches/patch-build_make_rtcd_sh
@@ -0,0 +1,18 @@
+--- libvpx-v1.2.0.orig/build/make/rtcd.sh	2013-10-14 20:16:36.000000000 +0200
++++ libvpx-v1.2.0/build/make/rtcd.sh	2014-01-06 11:24:01.457213627 +0100
+@@ -338,6 +338,15 @@ case $arch in
+     fi
+     mips
+     ;;
++  mips64)
++    ALL_ARCHS=$(filter mips64)
++    dspr2=$([ -f "$config_file" ] && eval echo $(grep HAVE_DSPR2 "$config_file"))
++    HAVE_DSPR2="${dspr2#*=}"
++    if [ "$HAVE_DSPR2" = "yes" ]; then
++        ALL_ARCHS=$(filter mips64 dspr2)
++    fi
++    mips
++    ;;
+   armv5te)
+     ALL_ARCHS=$(filter edsp)
+     arm
diff --git a/package/libvpx/patches/patch-configure b/package/libvpx/patches/patch-configure
new file mode 100644
index 000000000..b53e47b8a
--- /dev/null
+++ b/package/libvpx/patches/patch-configure
@@ -0,0 +1,18 @@
+--- libvpx-v1.2.0.orig/configure	2013-10-14 20:16:36.000000000 +0200
++++ libvpx-v1.2.0/configure	2014-01-06 11:22:14.096914325 +0100
+@@ -98,6 +98,7 @@ all_platforms="${all_platforms} armv7-li
+ all_platforms="${all_platforms} armv7-linux-gcc"     #neon Cortex-A8
+ all_platforms="${all_platforms} armv7-none-rvct"     #neon Cortex-A8
+ all_platforms="${all_platforms} mips32-linux-gcc"
++all_platforms="${all_platforms} mips64-linux-gcc"
+ all_platforms="${all_platforms} ppc32-darwin8-gcc"
+ all_platforms="${all_platforms} ppc32-darwin9-gcc"
+ all_platforms="${all_platforms} ppc32-linux-gcc"
+@@ -210,6 +211,7 @@ ARCH_EXT_LIST="
+     neon
+ 
+     mips32
++    mips64
+     dspr2
+ 
+     mmx
-- 
cgit v1.2.3