Building BOINC Manager with embedded Core Client plus libraries libboinc.a and libboinc_graphics_api.a

Written by Charlie Fenton
Last updated 5/5/05

NOTE: Substitute the appropriate path for [wxpath] and [boincpath] throughout this document.  Typically, [boincpath] will end in "/boinc" or /boinc_public", and [wxpath] will end in "/wxMac-2.6.0".

These directions are for building under OS X version 10.3 (Panther) using XCode Developer Tools version 1.5.

You must have installed XCode's optional Cross-Development SDK for system 10.3.0 from the XCode Tools CD.  This guarantees that all builds are backward compatible to OS 10.3.0.

ONE_TIME SETUP for BOINC Manager and embedded Core Client

(1) First download wxMac-2.6.0 from www.wxwidgets.org and build it:
Set the following three environment variables NEXT_ROOT, CPPFLAGS and LDFLAGS.  These commands are for the bash shell; use the equivalent commands if you are running a different UNIX shell.  These environment variables allow the application to be built using the OS 10.3.0 compatibility SDK.

NEXT_ROOT=/Developer/SDKs/MacOSX10.3.0.sdk;export NEXT_ROOT

CPPFLAGS="-isystem /Developer/SDKs/MacOSX10.3.0.sdk/usr/include -DMAC_OS_X_VERSION_MAX_ALLOWED=1030";export CPPFLAGS

LDFLAGS=-L/Developer/SDKs/MacOSX10.3.0.sdk/usr/lib/gcc/darwin/3.3;export LDFLAGS

The continue building wxMac-2.6.0:

cd [wxpath]
mkdir osx-build
cd osx-build
../configure --disable-shared --with-opengl
make

(2) Run Configure to create the correct config.h file for BOINC:

cd [boincpath]
./configure --disable-server --with-apple-opengl-framework

(3) Create a  symbolic link [path]/ boinc/wx_lib pointing to 
[wxpath]/osx-build/lib/

(4) Create a  symbolic link [path]/ boinc/wxinclude pointing to 
[wxpath]/include

(5) Create a  symbolic link [path]/ boinc/jpeglib pointing to 
your jpeg-6b directory (or whatever directory contains the jpeglib source files).  If you have the seti_boinc source directory which contains jpeglib, you can point the symbolic link there.

For example, if the boinc, wxMac-2.6.0 and jpeg-6b directories are all in 
    [wxpath]    then the commands would be:

cd [boincpath] 

ln -s [wxpath]/osx-build/lib ./wx_lib

ln -s [wxpath]/include ./wxinclude

ln -s [path]/jpeg-6b ./jpeglib

Building the BOINC Manager with embedded Core Client, plus 
BOINC libraries, screensaver and helper applications

(1) Double-click on [boincpath]/mac_build/boinc.pbproj to launch the XCode development IDE with the BOINC project.

(2) In the Active Target popup, select mgr_boinc or Build_All.  Build_All also builds the three libraries libboinc_api.a, libboinc_graphics_api.a and libboinc.a, which are used to build science applications such as SETI@home.  These libraries are not needed by the BOINC Manager or Core Client.  In addition, Build_All builds the screensaver BOINCSaver.saver and the installer halper application Postinstall.app.

(3) In the Active Build Style popup, choose Development (for debugging) or Deployment (for release builds.)

(4) If you have switched Build Style, be sure to do a "Clean All Targets" from the Build menu; otherwise object files from the old build style will not be rebuilt in the new build style.

(5) If you are building the screensaver, be sure to unstuff the file: 
boinc/clientgui/mac/BOINCSaver.nib.sit

(6) Select Build from the Build menu.  I suggest you also open the Detailed Build Results window from the Build menu.  Wait a long  time while it compiles.

(7) In addition to the BOINC Manager BOINC.app and Core Client boinc, the mgr_boinc target will also build the SystemMenu.bundle framework and a small helper utility SetVersion.  

(8) SetVersion is run automatically as part of the build process to update the Mac version information file InfoPlist.strings, using the contents of version.h.  The boinc-client, SystemMenu.bundle and InfoPlist.strings will all be embedded automatically inside the BOINC.app application bundle as part of the build process.

(9) For completeness, you should manually update the value of CFBundleVersion to the new BOINC version number in the following four files:
Info.plist (under the resources group)
SystemMenu-Info.plist
ScrenSaver-Info.plist
Installer-Info.plist

