I am very thankful for the experimental, static Mac OS X executable package. The binaries run perfectly on my Intel Mac.
As I would really like to hit the road with it and use it on my ancient PowerBook G4, I have tried building sox statically and dynamically on the PPC Mac (same Mac OS X 10.5.6, XCode 3.1.2) and I always run into one issue or another.
It would help me tremendously if the generous person who is regularly building the current (Intel) binaries for Mac OS X would provide details as to how this static and feature rich build is achieved. Alternatively it would be even better if the process could be modified to build universal binaries.
These documents have helped me getting some of the libs to build as universal binaries:
http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/intro/intro.html
http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html#//apple_ref/doc/uid/TP40002850-BAJCFEBA
I am thankful for any help whatsoever!
To clarify this a bit: I can get the libraries to compile statically, but not sox itself.
#/bin/bash
# This will build a static binary of sox for Mac OS X
# You should run this as root
# placed in a folder containing:
# lpng1235
# wavpack-4.50.1
# libogg-1.1.3
# libvorbis-1.2.0
# libsndfile-1.0.19
# lame-398-2
# libid3tag-0.15.1b
# libmad-0.15.1b
# flac-1.2.1
# libsamplerate-0.1.7
# sox-14.2.0
# You will have to change the names below for different versions!
# For some reason this process will fail to build a static binary if any of the dynamic libraries is available.
# So make sure that there are no .dylib files in /usr/local/lib/
# ./configure --disable-shared --enable-static LDFLAGS="-static"
# doesn't work. It will produce errors and fail to build
SHELLDIR=`echo $0 | awk -F "/" '{for ( a = 1; a < NF; a = a+1 ) printf "%s/", $a}'`
cd $SHELLDIR
cd lpng1235
cp scripts/makefile.darwin makefile
make
sudo make install-static
cd ../libsamplerate-0.1.7/
./configure --disable-shared --enable-static;make;sudo make install
cd ../libid3tag-0.15.1b/
./configure --disable-shared --enable-static;make;sudo make install
cd ../libmad-0.15.1b/
./configure --disable-shared --enable-static;make;sudo make install
cd ../lame-398-2/
./configure --disable-shared --enable-static;make;sudo make install
cd ../wavpack-4.50.1/
./configure --disable-shared --enable-static;make;sudo make install
cd ../flac-1.2.1/
./configure --disable-shared --enable-static --disable-asm-optimizations --disable-xmms-plugin;make;sudo make install
cd ../libogg-1.1.3/
./configure --disable-shared --enable-static;make;sudo make install
cd ../libvorbis-1.2.0/
./configure --disable-shared --enable-static;make;sudo make install
cd ../libsndfile-1.0.19/
./configure --disable-shared --enable-static;make;sudo make install
cd ../sox-14.3.0/
./configure --disable-shared --enable-static;make;sudo make install
The last comment contains a shell script that allowed me to build a static binary of sox 14.2.0 and, with modifications, 14.3.0RC2
Thanks for the information. A script called "cygbuild" was just submitted to CVS that shows how we build the binary we distribute for win32. I'll attempt to submit a similar script for OSX that will mostly contain the information you listed below.
I've not responded yet to your feature request because I've been attempting to build a universal binary under OSX and wanted to see how far I could get. I haven't had much luck so far. I think I'll try your suggestion of *not* using "-static" and see if that helps any.
My last ditch effort will be to compile all libraries and sox binaries twice (once for i386 and once cross compiled for ppc) and then attempt to join them afterwards. For the cross compile, something similar to './configure --host=ppc-apple-darwim CFLAGS="-arch ppc" LDFLAGS="-arch ppc"' had some initial success on i386 although I'm unable to run this to see if its valid executable.
I've not got access to ppc OSX so I'll need to rely on someone such as you to test the results.
Building a universal binary that way is not hard:
1. Build everything the same way on both machines (I used my script below)
2. Put the binaries in a folder called "build"
4. Create two folders within that folder called "intel" and "ppc"
5. Put your two compiles into the appropriate folders
6. cd to the parent directory of the "build" directory
7. run "lipo -create build/*/sox -output sox"
I still need to get this process to spit out binaries that will run on 10.4. The only problem currently appears to be this:
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
For 10.4 it has to be compatible to 5.0.0. I will experiment with injecting the 10.4 SDK into the build process as described in the Apple docs in my first post.
Hello! I found this thread while searching the archives for answers regarding ppc/universal binary. I can easily build ppc versions out of macports (previously darwinports) but what I very much need is a fully static build that I could include in my project targetting (for a reason) 10.4u SDK. It would be _very much_ appreciated if the pre-built static binary could be made universal and 10.4 compatible. Many thanks for considering. If to make it happen any ppc related help from my side is needed pleas let me know.