shithub: openh264

Download patch

ref: 585c526b1f9a36a565b3a56ba143e7b51b463692
parent: 8beb3c8c09db358068d8f9d081c9a3a274b6e768
author: Licai Guo <[email protected]>
date: Wed Mar 5 12:32:03 EST 2014

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)