~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to MacOSX-Framework

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-05-26 18:58:51 UTC
  • mfrom: (3.3.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090526185851-t1gun9nboi5kbd9u
Tags: 7.19.5-1ubuntu1
* Merge from Debian unstable (LP: #380281), remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* Fixes LP: #379477

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
 
# This script performs all of the steps needed to build a 32 bit 
 
2
# This script performs all of the steps needed to build a 
3
3
# universal binary libcurl.framework for Mac OS X 10.4 or greater.
4
4
 
5
5
VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
6
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..."
 
7
SDK32='/Developer/SDKs/MacOSX10.4u.sdk'
 
8
 
 
9
MINVER32='-mmacosx-version-min=10.4'
 
10
 
 
11
ARCHES32='-arch ppc -arch i386'
 
12
 
 
13
SDK64='/Developer/SDKs/MacOSX10.5.sdk'
 
14
 
 
15
MINVER64='-mmacosx-version-min=10.5'
 
16
 
 
17
ARCHES64='-arch ppc64 -arch x86_64'
 
18
 
 
19
if test -d $SDK32; then
 
20
  echo "----Configuring libcurl for 32 bit universal framework..."
24
21
  ./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"
 
22
    CFLAGS="-Os -isysroot $SDK32 $ARCHES32 $MINVER32" \
 
23
    LDFLAGS="-Wl,-syslibroot,$SDK32 $ARCHES32 $MINVER32 -Wl,-headerpad_max_install_names" \
 
24
    CC=$CC
27
25
  
28
 
  echo "Building libcurl..."
 
26
  echo "----Building 32 bit libcurl..."
29
27
  make
30
28
  
31
 
  echo "Creating framework..."
 
29
  echo "----Creating 32 bit framework..."
32
30
  rm -r libcurl.framework
33
31
  mkdir -p libcurl.framework/Versions/A/Resources
34
32
  cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl
35
33
  install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl
36
34
  /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
 
35
  mkdir -p libcurl.framework/Versions/A/Headers/curl
 
36
  cp include/curl/*.h libcurl.framework/Versions/A/Headers/curl
 
37
  pushd libcurl.framework
40
38
  ln -fs Versions/A/libcurl libcurl
41
39
  ln -fs Versions/A/Resources Resources
42
40
  ln -fs Versions/A/Headers Headers
43
41
  cd Versions
44
42
  ln -fs A Current
45
43
  
 
44
  if test -d $SDK64; then
 
45
    popd
 
46
    make clean
 
47
    echo "----Configuring libcurl for 64 bit universal framework..."
 
48
    ./configure --disable-dependency-tracking --disable-static --with-gssapi \
 
49
      CFLAGS="-Os -isysroot $SDK64 $ARCHES64 $MINVER64" \
 
50
      LDFLAGS="-Wl,-syslibroot,$SDK64 $ARCHES64 $MINVER64 -Wl,-headerpad_max_install_names" \
 
51
      CC=$CC
 
52
  
 
53
    echo "----Building 64 bit libcurl..."
 
54
    make
 
55
  
 
56
    echo "----Appending 64 bit framework to 32 bit framework..."
 
57
    cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl64
 
58
    install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl64
 
59
    cp libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl32
 
60
    lipo libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64 -create -output libcurl.framework/Versions/A/libcurl
 
61
    rm libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64
 
62
    cp libcurl.framework/Versions/A/Headers/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild32.h
 
63
    cp include/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild64.h
 
64
    cat >libcurl.framework/Versions/A/Headers/curl/curlbuild.h <<EOF
 
65
#ifdef __LP64__
 
66
#include "curl/curlbuild64.h"
 
67
#else
 
68
#include "curl/curlbuild32.h"
 
69
#endif
 
70
EOF
 
71
  fi
 
72
  
 
73
  lipo -info libcurl.framework/Versions/A/libcurl
46
74
  echo "libcurl.framework is built and can now be included in other projects."
 
75
  echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
47
76
else
48
77
  echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4u SDK installed."
49
78
fi