Daniel Johnson improved the MacOSX-Framework shell script to now perform all

the steps required to build a Mac OS X four way fat ppc/i386/ppc64/x86_64
libcurl.framework.  Four way fat framework requires OS X 10.5 SDK or later.
This commit is contained in:
Yang Tse 2009-04-10 02:50:21 +00:00
parent 7e9f7659b3
commit eed4a13b3b
3 changed files with 55 additions and 21 deletions

View File

@ -6,6 +6,10 @@
Changelog Changelog
Yang Tse (10 Apr 2009)
- Daniel Johnson improved the MacOSX-Framework shell script to now perform all
the steps required to build a Mac OS X four way fat ppc/i386/ppc64/x86_64
libcurl.framework. Four way fat framework requires OS X 10.5 SDK or later.
Yang Tse (8 Apr 2009) Yang Tse (8 Apr 2009)
- Removed Sun compilers preprocessor block from curlbuild.h.dist, this also - Removed Sun compilers preprocessor block from curlbuild.h.dist, this also

View File

@ -1,49 +1,78 @@
#!/bin/bash #!/bin/bash
# This script performs all of the steps needed to build a 32 bit # This script performs all of the steps needed to build a
# universal binary libcurl.framework for Mac OS X 10.4 or greater. # universal binary libcurl.framework for Mac OS X 10.4 or greater.
VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h` VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
SDK='/Developer/SDKs/MacOSX10.4u.sdk' SDK32='/Developer/SDKs/MacOSX10.4u.sdk'
MINVER='-mmacosx-version-min=10.4' MINVER32='-mmacosx-version-min=10.4'
ARCHES='-arch ppc -arch i386' ARCHES32='-arch ppc -arch i386'
# Use these values instead to produce a 64 bit framework that only works on 10.5. SDK64='/Developer/SDKs/MacOSX10.5.sdk'
# You can't currently build a combined 32/64 framework.
#SDK='/Developer/SDKs/MacOSX10.5.sdk'
#
#MINVER='-mmacosx-version-min=10.5'
#
#ARCHES='-arch ppc64 -arch x86_64'
MINVER64='-mmacosx-version-min=10.5'
if test -d $SDK; then ARCHES64='-arch ppc64 -arch x86_64'
echo "Configuring libcurl for 32 bit universal framework..."
if test -d $SDK32; then
echo "----Configuring libcurl for 32 bit universal framework..."
./configure --disable-dependency-tracking --disable-static --with-gssapi \ ./configure --disable-dependency-tracking --disable-static --with-gssapi \
CFLAGS="-isysroot $SDK $ARCHES $MINVER" \ CFLAGS="-Os -isysroot $SDK32 $ARCHES32 $MINVER32" \
LDFLAGS="-Wl,-syslibroot,$SDK $ARCHES $MINVER -Wl,-headerpad_max_install_names" LDFLAGS="-Wl,-syslibroot,$SDK32 $ARCHES32 $MINVER32 -Wl,-headerpad_max_install_names" \
CC=$CC
echo "Building libcurl..." echo "----Building 32 bit libcurl..."
make make
echo "Creating framework..." echo "----Creating 32 bit framework..."
rm -r libcurl.framework rm -r libcurl.framework
mkdir -p libcurl.framework/Versions/A/Resources mkdir -p libcurl.framework/Versions/A/Resources
cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl
/usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/Versions/A/Resources/Info.plist /usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/Versions/A/Resources/Info.plist
mkdir -p libcurl.framework/Versions/A/Headers mkdir -p libcurl.framework/Versions/A/Headers/curl
cp include/curl/*.h libcurl.framework/Versions/A/Headers cp include/curl/*.h libcurl.framework/Versions/A/Headers/curl
cd libcurl.framework pushd libcurl.framework
ln -fs Versions/A/libcurl libcurl ln -fs Versions/A/libcurl libcurl
ln -fs Versions/A/Resources Resources ln -fs Versions/A/Resources Resources
ln -fs Versions/A/Headers Headers ln -fs Versions/A/Headers Headers
cd Versions cd Versions
ln -fs A Current ln -fs A Current
if test -d $SDK64; then
popd
make clean
echo "----Configuring libcurl for 64 bit universal framework..."
./configure --disable-dependency-tracking --disable-static --with-gssapi \
CFLAGS="-Os -isysroot $SDK64 $ARCHES64 $MINVER64" \
LDFLAGS="-Wl,-syslibroot,$SDK64 $ARCHES64 $MINVER64 -Wl,-headerpad_max_install_names" \
CC=$CC
echo "----Building 64 bit libcurl..."
make
echo "----Appending 64 bit framework to 32 bit framework..."
cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl64
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl64
cp libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl32
lipo libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64 -create -output libcurl.framework/Versions/A/libcurl
rm libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64
cp libcurl.framework/Versions/A/Headers/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild32.h
cp include/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild64.h
cat >libcurl.framework/Versions/A/Headers/curl/curlbuild.h <<EOF
#ifdef __LP64__
#include "curl/curlbuild64.h"
#else
#include "curl/curlbuild32.h"
#endif
EOF
fi
lipo -info libcurl.framework/Versions/A/libcurl
echo "libcurl.framework is built and can now be included in other projects." echo "libcurl.framework is built and can now be included in other projects."
echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
else else
echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4u SDK installed." echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4u SDK installed."
fi fi

View File

@ -25,6 +25,7 @@ This release includes the following bugfixes:
o more ciphers enabled in libcurl built to use NSS o more ciphers enabled in libcurl built to use NSS
o properly return an error code in curl_easy_recv o properly return an error code in curl_easy_recv
o Sun compilers specific preprocessor block removed from curlbuild.h.dist o Sun compilers specific preprocessor block removed from curlbuild.h.dist
o allow creation of four way fat libcurl Mac OS X Framework
This release includes the following known bugs: This release includes the following known bugs:
@ -35,6 +36,6 @@ advice from friends like these:
Daniel Fandrich, Yang Tse, David James, Chris Deidun, Bill Egert, Daniel Fandrich, Yang Tse, David James, Chris Deidun, Bill Egert,
Andre Guibert de Bruet, Andreas Farber, Frank Hempel, Pierre Brico, Andre Guibert de Bruet, Andreas Farber, Frank Hempel, Pierre Brico,
Kamil Dudka, Jim Freeman Kamil Dudka, Jim Freeman, Daniel Johnson
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)