-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathbuildme-mingw32.sh
executable file
·59 lines (51 loc) · 1.44 KB
/
buildme-mingw32.sh
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
#!/bin/sh
OGG=1.3.5
FLAC=1.4.1
OGG_GIT=""
FLAC_GIT=""
LOG=$PWD/config.log
CHANGENO=$(git rev-parse --short HEAD)
ARCH=`arch`
OUTPUT=$PWD/flac-build-$ARCH-$CHANGENO
# Clean up
rm -rf $OUTPUT
rm -rf flac-$FLAC
## Start
echo "Most log mesages sent to $LOG... only 'errors' displayed here"
date > $LOG
# '-O2' reduces binary size with minimal performance loss.
export CFLAGS="-O2"
export CXXFLAGS="-O2"
## Build Ogg first
echo "Untarring libogg-$OGG.tar.xz..."
tar -Jxf libogg-${OGG}${OGG_GIT}.tar.xz >> $LOG
cd libogg-$OGG
. ../../CPAN/update-config.sh
echo "Configuring..."
./configure --disable-shared >> $LOG
echo "Running make..."
make >> $LOG
cd ..
## Build
echo "Untarring..."
tar Jxvf flac-${FLAC}${FLAC_GIT}.tar.xz >> $LOG
cd flac-$FLAC >> $LOG
. ../../CPAN/update-config.sh
patch -p1 < ../01-flac.patch >> $LOG
patch -p1 < ../02-flac-C-locale.patch >> $LOG
echo "Configuring..."
./configure --with-ogg-includes=$PWD/../libogg-$OGG/include --with-ogg-libraries=$PWD/../libogg-$OGG/src/.libs/ --disable-doxygen-docs --disable-shared --disable-xmms-plugin --disable-cpplibs --prefix $OUTPUT >> $LOG
echo "Disabling Fortify Sources"
find . -name Makefile -exec sed 's/ -D_FORTIFY_SOURCE=2//g' -i {} \;
echo "Running make"
make >> $LOG
echo "Running make install"
make install >> $LOG
cd ..
strip --strip-unneeded $OUTPUT/bin/*
## Tar the whole package up
cp $OUTPUT/bin/flac.exe .
tar -zcf $OUTPUT.tgz $OUTPUT
rm -rf $OUTPUT
rm -rf flac-$FLAC
rm -rf libogg-$OGG