[Android] [PATCH] Support build without iconv

Uwe L. Korn uwelk at xhochy.com
Tue May 13 21:52:59 CEST 2014


Make building iconv optional via setting the environment variable
VLC_USE_ICONV=0, this is given correctly to VLC's contrib system
and the linking process of libvlcjni.so
---
 compile.sh                 | 12 ++++++++++--
 vlc-android/jni/Android.mk |  7 ++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/compile.sh b/compile.sh
index 28fae08..2eeca3b 100755
--- a/compile.sh
+++ b/compile.sh
@@ -91,6 +91,14 @@ $ export NO_ARMV6=1
 If you plan to use a release build, run 'compile.sh release'
 EOF
 
+# As default, we will use iconv but provide the option to disable it
+if [ "${VLC_USE_ICONV}" = 0 ]; then
+    CONTRIB_BOOTSTRAP_OPTS+=" --disable-iconv "
+    ANDROID_MKFLAGS+=" USE_ICONV=0 "
+else
+    CONTRIB_BOOTSTRAP_OPTS+=" --ensable-iconv "
+fi
+
 export TARGET_TUPLE
 export PATH_HOST
 export HAVE_ARM
@@ -233,7 +241,7 @@ cd contrib/android
     --disable-samplerate \
     --disable-faad2 \
     --disable-harfbuzz \
-    --enable-iconv
+    ${CONTRIB_BOOTSTRAP_OPTS}
 
 # TODO: mpeg2, theora
 
@@ -292,7 +300,7 @@ export ANDROID_LIBS=${PWD}/android-libs
 export VLC_BUILD_DIR=vlc/android
 
 make $CLEAN
-make -j1 TARGET_TUPLE=$TARGET_TUPLE PLATFORM_SHORT_ARCH=$PLATFORM_SHORT_ARCH CXXSTL=$CXXSTL RELEASE=$RELEASE $TARGET
+make -j1 TARGET_TUPLE=$TARGET_TUPLE PLATFORM_SHORT_ARCH=$PLATFORM_SHORT_ARCH CXXSTL=$CXXSTL RELEASE=$RELEASE $TARGET ${ANDROID_MKFLAGS}
 
 # 3/ Environment script
 echo "Generating environment script."
diff --git a/vlc-android/jni/Android.mk b/vlc-android/jni/Android.mk
index ba909b2..85b4876 100644
--- a/vlc-android/jni/Android.mk
+++ b/vlc-android/jni/Android.mk
@@ -68,11 +68,16 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
 	-lspeex -lspeexdsp \
 	-lxml2 -lpng -lgnutls -lgcrypt -lgpg-error \
 	-lnettle -lhogweed -lgmp \
-	-lfreetype -liconv -lass -lfribidi -lopus \
+	-lfreetype -lass -lfribidi -lopus \
 	-lEGL -lGLESv2 -ljpeg \
 	-ldvdread -ldvdcss \
 	$(CPP_STATIC)
 
+USE_ICONV ?= 1
+ifeq ($(USE_ICONV),1)
+	LOCAL_LDLIBS += -liconv
+endif
+
 include $(BUILD_SHARED_LIBRARY)
 
 
-- 
1.9.2



More information about the Android mailing list