Commit a8fe060f authored by Rafaël Carré's avatar Rafaël Carré

contrib: set android specifics

parent 259b9e4b
......@@ -151,6 +151,13 @@ check_macosx_sdk()
add_make "OSX_VERSION ?= ${OSX_VERSION}"
}
check_android_sdk()
{
[ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
add_make "ANDROID_NDK := ${ANDROID_NDK}"
test -z "${NO_NEON}" && add_make_enabled "HAVE_NEON"
}
test -z "$PREFIX" || add_make "PREFIX := $PREFIX"
test -z "$BUILD_DISCS" || add_make_enabled "BUILD_DISCS"
test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS"
......@@ -170,6 +177,10 @@ case "${OS}" in
*bsd*)
add_make_enabled "HAVE_BSD"
;;
linux-androideabi)
check_android_sdk
add_make_enabled "HAVE_LINUX" "HAVE_ANDROID"
;;
*linux*)
add_make_enabled "HAVE_LINUX"
;;
......
......@@ -92,6 +92,23 @@ STRIP := $(HOST)-strip
endif
endif
ifdef HAVE_ANDROID
CC := $(HOST)-gcc --sysroot=$(ANDROID_NDK)/platforms/android-9/arch-arm
CXX := $(HOST)-g++ --sysroot=$(ANDROID_NDK)/platforms/android-9/arch-arm
# Kludge for C++ prebuilt compiler
EXTRA_CFLAGS += -D__STDC_VERSION__=199901L
EXTRA_CFLAGS += -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/include
ifdef HAVE_NEON
EXTRA_CFLAGS += -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include
else
EXTRA_CFLAGS += -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include
endif
# Change HOST to not confuse autotools
HOST=arm-eabi
endif
ifdef HAVE_MACOSX
MACOSX_SDK=/Developer/SDKs/MacOSX$(OSX_VERSION).sdk
CC=gcc-4.2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment