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
|
|
|
#
|
|
|
|
#
|
2005-12-22 02:33:59 +00:00
|
|
|
# Script to build Macintosh Universal Binary library of jpeg-6b for
|
|
|
|
# use in building BOINC.
|
|
|
|
#
|
2007-12-04 13:42:02 +00:00
|
|
|
# by Charlie Fenton 12/4/07
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
2006-04-27 11:15:08 +00:00
|
|
|
## In Terminal, CD to the jpeg-6b directory.
|
2006-02-18 05:49:24 +00:00
|
|
|
## cd [path]/jpeg-6b/
|
|
|
|
## then run this script:
|
|
|
|
## source [ path_to_this_script ] [ -clean ]
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
|
|
|
# the -clean argument will force a full rebuild.
|
|
|
|
#
|
|
|
|
|
2007-12-04 13:42:02 +00:00
|
|
|
AlreadyBuilt=0
|
|
|
|
|
2005-12-22 02:33:59 +00:00
|
|
|
if [ "$1" != "-clean" ]; then
|
2007-12-04 13:42:02 +00:00
|
|
|
if [ -f libjpeg_ppc.a ] && [ -f libjpeg_i386.a ] && [ -f libjpeg.a ]; then
|
|
|
|
AlreadyBuilt=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d /Developer/SDKs/MacOSX10.5.sdk/ ]; then
|
|
|
|
# Build for x86_64 architecture if OS 10.5 SDK is present
|
|
|
|
if [ ! -f libjpeg_x86_64.a ]; then
|
|
|
|
AlreadyBuilt=0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $AlreadyBuilt -ne 0 ]; then
|
2005-12-22 02:33:59 +00:00
|
|
|
echo "jpeg-6b already built"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
export PATH=/usr/local/bin:$PATH
|
|
|
|
export CC=/usr/bin/gcc-3.3;export CXX=/usr/bin/g++-3.3
|
2007-12-07 23:48:46 +00:00
|
|
|
export LDFLAGS="-arch ppc -D_NONSTD_SOURCE"
|
|
|
|
export CPPFLAGS="-arch ppc -D_NONSTD_SOURCE"
|
|
|
|
export CFLAGS="-arch ppc -D_NONSTD_SOURCE"
|
2006-05-05 10:11:06 +00:00
|
|
|
export SDKROOT="/Developer/SDKs/MacOSX10.3.9.sdk"
|
2007-12-05 01:02:10 +00:00
|
|
|
export MACOSX_DEPLOYMENT_TARGET=10.3
|
2006-02-18 05:49:24 +00:00
|
|
|
|
2005-12-22 02:33:59 +00:00
|
|
|
./configure --disable-shared --host=ppc
|
2006-07-22 03:35:48 +00:00
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
2005-12-22 02:33:59 +00:00
|
|
|
|
|
|
|
rm -f libjpeg_ppc.a
|
|
|
|
rm -f libjpeg_i386.a
|
2007-12-04 13:42:02 +00:00
|
|
|
rm -f libjpeg_x86_64.a
|
2005-12-22 02:33:59 +00:00
|
|
|
rm -f libjpeg.a
|
|
|
|
make clean
|
|
|
|
|
2006-05-05 10:11:06 +00:00
|
|
|
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 libjpeg.a libjpeg_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
|
|
|
|
2007-12-05 01:02:10 +00:00
|
|
|
##export PATH=/usr/local/bin:$PATH
|
2005-12-22 02:33:59 +00:00
|
|
|
export CC=/usr/bin/gcc-4.0;export CXX=/usr/bin/g++-4.0
|
2007-12-05 01:02:10 +00:00
|
|
|
export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386"
|
|
|
|
export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386"
|
|
|
|
export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386"
|
2006-05-05 10:11:06 +00:00
|
|
|
export SDKROOT="/Developer/SDKs/MacOSX10.4u.sdk"
|
2007-12-05 01:02:10 +00:00
|
|
|
export MACOSX_DEPLOYMENT_TARGET=10.4
|
2006-05-05 10:11:06 +00:00
|
|
|
|
2005-12-22 02:33:59 +00:00
|
|
|
./configure --disable-shared --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
|
|
|
|
|
|
|
|
|
|
|
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 libjpeg.a libjpeg_i386.a
|
2007-12-04 13:42:02 +00:00
|
|
|
|
|
|
|
if [ ! -d /Developer/SDKs/MacOSX10.5.sdk/ ]; then
|
|
|
|
lipo -create libjpeg_i386.a libjpeg_ppc.a -output libjpeg.a
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
|
|
|
|
|
|
|
export CC="";export CXX=""
|
|
|
|
export LDFLAGS=""
|
|
|
|
export CPPFLAGS=""
|
|
|
|
export SDKROOT=""
|
|
|
|
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Build for x86_64 architecture if OS 10.5 SDK is present
|
|
|
|
make clean
|
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
|
|
|
|
2007-12-05 01:02:10 +00:00
|
|
|
##export PATH=/usr/local/bin:$PATH
|
2007-12-04 13:42:02 +00:00
|
|
|
export CC=/usr/bin/gcc-4.0;export CXX=/usr/bin/g++-4.0
|
2007-12-05 01:02:10 +00:00
|
|
|
export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64"
|
|
|
|
export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64"
|
|
|
|
export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64"
|
2007-12-04 13:42:02 +00:00
|
|
|
export SDKROOT="/Developer/SDKs/MacOSX10.5.sdk"
|
2007-12-05 01:02:10 +00:00
|
|
|
export MACOSX_DEPLOYMENT_TARGET=10.5
|
2007-12-04 13:42:02 +00:00
|
|
|
|
|
|
|
./configure --disable-shared --host=x86_64
|
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
|
|
|
|
|
|
|
|
|
|
|
make -e
|
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
|
|
|
|
|
|
|
mv libjpeg.a libjpeg_x86_64.a
|
|
|
|
|
|
|
|
|
|
|
|
lipo -create libjpeg_i386.a libjpeg_ppc.a libjpeg_x86_64.a -output libjpeg.a
|
2005-12-22 02:33:59 +00:00
|
|
|
|
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=""
|
2007-12-05 01:02:10 +00:00
|
|
|
export CFLAGS=""
|
2006-05-05 10:11:06 +00:00
|
|
|
export SDKROOT=""
|
2005-12-22 02:33:59 +00:00
|
|
|
|
|
|
|
return 0
|