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
CFLAGS="${CFLAGS} -mlong-calls"
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"
if [ -n "$HAVE_ARM" ]; then
......@@ -110,11 +149,14 @@ CROSS_COMPILE=${ANDROID_BIN}/${TARGET_TUPLE}-
# Release or not?
if [ "$RELEASE" = 1 ]; then
OPTS=""
EXTRA_CFLAGS=" -DNDEBUG "
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DNDEBUG "
else
OPTS="--enable-debug"
fi
echo "CFLAGS ${EXTRA_CFLAGS}"
###########################
# Build buildsystem tools #
###########################
......
......@@ -178,44 +178,6 @@ then
exit 0
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 //
if [ -z "$MAKEFLAGS" ]; then
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