Building the installer

After creating the deployment build of all targets using Build_All, use the Finder to do the following:
(1) In a convenient place on disk, create a directory "Installer_Resources".  Copy the following items into this directory:
	[boincpath]/mac_installer/License.rtf
	[boincpath]/mac_installer/ReadMe.rtf
	[boincpath]/mac_installer/postinstall
	[boincpath]/mac_installer/postupgrade
	[boincpath]/mac_build/build/Postinstall.app

NOTE: the file extensions (such as .app and .saver) may be hidden by the Finder.  You can check an item's extension by selecting it in the Finder and using Get Info function from the Finder's File menu.

(2) Create another directory "Pkg_Root", and inside that create two more directories "Applications" and"Library".  Create:
 - a "Screen Savers" directory inside your new Library directory,
 - an "Application Support" directory inside your new Library directory,
 - a "BOINC Data" directory inside your new Application Support directory,
 - a "locale" directory inside your new BOINC Data directory  
Correct spelling of these names is critical.

(3) Copy [boincpath]/mac_build/build/BOINCManager.app into your 
"Pkg_Root/Applications" directory.

(4) Copy [boincpath]/mac_build/build/BOINCSaver.saver into your 
"Pkg_Root/Library/Screen Savers" directory.  

(5) Copy the contents of boincpath]/locale/client/ into your 
"Pkg_Root/Library/Application Support/BOINC Data/locale" directory.  (You may optionally exclude the CVS subdirectories to save space.)

You will now have the following directory structure:
	Pkg_Root
	        Applications
	                BOINCManager.app
	        Library
	                Application Support
                                    BOINC Data
                                            locale
                                                    de
                                                    en_US
                                                    it
                                                    etc.....
	                Screen Savers
	                        BOINCSaver.saver

(6) From the Finder, open [boincpath]/mac_installer/BOINC.pmsp.  it will open in the PackageMaker application.  In the Files tab, set the path to your Pkg_Root directory.  in the Resources tab, set the path to your Installer_Resources directory.   Update the  version number in multiple places in the Description and Version tabs.

(7) Select "Create Package" from PackageMaker's File menu.  You can give any name you wish to the installer package when you create it, but do not change the package name after it is created.

(8) Quit PackageMaker.

Package BOINC installer for distribution

(1) Create a directory and name it appropriately, e.g. BOINC_Mac_Installer.  Copy the installer package and the ReadMe file into the directory.

(2)After selecting the directory you just created and populated, select Create archive from the Finder's File menu.  This will zip the file.  (Note: if you want to stuff the file instead of zipping it, be sure to uncheck "stuff originals instead of aliases" in DropStuff's preferences.)

(3) Rename the zip file as appropriate to show the version number; for example, BOINC_Mac_4_67.zip 

BOINC SETI client application

ONE_TIME SETUP for BOINC SETI client application

(1) Set the following five environment variables NEXT_ROOT, CPPFLAG, LDFLAGS, PROJECTDIR and BOINCDIR.  These commands are for the bash shell; use the equivalent commands if you are running a different UNIX shell.  The first three environment variables allow the application to be built using the OS 10.3.0 compatibility SDK.

NEXT_ROOT=/Developer/SDKs/MacOSX10.3.0.sdk;export NEXT_ROOT

CPPFLAGS="-isystem /Developer/SDKs/MacOSX10.3.0.sdk/usr/include -DMAC_OS_X_VERSION_MAX_ALLOWED=1030 -L[boincpath]/seti_boinc/jpeglib -ljpeg";export CPPFLAGS

LDFLAGS=-L/Developer/SDKs/MacOSX10.3.0.sdk/usr/lib/gcc/darwin/3.3;export LDFLAGS

PROJECTDIR=[boincpath]/seti_boinc;export PROJECTDIR

BOINCDIR=[boincpath];export BOINCDIR

(2) Run Configure to create the correct config.h file:

./configure --disable-server --with-apple-opengl-framework --disable-dynamic-graphics

(3) Copy the correct jpebglib.a into [path]/seti_boinc/jpeg/   ?????

(4)Create a  symbolic link [path]/seti_boinc/boinc pointing to the boinc directory

cd [boincpath]/seti_boinc 
ln -s [boincpath] ./boinc

Building the BOINC SETI client application

The XCODE project for building the BOINC SETI@home client application is 
[boincpath]/seti_boinc/mac_build/seti_boinc.xcode.