Skip to content

Commit

Permalink
Updating osxbuild to work with OS X 10.7+/XCode 4.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbagwell committed Jan 13, 2013
1 parent 946687b commit 3e4bb56
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
9 changes: 5 additions & 4 deletions README.osx
Expand Up @@ -73,15 +73,16 @@ Lame MP3 encoder http://lame.sourceforge.net
MAD MP3 decoder http://www.underbit.com/products/mad

If your system is setup to compile software, then the following commands
can be used:
can be used. Note: since SoX is distributed as a 32-bit i386 binary,
the library must match that format as well:

cd lame-398-2
./configure
./configure CFLAGS="-arch i386 -m32" LDFALGS="-arch i386"
make
sudo make install

cd libmad-0.15.1b
./configure
./configure CFLAGS="-arch i386 -m32" LDFALGS="-arch i386"
make
sudo make install

Expand All @@ -105,7 +106,7 @@ Obtain the latest amrnb and amrwb source code from
http://sourceforge.net/projects/opencore-amr

cd opencore-amr-0.1.2
./configure
./configure CFLAGS="-arch i386 -m32" LDFALGS="-arch i386"
make
sudo make install

Expand Down
41 changes: 27 additions & 14 deletions osxbuild
Expand Up @@ -4,49 +4,62 @@
# 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
# under /usr/local/10.5. 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.
# This goes out of its way to only compile a 32 bit i386 binary and to use the
# oldest available SDK for greater compatibility.
#
# 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
# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.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
# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.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
# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.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
# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" CXXFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.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
# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.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
# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# When compiling with newer versions of OS X, Carbon.h does not exist and
# doesn't need to be included by app. Edit programs/sndfile-play.c and
# delete/comment out line 61.
# 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
# ./configure --disable-sqlite --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" CXXFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.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
# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# To get MP3 header files used to enable MP3 support (no libraries used):
#
# brew install mad
#
# or compile and install:
#
# 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
#

if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
MacOSXSDK=/Developer/SDKs/MacOSX10.5.sdk
else
MacOSXSDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
fi

[ ! -x configure ] && autoreconf -i

# Some versions of autoconf (2.63?) seem to get easily confused about
Expand All @@ -60,9 +73,9 @@ if [ $# -ne 0 -o ! -r Makefile ]; then
--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" \
CPPFLAGS="-I/usr/local/10.5/include -I/usr/local/include" \
CFLAGS="-m32 -arch i386 -isysroot ${MacOSXSDK} -mmacosx-version-min=10.5" \
LDFLAGS="-L/usr/local/10.5/lib -m32 -arch i386 -isysroot ${MacOSXSDK} -mmacosx-version-min=10.5" \
$*
fi

Expand Down

0 comments on commit 3e4bb56

Please sign in to comment.