configure.sh 3.81 KB
Newer Older
1 2
#!/bin/sh

3 4 5 6 7 8 9
if [ -z "$ANDROID_NDK" ]; then
    echo "Please set the ANDROID_NDK environment variable with its path."
    exit 1
fi

if [ -z "$ANDROID_ABI" ]; then
    echo "Please set ANDROID_ABI to your architecture: armeabi-v7a, armeabi, x86 or mips."
10 11 12
    exit 1
fi

13 14
# Must use android-9 here. Any replacement functions needed are in the vlc-android/jni
# folder.
15 16
ANDROID_API=android-9

17
VLC_SOURCEDIR=..
18

Edward Wang's avatar
Edward Wang committed
19 20 21
CFLAGS="-g -O2 -fstrict-aliasing -funsafe-math-optimizations"
if [ -n "$HAVE_ARM" ]; then
    CFLAGS="${CFLAGS} -mlong-calls"
22 23
fi

Edward Wang's avatar
Edward Wang committed
24 25 26
LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined"

if [ -n "$HAVE_ARM" ]; then
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
27
    if [ ${ANDROID_ABI} = "armeabi-v7a" ]; then
Edward Wang's avatar
Edward Wang committed
28 29 30
        EXTRA_PARAMS=" --enable-neon"
        LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8"
    fi
31 32
fi

Rafaël Carré's avatar
Rafaël Carré committed
33 34
CPPFLAGS="-I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/include -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI}/include"
LDFLAGS="$LDFLAGS -L${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++${CXXSTL}/libs/${ANDROID_ABI}"
35

Edward Wang's avatar
Edward Wang committed
36
SYSROOT=$ANDROID_NDK/platforms/$ANDROID_API/arch-$PLATFORM_SHORT_ARCH
37
ANDROID_BIN=`echo $ANDROID_NDK/toolchains/${PATH_HOST}-${GCCVER}/prebuilt/\`uname|tr A-Z a-z\`-*/bin/`
Edward Wang's avatar
Edward Wang committed
38
CROSS_COMPILE=${ANDROID_BIN}/${TARGET_TUPLE}-
39 40

CPPFLAGS="$CPPFLAGS" \
41
CFLAGS="$CFLAGS ${VLC_EXTRA_CFLAGS}" \
42 43 44 45 46 47 48 49
CXXFLAGS="$CFLAGS" \
LDFLAGS="$LDFLAGS" \
CC="${CROSS_COMPILE}gcc --sysroot=${SYSROOT}" \
CXX="${CROSS_COMPILE}g++ --sysroot=${SYSROOT}" \
NM="${CROSS_COMPILE}nm" \
STRIP="${CROSS_COMPILE}strip" \
RANLIB="${CROSS_COMPILE}ranlib" \
AR="${CROSS_COMPILE}ar" \
50
PKG_CONFIG_LIBDIR=$VLC_SOURCEDIR/contrib/$TARGET_TUPLE/lib/pkgconfig \
Edward Wang's avatar
Edward Wang committed
51
sh $VLC_SOURCEDIR/configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux $EXTRA_PARAMS \
52
                --disable-nls \
53 54 55 56
                --enable-live555 --enable-realrtsp \
                --enable-avformat \
                --enable-swscale \
                --enable-avcodec \
57
                --enable-opus \
58 59 60 61
                --enable-opensles \
                --enable-android-surface \
                --enable-mkv \
                --enable-taglib \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
62
                --enable-dvbpsi \
63
                --disable-vlc --disable-shared \
64
                --disable-update-check \
65
                --disable-vlm \
66 67 68 69 70
                --disable-dbus \
                --disable-lua \
                --disable-vcd \
                --disable-v4l2 \
                --disable-gnomevfs \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
71
                --enable-dvdread \
72
                --enable-dvdnav \
73 74 75 76
                --disable-bluray \
                --disable-linsys \
                --disable-decklink \
                --disable-libva \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
77
                --disable-dv1394 \
78 79 80
                --disable-mod \
                --disable-sid \
                --disable-gme \
81
                --disable-tremor \
82
                --disable-mad \
83
                --disable-dca \
84 85 86 87 88 89 90 91 92 93
                --disable-sdl-image \
                --disable-zvbi \
                --disable-fluidsynth \
                --disable-jack \
                --disable-pulse \
                --disable-alsa \
                --disable-samplerate \
                --disable-sdl \
                --disable-xcb \
                --disable-atmo \
Edward Wang's avatar
Edward Wang committed
94
                --disable-qt \
95 96 97
                --disable-skins2 \
                --disable-mtp \
                --disable-notify \
Sébastien Toque's avatar
Sébastien Toque committed
98
                --enable-libass \
99 100
                --disable-svg \
                --disable-udev \
101
                --enable-libxml2 \
102 103
                --disable-caca \
                --disable-glx \
104 105
                --enable-egl \
                --enable-gles2 \
106 107
                --disable-goom \
                --disable-projectm \
108
                --disable-sout \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
109
                --enable-vorbis \
Edward Wang's avatar
Edward Wang committed
110
                --disable-faad \
111 112
                --disable-x264 \
                --disable-schroedinger --disable-dirac \
113
                $*