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

3
4
5
if [ -z "$ANDROID_NDK" -o -z "$ANDROID_ABI" ]; then
    echo "Please set the ANDROID_NDK environment variable with its path.\n"
    echo "ANDROID_ABI should match your ABI: armeabi-v7a, armeabi or ..."
6
7
8
    exit 1
fi

9
10
# Must use android-9 here. Any replacement functions needed are in the vlc-android/jni
# folder.
11
12
ANDROID_API=android-9

13
VLC_SOURCEDIR=..
14

Edward Wang's avatar
Edward Wang committed
15
16
17
CFLAGS="-g -O2 -fstrict-aliasing -funsafe-math-optimizations"
if [ -n "$HAVE_ARM" ]; then
    CFLAGS="${CFLAGS} -mlong-calls"
18
19
fi

Edward Wang's avatar
Edward Wang committed
20
21
22
23
24
25
26
27
28
29
30
31
32
LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined"

if [ -n "$HAVE_ARM" ]; then
    if [ -z "$NO_NEON" ]; then
        NO_NEON=0
    fi

    if [ $NO_NEON -gt 0 ]; then
        EXTRA_PARAMS=" --disable-neon"
    else
        EXTRA_PARAMS=" --enable-neon"
        LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8"
    fi
33
34
fi

35
36
CPPFLAGS="-I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/include -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_ABI}/include"
LDFLAGS="$LDFLAGS -L${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_ABI}"
37

Edward Wang's avatar
Edward Wang committed
38
SYSROOT=$ANDROID_NDK/platforms/$ANDROID_API/arch-$PLATFORM_SHORT_ARCH
bbcallen's avatar
bbcallen committed
39
ANDROID_BIN=$ANDROID_NDK/toolchains/${PATH_HOST}-4.4.3/prebuilt/*-x86/bin/
Edward Wang's avatar
Edward Wang committed
40
CROSS_COMPILE=${ANDROID_BIN}/${TARGET_TUPLE}-
41
42

CPPFLAGS="$CPPFLAGS" \
43
CFLAGS="$CFLAGS ${VLC_EXTRA_CFLAGS}" \
44
45
46
47
48
49
50
51
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" \
Edward Wang's avatar
Edward Wang committed
52
sh $VLC_SOURCEDIR/configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux $EXTRA_PARAMS \
53
54
55
56
57
                --enable-live555 --enable-realrtsp \
                --enable-avformat \
                --enable-swscale \
                --enable-avcodec \
                --enable-opensles \
Rafaël Carré's avatar
Rafaël Carré committed
58
                --enable-audiotrack \
59
60
61
                --enable-android-surface \
                --enable-mkv \
                --enable-taglib \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
62
                --enable-dvbpsi \
63
                --enable-iomx \
64
                --disable-vlc --disable-shared \
65
                --disable-vlm \
66
67
68
69
70
71
72
73
74
75
76
                --disable-dbus \
                --disable-lua \
                --disable-vcd \
                --disable-v4l2 \
                --disable-gnomevfs \
                --disable-dvdread \
                --disable-dvdnav \
                --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
101
                --disable-svg \
                --disable-sqlite \
                --disable-udev \
102
                --enable-libxml2 \
103
104
105
106
107
                --disable-caca \
                --disable-glx \
                --disable-egl \
                --disable-goom \
                --disable-projectm \
108
109
                --disable-sout \
                --disable-vorbis \
Edward Wang's avatar
Edward Wang committed
110
                --disable-faad \
111
112
                --disable-x264 \
                --disable-schroedinger --disable-dirac \
113
                $*