Blame README.OSX

Packit 8dc392
IlmBase on MacOS X
Packit 8dc392
------------------
Packit 8dc392
Packit 8dc392
Building IlmBase on MacOS X is just like building it on GNU/Linux. 
Packit 8dc392
Follow the instructions in the README file under BUILDLING ILMBASE,
Packit 8dc392
but see below re: shared libraries.
Packit 8dc392
Packit 8dc392
Packit 8dc392
Missing gnu automake tools on  Mac OS X 10.8+
Packit 8dc392
------------------
Packit 8dc392
Later versions of OS X ,10.8+, do not, by default have all the necessary 
Packit 8dc392
tools for building. In particular,  Autoconf and Automake may be missing. 
Packit 8dc392
Packit 8dc392
The following commands will download and install the necessary components:
Packit 8dc392
Packit 8dc392
cd ~/myDevLoc
Packit 8dc392
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.64.tar.gz
Packit 8dc392
tar xzf autoconf-2.64.tar.gz
Packit 8dc392
cd autoconf-2.64
Packit 8dc392
./configure --prefix=~/myDevLoc/autotools-bin
Packit 8dc392
make; make install
Packit 8dc392
Packit 8dc392
cd ~/myDevLoc
Packit 8dc392
curl -OL http://ftpmirror.gnu.org/automake/automake-1.12.tar.gz
Packit 8dc392
tar xzf automake-1.12.tar.gz
Packit 8dc392
cd automake-1.12
Packit 8dc392
./configure --prefix=~/myDevLoc/autotools-bin
Packit 8dc392
make; make install
Packit 8dc392
Packit 8dc392
cd ~/myDevLoc
Packit 8dc392
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.tar.gz
Packit 8dc392
tar xzf libtool-2.4.tar.gz
Packit 8dc392
cd libtool-2.4
Packit 8dc392
./configure --prefix=~/myDevLoc/autotools-bin
Packit 8dc392
make; make install
Packit 8dc392
Packit 8dc392
Packit 8dc392
You may want to export the installation path for your convenience.
Packit 8dc392
Finally, make sure that you have installed the command line tools for XCode.
Packit 8dc392
Packit 8dc392
Packit 8dc392
Universal Builds on Mac OS X
Packit 8dc392
------------------
Packit 8dc392
OS X supports multiple architectures. By default, IlmBase will be built
Packit 8dc392
for the system doing the building. For example, if you build IlmBase on
Packit 8dc392
an Intel system, the libraries will be built for Intel.
Packit 8dc392
Packit 8dc392
You can specify building for a different architecture, or multiple architectures,
Packit 8dc392
by passing the "--enable-osx-arch" flag to configure. Building for multiple
Packit 8dc392
architectures requires that "--disable-dependency-tracking" be passed as well.
Packit 8dc392
Packit 8dc392
For example, to build for Intel and PowerPC:
Packit 8dc392
Packit 8dc392
./configure --enable-osx-arch="i386 ppc" --disable-dependency-tracking.
Packit 8dc392
Packit 8dc392
To build "4-way universal" for 32-bit and 64-bit Intel and PowerPC:
Packit 8dc392
Packit 8dc392
./configure --enable-osx-arch="i386 ppc x86_64 ppc64" --disable-dependency-tracking.
Packit 8dc392
Packit 8dc392
For more information on universal builds, see:
Packit 8dc392
Packit 8dc392
http://developer.apple.com/documentation/Porting/Conceptual/PortingUNIX/compiling/chapter_4_section_3.html
Packit 8dc392
Packit 8dc392
Earlier releases of IlmBase included an "--enable-osx-universal-binaries" 
Packit 8dc392
switch, which specifies a two-way universal build: Intel and PowerPC, 32-bit only. 
Packit 8dc392
This is still available, but deprecated in favor of the more flexible 
Packit 8dc392
"--enable-osx-arch" and "--enable-osx-sdk" switches.
Packit 8dc392
Packit 8dc392
Packit 8dc392
Choosing an SDK on Mac OS X
Packit 8dc392
------------------
Packit 8dc392
OS X allows you to specify one of several SDKs, or sysroots. This allows you to 
Packit 8dc392
target systems other than the system that your build machine runs.
Packit 8dc392
Packit 8dc392
For example, if you are building on Mac OS X 10.4, but you need access to features 
Packit 8dc392
that were introduced in Mac OS X 10.5, you can build against the Mac OS X 10.5 
Packit 8dc392
versions of system libraries and headers.
Packit 8dc392
Packit 8dc392
You can choose to build IlmBase with a specific SDK using the "--enable-osx-sdk" 
Packit 8dc392
switch. For example:
Packit 8dc392
Packit 8dc392
./configure --enable-osx-sdk=MacOSX10.5.sdk
Packit 8dc392
Packit 8dc392
If you are building on Mac OS X 10.4 and want to build universal, you will need to 
Packit 8dc392
specify the universal version of the 10.4 SDK: MacOSX10.4u.sdk. Otherwise, you probably 
Packit 8dc392
don't need to specify an SDK.
Packit 8dc392
Packit 8dc392
For more information on sysroots, see:
Packit 8dc392
Packit 8dc392
http://developer.apple.com/documentation/DeveloperTools/gcc-4.2.1/gcc/Directory-Options.html
Packit 8dc392
Packit 8dc392
Packit 8dc392
Shared libraries
Packit 8dc392
----------------
Packit 8dc392
Packit 8dc392
IlmBase requires the "flat namespace" option when built as a shared
Packit 8dc392
library.  You may have problems trying to use IlmBase shared libraries
Packit 8dc392
with applications that expect OS X's two-level namespace.  We have not
Packit 8dc392
tested the shared libs extensively, though they appear to work with
Packit 8dc392
exrdisplay and exrheader, but use them at your own risk.  We will
Packit 8dc392
support two-level namespace shared libs in a future release.