shithub: sox

Download patch

ref: 3e4bb567ba239293df67d1995aaef21c38d3272c
parent: 946687bf7eb29c7bbff52cedfd29599a68d402a4
author: Chris Bagwell <chris@cnpbagwell.com>
date: Sun Jan 13 07:44:41 EST 2013

Updating osxbuild to work with OS X 10.7+/XCode 4.x.

--- a/README.osx
+++ b/README.osx
@@ -73,15 +73,16 @@
 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
 
@@ -105,7 +106,7 @@
 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
 
--- a/osxbuild
+++ b/osxbuild
@@ -4,11 +4,11 @@
 # 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:
 #
@@ -16,37 +16,50 @@
 # 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
@@ -60,9 +73,9 @@
     --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