boinc/doc/mac_build.html

260 lines
27 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="824.35">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; text-align: center; font: 14.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; text-align: center; font: 12.0px Helvetica}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande; min-height: 15.0px}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px}
p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; text-align: center; font: 14.0px Helvetica; min-height: 17.0px}
p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; color: #4e007c}
p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; color: #0000ef}
p.p11 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px}
p.p12 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier}
span.s1 {font: 12.0px Helvetica}
span.s2 {font: 13.0px Courier}
span.s3 {font: 12.0px Courier}
span.s4 {text-decoration: underline}
span.s5 {text-decoration: underline ; color: #0000ef}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><b>Building BOINC Clients and Applications on Macintosh OSX</b></p>
<p class="p2"><br></p>
<p class="p3">Written by Charlie Fenton</p>
<p class="p3">Last updated 4/27/06</p>
<p class="p2"><br></p>
<p class="p4">This document applies to BOINC version 5.3.19 and later.<span class="Apple-converted-space">  </span>It has instructions for building BOINC for Macintosh OSX, plus information for building science project applications to run under BOINC on Macintosh OSX. <span class="Apple-converted-space"> </span></p>
<p class="p2"><br></p>
<p class="p4">Contents of this document:</p>
<p class="p4">• Important requirements for building BOINC software for the Mac.</p>
<p class="p4">• Building BOINC libraries to link with project applications.</p>
<p class="p4">• Building BOINC Manager, BOINC Client and BOINC libraries.</p>
<p class="p4">• Building BOINC Manager Installer.</p>
<p class="p4">• Building project applications.</p>
<p class="p4">• Upgrading applications for Macs with Intel processors.</p>
<p class="p4">• Adding a Finder icon to your application</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p1"><b>Important requirements for building BOINC software for the Mac</b></p>
<p class="p2"><br></p>
<p class="p4">All BOINC software for Power PC Macs must be built using GCC 3.3 and MacOS10.3.9 SDK to assure backward compatibility with OS 10.3.<span class="Apple-converted-space">  </span>All BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.4.u SDK to allow cross-compiling.<span class="Apple-converted-space">  </span><b>This includes not only BOINC itself, but also the WxWidgets, JPEG and cURL libraries, as well as all project applications</b>.</p>
<p class="p2"><br></p>
<p class="p4">Beware of using the wrong compiler!<span class="Apple-converted-space">  </span>Apple's release notes for GCC 4.0 say:</p>
<p class="p4"><i>If your application must support versions of Mac OS X prior to 10.3.9, you must not use the GCC 4.0 compiler. Instead, build your project using the GCC 3.3 compiler</i></p>
<p class="p2"><br></p>
<p class="p4">Elsewhere on Apple's web site is the warning:</p>
<p class="p4"><i>Do not link C++ modules compiled with one of these compilers against modules compiled with the other. Even if the modules appear to link correctly, C++ ABI differences may still cause problems that will not manifest themselves until run time.</i></p>
<p class="p2"><br></p>
<p class="p4">Be sure to follow the directions in this document to ensure that these requirements are met.</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p1"><b>Building BOINC libraries to link with project applications</b></p>
<p class="p2"><br></p>
<p class="p4">If you are building a project application to be run by BOINC, you only need to build the boinc libraries libboinc_api.a, ibboinc.a, and (if you want graphics) libboinc_graphics_api.a.<span class="Apple-converted-space">  </span>There are two ways to do this:</p>
<p class="p2"><br></p>
<p class="p4">(1) Use the BOINC autoconf / automake scripts to build these libraries and the jpeg and curl libraries on which they depend.<span class="Apple-converted-space">  </span>You must do all of this twice: once on a PowerPC Mac running OS 10.3.x (do NOT use OS 10.4), and once on an Intel Mac running OS 10.4.x.</p>
<p class="p2"><br></p>
<p class="p4">(If you wish, you can combine separate Intel and PowerPC builds in a single Universal Binary mach-O file using the command-line utility lipo.<span class="Apple-converted-space">  </span>For details on lipo, type "man lipo" in Terminal; it is available on all Macs running OS10.4.x.)</p>
<p class="p2"><br></p>
<p class="p4">(2) Use scripts setupForBOINC.sh and BuildMacBOINC.sh.<span class="Apple-converted-space">  </span>You do this once on any Macintosh (PowerPC or Intel) running OS 10.4.x and with XCode 2.2 (or later) installed.<span class="Apple-converted-space">  </span>This will produce Universal Binaries of all the libraries.<span class="Apple-converted-space">  </span>These can then be linked with both PowerPC applications and Mac Intel applications.</p>
<p class="p2"><br></p>
<p class="p4">This document gives instructions only for the second method.</p>
<p class="p2"><br></p>
<p class="p4">After building the libraries as Universal Binaries using the second method, you probably still want to build your actual application separately on the two architectures: on a PowerPC Mac running OS 10.3.x (do NOT use OS 10.4), and also on an Intel Mac running OS 10.4.x.<span class="Apple-converted-space">  </span>Or you can look at the scripts buildcurl.sh and buildjpeg.sh for examples of environment settings which can cross-compile on one Mac running OS 10.4.x.</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p1"><b>Building BOINC Manager with embedded Core Client plus libraries libboinc.a and libboinc_graphics_api.a</b></p>
<p class="p2"><br></p>
<p class="p4">BOINC depends on three third-party libraries: wxMac-2.6.2, curl-7.15.3, and jpeg-6b.<span class="Apple-converted-space">  </span>You can obtain these from the following URLs:</p>
<p class="p2"><br></p>
<p class="p4">wxMac-2.6.2 (needed<span class="Apple-converted-space">  </span>only if you are building the BOINC Manager):</p>
<p class="p5"><span class="s1"><span class="Apple-tab-span"> </span><a href="http://www.wxwidgets.org"><span class="s2">http://www.wxwidgets.org</span></a></span></p>
<p class="p5"><span class="s1"><span class="Apple-tab-span"> </span><a href="http://prdownloads.sourceforge.net/wxwindows/wxMac-2.6.2.tar.gz"><span class="s2">http://prdownloads.sourceforge.net/wxwindows/wxMac-2.6.2.tar.gz</span></a></span></p>
<p class="p2"><br></p>
<p class="p4">curl-7.15.3:</p>
<p class="p5"><span class="Apple-tab-span"> </span><a href="http://curl.haxx.se">http://curl.haxx.se</a></p>
<p class="p5"><span class="Apple-tab-span"> </span><a href="http://curl.haxx.se/download/curl-7.15.3.tar.gz">http://curl.haxx.se/download/curl-7.15.3.tar.gz</a></p>
<p class="p2"><br></p>
<p class="p4">jpeg-6b (needed<span class="Apple-converted-space">  </span>only if you are building the BOINC libboinc_graphics_api.a library):</p>
<p class="p5"><span class="Apple-tab-span"> </span><a href="http://www.ijg.org">http://www.ijg.org</a></p>
<p class="p5"><span class="Apple-tab-span"> </span><a href="ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz">ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz</a></p>
<p class="p2"><br></p>
<p class="p4"><i>XCode 2.2 installs autoconf 2.59 and automake 1.63.</i><span class="Apple-converted-space">  </span><i>To determine the version number, type "autoconf --version" or "automake --version" .<span class="Apple-converted-space">  </span>Building wxMac-2.6.2 and curl-7.15.3 require autoconf 2.59 and automake 1.93 or later. <span class="Apple-converted-space"> </span></i></p>
<p class="p2"><i></i><br></p>
<p class="p4"><i>Upgrades for autoconf and automake are available from www.gnu.org: <span class="Apple-converted-space"> </span></i></p>
<p class="p5"><a href="http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.gz">http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.gz</a></p>
<p class="p5"><a href="http://ftp.gnu.org/gnu/automake/automake-1.9.3.tar.gz">http://ftp.gnu.org/gnu/automake/automake-1.9.3.tar.gz</a></p>
<p class="p2"><i></i><br></p>
<p class="p4"><i>XCode installed these utilities in the /usr/bin/ directory, but the upgrades by default will install in /usr/local/bin/.<span class="Apple-converted-space">  </span>If you install there, you must also set your PATH environment variable to include that location.<span class="Apple-converted-space">  </span>The scripts referenced below do this automatically.</i></p>
<p class="p2"><br></p>
<p class="p4">As stated above, all BOINC software for Power PC Macs must be built using GCC 3.3 and MacOS10.3.9 SDK to assure backward compatibility with OS 10.3.<span class="Apple-converted-space">  </span>All BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.4.u SDK to allow cross-compiling. <span class="Apple-converted-space"> </span></p>
<p class="p2"><br></p>
<p class="p4">These are not done by either the XCode projects which come with wxMac-2.6.2, nor<span class="Apple-converted-space">  </span>the AutoMake scripts supplied with wxMac-2.6.2, curl-7.15.3, or jpeg-6b.<span class="Apple-converted-space">  </span>So be sure to use our special scripts to build these packages.</p>
<p class="p2"><br></p>
<p class="p4">Building BOINC and the library packages on which it depends requires OS 10.4.4 and XCode 2.2 (or greater).<span class="Apple-converted-space">  </span>It may be possible to use XCode 2.1 and/or versions of OS X earlier than 10.4.4, but this has not been tested by the authors.</p>
<p class="p2"><br></p>
<p class="p4">[1] Create a parent directory within which to work.<span class="Apple-converted-space">  </span>In this description , we will call it BOINC_dev, but you can name it anything you wish.</p>
<p class="p2"><br></p>
<p class="p4">[2] Put the following 3 directories inside the BOINC_dev folder (omit any you don't need):</p>
<p class="p4"><span class="Apple-converted-space">    </span>curl-7.15.3</p>
<p class="p4"><span class="Apple-converted-space">    </span>jpeg-6b</p>
<p class="p4"><span class="Apple-converted-space">    </span>wxMac-2.6.2</p>
<p class="p2"><br></p>
<p class="p4">Important: do not change the names of any of these 3 directories.</p>
<p class="p2"><br></p>
<p class="p4">[3] Get the BOINC source tree from CVS, and put it in the same BOINC_dev folder.<span class="Apple-converted-space">  </span>To do this, type the following in Terminal:</p>
<p class="p2"><br></p>
<p class="p5">cd {path}/BOINC_dev/</p>
<p class="p5">cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout boinc<span class="s1"> <span class="Apple-converted-space"> </span></span></p>
<p class="p2"><br></p>
<p class="p4">(You may change the name of the boinc directory to anything you wish.)</p>
<p class="p2"><br></p>
<p class="p4">The command above retrieves the source code from the HEAD or development branch of the CVS repository.<span class="Apple-converted-space">  </span>For more information on getting the BOINC source code, see:</p>
<p class="p5"><a href="http://boinc.berkeley.edu/source_code.php">http://boinc.berkeley.edu/source_code.php</a></p>
<p class="p2"><br></p>
<p class="p4">[4] Run the script to build the curl, jpeg and wxMac libraries as follows:</p>
<p class="p2"><br></p>
<p class="p5">cd {path}/BOINC_dev/boinc/mac_build/</p>
<p class="p5">source setupForBoinc.sh -clean</p>
<p class="p2"><br></p>
<p class="p4">If you don't wish to force a full rebuild of everything, omit the -clean argument.</p>
<p class="p2"><br></p>
<p class="p4">Note: this script builds curl first, followed by jpeg and finally wxMac.<span class="Apple-converted-space">  </span>If you haven't downloaded wxMac because you aren't building the BOINC Manager, the script will build curl and jpeg.<span class="Apple-converted-space">  </span>Likewise, if you only downloaded curl because you need neither graphics nor the BOINC Manager, the script will build curl before quitting.</p>
<p class="p2"><br></p>
<p class="p4">[5] Build BOINC as follows:</p>
<p class="p2"><br></p>
<p class="p5">cd {path}/BOINC_dev/boinc/mac_build/</p>
<p class="p5">source BuildMacBOINC.sh</p>
<p class="p2"><br></p>
<p class="p4">The complete syntax for this script is</p>
<p class="p5">source BuildMacBOINC.sh [-dev] [-noclean] [-all] [-lib] [-client]</p>
<p class="p2"><br></p>
<p class="p4">The options for BuildMacBOINC.sh are:</p>
<p class="p4"><span class="Apple-tab-span"> </span>-dev<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>build the development (debug) version (native architecture only).<span class="Apple-converted-space"> </span></p>
<p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>default is deployment (release) version (universal binaries: ppc and i386).</p>
<p class="p2"><br></p>
<p class="p4"><span class="Apple-tab-span"> </span>-noclean<span class="Apple-tab-span"> </span>don't do a "clean" of each target before building.</p>
<p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>default is to clean all first.</p>
<p class="p2"><br></p>
<p class="p4"><span class="Apple-converted-space">  </span>The following arguments determine which targets to build</p>
<p class="p4"><span class="Apple-tab-span"> </span>-all<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>build all targets (i.e. target "Build_All" -- this is the default)</p>
<p class="p2"><br></p>
<p class="p4"><span class="Apple-tab-span"> </span>-lib<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>build the three libraries: libboinc_api.a, libboinc_graphics_api.a, libboinc.a</p>
<p class="p2"><br></p>
<p class="p4"><span class="Apple-tab-span"> </span>-client<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>build two targets: boinc client and command-line utility boinc_cmd</p>
<p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>(also builds libboinc.a, since boinc_cmd requires it.)</p>
<p class="p2"><br></p>
<p class="p4"><span class="Apple-converted-space"> </span>Both -lib and -client may be specified to build five targets (no BOINC Manager.)</p>
<p class="p2"><br></p>
<p class="p4"><b>Note:</b> You may find three XCode projects in the BOINC_dev/boinc/mac_build/ directory:<span class="Apple-converted-space"> </span></p>
<p class="p4"><span class="Apple-converted-space">  </span><b>boinc.pbproj</b> is obsolete and should no longer be used.</p>
<p class="p4"><span class="Apple-converted-space">  </span><b>wxMac-BOINC.xcodeproj</b> is used to build the wxMac-2.6.2 library in conjunction with the setupForBoinc.sh or buildWxMac.sh scripts.<span class="Apple-converted-space">  </span>Do not use it as a stand-alone project; it will not configure the wxMac libraries correctly when run outside of these scripts.<span class="Apple-converted-space"> </span></p>
<p class="p4"><span class="Apple-converted-space">  </span><b>boinc.xcodeproj</b> builds BOINC.<span class="Apple-converted-space">  </span>It can be used either with the BuildMacBOINC.sh script or as a stand-alone project.<span class="Apple-converted-space">  </span>It has two extra build configurations, i386-Deployment and ppc-Deployment, which can be used for testing only to build for just one architecture.<span class="Apple-converted-space">  </span>The Development build configuration builds only the native architecture and is used for debugging.<span class="Apple-converted-space">  </span>The Deployment build configuration builds a universal binary and is suitable for release builds.</p>
<p class="p6"><br></p>
<p class="p2"><br></p>
<p class="p1"><b>Building BOINC Manager Installer</b></p>
<p class="p2"><br></p>
<p class="p4">To build the Installer for the BOINC Manager, if the BOINC version number is x.y.z, you must be logged in as an administrator.<span class="Apple-converted-space">  </span>Type the following in Terminal, then enter your administrator password when prompted by the script:</p>
<p class="p2"><br></p>
<p class="p5">cd {path}/BOINC_dev/boinc/</p>
<p class="p5">source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh x y z</p>
<p class="p2"><br></p>
<p class="p4">Substitute the 3 parts of the BOINC version number for x y and z in the above.<span class="Apple-converted-space">  </span>For example, to build the installer for BOINC version 5.3.19, the command would be</p>
<p class="p5">source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh 5 3 19</p>
<p class="p4">This will create a directory "BOINC_Installer/New_Release_5_3_19" in the BOINC_dev directory.</p>
<p class="p7"><br></p>
<p class="p4">To build version 5.3.19 of the Grid Republic flavor of BOINC, you would type:<span class="s3"><span class="Apple-converted-space"> </span></span></p>
<p class="p5">cd {path}/BOINC_dev/boinc/</p>
<p class="p5">source {path}/BOINC_dev/boinc/mac_installer/release_GridRepublic.sh 5 3 19</p>
<p class="p4">This will create a directory "BOINC_Installer/New_Release_GR_5_3_19" in the BOINC_dev directory.</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p1"><b>Building project applications</b></p>
<p class="p8"><b></b><br></p>
<p class="p1"><b>Upgrading applications for Macs with Intel processors</b></p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p4">Apple began shipping Macs with Intel processors on January 10, and Apple expects to convert all its lines of computers to Intel by the end of 2006. <span class="Apple-converted-space"> </span></p>
<p class="p2"><br></p>
<p class="p4">All future releases of BOINC will include "universal binary" builds for the Macintosh of BOINC Manager, command-line BOINC client and the boinc_cmd command-line tool.<span class="Apple-converted-space">  </span>(Universal binaries contain both PowerPC and Intel executables in one file; the Macintosh OS automatically selects the appropriate one for that computer.)</p>
<p class="p2"><br></p>
<p class="p4">The advantage of "universal binaries" is that you only need to have one copy of the application, and it will run on either PowerPC or Intel Macs, so users don't need to choose between two options.<span class="Apple-converted-space">  </span>Since BOINC participants manually download BOINC from the web site, we will be providing BOINC in<span class="Apple-converted-space">  </span>"universal binary" form.</p>
<p class="p2"><br></p>
<p class="p4">However, participants do not manually download project applications; this is done automatically by BOINC.<span class="Apple-converted-space">  </span>So there would be no advantage to combining the Intel and PowerPC versions in a single "universal binary" file, but doing so would double the size of the download.</p>
<p class="p2"><br></p>
<p class="p4">So BOINC treats Intel Macs as a new, separate platform.<span class="Apple-converted-space">  </span>BOINC previously directly supported four platforms: PowerPC Macs (powerpc-apple-darwin), Intel Linux (i686-pc-linux-gnu), Windows (windows-intelx86) and Solaris (sparc-sun-solaris2.7).<span class="Apple-converted-space">   </span></p>
<p class="p2"><br></p>
<p class="p4"><b>We have now added a fifth platform for Intel Macs (i686-apple-darwin).</b></p>
<p class="p2"><br></p>
<p class="p4">As a <b>temporary</b> measure, projects can set their servers to deliver a copy of their current PowerPC application (renamed for the new platform) under the new i686-apple-darwin platform.<span class="Apple-converted-space">  </span>The OS will run it in compatibility mode, emulating a PowerPC.<span class="Apple-converted-space">  </span>(Apple calls this compatibility mode Rosetta, which of course has nothing to do with the Rosetta BOINC project.) <span class="Apple-converted-space"> </span></p>
<p class="p2"><br></p>
<p class="p4">If you do this, be sure to give your native Intel application a higher version number when you do release it, so that clients will download it.</p>
<p class="p2"><br></p>
<p class="p4">However, running a PowerPC application<span class="Apple-converted-space">  </span>in compatibility mode has two significant drawbacks:</p>
<p class="p2"><br></p>
<p class="p4">(1) Screensaver graphics do not work.</p>
<p class="p2"><br></p>
<p class="p4">(2) Since it is running under emulation, your application will run at reduced efficiency.<span class="Apple-converted-space">  </span>But the benchmarks are based on running native Intel applications.<span class="Apple-converted-space">  </span>This may cause scheduler problems, such as uncompleted deadlines and inadequate credit for participants. <span class="Apple-converted-space"> </span></p>
<p class="p2"><br></p>
<p class="p4">So it is important to make a native Intel application available as soon as possible.</p>
<p class="p2"><br></p>
<p class="p4">It is very easy to add a new platform to your server with the xadd utility.<span class="Apple-converted-space">  </span>For directions on how to do this, see these web pages:</p>
<p class="p9"><span class="s4"><a href="http://boinc.berkeley.edu/platform.php">http://boinc.berkeley.edu/platform.php</a></span></p>
<p class="p10"><span class="s4"><a href="http://boinc.berkeley.edu/tool_xadd.php">http://boinc.berkeley.edu/tool_xadd.php<span class="s5"></span></a></span></p>
<p class="p2"><br></p>
<p class="p4">BOINC supports all PowerPC Macs running OS 10.3.0 or later, and all Intel Macs.<span class="Apple-converted-space">  </span>(The Intel Macs themselves require OS 10.4.4 or later.)</p>
<p class="p2"><br></p>
<p class="p4">The easiest way to build your application for these two platforms is to build each one on its native platform.<span class="Apple-converted-space">  </span>In other words, do your powerpc-apple-darwin build on a PowerPC Mac running OS 10.3.9, and your i686-apple-darwin build on an Intel Mac.</p>
<p class="p2"><br></p>
<p class="p4">But Apple provides the tools to allow you to cross-compile your application on any Mac (PowerPC or Intel) running OS 10.4 or later.<span class="Apple-converted-space">  </span>Here is how:</p>
<p class="p2"><br></p>
<p class="p4">All BOINC software for Power PC Macs must be built using GCC 3.3 and MacOS10.3.9 SDK to assure backward compatibility with OS 10.3.<span class="Apple-converted-space">  </span>If building a PowerPC application on an Intel Mac, you must also specify "-arch ppc" in the compiler and linker flags.</p>
<p class="p2"><br></p>
<p class="p4">All BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.4.u SDK to allow cross-compiling.<span class="Apple-converted-space">  </span>If building an Intel application on a PowerPC Mac, you must also specify "-arch i386" in the compiler and linker flags.</p>
<p class="p2"><br></p>
<p class="p4">You can find examples of how to do this for two different kinds of configure / make scripts in the HEAD branch of the BOINC CVS tree at boinc/mac_build/buildcurl.sh and boinc/mac_build/buildjpeg.sh. <span class="Apple-converted-space"> </span></p>
<p class="p2"><br></p>
<p class="p4">The lipo utility is used at the end of each of these scripts to combine the two binaries into a single "Universal Binary" file.<span class="Apple-converted-space">  </span>You won't need to do that with you project applications, since you will be distributing them separately under the two platforms.<span class="Apple-converted-space">  </span>But if you prefer, you can create a Universal Binary and distribute the same file for both i686-apple-darwin and powerpc-apple-darwin platforms.</p>
<p class="p2"><br></p>
<p class="p4">Note that the BOINC libraries (and any third-party libraries) which you link with your applications must be built with the same configuration as the application itself.<span class="Apple-converted-space">  </span>Follow the instructions earlier in this document to build the needed libraries.</p>
<p class="p2"><br></p>
<p class="p4">Additional information on building Unix applications universal can<span class="Apple-converted-space">  </span>be found here:</p>
<p class="p5"><a href="http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html">http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html</a></p>
<p class="p11"><br></p>
<p class="p4">and here:</p>
<p class="p5"><a href="http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/universal_binary_compiling/chapter_2_section_7.html">http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/universal_binary_compiling/chapter_2_section_7.html</a></p>
<p class="p11"><br></p>
<p class="p4">For information on making your code work with GCC 4:</p>
<p class="p5"><a href="http://developer.apple.com/releasenotes/DeveloperTools/GCC40PortingReleaseNotes/index.html">http://developer.apple.com/releasenotes/DeveloperTools/GCC40PortingReleaseNotes/index.html</a></p>
<p class="p2"><br></p>
<p class="p1"><b>Adding a Finder icon to your application</b></p>
<p class="p2"><br></p>
<p class="p4">There is an optional api setMacIcon() in the libboinc_api.a library.<span class="Apple-converted-space">  </span>This allows science applications to display an application icon in the Dock) and in the Finder. <span class="Apple-converted-space">  </span>(The icon does not appear in the Dock until the application displays graphics.)<span class="Apple-converted-space">  </span>To implement this, do the following:</p>
<p class="p2"><br></p>
<p class="p4">(1)Use "/Developer/Applications/utilities/Icon Composer.app" to create a xxx.icns file.<span class="Apple-converted-space">  </span>(Use any name you wish instead of xxx.)</p>
<p class="p2"><br></p>
<p class="p4">(2) Convert the xxx.icns file to an app_icon.h file as follows: in Terminal, run:<span class="Apple-converted-space"> </span></p>
<p class="p12">{path}/MakeAppIcon_h {source_file_path}/<span class="s1">xxx.icns</span> {dest_file_path}/<span class="s1">app_icon.h</span></p>
<p class="p4">(The MakeAppIcon_h command-line utility is built by the Mac boinc XCode project in the "boinc/mac_build/build/" directory.)<span class="Apple-converted-space">  </span>Add the app_icon.h file to your science application's project.</p>
<p class="p2"><br></p>
<p class="p4">(3) In the science application's main(), add<span class="Apple-converted-space"> </span></p>
<p class="p12">#include "app_icon.h"<span class="Apple-converted-space"> </span></p>
<p class="p4">and call:</p>
<p class="p12"><span class="Apple-converted-space">  </span>setMacIcon(argv[0], MacAppIconData, sizeof(MacAppIconData));</p>
<p class="p2"><br></p>
<p class="p4">(4) The science application must link with Carbon.framework to use setMacIcon().</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
</body>
</html>