From e702657f67e527771c6a0bfb195386cdef4c3ee9 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Tue, 2 Jan 2007 04:31:57 +0000 Subject: [PATCH] Update mac build scripts to build universal binaries --- mkmac.sh.templ | 37 +++++++++++++++++++++++++++++++------ osx/makedist.sh.templ | 8 ++++---- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/mkmac.sh.templ b/mkmac.sh.templ index b21196d1..6110b53d 100755 --- a/mkmac.sh.templ +++ b/mkmac.sh.templ @@ -28,6 +28,10 @@ if [ ! -f mt-daapd-svn-${SVNVERSION}.tar.gz ]; then exit fi +rm -rf .build +mkdir -p .build/ppc +mkdir -p .build/intel + tar -xvzf mt-daapd-svn-${SVNVERSION}.tar.gz pushd mt-daapd-svn-${SVNVERSION} ./configure --enable-static --with-static-libs=/sw/lib --enable-sqlite --with-id3tag=/sw @@ -35,18 +39,37 @@ check_error $? "Configure error" make check_error $? "Compile error" - popd BUILDDIR=mt-daapd-svn-${SVNVERSION}/src -rm -rf .build -mkdir -p .build/ppc cp $BUILDDIR/mt-daapd .build/ppc cp $BUILDDIR/wavstreamer .build/ppc cp $BUILDDIR/plugins/.libs/*so .build/ppc + +# now make the intel version +pushd mt-daapd-svn-${SVNVERSION} +make clean +CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386" LDFLAGS="-arch i386" ac_cv_func_setpgrp_void=no ./configure --disable-dependency-tracking --enable-static --with-static-libs=/sw-x86/lib --enable-sqlite --with-id3tag=/sw-x86 --host=i686-apple-darwin8.8.0 + +check_error $? "Configure error" + +make +check_error $? "Compile error" +popd + +BUILDDIR=mt-daapd-svn-${SVNVERSION}/src +cp $BUILDDIR/mt-daapd .build/intel +cp $BUILDDIR/wavstreamer .build/intel +cp $BUILDDIR/plugins/.libs/*so .build/intel rm -rf mt-daapd-svn-${SVNVERSION} -ALAC_VERSION=0.1.1 +for f in .build/intel/*; do + f=`basename $f` + lipo -create .build/intel/$f .build/ppc/$f -output .build/$f +done + + +ALAC_VERSION=0.1.3 if [ ! -x alac_decoder/alac ]; then wget http://craz.net/programs/itunes/files/alac_decoder-${ALAC_VERSION}.tar.gz @@ -56,7 +79,9 @@ if [ ! -x alac_decoder/alac ]; then check_error $? "error decompressing alac decoder" pushd alac_decoder - make + patch -p0 < ../alac_decoder.patch + + CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" LDFLAGS="-arch i386 -arch ppc" make check_error $? "Could not compile alac decoder" popd @@ -67,5 +92,5 @@ if [ ! -x alac_decoder/alac ]; then exit 1 fi -cp alac_decoder/alac .build/ppc +cp alac_decoder/alac .build diff --git a/osx/makedist.sh.templ b/osx/makedist.sh.templ index c5a2751b..af1d15e6 100755 --- a/osx/makedist.sh.templ +++ b/osx/makedist.sh.templ @@ -35,10 +35,10 @@ if [ "$BUILD" = "yes" ]; then mkdir -p "${AR}/lib-js" mkdir -p "${AR}/lib-js/script.aculo.us" - cp ../.build/ppc/mt-daapd "Firefly Helper/Server/firefly" - cp ../.build/ppc/*so "Firefly Helper/Server/Plugins" - cp ../.build/ppc/wavstreamer "Firefly Helper/Server" - cp ../.build/ppc/alac "Firefly Helper/Server" + cp ../.build/mt-daapd "Firefly Helper/Server/firefly" + cp ../.build/*so "Firefly Helper/Server/Plugins" + cp ../.build/wavstreamer "Firefly Helper/Server" + cp ../.build/alac "Firefly Helper/Server" cp ../admin-root/*.+(html|xml|txt|jar|gif|js|png|jpg|css|ico) "${AR}" cp ../admin-root/CREDITS "${AR}" cp ../admin-root/lib-js/*js "${AR}/lib-js"