shithub: openh264

Download patch

ref: 54c63e254744d5b0cca77dde8f4490e94fbe5a57
parent: d292179095be94d8f4ddaf97d21b1c793c039afa
parent: 585c526b1f9a36a565b3a56ba143e7b51b463692
author: volvet <[email protected]>
date: Thu Mar 6 08:55:16 EST 2014

Merge pull request #423 from licaiguo/refine-android-build-pr

rebase on latest code, refine android build

--- a/build/platform-android.mk
+++ b/build/platform-android.mk
@@ -3,22 +3,18 @@
 SHAREDLIBSUFFIX = so
 GCCVERSION = 4.8
 NDKLEVEL = 12
-HOSTOS = $(shell uname | tr A-Z a-z | tr -d \\-[:digit:].)
-HOSTARCH = $(shell uname -m)
 ifeq ($(ARCH), arm)
-    GCCPATHPREFIX = arm-linux-androideabi
-    GCCPREFIX = arm-linux-androideabi
     CFLAGS += -march=armv7-a -mfloat-abi=softfp
     CFLAGS += -mfpu=vfpv3-d16
     LDFLAGS += -march=armv7-a -Wl,--fix-cortex-a8
     APP_ABI = armeabi-v7a
+    TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=./codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=armeabi)
   ifeq (Yes, $(USE_ASM))
     ASMFLAGS += -march=armv7-a -mfpu=neon
   endif
 else
-    GCCPATHPREFIX = x86
-    GCCPREFIX = i686-linux-android
     APP_ABI = x86
+    TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=./codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=x86)
   ifeq (Yes, $(USE_ASM))
     ASMFLAGS += -DNOPREFIX -f elf32
   endif
@@ -32,9 +28,9 @@
 endif
 
 SYSROOT = $(NDKROOT)/platforms/android-$(NDKLEVEL)/arch-$(ARCH)
-CXX = $(NDKROOT)/toolchains/$(GCCPATHPREFIX)-$(GCCVERSION)/prebuilt/$(HOSTOS)-$(HOSTARCH)/bin/$(GCCPREFIX)-g++
-CC = $(NDKROOT)/toolchains/$(GCCPATHPREFIX)-$(GCCVERSION)/prebuilt/$(HOSTOS)-$(HOSTARCH)/bin/$(GCCPREFIX)-gcc
-AR = $(NDKROOT)/toolchains/$(GCCPATHPREFIX)-$(GCCVERSION)/prebuilt/$(HOSTOS)-$(HOSTARCH)/bin/$(GCCPREFIX)-ar
+CXX = $(TOOLCHAINPREFIX)g++
+CC = $(TOOLCHAINPREFIX)gcc
+AR = $(TOOLCHAINPREFIX)ar
 CFLAGS += -DLINUX -DANDROID_NDK -fpic --sysroot=$(SYSROOT)
 CXXFLAGS += -fno-rtti -fno-exceptions
 LDFLAGS += --sysroot=$(SYSROOT)