-
Notifications
You must be signed in to change notification settings - Fork 9
/
osxbuild
executable file
·117 lines (103 loc) · 5.43 KB
/
osxbuild
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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/sh
#
# This script will automates the steps used to producing a static osx
# package of SoX.
#
# It requires to already have several external libraries already installed
# under /usr/local. The external libraries must be static only or else
# it will expect dylib versions to already exist on external boxes.
#
# This goes out of its way to only compile i386 binary and to use
# OS X 10.5 SDK for greater compatibilty.
#
# Various notes:
#
# The following command lines were used to generate the static external
# libraries SoX ships with.
#
# cd libtool-2.4.2
#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd libpng-1.5.7
#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd ../wavpack-4.60.1
#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# flac won't compile without following fix. Edit src/libFLAC/ia32/nasm.h and
# add following to top of that file: %define FLAC__PUBLIC_NEEDS_UNDERSCORE
# cd ../flac-1.2.1
#./configure CXXFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd ../libogg-1.3.0
#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd ../libvorbis-1.3.2
#./configure CPPFLAGS="-I/usr/local/include" CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd ../libsndfile-1.0.25
#./configure CXXFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd ../libid3tag-0.15.1b
#./configure CXXFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --enable-static --disable-shared;make;sudo make install
#
# To get MP3 header files used to enable MP3 support (no libraries used):
#
# cd ../libmad-0.15.1b
#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --enable-shared --disable-static;make;sudo make install
#
[ ! -x configure ] && autoreconf -i
# Some versions of autoconf (2.63?) seem to get easily confused about
# CPP variable. If you see warning messages about header files
# rejected by preprocessor then its most likely from that.
# Force the value of CPP=cpp works around that bug.
if [ $# -ne 0 -o ! -r Makefile ]; then
./configure \
--disable-shared \
--with-libltdl \
--enable-dl-lame --enable-dl-mad \
--enable-dl-amrnb --enable-dl-amrwb \
CPP=cpp\
CPPFLAGS="-I/usr/local/include" \
CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" \
LDFLAGS="-L/usr/local/lib -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" \
$*
fi
make -s all txt || exit 1
dylib_need_to_ship=`otool -L src/sox | grep -v CoreAudio.framework | grep -v libz | grep -v libiconv | grep -v libSystem | grep -v libgcc_s | grep -v src/sox`
# Make sure we are only relying on OS dynamic libraries. If not
# then app won't run unless user's box looks just like this one
# (unlikely). We could ship some dylibs but that would require
# using rpath just right (@loader_path) and thats not easy to
# get right.
if [ ! "${dylib_need_to_ship}x" = "x" ]; then
echo "Non-OS dylib's detected:${dylib_need_to_ship}"
exit 1
fi
dir=sox-`grep Version: sox.pc | cut -d ' ' -f 2`
rm -rf $dir $dir-macosx.zip
mkdir -p $dir
# Judgement call. If filename ends in .txt then user can view
# by double clicking in Finder.
for f in LICENSE.GPL README.osx; do
cp -p $f $dir/$f.txt
done
for f in ChangeLog README; do
cp -p $f $dir/$f
done
binaries=src/sox
# TODO: Distribute wget binary
#[ -r "../wget-1.11.4/wget" ] && binaries+=" ../wget-1.11.4/wget"
cp -p \
$binaries \
sox.txt \
soxformat.txt \
soxi.txt \
libsox.txt \
$dir
(cd $dir; ln -s sox soxi; ln -s sox play; ln -s sox rec)
#if test -r "../wget-1.11.4/wget"; then
# cp ../wget-1.11.4/wget.ini $dir
#fi
zip --symlinks -r $dir-macosx.zip $dir
rm -rf $dir