configure.sh 3.66 KB
Newer Older
1
2
3
4
5
6
7
8
9
#!/bin/sh

if [ -z "$ANDROID_NDK" ]; then
    echo "Please set the ANDROID_NDK environment variable with its path."
    exit 1
fi

ANDROID_API=android-9

10
VLC_SOURCEDIR=..
11
12
13
14
15
16

CFLAGS="-g -O2 -mlong-calls -fstrict-aliasing -mfloat-abi=softfp -funsafe-math-optimizations"
LDFLAGS="-Wl,-Bdynamic,-dynamic-linker=/system/bin/linker -Wl,--no-undefined"

if [ -z "$NO_NEON" ]; then
    CXX_TARGET="armeabi-v7a"
17
    CFLAGS="$CFLAGS -mfpu=neon -mcpu=cortex-a8 -mthumb"
18
19
20
21
    LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8"
    EXTRA_PARAMS=" --enable-neon"
elif [ -n "$TEGRA2" ]; then
    CXX_TARGET="armeabi-v7a"
22
    CFLAGS="$CFLAGS -mfpu=vfpv3-d16 -mcpu=cortex-a9 -mthumb"
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    EXTRA_PARAMS=" --disable-neon"
else
    CXX_TARGET="armeabi"
    CFLAGS="$CFLAGS -mcpu=arm1136jf-s -mfpu=vfp"
    EXTRA_PARAMS=" --disable-neon"
fi


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

SYSROOT=$ANDROID_NDK/platforms/$ANDROID_API/arch-arm
ANDROID_BIN=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/*-x86/bin/
CROSS_COMPILE=${ANDROID_BIN}/arm-linux-androideabi-

CPPFLAGS="$CPPFLAGS" \
CFLAGS="$CFLAGS" \
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" \
sh $VLC_SOURCEDIR/configure --host=arm-linux-androideabi --build=x86_64-unknown-linux $EXTRA_PARAMS \
                --enable-live555 --enable-realrtsp \
                --enable-avformat \
                --enable-swscale \
                --enable-avcodec \
                --enable-opensles \
Rafaël Carré's avatar
Rafaël Carré committed
54
                --enable-audiotrack \
55
56
57
58
                --enable-android-surface \
                --enable-debug \
                --enable-mkv \
                --enable-taglib \
59
                --enable-iomx \
60
                --disable-vlc --disable-shared \
61
                --disable-vlm \
62
63
64
65
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 \
                --disable-dv \
                --disable-mod \
                --disable-sid \
                --disable-gme \
77
                --disable-tremor \
78
                --disable-mad \
79
                --disable-dca \
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
                --disable-sdl-image \
                --disable-zvbi \
                --disable-fluidsynth \
                --disable-jack \
                --disable-pulse \
                --disable-alsa \
                --disable-samplerate \
                --disable-sdl \
                --disable-xcb \
                --disable-atmo \
                --disable-qt4 \
                --disable-skins2 \
                --disable-mtp \
                --disable-notify \
                --disable-freetype \
                --disable-libass \
                --disable-svg \
                --disable-sqlite \
                --disable-udev \
                --disable-libxml2 \
                --disable-caca \
                --disable-glx \
                --disable-egl \
                --disable-goom \
                --disable-projectm \
105
106
107
108
                --disable-sout \
                --disable-vorbis \
                --disable-x264 \
                --disable-schroedinger --disable-dirac \
109
                $*