[vlc-commits] contrib: set android specifics

Rafaël Carré git at videolan.org
Sun Nov 27 09:57:06 CET 2011


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun Nov 27 03:56:20 2011 -0500| [a8fe060f3f5e17af2aa7b7bafb599b80e4a3181f] | committer: Rafaël Carré

contrib: set android specifics

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a8fe060f3f5e17af2aa7b7bafb599b80e4a3181f
---

 contrib/bootstrap    |   11 +++++++++++
 contrib/src/main.mak |   17 +++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/contrib/bootstrap b/contrib/bootstrap
index 647a600..170b8f1 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -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"
 		;;
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 2e69863..5ec18ee 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -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



More information about the vlc-commits mailing list