2005-10-12 12:29:56 +00:00
|
|
|
#!/bin/sh
|
2005-09-30 08:58:22 +00:00
|
|
|
|
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-09-30 08:58:22 +00:00
|
|
|
##
|
|
|
|
# Script for building Macintosh BOINC Manager, Core Client and libraries
|
2006-02-18 05:49:24 +00:00
|
|
|
# by Charlie Fenton 2/17/06
|
2005-10-13 00:20:38 +00:00
|
|
|
# with thanks to Reinhard Prix for his assistance
|
2005-09-30 08:58:22 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
## Usage:
|
|
|
|
## cd to the mac_build directory of the boinc tree, for example:
|
|
|
|
## cd [path]/boinc/mac_build
|
|
|
|
##
|
|
|
|
## then invoke this script as follows:
|
2006-02-08 10:28:32 +00:00
|
|
|
## source BuildMacBOINC.sh [-dev] [-noclean] [-all] [-lib] [-client] [-help]
|
2005-10-13 00:39:12 +00:00
|
|
|
## or
|
|
|
|
## chmod +x BuildMacBOINC.sh
|
2006-02-08 10:28:32 +00:00
|
|
|
## ./BuildMacBOINC.sh [-dev] [-noclean] [-all] [-lib] [-client]
|
2005-09-30 08:58:22 +00:00
|
|
|
##
|
|
|
|
## optional arguments
|
2006-02-08 10:28:32 +00:00
|
|
|
## -dev build the development (debug) version (native architecture only).
|
|
|
|
## default is deployment (release) version (universal binaries: ppc and i386).
|
2005-09-30 08:58:22 +00:00
|
|
|
##
|
2006-02-08 10:28:32 +00:00
|
|
|
## -noclean don't do a "clean" of each target before building.
|
2005-09-30 08:58:22 +00:00
|
|
|
## default is to clean all first.
|
|
|
|
##
|
2006-02-08 10:28:32 +00:00
|
|
|
## The following arguments determine which targets to build
|
|
|
|
##
|
|
|
|
## -all build all targets (i.e. target "Build_All" -- this is the default)
|
|
|
|
##
|
|
|
|
## -lib build the three libraries: libboinc_api.a, libboinc_graphics_api.a, libboinc.a
|
|
|
|
##
|
|
|
|
## -client build two targets: boinc client and command-line utility boinc_cmd
|
|
|
|
## (also builds libboinc.a if needed, since boinc_cmd requires it.)
|
|
|
|
##
|
|
|
|
## Both -lib and -client may be specified to build five targets (no BOINC Manager)
|
|
|
|
##
|
|
|
|
|
|
|
|
targets=""
|
|
|
|
style="Deployment"
|
|
|
|
doclean="clean"
|
|
|
|
buildall=0
|
|
|
|
buildlibs=0
|
|
|
|
buildclient=0
|
2005-09-30 08:58:22 +00:00
|
|
|
|
2006-02-08 10:28:32 +00:00
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
|
|
|
-noclean ) doclean="" ; shift 1 ;;
|
|
|
|
-dev ) style="Development" ; shift 1 ;;
|
|
|
|
-all ) buildall=1 ; shift 1 ;;
|
|
|
|
-lib ) buildlibs=1 ; shift 1 ;;
|
|
|
|
-client ) buildclient=1 ; shift 1 ;;
|
|
|
|
* ) echo "usage:" ; echo "cd {path}/mac_build/" ; echo "source BuildMacBOINC.sh [-dev] [-noclean] [-all] [-lib] [-client] [-help]" ; return 1 ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "${style}" = "Development" ]; then
|
2006-02-02 12:48:36 +00:00
|
|
|
echo "Development (debug) build"
|
2005-09-30 08:58:22 +00:00
|
|
|
else
|
2006-02-02 12:48:36 +00:00
|
|
|
echo "Deployment (release) build"
|
2005-09-30 08:58:22 +00:00
|
|
|
fi
|
|
|
|
|
2006-02-08 10:28:32 +00:00
|
|
|
if [ "${doclean}" = "clean" ]; then
|
|
|
|
echo "Clean each target before building"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${buildlibs}" = "1" ]; then
|
|
|
|
targets="$targets -target libboinc -target gfxlibboinc -target api_libboinc"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${buildclient}" = "1" ]; then
|
|
|
|
targets="$targets -target BOINC_Client -target cmd_boinc"
|
|
|
|
fi
|
|
|
|
|
|
|
|
## "-all" overrides "-lib" and "-client" since it includes those targets
|
|
|
|
if [ "${buildall}" = "1" ] || [ "${targets}" = "" ]; then
|
|
|
|
targets="-target Build_All"
|
2005-09-30 08:58:22 +00:00
|
|
|
fi
|
|
|
|
|
2005-10-13 00:20:38 +00:00
|
|
|
version=`uname -r`;
|
|
|
|
|
|
|
|
major=`echo $version | sed 's/\([0-9]*\)[.].*/\1/' `;
|
|
|
|
minor=`echo $version | sed 's/[0-9]*[.]\([0-9]*\).*/\1/' `;
|
|
|
|
|
|
|
|
# echo "major = $major"
|
|
|
|
# echo "minor = $minor"
|
|
|
|
#
|
|
|
|
# Darwin version 8.x.y corresponds to OS 10.4.x
|
|
|
|
# Darwin version 7.x.y corresponds to OS 10.3.x
|
2007-05-22 01:08:53 +00:00
|
|
|
# Darwin version 6.x corresponds to OS 10.2.x
|
2005-10-13 00:20:38 +00:00
|
|
|
|
|
|
|
if [ "$major" = "8" ]; then
|
2005-09-30 08:58:22 +00:00
|
|
|
echo "Building BOINC under System 10.4"
|
2006-02-02 12:48:36 +00:00
|
|
|
if [ ! -d /Developer/SDKs/MacOSX10.3.9.sdk/ ]; then
|
|
|
|
echo "ERROR: System 10.3.9 SDK is missing. For details, see build instructions at "
|
|
|
|
echo "boinc/mac_build/HowToBuildBOINC_XCode.rtf or http://boinc.berkeley.edu/mac_build.html"
|
2006-02-08 10:28:32 +00:00
|
|
|
return 1
|
2005-10-13 00:20:38 +00:00
|
|
|
fi
|
2005-09-30 08:58:22 +00:00
|
|
|
else
|
2006-02-02 12:48:36 +00:00
|
|
|
echo "ERROR: Building BOINC requires System 10.4 or later. For details, see build instructions at "
|
|
|
|
echo "boinc/mac_build/HowToBuildBOINC_XCode.rtf or http://boinc.berkeley.edu/mac_build.html"
|
2006-02-08 10:28:32 +00:00
|
|
|
return 1
|
2005-09-30 08:58:22 +00:00
|
|
|
fi
|
|
|
|
|
2006-02-08 10:28:32 +00:00
|
|
|
xcodebuild -project boinc.xcodeproj ${targets} -configuration ${style} ${doclean} build
|
|
|
|
|
|
|
|
return $?
|