Build script now builds an oggenc binary with flac support.
[vorbis-lancer-gcc.git] / build-script
blobb20f455c0d154eac34da0c41d06b524b03f7e119
1 #!/bin/bash
3 # Builds a statically linked version of oggenc.
4 # =============================================
6 # Where to keep the generated binaries.
7 BIN_LOCATION=`pwd`/out
9 # Name of the libogg subdirectory.
10 LIBOGG_DIR="libogg-1.1.3"
12 # Name of the vorbis-aotuv subdirectory.
13 VORBIS_AOTUV_DIR="aotuv-b5_20061024"
15 # Name of the vorbis-tools subdirectory.
16 VORBIS_TOOLS_DIR="vorbis-tools-1.2.0"
18 # Name of the FLAC subdirectory.
19 FLAC_DIR="flac-1.2.1"
21 # Optimisation flags to use for the compiler.
22 OPTIMISATION_FLAGS="-O3"
24 # Floating point math flags.
25 # -mfpmath=sse : use SSE-type instructions for all floating-point math.
26 # -msse : use SSE (as opposed to SSE2/SSE3)
27 FP_FLAGS="-mfpmath=sse -msse"
29 # 1. Build libogg.
30 # ----------------
32 cd $LIBOGG_DIR
33 CFLAGS="-fno-strict-aliasing $OPTIMISATION_FLAGS $FP_FLAGS" sh ./configure --prefix=$BIN_LOCATION --disable-shared --enable-static
34 make clean
35 make install
36 cd ..
38 # 2. Build vorbis-aotuv.
39 # ----------------------
40 cd $VORBIS_AOTUV_DIR
41 CFLAGS="-fno-strict-aliasing $OPTIMISATION_FLAGS $FP_FLAGS" sh ./configure --prefix=$BIN_LOCATION --disable-shared --enable-static --with-ogg=$BIN_LOCATION
42 make clean
43 make install
44 cd ..
46 # 3. Build FLAC.
47 # --------------
48 cd $FLAC_DIR
49 CFLAGS="-fno-strict-aliasing $OPTIMISATION_FLAGS $FP_FLAGS" sh ./configure --prefix=$BIN_LOCATION --disable-shared --enable-static
50 make clean
51 make install
52 cd ..
54 # 4. Build vorbis-tools.
55 # ----------------------
56 cd $VORBIS_TOOLS_DIR
57 # This is a tricky bug - we have to manually tweak CPPFLAGS and LDFLAGS, otherwise vorbis-tools's configure
58 # will not pick up FLAC's presence.
59 CPPFLAGS="-I$BIN_LOCATION/include" LDFLAGS="-L$BIN_LOCATION/lib" CFLAGS="-fno-strict-aliasing $OPTIMISATION_FLAGS $FP_FLAGS" sh ./configure --prefix=$BIN_LOCATION --without-speex --without-curl --disable-ogg123 --disable-oggdec --disable-ogginfo --disable-vcut --disable-vorbiscomment --disable-shared --enable-static --with-ogg=$BIN_LOCATION --with-vorbis=$BIN_LOCATION
60 make clean
61 make install
62 cd ..
64 # 4. Copy the oggenc executable into the current directory,
65 # so people can find it.
66 cp ./out/bin/oggenc ./oggenc