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

rebase on latest code, refine android build
This commit is contained in:
volvet 2014-03-06 13:55:16 +08:00
commit 54c63e2547

View File

@ -3,22 +3,18 @@ include build/platform-arch.mk
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 @@ $(error TARGET is not set)
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)