2005-10-12 12:29:56 +00:00
|
|
|
#!/bin/sh
|
2005-09-30 08:58:22 +00:00
|
|
|
|
2009-02-21 02:42:50 +00:00
|
|
|
# This file is part of BOINC.
|
2006-02-18 05:49:24 +00:00
|
|
|
# http://boinc.berkeley.edu
|
2010-02-12 00:53:05 +00:00
|
|
|
# Copyright (C) 2010 University of California
|
2006-02-18 05:49:24 +00:00
|
|
|
#
|
2009-02-21 02:42:50 +00:00
|
|
|
# BOINC 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 3 of the License, or (at your option) any later version.
|
2006-02-18 05:49:24 +00:00
|
|
|
#
|
2009-02-21 02:42:50 +00:00
|
|
|
# BOINC is distributed in the hope that it will be useful,
|
2006-02-18 05:49:24 +00:00
|
|
|
# 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.
|
|
|
|
#
|
2009-02-21 02:42:50 +00:00
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
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
|
2008-03-27 09:44:59 +00:00
|
|
|
# by Charlie Fenton 3/27/08
|
2005-10-13 00:20:38 +00:00
|
|
|
# with thanks to Reinhard Prix for his assistance
|
2010-02-12 00:53:05 +00:00
|
|
|
#
|
2011-10-19 09:26:52 +00:00
|
|
|
# Updated for OS 10.7 Lion and XCode 4.2 on 10/19/11
|
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:
|
2010-02-12 00:53:05 +00:00
|
|
|
## source BuildMacBOINC.sh [-dev] [-noclean] [-all] [-lib] [-client] [-help]
|
2005-10-13 00:39:12 +00:00
|
|
|
## or
|
|
|
|
## chmod +x BuildMacBOINC.sh
|
2010-02-12 00:53:05 +00:00
|
|
|
## ./BuildMacBOINC.sh [-dev] [-noclean] [-all] [-lib] [-client] [-help]
|
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).
|
2011-10-18 12:42:53 +00:00
|
|
|
## default is deployment (release) version (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)
|
|
|
|
##
|
2011-10-19 09:26:52 +00:00
|
|
|
## -lib build the five libraries: libboinc_api.a, libboinc_graphics2.a,
|
|
|
|
## libboinc.a, libboinc_opncl.a, jpeglib.a and the utility
|
|
|
|
## application MakeAppIcon_h.
|
2006-02-08 10:28:32 +00:00
|
|
|
##
|
|
|
|
## -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=""
|
|
|
|
doclean="clean"
|
|
|
|
buildall=0
|
|
|
|
buildlibs=0
|
|
|
|
buildclient=0
|
2007-12-04 13:42:02 +00:00
|
|
|
style="Deployment"
|
2007-11-16 13:48:28 +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 ;;
|
2010-02-12 00:53:05 +00:00
|
|
|
* ) echo "usage:" ; echo "cd {path}/mac_build/" ; echo "source BuildMacBOINC.sh [-dev] [-noclean] [-all] [-lib] [-client] [-help]" ; return 1 ;;
|
2006-02-08 10:28:32 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "${doclean}" = "clean" ]; then
|
|
|
|
echo "Clean each target before building"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${buildlibs}" = "1" ]; then
|
2011-10-19 12:15:44 +00:00
|
|
|
targets="$targets -target libboinc -target gfx2libboinc -target api_libboinc -target boinc_opencl -target jpeg -target MakeAppIcon_h"
|
2006-02-08 10:28:32 +00:00
|
|
|
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/' `;
|
2007-12-04 13:42:02 +00:00
|
|
|
# minor=`echo $version | sed 's/[0-9]*[.]\([0-9]*\).*/\1/' `;
|
2005-10-13 00:20:38 +00:00
|
|
|
|
|
|
|
# echo "major = $major"
|
|
|
|
# echo "minor = $minor"
|
|
|
|
#
|
2010-02-12 00:53:05 +00:00
|
|
|
# Darwin version 10.x.y corresponds to OS 10.6.x
|
2007-12-04 13:42:02 +00:00
|
|
|
# Darwin version 9.x.y corresponds to OS 10.5.x
|
2005-10-13 00:20:38 +00:00
|
|
|
# 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
|
|
|
|
2010-02-12 00:53:05 +00:00
|
|
|
if [ "$major" -lt "10" ]; then
|
|
|
|
echo "ERROR: Building BOINC requires System 10.6 or later. For details, see build instructions at"
|
2008-01-09 01:21:43 +00:00
|
|
|
echo "boinc/mac_build/HowToBuildBOINC_XCode.rtf or http://boinc.berkeley.edu/trac/wiki/MacBuild"
|
2006-02-08 10:28:32 +00:00
|
|
|
return 1
|
2005-10-13 00:20:38 +00:00
|
|
|
fi
|
2007-12-04 13:42:02 +00:00
|
|
|
|
2011-10-18 12:42:53 +00:00
|
|
|
if [ ! -d /Developer/SDKs/MacOSX10.6.sdk/ ]; then
|
|
|
|
echo "ERROR: System 10.6 SDK is missing. For details, see build instructions at"
|
2008-01-09 01:21:43 +00:00
|
|
|
echo "boinc/mac_build/HowToBuildBOINC_XCode.rtf or http://boinc.berkeley.edu/trac/wiki/MacBuild"
|
2006-02-08 10:28:32 +00:00
|
|
|
return 1
|
2005-09-30 08:58:22 +00:00
|
|
|
fi
|
|
|
|
|
2010-10-11 11:59:05 +00:00
|
|
|
if [ "${buildall}" = "1" ] || [ "${targets}" = "" ]; then
|
|
|
|
if [ "${style}" = "Deployment" ]; then
|
|
|
|
if [ ! -d /Developer/SDKs/MacOSX10.6.sdk/ ]; then
|
|
|
|
echo "ERROR: System 10.6 SDK is missing. For details, see build instructions at"
|
|
|
|
echo "boinc/mac_build/HowToBuildBOINC_XCode.rtf or http://boinc.berkeley.edu/trac/wiki/MacBuild"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2007-12-04 13:42:02 +00:00
|
|
|
if [ "${style}" = "Development" ]; then
|
|
|
|
echo "Development (debug) build"
|
|
|
|
else
|
|
|
|
style="Deployment"
|
2011-10-18 12:42:53 +00:00
|
|
|
echo "Deployment (release) build for architectures: i386, x86_64"
|
2007-12-04 13:42:02 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
2007-12-20 00:19:59 +00:00
|
|
|
export DEVELOPER_SDK_DIR="/Developer/SDKs"
|
|
|
|
|
2006-02-08 10:28:32 +00:00
|
|
|
xcodebuild -project boinc.xcodeproj ${targets} -configuration ${style} ${doclean} build
|
|
|
|
|
|
|
|
return $?
|