3 # This script will automates the steps used to producing a static osx
6 # It requires to already have several external libraries already installed
7 # under /usr/local/10.9. The external libraries must be static only or else
8 # it will expect dylib versions to already exist on external boxes.
10 # This goes out of its way to use the oldest available SDK for greater
15 # The following command lines were used to generate the static external
16 # libraries SoX ships with.
18 # brew install libtool
21 # ./configure --prefix=/usr/local/10.9 CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" --disable-shared --enable-static;make;sudo make install
23 # cd ../wavpack-4.70.0
24 # ./configure --prefix=/usr/local/10.9 CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" --disable-shared --enable-static;make;sudo make install
27 # ./configure --prefix=/usr/local/10.9 CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" CXXFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9" --disable-shared --enable-static;make;sudo make install
30 # ./configure --prefix=/usr/local/10.9 CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" --disable-shared --enable-static;make;sudo make install
32 # cd ../libvorbis-1.3.4
33 # ./configure --prefix=/usr/local/10.9 CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" --disable-shared --enable-static;make;sudo make install
35 # When compiling with newer versions of OS X, Carbon.h does not exist and
36 # doesn't need to be included by app. Edit programs/sndfile-play.c and
37 # delete/comment out line 61.
38 # cd ../libsndfile-1.0.25
39 # ./configure --disable-sqlite --prefix=/usr/local/10.9 CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" CXXFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9" --disable-shared --enable-static;make;sudo make install
41 # cd ../libid3tag-0.15.1b
42 # ./configure --prefix=/usr/local/10.9 CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" --disable-shared --enable-static;make;sudo make install
44 # To get MP3 header files used to enable MP3 support (no libraries used):
48 # or compile and install:
50 # cd ../libmad-0.15.1b
51 # ./configure CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" --enable-shared --disable-static;make;sudo make install
54 MacOSXSDK
=/Applications
/Xcode.app
/Contents
/Developer
/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX10.9.sdk
56 [ ! -x configure
] && autoreconf
-i
58 # Some versions of autoconf (2.63?) seem to get easily confused about
59 # CPP variable. If you see warning messages about header files
60 # rejected by preprocessor then its most likely from that.
61 # Force the value of CPP=cpp works around that bug.
62 if [ $# -ne 0 -o ! -r Makefile
]; then
66 --enable-dl-lame --enable-dl-mad \
67 --enable-dl-amrnb --enable-dl-amrwb \
69 CPPFLAGS
="-I/usr/local/10.9/include -I/usr/local/include" \
70 CFLAGS
="-isysroot ${MacOSXSDK}" \
71 LDFLAGS
="-L/usr/local/10.9/lib -isysroot ${MacOSXSDK}" \
75 make -s all txt ||
exit 1
77 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`
79 # Make sure we are only relying on OS dynamic libraries. If not
80 # then app won't run unless user's box looks just like this one
81 # (unlikely). We could ship some dylibs but that would require
82 # using rpath just right (@loader_path) and thats not easy to
84 if [ ! "${dylib_need_to_ship}x" = "x" ]; then
85 echo "Non-OS dylib's detected:${dylib_need_to_ship}"
89 dir
=sox-
`grep Version: sox.pc | cut -d ' ' -f 2`
90 rm -rf $dir $dir-macosx.
zip
93 # Judgement call. If filename ends in .txt then user can view
94 # by double clicking in Finder.
95 for f
in LICENSE.GPL README.osx
; do
99 for f
in ChangeLog README
; do
105 # TODO: Distribute wget binary
106 #[ -r "../wget-1.11.4/wget" ] && binaries+=" ../wget-1.11.4/wget"
116 (cd $dir; ln -s sox soxi
; ln -s sox play
; ln -s sox rec
)
118 #if test -r "../wget-1.11.4/wget"; then
119 # cp ../wget-1.11.4/wget.ini $dir
122 zip --symlinks -r $dir-macosx.
zip $dir