Commit 75e1d9c7 authored by Rafaël Carré's avatar Rafaël Carré

android/configure.sh: sanitize flags

No need for -Wl,-shared or -rpath-link
No need for -lc -lgcc -ld, especially when using -nostdlib
Use --sysroot to point compiler to android headers/libs
Rename some shell variables
Move enabled modules at the top of the options
No need to set PATH, we give the absolute path for compiler
parent 69b3ac6b
...@@ -7,51 +7,57 @@ fi ...@@ -7,51 +7,57 @@ fi
ANDROID_API=android-9 ANDROID_API=android-9
ANDROID_BIN=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/*-x86/bin/
ANDROID_INCLUDE=$ANDROID_NDK/platforms/$ANDROID_API/arch-arm/usr/include
ANDROID_LIB=$ANDROID_NDK/platforms/$ANDROID_API/arch-arm/usr/lib
GCC_PREFIX=${ANDROID_BIN}/arm-linux-androideabi-
VLC_SOURCEDIR="`dirname $0`/../../.." VLC_SOURCEDIR="`dirname $0`/../../.."
# needed for old ndk: change all the arm-linux-androideabi to arm-eabi # needed for old ndk: change all the arm-linux-androideabi to arm-eabi
# the --host is kept on purpose because otherwise libtool complains.. # the --host is kept on purpose because otherwise libtool complains..
EXTRA_CFLAGS="-mlong-calls -fstrict-aliasing -fprefetch-loop-arrays -ffast-math" CFLAGS="-O2 -mlong-calls -fstrict-aliasing -fprefetch-loop-arrays -ffast-math"
EXTRA_LDFLAGS="" LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined"
EXTRA_PARAMS=""
if [ -z "$NO_NEON" ]; then if [ -z "$NO_NEON" ]; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpu=neon -mtune=cortex-a8 -ftree-vectorize -mvectorize-with-neon-quad" CXX_TARGET="armeabi-v7a"
EXTRA_LDFLAGS="-Wl,--fix-cortex-a8" CFLAGS="$CFLAGS -mfpu=neon -mtune=cortex-a8 -ftree-vectorize -mvectorize-with-neon-quad"
LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8"
EXTRA_PARAMS=""
else else
EXTRA_CFLAGS="$EXTRA_CFLAGS -march=armv6j -mtune=arm1136j-s -msoft-float" CXX_TARGET="armeabi"
EXTRA_PARAMS=" --disable-neon" CFLAGS="$CFLAGS -march=armv6j -mtune=arm1136j-s -msoft-float"
EXTRA_PARAMS=" --disable-neon"
fi fi
PATH="$ANDROID_BIN:$PATH" \ CPPFLAGS="-I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/include -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${CXX_TARGET}/include"
CC="${GCC_PREFIX}gcc" \
CXX="${GCC_PREFIX}g++" \ SYSROOT=$ANDROID_NDK/platforms/$ANDROID_API/arch-arm
NM="${GCC_PREFIX}nm" \ ANDROID_BIN=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/*-x86/bin/
STRIP="${GCC_PREFIX}strip" \ CROSS_COMPILE=${ANDROID_BIN}/arm-linux-androideabi-
RANLIB="${GCC_PREFIX}ranlib" \
AR="${GCC_PREFIX}ar" \ CPPFLAGS="$CPPFLAGS" \
CPPFLAGS="-I$ANDROID_INCLUDE -I$VLC_SOURCEDIR/extras/contrib/hosts/arm-eabi/include \ CFLAGS="$CFLAGS" \
-I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/include \ CXXFLAGS="$CFLAGS" \
-I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include/" \ LDFLAGS="$LDFLAGS" \
LDFLAGS="-Wl,-rpath-link=$ANDROID_LIB,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined -Wl,-shared -L$ANDROID_LIB $EXTRA_LDFLAGS" \ CC="${CROSS_COMPILE}gcc --sysroot=${SYSROOT}" \
CFLAGS="-nostdlib $EXTRA_CFLAGS -O2" \ CXX="${CROSS_COMPILE}g++ --sysroot=${SYSROOT}" \
CXXFLAGS="-nostdlib $EXTRA_CFLAGS -O2 -D__STDC_VERSION__=199901L -D__STDC_CONSTANT_MACROS" \ NM="${CROSS_COMPILE}nm" \
LIBS="-lc -ldl -lgcc" \ STRIP="${CROSS_COMPILE}strip" \
RANLIB="${CROSS_COMPILE}ranlib" \
AR="${CROSS_COMPILE}ar" \
PKG_CONFIG_LIBDIR="$VLC_SOURCEDIR/extras/contrib/hosts/arm-eabi/lib/pkgconfig" \ PKG_CONFIG_LIBDIR="$VLC_SOURCEDIR/extras/contrib/hosts/arm-eabi/lib/pkgconfig" \
sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux $EXTRA_PARAMS \ sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux $EXTRA_PARAMS \
--enable-static-modules \ --enable-static-modules \
--disable-vlc \ --enable-live555 --enable-realrtsp \
--enable-avformat \
--enable-swscale \
--enable-avcodec \
--enable-opensles \
--enable-android-surface \
--enable-debug \ --enable-debug \
--disable-mkv \
--disable-vlc \
--disable-vlm --disable-sout \ --disable-vlm --disable-sout \
--disable-dbus \ --disable-dbus \
--disable-lua \ --disable-lua \
--disable-libgcrypt \ --disable-libgcrypt \
--enable-live555 --enable-realrtsp \
--disable-vcd \ --disable-vcd \
--disable-v4l2 \ --disable-v4l2 \
--disable-gnomevfs \ --disable-gnomevfs \
...@@ -60,11 +66,7 @@ sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux $ ...@@ -60,11 +66,7 @@ sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux $
--disable-bluray \ --disable-bluray \
--disable-linsys \ --disable-linsys \
--disable-decklink \ --disable-decklink \
--enable-avformat \
--enable-swscale \
--enable-avcodec \
--disable-libva \ --disable-libva \
--disable-mkv \
--disable-dv \ --disable-dv \
--disable-mod \ --disable-mod \
--disable-sid \ --disable-sid \
...@@ -75,7 +77,6 @@ sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux $ ...@@ -75,7 +77,6 @@ sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux $
--disable-sdl-image \ --disable-sdl-image \
--disable-zvbi \ --disable-zvbi \
--disable-fluidsynth \ --disable-fluidsynth \
--enable-opensles \
--disable-jack \ --disable-jack \
--disable-pulse \ --disable-pulse \
--disable-alsa \ --disable-alsa \
...@@ -94,7 +95,6 @@ sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux $ ...@@ -94,7 +95,6 @@ sh $VLC_SOURCEDIR/configure --host=arm-eabi-linux --build=x86_64-unknown-linux $
--disable-sqlite \ --disable-sqlite \
--disable-udev \ --disable-udev \
--disable-libxml2 \ --disable-libxml2 \
--enable-android-surface \
--disable-caca \ --disable-caca \
--disable-glx \ --disable-glx \
--disable-egl \ --disable-egl \
......
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