Mac: update build scripts, source files and Xcode project to allow building with Xcode 4.3 and Xcode 4.5

svn path=/trunk/boinc/; revision=25855
This commit is contained in:
Charlie Fenton 2012-07-10 09:28:17 +00:00
parent 78f74661aa
commit cd1ad97464
10 changed files with 195 additions and 52 deletions

View File

@ -4786,3 +4786,23 @@ David 7 July 2012
sched_vda.cpp
html/user/img/
star.gif
Charlie 10 July 2012
- Mac: update build scripts, source files and Xcode project to allow
building with Xcode 4.3 under OS 10.7.x Lion and Xcode 4.5 under
OS 10.8 Mountain Lion.
clientgui/
mac/
MacBitmapCompboBox.cpp
MacSysMenu.cpp
clientscr/
Mac_Saver_ModuleView.m
mac_build/
boinc.xcodeproj/
project.pbxproj
buildc_ares.sh
buildcurl.sh
buildopenssl.sh
BuildMacBOINC.sh
HowToBuildBOINC_XCode.rtf

View File

@ -16,7 +16,6 @@
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#include "stdwx.h"
#include <wx/mac/carbon/private.h>
#include "MacBitmapComboBox.h"
#define POPUPBUTTONCONTROLHEIGHT 20

View File

@ -28,7 +28,6 @@
#include "Events.h"
#include "miofile.h"
#include "SkinManager.h"
#include "wx/mac/private.h" // for wxBitmapRefData::GetPictHandle
pascal OSStatus SysMenuEventHandler( EventHandlerCallRef inHandlerCallRef,
EventRef inEvent, void* pData);

View File

