2005-12-22 02:33:59 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2006-02-18 05:49:24 +00:00
|
|
|
# Berkeley Open Infrastructure for Network Computing
|
|
|
|
# http://boinc.berkeley.edu
|
|
|
|
# Copyright (C) 2005 University of California
|
|
|
|
#
|
|
|
|
# This is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation;
|
|
|
|
# either version 2.1 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This software is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the GNU Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# To view the GNU Lesser General Public License visit
|
|
|
|
# http://www.gnu.org/copyleft/lesser.html
|
|
|
|
# or write to the Free Software Foundation, Inc.,
|
2007-10-09 11:35:47 +00:00
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2006-02-18 05:49:24 +00:00
|
|
|
#
|
|
|
|
#
|
2007-10-17 05:59:37 +00:00
|
|
|
# Script to build Macintosh Universal Binary library of curl-7.17.0 for
|
2005-12-22 02:33:59 +00:00
|
|
|
# use in building BOINC.
|
|
|
|
#
|
2006-07-22 09:30:34 +00:00
|
|
|
# by Charlie Fenton 7/21/06
|
2007-10-17 05:59:37 +00:00
|
|
|
# Updated for curl-7.17.0 10/16/07
|
2007-10-27 11:19:12 +00:00
|
|
|
# Updated 10/27/07
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
2007-10-17 05:59:37 +00:00
|
|
|
## In Terminal, CD to the curl-7.17.0 directory.
|
|
|
|
## cd [path]/curl-7.17.0/
|
2006-02-18 05:49:24 +00:00
|
|
|
## then run this script:
|
2007-10-27 11:19:12 +00:00
|
|
|
## source [path]/buildcurl.sh [ -clean ] [ -gcc33 ]
|
2006-02-18 05:49:24 +00:00
|
|
|
##
|
|
|
|
## the -clean argument will force a full rebuild.
|
2007-10-27 11:19:12 +00:00
|
|
|
##
|
|
|
|
## the -gcc33 argument will cause the PowerPC build to use gcc-3.3
|
|
|
|
## otherwise both architectures will be built using gcc_4.0
|
|
|
|
##
|
|
|
|
## Use -gcc33 if you need to link with a project application using BOINC
|
|
|
|
## libraries built with gcc-3.3 for backward compatibility to OS 10.3.0
|
|
|
|
##
|
|
|
|
## Build with gcc-4.0 to link with the BOINC client
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
if [ "$1" != "-clean" ]; then
|
|
|
|
if [ -f lib/.libs/libcurl_ppc.a ] && [ -f lib/.libs/libcurl_i386.a ] && [ -f lib/.libs/libcurl.a ]; then
|
|
|
|
|
2007-10-17 05:59:37 +00:00
|
|
|
echo "curl-7.17.0 already built"
|
2005-12-22 02:33:59 +00:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2007-10-27 11:19:12 +00:00
|
|
|
|
|
|
|
if [ "$1" = "-gcc33" ] || [ "$2" = "-gcc33" ]; then
|
|
|
|
usegcc33=1
|
|
|
|
else
|
|
|
|
usegcc33=0
|
|
|
|
fi
|
|
|
|
|
2005-12-22 02:33:59 +00:00
|
|
|
export PATH=/usr/local/bin:$PATH
|
2006-02-18 05:49:24 +00:00
|
|
|
export LDFLAGS="-arch ppc"
|
|
|
|
export CFLAGS="-arch ppc"
|
2006-05-05 10:11:06 +00:00
|
|
|
export SDKROOT="/Developer/SDKs/MacOSX10.3.9.sdk"
|
|
|
|
|
2007-10-27 11:19:12 +00:00
|
|
|
if [ $usegcc33 -ne 0 ]; then
|
|
|
|
|
|
|
|
export CC=/usr/bin/gcc-3.3;export CXX=/usr/bin/g++-3.3
|
|
|
|
|
2006-05-05 10:42:22 +00:00
|
|
|
## ./configure --enable-shared=NO --host=ppc
|
|
|
|
./configure --enable-shared=NO --host=ppc CPPFLAGS="-arch ppc -I/Developer/SDKs/MacOSX10.3.9.sdk/Developer/Headers/FlatCarbon -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include -isystem /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3 -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3/c++ -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/gcc/darwin/3.3/c++/ppc-darwin -isystem /Developer/SDKs/MacOSX10.3.9.sdk/usr/include"
|
2006-07-22 03:35:48 +00:00
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
2005-12-22 02:33:59 +00:00
|
|
|
|
2007-10-27 11:19:12 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
export CC=/usr/bin/gcc-4.0;export CXX=/usr/bin/g++-4.0
|
|
|
|
|
|
|
|
## ./configure --enable-shared=NO --host=ppc
|
|
|
|
./configure --enable-shared=NO --host=ppc CPPFLAGS="-arch ppc -I/Developer/SDKs/MacOSX10.3.9.sdk/Developer/Headers/FlatCarbon -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/include -isystem /Developer/SDKs/MacOSX10.3.9.sdk/usr/include"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
|
|
|
|
|
|
|
|
2005-12-22 02:33:59 +00:00
|
|
|
make clean
|
|
|
|
|
|
|
|
rm -f lib/.libs/libcurl.a
|
|
|
|
rm -f lib/.libs/libcurl_ppc.a
|
|
|
|
rm -f lib/.libs/libcurl_i386.a
|
|
|
|
|
|
|
|
export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.3.9.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.3.9.sdk"
|
|
|
|
|
|
|
|
make
|
2006-07-22 03:35:48 +00:00
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
2005-12-22 02:33:59 +00:00
|
|
|
mv -f lib/.libs/libcurl.a lib/libcurl_ppc.a
|
|
|
|
|
|
|
|
make clean
|
2006-07-22 03:35:48 +00:00
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
2005-12-22 02:33:59 +00:00
|
|
|
|
|
|
|
export PATH=/usr/local/bin:$PATH
|
|
|
|
export CC=/usr/bin/gcc-4.0;export CXX=/usr/bin/g++-4.0
|
2006-02-18 09:02:35 +00:00
|
|
|
export LDFLAGS=""
|
|
|
|
export CPPFLAGS=""
|
|
|
|
export CFLAGS=""
|
2006-05-05 10:11:06 +00:00
|
|
|
export SDKROOT="/Developer/SDKs/MacOSX10.4u.sdk"
|
|
|
|
|
2006-05-05 10:42:22 +00:00
|
|
|
./configure --enable-shared=NO --host=i386
|
2006-07-22 03:35:48 +00:00
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
2005-12-22 02:33:59 +00:00
|
|
|
|
|
|
|
export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386"
|
|
|
|
export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386"
|
|
|
|
|
|
|
|
make -e
|
2006-07-22 03:35:48 +00:00
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
2005-12-22 02:33:59 +00:00
|
|
|
mv -f lib/.libs/libcurl.a lib/.libs/libcurl_i386.a
|
|
|
|
mv -f lib/libcurl_ppc.a lib/.libs/
|
|
|
|
lipo -create lib/.libs/libcurl_i386.a lib/.libs/libcurl_ppc.a -output lib/.libs/libcurl.a
|
2006-07-22 03:35:48 +00:00
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
2005-12-22 02:33:59 +00:00
|
|
|
|
|
|
|
export CC="";export CXX=""
|
|
|
|
export LDFLAGS=""
|
|
|
|
export CPPFLAGS=""
|
2006-05-05 10:11:06 +00:00
|
|
|
export CFLAGS=""
|
|
|
|
export SDKROOT=""
|
2005-12-22 02:33:59 +00:00
|
|
|
|
|
|
|
return 0
|