forked from gabriel/ffmpeg-iphone-build
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-vorbis
executable file
·79 lines (64 loc) · 2.04 KB
/
build-vorbis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
set -e
SCRIPT_DIR=$( (cd -P $(dirname $0) && pwd) )
. $SCRIPT_DIR/build-common
rm -rf libogg-1.2.0 ogg
if [ ! -f libogg-1.2.0.tar.gz ]
then
wget -q http://downloads.xiph.org/releases/ogg/libogg-1.2.0.tar.gz
fi
tar zxf libogg-1.2.0.tar.gz
mv libogg-1.2.0 ogg
rm -rf vorbis libvorbis-1.3.1
if [ ! -f libvorbis-1.3.1.tar.gz ]
then
wget -q http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.1.tar.gz
fi
tar zxf libvorbis-1.3.1.tar.gz
mv libvorbis-1.3.1 vorbis
LIBS="ogg vorbis"
for ARCH in $ARCHS
do
for LIB in $LIBS
do
DIR="$LIB-$ARCH"
rm -rf $DIR
cp -a $LIB $DIR
cd $DIR
DIST_DIR=$DIST_DIR_BASE-$ARCH
mkdir -p $DIST_DIR
EXTRA_CFLAGS="-arch $ARCH --sysroot=$SYSROOT"
EXTRA_LDFLAGS="-arch $ARCH --sysroot=$SYSROOT"
case $ARCH in
armv6)
EXTRA_FLAGS="--host=arm-apple-darwin --enable-pic --disable-asm"
;;
armv7)
EXTRA_FLAGS="--host=arm-apple-darwin --enable-pic"
;;
i386)
;;
esac
case $LIB in
vorbis)
LIB_FLAGS="--disable-oggtest --with-ogg=$DIST_DIR --with-ogg-libraries=$DIST_DIR/lib --with-ogg-includes=$DIST_DIR/include"
export OGG_CFLAGS="-I$DIST_DIR/include"
export OGG_LIBS="-L$DIST_DIR/lib"
# Configure file is broken if you don't have pkg-config
sed "s/-force_cpusubtype_ALL//" < configure> configure.tmp && mv configure.tmp configure
chmod +x configure
;;
esac
echo "Configuring $LIB for $ARCH..."
CC=$CC CPP=$CPP ./configure CFLAGS="$EXTRA_CFLAGS" LDFLAGS="$EXTRA_LDFLAGS" --prefix=$DIST_DIR --disable-shared $EXTRA_FLAGS $LIB_FLAGS
# Make it not compile
case $LIB in
vorbis)
touch lib/test_sharedbook
;;
esac
echo "Compiling $LIB for $ARCH..."
make && make install
cd $SCRIPT_DIR
done
done