shithub: openh264

Download patch

ref: df6f92096ac1fad79de4dde4f9b5f63f415d786d
parent: a97789de6dabebac0922aecbbb59b3ed89183aeb
parent: a8a2c5eaba6cf7beeab8521d044fa4b2e703f0fa
author: Ethan Hugg <[email protected]>
date: Thu Feb 20 10:39:22 EST 2014

Merge pull request #330 from mstorsjo/android-build-fixes

Android build fixes/cleanups

--- a/Makefile
+++ b/Makefile
@@ -67,11 +67,11 @@
     -Icodec/processing/interface \
     -Icodec/processing/src/common
 
-GTEST_INCLUDES = \
+GTEST_INCLUDES += \
     -Igtest \
     -Igtest/include
 
-CODEC_UNITTEST_INCLUDES = \
+CODEC_UNITTEST_INCLUDES += \
     -Igtest/include
 
 H264DEC_INCLUDES = $(DECODER_INCLUDES) -Icodec/console/dec/inc
--- a/build/platform-android.mk
+++ b/build/platform-android.mk
@@ -11,6 +11,8 @@
     CFLAGS += -march=armv7-a -mfloat-abi=softfp
 ifeq (Yes, $(HAVE_NEON))
     CFLAGS += -mfpu=neon
+else
+    CFLAGS += -mfpu=vfpv3-d16
 endif
     LDFLAGS += -march=armv7-a -Wl,--fix-cortex-a8
     APP_ABI = armeabi-v7a
@@ -35,14 +37,24 @@
 
 SYSROOT = $(NDKROOT)/platforms/android-$(NDKLEVEL)/arch-$(ARCH)
 CXX = $(NDKROOT)/toolchains/$(GCCPATHPREFIX)-$(GCCVERSION)/prebuilt/$(HOSTOS)-$(HOSTARCH)/bin/$(GCCPREFIX)-g++
-CFLAGS += -DLINUX -fpic --sysroot=$(SYSROOT) -fno-rtti -fno-exceptions
-LDFLAGS += --sysroot=$(SYSROOT) -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-soname,libwels.so
+CC = $(NDKROOT)/toolchains/$(GCCPATHPREFIX)-$(GCCVERSION)/prebuilt/$(HOSTOS)-$(HOSTARCH)/bin/$(GCCPREFIX)-gcc
+AR = $(NDKROOT)/toolchains/$(GCCPATHPREFIX)-$(GCCVERSION)/prebuilt/$(HOSTOS)-$(HOSTARCH)/bin/$(GCCPREFIX)-ar
+CFLAGS += -DLINUX -fpic --sysroot=$(SYSROOT)
+CXXFLAGS += -fno-rtti -fno-exceptions
+LDFLAGS += --sysroot=$(SYSROOT)
+SHLDFLAGS = -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-soname,libwels.so
 
+STL_INCLUDES = \
+    -I$(NDKROOT)/sources/cxx-stl/gnu-libstdc++/$(GCCVERSION)/include \
+    -I$(NDKROOT)/sources/cxx-stl/gnu-libstdc++/$(GCCVERSION)/libs/$(APP_ABI)/include
 
+GTEST_INCLUDES = $(STL_INCLUDES)
+CODEC_UNITTEST_INCLUDES = $(STL_INCLUDES)
+
 binaries : decdemo encdemo
 
 decdemo: libraries
-	sh -c 'cd ./codec/build/android/dec/jni; $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI); cd ..; android update project -t $(TARGET) -p . ; ant debug; cd ../../../..'
+	cd ./codec/build/android/dec && $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) && android update project -t $(TARGET) -p . && ant debug
 
 encdemo: libraries
-	sh -c 'cd ./codec/build/android/enc/jni; $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI); cd ..; android update project -t $(TARGET) -p . ; ant debug; cd ../../../..'
+	cd ./codec/build/android/enc && $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) && android update project -t $(TARGET) -p . && ant debug
--- a/codec/build/android/dec/jni/welsdecdemo.mk
+++ b/codec/build/android/dec/jni/welsdecdemo.mk
@@ -3,7 +3,7 @@
 
 include $(CLEAR_VARS)
 LOCAL_MODULE    := wels
-LOCAL_SRC_FILES := $(LOCAL_PATH)/../../../../../libwels.so
+LOCAL_SRC_FILES := ../../../../../libwels.so
 include $(PREBUILT_SHARED_LIBRARY)
 
 
--- a/codec/build/android/enc/jni/welsencdemo.mk
+++ b/codec/build/android/enc/jni/welsencdemo.mk
@@ -3,7 +3,7 @@
 
 include $(CLEAR_VARS)
 LOCAL_MODULE    := wels
-LOCAL_SRC_FILES := $(LOCAL_PATH)/../../../../../libwels.so
+LOCAL_SRC_FILES := ../../../../../libwels.so
 include $(PREBUILT_SHARED_LIBRARY)