Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 133 lines (113 sloc) 5.099 kB
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
1 #!/bin/bash
a07bc79 @yangtse removed trailing whitespace
yangtse authored
2 # This script performs all of the steps needed to build a
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
3 # universal binary libcurl.framework for Mac OS X 10.4 or greater.
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
4 #
5 # Hendrik Visage:
6 # Generalizations added since Snowleopard (10.6) do not include
7 # the 10.4u SDK.
8 #
9 # Also note:
10 # 10.5 is the *ONLY* SDK that support PPC64 :( -- 10.6 do not have ppc64 support
11 #If you need to have PPC64 support then change below to 1
12 PPC64_NEEDED=0
13
14 # For me the default is to develop for the platform I am on, and if you
15 #desire compatibility with older versions then change USE_OLD to 1 :)
16 USE_OLD=0
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
17
18 VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
19 FRAMEWORK_VERSION=Versions/Release-$VERSION
20
21 #I also wanted to "copy over" the system, and thus the reason I added the
22 # version to Versions/Release-7.20.1 etc.
23 # now a simple rsync -vaP libcurl.framework /Library/Frameworks will install it
24 # and setup the right paths to this version, leaving the system version
25 # "intact", so you can "fix" it later with the links to Versions/A/...
26
27
28 OLD_SDK=`ls /Developer/SDKs|head -1`
29 NEW_SDK=`ls -r /Developer/SDKs|head -1`
30
31 if test "0"$USE_OLD -gt 0
32 then
33 SDK32=$OLD_SDK
34 else
35 SDK32=$NEW_SDK
36 fi
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
37
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
38 MACVER=`echo $SDK32|sed -e s/[a-zA-Z]//g -e s/.\$//`
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
39
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
40 SDK32_DIR='/Developer/SDKs/'$SDK32
41 MINVER32='-mmacosx-version-min='$MACVER
42 ARCHES32='-arch i386 -arch ppc'
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
43
44
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
45 if test $PPC64_NEEDED -gt 0
46 then
47 SDK64=10.5
48 ARCHES64='-arch x86_64 -arch ppc64'
49 SDK64=`ls /Developer/SDKs|grep 10.5|head -1`
50 else
51 ARCHES64='-arch x86_64'
52 #We "know" that 10.4 and earlier do not support 64bit
53 OLD_SDK64=`ls /Developer/SDKs|egrep -v "10.[0-4]"|head -1`
54 NEW_SDK64=`ls -r /Developer/SDKs|egrep -v "10.[0-4]"|head -1`
55 if test $USE_OLD -gt 0
56 then
57 SDK64=$OLD_SDK64
58 else
59 SDK64=$NEW_SDK64
60 fi
61 fi
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
62
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
63 SDK64_DIR='/Developer/SDKs/'$SDK64
64 MACVER64=`echo $SDK64|sed -e s/[a-zA-Z]//g -e s/.\$//`
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
65
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
66 MINVER64='-mmacosx-version-min='$MACVER64
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
67
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
68 if test ! -z $SDK32; then
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
69 echo "----Configuring libcurl for 32 bit universal framework..."
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
70 make clean
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
71 ./configure --disable-dependency-tracking --disable-static --with-gssapi \
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
72 CFLAGS="-Os -isysroot $SDK32_DIR $ARCHES32 $MINVER32" \
73 LDFLAGS="-Wl,-syslibroot,$SDK32_DIR $ARCHES32 $MINVER32 -Wl,-headerpad_max_install_names" \
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
74 CC=$CC
a07bc79 @yangtse removed trailing whitespace
yangtse authored
75
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
76 echo "----Building 32 bit libcurl..."
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
77 make
a07bc79 @yangtse removed trailing whitespace
yangtse authored
78
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
79 echo "----Creating 32 bit framework..."
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
80 rm -r libcurl.framework
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
81 mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Resources
82 cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl
83 install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl
84 /usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/${FRAMEWORK_VERSION}/Resources/Info.plist
85 mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
86 cp include/curl/*.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
87 pushd libcurl.framework
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
88 ln -fs ${FRAMEWORK_VERSION}/libcurl libcurl
89 ln -fs ${FRAMEWORK_VERSION}/Resources Resources
90 ln -fs ${FRAMEWORK_VERSION}/Headers Headers
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
91 cd Versions
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
92 ln -fs ${FRAMEWORK_VERSION} Current
a07bc79 @yangtse removed trailing whitespace
yangtse authored
93
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
94 echo TEsting for SDK64
95 if test -d $SDK64_DIR; then
96 echo entering...
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
97 popd
98 make clean
99 echo "----Configuring libcurl for 64 bit universal framework..."
100 ./configure --disable-dependency-tracking --disable-static --with-gssapi \
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
101 CFLAGS="-Os -isysroot $SDK64_DIR $ARCHES64 $MINVER64" \
102 LDFLAGS="-Wl,-syslibroot,$SDK64_DIR $ARCHES64 $MINVER64 -Wl,-headerpad_max_install_names" \
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
103 CC=$CC
a07bc79 @yangtse removed trailing whitespace
yangtse authored
104
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
105 echo "----Building 64 bit libcurl..."
106 make
a07bc79 @yangtse removed trailing whitespace
yangtse authored
107
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
108 echo "----Appending 64 bit framework to 32 bit framework..."
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
109 cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
110 install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
111 cp libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl32
112 pwd
113 lipo libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 -create -output libcurl.framework/${FRAMEWORK_VERSION}/libcurl
114 rm libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
115 cp libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild32.h
116 cp include/curl/curlbuild.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild64.h
117 cat >libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild.h <<EOF
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
118 #ifdef __LP64__
119 #include "curl/curlbuild64.h"
120 #else
121 #include "curl/curlbuild32.h"
122 #endif
123 EOF
124 fi
a07bc79 @yangtse removed trailing whitespace
yangtse authored
125
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
126 pwd
127 lipo -info libcurl.framework/${FRAMEWORK_VERSION}/libcurl
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
128 echo "libcurl.framework is built and can now be included in other projects."
eed4a13 @yangtse Daniel Johnson improved the MacOSX-Framework shell script to now perf…
yangtse authored
129 echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
130 else
70a025f @hevisko MacOSX-Framework: updates for Snowleopard
hevisko authored
131 echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4/5/6 SDK installed."
f554897 @yangtse Daniel Johnson provided a shell script that will perform all the step…
yangtse authored
132 fi
Something went wrong with that request. Please try again.