Commit e277ab93 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Move CFLAGS computation to compile-libvlc.sh

parent 26bd6658
...@@ -91,6 +91,45 @@ if [ -n "$HAVE_ARM" -a ! -n "$HAVE_64" ]; then ...@@ -91,6 +91,45 @@ if [ -n "$HAVE_ARM" -a ! -n "$HAVE_64" ]; then
CFLAGS="${CFLAGS} -mlong-calls" CFLAGS="${CFLAGS} -mlong-calls"
fi fi
# Setup CFLAGS
if [ ${ANDROID_ABI} = "armeabi-v7a" ] ; then
EXTRA_CFLAGS="-mfpu=vfpv3-d16 -mcpu=cortex-a8"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mthumb -mfloat-abi=softfp"
elif [ ${ANDROID_ABI} = "armeabi" ] ; then
if [ -n "${NO_ARMV6}" ]; then
EXTRA_CFLAGS="-march=armv5te -mtune=arm9tdmi -msoft-float"
else
if [ -n "${NO_FPU}" ]; then
EXTRA_CFLAGS="-march=armv6j -mtune=arm1136j-s -msoft-float"
else
EXTRA_CFLAGS="-mfpu=vfp -mcpu=arm1136jf-s -mfloat-abi=softfp"
fi
fi
elif [ ${ANDROID_ABI} = "arm64-v8a" ] ; then
EXTRA_CFLAGS=""
elif [ ${ANDROID_ABI} = "x86" ] ; then
EXTRA_CFLAGS="-march=pentium -m32"
elif [ ${ANDROID_ABI} = "x86_64" ] ; then
EXTRA_CFLAGS=""
elif [ ${ANDROID_ABI} = "mips" ] ; then
EXTRA_CFLAGS="-march=mips32 -mtune=mips32r2 -mhard-float"
# All MIPS Linux kernels since 2.4.4 will trap any unimplemented FPU
# instruction and emulate it, so we select -mhard-float.
# See http://www.linux-mips.org/wiki/Floating_point#The_Linux_kernel_and_floating_point
else
echo "Unknown ABI. Die, die, die!"
exit 2
fi
EXTRA_CFLAGS="${EXTRA_CFLAGS} -O2"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/include"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI}/include"
# Setup LDFLAGS
EXTRA_LDFLAGS="-L${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI} -lgnustl_static"
LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined" LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined"
if [ -n "$HAVE_ARM" ]; then if [ -n "$HAVE_ARM" ]; then
...@@ -110,11 +149,14 @@ CROSS_COMPILE=${ANDROID_BIN}/${TARGET_TUPLE}- ...@@ -110,11 +149,14 @@ CROSS_COMPILE=${ANDROID_BIN}/${TARGET_TUPLE}-
# Release or not? # Release or not?
if [ "$RELEASE" = 1 ]; then if [ "$RELEASE" = 1 ]; then
OPTS="" OPTS=""
EXTRA_CFLAGS=" -DNDEBUG " EXTRA_CFLAGS="${EXTRA_CFLAGS} -DNDEBUG "
else else
OPTS="--enable-debug" OPTS="--enable-debug"
fi fi
echo "CFLAGS ${EXTRA_CFLAGS}"
########################### ###########################
# Build buildsystem tools # # Build buildsystem tools #
########################### ###########################
......
...@@ -178,44 +178,6 @@ then ...@@ -178,44 +178,6 @@ then
exit 0 exit 0
fi fi
# Setup CFLAGS
if [ ${ANDROID_ABI} = "armeabi-v7a" ] ; then
EXTRA_CFLAGS="-mfpu=vfpv3-d16 -mcpu=cortex-a8"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mthumb -mfloat-abi=softfp"
elif [ ${ANDROID_ABI} = "armeabi" ] ; then
if [ -n "${NO_ARMV6}" ]; then
EXTRA_CFLAGS="-march=armv5te -mtune=arm9tdmi -msoft-float"
else
if [ -n "${NO_FPU}" ]; then
EXTRA_CFLAGS="-march=armv6j -mtune=arm1136j-s -msoft-float"
else
EXTRA_CFLAGS="-mfpu=vfp -mcpu=arm1136jf-s -mfloat-abi=softfp"
fi
fi
elif [ ${ANDROID_ABI} = "arm64-v8a" ] ; then
EXTRA_CFLAGS=""
elif [ ${ANDROID_ABI} = "x86" ] ; then
EXTRA_CFLAGS="-march=pentium -m32"
elif [ ${ANDROID_ABI} = "x86_64" ] ; then
EXTRA_CFLAGS=""
elif [ ${ANDROID_ABI} = "mips" ] ; then
EXTRA_CFLAGS="-march=mips32 -mtune=mips32r2 -mhard-float"
# All MIPS Linux kernels since 2.4.4 will trap any unimplemented FPU
# instruction and emulate it, so we select -mhard-float.
# See http://www.linux-mips.org/wiki/Floating_point#The_Linux_kernel_and_floating_point
else
echo "Unknown ABI. Die, die, die!"
exit 2
fi
EXTRA_CFLAGS="${EXTRA_CFLAGS} -O2"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/include"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI}/include"
# Setup LDFLAGS
EXTRA_LDFLAGS="-L${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI} -lgnustl_static"
# Make in // # Make in //
if [ -z "$MAKEFLAGS" ]; then if [ -z "$MAKEFLAGS" ]; then
UNAMES=$(uname -s) UNAMES=$(uname -s)
......
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