@ -40,6 +40,18 @@ typedef int NSInteger;
typedef float CGFloat;
#endif
#ifndef GrafPtr
// OS 10.7 SDK and later do not have QuickDraw headers
// Although the run-time libraries are still available,
// we use weak linking in case they are removed in
// future versions of OS X.
typedef struct OpaqueGrafPtr* GrafPtr;
void GetPort(GrafPtr * port) __attribute__((weak_import));
void SetPortTextFont(GrafPtr port,short txFont) __attribute__((weak_import));
void SetPortTextSize(CGrafPtr port, short txSize) __attribute__((weak_import));
#endif
#define kHelveticaFontID 21
void print_to_log_file(const char *format, ...);
void strip_cr(char *buf);
@ -246,7 +258,8 @@ int signof(float x) {
UInt64 params;
IOByteCount rcnt = sizeof(UInt64);
double idleTime = 0;
HIThemeTextInfo textInfo;
if ([ self isPreview ]) {
#if 1 // Currently drawRect just draws our logo in the preview window
NSString *fileName = [[ NSBundle bundleForClass:[ self class ]] pathForImageResource:@"boinc" ];
@ -444,27 +457,29 @@ int signof(float x) {
CGContextTranslateCTM (myContext, 0, viewBounds.origin.y + viewBounds.size.height);
CGContextScaleCTM (myContext, 1.0f, -1.0f);
if (gSystemVersion >= 1050) {
CTFontRef myFont = CTFontCreateWithName(CFSTR("Helvetica"), 20, NULL);
#ifdef __x86_64__
CTFontRef myFont = CTFontCreateWithName(CFSTR("Helvetica"), 20, NULL);
HIThemeTextInfo textInfo = {kHIThemeTextInfoVersionOne, kThemeStateActive, kThemeSpecifiedFont,
kHIThemeTextHorizontalFlushLeft, kHIThemeTextVerticalFlushTop,
kHIThemeTextBoxOptionNone, kHIThemeTextTruncationNone, 0, false,
0, myFont
};
#else
GrafPtr port;
GetPort(&port);
SetPortTextFont(port, kFontIDHelvetica);
SetPortTextSize(port, 20);
HIThemeTextInfo textInfo = {0, kThemeStateActive, kThemeCurrentPortFont, //kThemeMenuItemCmdKeyFont, //kThemePushButtonFont,
kHIThemeTextHorizontalFlushLeft, kHIThemeTextVerticalFlushTop,
kHIThemeTextBoxOptionNone, kHIThemeTextTruncationNone, 0, false
};
HIThemeTextInfo theTextInfo = {kHIThemeTextInfoVersionOne, kThemeStateActive, kThemeSpecifiedFont,
kHIThemeTextHorizontalFlushLeft, kHIThemeTextVerticalFlushTop,
kHIThemeTextBoxOptionNone, kHIThemeTextTruncationNone, 0, false,
0, myFont
};
textInfo = theTextInfo;
} else {
#ifndef __x86_64__
GrafPtr port;
GetPort(&port);
SetPortTextFont(port, kHelveticaFontID);
SetPortTextSize(port, 20);
HIThemeTextInfo theTextInfo = {0, kThemeStateActive, kThemeCurrentPortFont, //kThemeMenuItemCmdKeyFont, //kThemePushButtonFont,
kHIThemeTextHorizontalFlushLeft, kHIThemeTextVerticalFlushTop,
kHIThemeTextBoxOptionNone, kHIThemeTextTruncationNone, 0, false
};
textInfo = theTextInfo;
#endif
}
HIThemeGetTextDimensions(cf_msg, (float)gMovingRect.size.width, &textInfo, NULL, &gActualTextBoxHeight, NULL);
gActualTextBoxHeight += TEXTBOXTOPBORDER;

View File

@ -24,9 +24,13 @@
# with thanks to Reinhard Prix for his assistance
#
# Updated for OS 10.7 Lion and XCode 4.2 on 10/19/11
# Updated 7/6/12 for Xcode 4.3 and later which are not at a fixed address
# Updated 7/9/12 for Xcode 4.3 and later which are not at a fixed address
#
## This script requires OS 10.6 or later
#
## If you drag-install Xcode 4.3 or later, you must have opened Xcode
## and clicked the Install button on the dialog which appears to
## complete the Xcode installation before running this script.
##
## Usage:
@ -126,8 +130,8 @@ fi
echo ""
export DEVELOPER_SDK_DIR="/Developer/SDKs"
SDKPATH=`xcodebuild -version -sdk macosx Path`
xcodebuild -project boinc.xcodeproj ${targets} -configuration ${style} ${doclean} build
xcodebuild -project boinc.xcodeproj ${targets} -configuration ${style} -sdk "${SDKPATH}" ${doclean} build
return $?

View File

@ -13,12 +13,15 @@
\b0\fs24 \cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc
\cf0 Written by Charlie Fenton\
Last updated 7/6/12\
Last updated 7/10/12\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
\cf0 \
This document applies to BOINC version 7.1.0 and later. It has instructions for building the BOINC Client and Manager for Macintosh OSX. Information for building science project applications to run under BOINC on Macintosh OSX can be found {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/BuildMacApp"}}{\fldrslt here}}. \
\
Note: the information in this document changes from time to time for different versions of BOINC. For any version of BOINC source files, the corresponding version of this document can be found in the source tree at:\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
\b \cf0 Note:
\b0 the information in this document changes from time to time for different versions of BOINC. For any version of BOINC source files, the corresponding version of this document can be found in the source tree at:\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
\f1\fs26 \cf0 boinc/mac_build/HowToBuildBOINC_XCode.rtf\
@ -187,7 +190,10 @@ MAC_OS_X_VERSION_MIN_REQUIRED=1040\
\f0\fs24 \cf0 \
Important: do not change the names of any of these 4 directories.\
\
Note: Building wxMac-2.8.10 requires the MacOSX10.6.sdk, which is not included in Xcode 4.5. If you are building wxMac-2.8.10 with Xcode 4.5, see the section
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
\b \cf0 Note:
\b0 Building wxMac-2.8.10 requires the MacOSX10.6.sdk, which is not included in Xcode 4.5. If you are building wxMac-2.8.10 with Xcode 4.5, see the section
\i\b Installing and setting up Xcode
\i0\b0 for further information.\
\
@ -226,7 +232,17 @@ source setupForBoinc.sh -clean
If you don't wish to force a full rebuild of everything, omit the -clean argument.\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
\cf0 \
Note: this script builds c-ares and curl first, followed by openssl and finally wxMac. If you haven't downloaded wxMac because you aren't building the BOINC Manager, the script will build c-ares, curl and openssl before quitting. \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
\b \cf0 Note 1:
\b0 Be sure to run the script using the
\f1\fs26 source
\f0\fs24 command. Do not double-click on the scripts or use the
\f1\fs26 sh
\f0\fs24 command to run them.\
\b Note 2:
\b0 this script builds c-ares and curl first, followed by openssl and finally wxMac. If you haven't downloaded wxMac because you aren't building the BOINC Manager, the script will build c-ares, curl and openssl before quitting. \
\
[5] Build BOINC as follows:\
\
@ -271,7 +287,7 @@ The options for BuildMacBOINC.sh are:\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
\b \cf0 Note:
\b \cf0 Note 1:
\b0 You may find two Xcode projects in the BOINC_dev/boinc/mac_build/ directory: \
\'95
\b wxMac-BOINC.xcodeproj
@ -285,11 +301,29 @@ The options for BuildMacBOINC.sh are:\
\i0 build configuration builds a universal binary and is suitable for release builds. If there are any other build configurations, they should not be used as they are obsolete. \
\
\b Note:
\b Note 2:
\b0 To perform a release build under Xcode 4.2 when not using the BuildMacBOINC.sh script, select "Build for archiving" from Xcode's Product menu. Do
\b not
\b0 select "Archive."\
\
\b Note 3:
\b0 Using the
\f1\fs26 BuildMacBOINC.sh
\f0\fs24 script is generally easier than building directly in Xcode. The script will place the built products in the directory
\f1\fs26 boinc/mac_build/build/Deployment/
\f0\fs24 or
\f1\fs26 boinc/mac_build/build/Development/
\f0\fs24 where they are easy to find. Building directly in Xcode places the built products in a somewhat obscure location; you would normally need to determine this location using Xcode's Organizer window. \
\
The BOINC Xcode project has built-in scripts which create a text file with the path to the built products at either
\f1\fs26 boinc/mac_build/Build_Deployment_Dir
\f0\fs24 or
\f1\fs26 boinc/mac_build/Build_Development_Dir
\f0\fs24 . These files are used by the
\f1\fs26 release_boinc.sh
\f0\fs24 script, but you can also use them to access the built products directly as follows; open the file with TextEdit and copy the path, then enter command-shift-G in the Finder and paste the path into the Finder's dialog.\
\
The standard release of BOINC version 6.13.0 and later builds only for Macintosh computers with Intel processors. Most of the executables are built only for the i386 architecture. The libraries and the screensaver are built as universal binaries containing builds for two architectures: i386 and x86_64.\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc
@ -406,7 +440,7 @@ You can find instructions for doing this in the comments in the file
Versions of Xcode prior to Xcode 4.3 have an installer package. After downloading Xcode, mount the disk image file by double-clicking on it, then double-click the installer package. \
\
Starting with Xcode 4.3, the disk image contains a copy of Xcode itself. After mounting the disk image, drag the Xcode icon to the folder where you wish it to reside. In most cases, this will be the
\f1\fs26 /Applications
\f1\fs26 /Applications/
\f0\fs24 folder. Unmount the disk image by dragging it to the trash. Finally, double-click on the installed Xcode icon to run Xcode. Xcode will display a dialog allowing you to finish the installation; you must do this before running BOINC's build scripts.\
\
Building wxMac-2.8.10 requires the MacOSX10.6.sdk, which is not included in Xcode 4.5. If you are building wxMac-2.8.10 with Xcode 4.5, you must install the OS 10.6 SDK as follows:\

View File

@ -4054,8 +4054,7 @@
../clientgui/mac/config.h,
);
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
"SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = "";
STRIP_INSTALLED_PRODUCT = YES;
WARNING_CFLAGS = (
"-Wmost",
@ -4239,8 +4238,7 @@
../clientgui/mac/config.h,
);
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
"SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SDKROOT = "";
STRIP_INSTALLED_PRODUCT = NO;
WARNING_CFLAGS = (
"-Wmost",

View File

@ -24,10 +24,14 @@
# by Charlie Fenton 7/21/06
# Updated 10/18/11 for OS 10.7 Lion and XCode 4.2
# Updated 6/25/12 for c-ares 1.9.1
# Updated 7/6/12 for Xcode 4.3 and later which are not at a fixed address
# Updated 7/9/12 for Xcode 4.3 and later which are not at a fixed address
#
## This script requires OS 10.6 or later
#
## If you drag-install Xcode 4.3 or later, you must have opened Xcode
## and clicked the Install button on the dialog which appears to
## complete the Xcode installation before running this script.
#
## In Terminal, CD to the c-ares-1.9.1 directory.
## cd [path]/c-ares-1.9.1/
## then run this script:
@ -43,8 +47,6 @@ if [ "$1" != "-clean" ]; then
fi
fi
export PATH=/usr/local/bin:$PATH
GCCPATH=`xcrun -find gcc`
if [ $? -ne 0 ]; then
echo "ERROR: can't find gcc compiler"
@ -57,15 +59,35 @@ if [ $? -ne 0 ]; then
return 1
fi
MAKEPATH=`xcrun -find make`
if [ $? -ne 0 ]; then
echo "ERROR: can't find make tool"
return 1
fi
TOOLSPATH1=${MAKEPATH%/make}
ARPATH=`xcrun -find ar`
if [ $? -ne 0 ]; then
echo "ERROR: can't find ar tool"
return 1
fi
TOOLSPATH2=${ARPATH%/ar}
export PATH="${TOOLSPATH1}":"${TOOLSPATH2}":/usr/local/bin:$PATH
SDKPATH=`xcodebuild -version -sdk macosx Path`
rm -f .libs/libcares.a
if [ $? -ne 0 ]; then return 1; fi
export PATH=/usr/local/bin:$PATH
export CC="${GCCPATH}";export CXX="${GPPPATH}"
export LDFLAGS="-Wl,-arch,i386"
export CPPFLAGS="-arch i386"
export CFLAGS="-arch i386"
export LDFLAGS="-Wl,-syslibroot,${SDKPATH},-arch,i386"
export CPPFLAGS="-isysroot ${SDKPATH} -arch i386"
export CFLAGS="-isysroot ${SDKPATH} -arch i386"
export SDKROOT="${SDKPATH}"
export MACOSX_DEPLOYMENT_TARGET=10.4
./configure --enable-shared=NO prefix=/tmp/installed-c-ares --host=i386

View File

@ -24,9 +24,14 @@
# by Charlie Fenton 7/21/06
# Updated 12/3/09 for OS 10.7 Lion and XCode 4.2
# Updated 6/25/12 for curl 7.26.0
# Updated 7/6/12 for Xcode 4.3 and later which are not at a fixed address
# Updated 7/9/12 for Xcode 4.3 and later which are not at a fixed address
#
## This script requires OS 10.6 or later
## This script requires OS 10.6 or later
#
## If you drag-install Xcode 4.3 or later, you must have opened Xcode
## and clicked the Install button on the dialog which appears to
## complete the Xcode installation before running this script.
#
## In Terminal, CD to the curl-7.26.0 directory.
## cd [path]/curl-7.26.0/
@ -57,6 +62,26 @@ if [ $? -ne 0 ]; then
return 1
fi
MAKEPATH=`xcrun -find make`
if [ $? -ne 0 ]; then
echo "ERROR: can't find make tool"
return 1
fi
TOOLSPATH1=${MAKEPATH%/make}
ARPATH=`xcrun -find ar`
if [ $? -ne 0 ]; then
echo "ERROR: can't find ar tool"
return 1
fi
TOOLSPATH2=${ARPATH%/ar}
export PATH="${TOOLSPATH1}":"${TOOLSPATH2}":/usr/local/bin:$PATH
SDKPATH=`xcodebuild -version -sdk macosx Path`
CURL_DIR=`pwd`
# curl configure and make expect a path to _installed_ c-ares-1.9.1
# so temporarily install c-ares at a path that does not contain spaces.
@ -71,9 +96,10 @@ if [ $? -ne 0 ]; then return 1; fi
export PATH=/usr/local/bin:$PATH
export CC="${GCCPATH}";export CXX="${GPPPATH}"
export LDFLAGS="-Wl,-arch,i386"
export CPPFLAGS="-arch i386"
export CFLAGS="-arch i386"
export LDFLAGS="-Wl,-syslibroot,${SDKPATH},-arch,i386"
export CPPFLAGS="-isysroot ${SDKPATH} -arch i386"
export CFLAGS="-isysroot ${SDKPATH} -arch i386"
export SDKROOT="${SDKPATH}"
export MACOSX_DEPLOYMENT_TARGET=10.4
./configure --enable-shared=NO --enable-ares=/tmp/installed-c-ares --host=i386

View File

@ -22,10 +22,14 @@
# libcrypto.a and libssl.a for use in building BOINC.
#
# by Charlie Fenton 6/25/12
# Updated 7/6/12 for Xcode 4.3 and later which are not at a fixed address
# Updated 7/9/12 for Xcode 4.3 and later which are not at a fixed address
#
## This script requires OS 10.6 or later
#
## If you drag-install Xcode 4.3 or later, you must have opened Xcode
## and clicked the Install button on the dialog which appears to
## complete the Xcode installation before running this script.
#
## In Terminal, CD to the openssl-1.0.1c directory.
## cd [path]/openssl-1.0.1c/
## then run this script:
@ -35,7 +39,7 @@
##
if [ "$1" != "-clean" ]; then
if [ -f libssl.a ]; then
if [ -f libssl.a ]&& [ -f libcrypto.a ]; then
echo "openssl-1.0.1c libraries already built"
return 0
fi
@ -55,16 +59,38 @@ if [ $? -ne 0 ]; then
return 1
fi
MAKEPATH=`xcrun -find make`
if [ $? -ne 0 ]; then
echo "ERROR: can't find make tool"
return 1
fi
TOOLSPATH1=${MAKEPATH%/make}
ARPATH=`xcrun -find ar`
if [ $? -ne 0 ]; then
echo "ERROR: can't find ar tool"
return 1
fi
TOOLSPATH2=${ARPATH%/ar}
SDKPATH=`xcodebuild -version -sdk macosx Path`
export PATH="${TOOLSPATH1}":"${TOOLSPATH2}":/usr/local/bin:$PATH
rm -f libssl.a
rm -f libcrypto.a
if [ $? -ne 0 ]; then return 1; fi
export CC="${GCCPATH}";export CXX="${GPPPATH}"
export LDFLAGS="-Wl,-arch,i386"
export CPPFLAGS="-arch i386"
export CFLAGS="-arch i386"
export LDFLAGS="-Wl,-sysroot,${SDKPATH},-syslibroot,${SDKPATH},-arch,i386"
export CPPFLAGS="-isysroot ${SDKPATH} -arch i386"
export CFLAGS="-isysroot ${SDKPATH} -arch i386"
export SDKROOT="${SDKPATH}"
export MACOSX_DEPLOYMENT_TARGET=10.4
export LIBRARY_PATH="${SDKPATH}/usr/lib"
./config no-shared
if [ $? -ne 0 ]; then return 1; fi