Daniel Johnson provided a shell script that will perform all the steps needed
[platform/upstream/curl.git] / MacOSX-Framework
1 #!/bin/bash
2 # This script performs all of the steps needed to build a 32 bit 
3 # universal binary libcurl.framework for Mac OS X 10.4 or greater.
4
5 VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
6
7 SDK='/Developer/SDKs/MacOSX10.4u.sdk'
8
9 MINVER='-mmacosx-version-min=10.4'
10
11 ARCHES='-arch ppc -arch i386'
12
13 # Use these values instead to produce a 64 bit framework that only works on 10.5.
14 # You can't currently build a combined 32/64 framework.
15 #SDK='/Developer/SDKs/MacOSX10.5.sdk'
16 #
17 #MINVER='-mmacosx-version-min=10.5'
18 #
19 #ARCHES='-arch ppc64 -arch x86_64'
20
21
22 if test -d $SDK; then
23   echo "Configuring libcurl for 32 bit universal framework..."
24   ./configure --disable-dependency-tracking --disable-static --with-gssapi \
25     CFLAGS="-isysroot $SDK $ARCHES $MINVER" \
26     LDFLAGS="-Wl,-syslibroot,$SDK $ARCHES $MINVER -Wl,-headerpad_max_install_names"
27   
28   echo "Building libcurl..."
29   make
30   
31   echo "Creating framework..."
32   rm -r libcurl.framework
33   mkdir -p libcurl.framework/Versions/A/Resources
34   cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl
35   install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl
36   /usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/Versions/A/Resources/Info.plist
37   mkdir -p libcurl.framework/Versions/A/Headers
38   cp include/curl/*.h libcurl.framework/Versions/A/Headers
39   cd libcurl.framework
40   ln -fs Versions/A/libcurl libcurl
41   ln -fs Versions/A/Resources Resources
42   ln -fs Versions/A/Headers Headers
43   cd Versions
44   ln -fs A Current
45   
46   echo "libcurl.framework is built and can now be included in other projects."
47 else
48   echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4u SDK installed."
49 fi