53 changes: 37 additions & 16 deletions doc/osx.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,23 @@ which can be used in build shell scripts like:
make -j $(/usr/sbin/sysctl -n hw.ncpu)
```

__Note:__ if you get an error in parallel compilation, try removing the -j # flag,
so it's just 'make', or using a smaller number. Sometimes make can hiccup on too
many threads.

== Install Developer Tools ==

Developer tools are not a part of a standard OS X installation. Up through
Snow Leopard, the Developer Tools, later called Xcode, were included with the
system install disks, though it's best to download the latest version compatible
with your system to get important updates fixing various issues.
Starting with Lion, Xcode is available as a download and from the App Store.
BUT, there is really no need for the full Xcode on Lion, and in fact could be
tricky to use for compiling QGIS.

Downloading Xcode/Developer Tools requires a free developer account at
Downloading Xcode/Developer Tools for up through Snow Leopard requires a free developer account at
developer.apple.com. Up through Snow Leopard, get the latest __Xcode__ that is
supported for your system. For Lion, all you need is the much smaller
__Command Line Tools for Xcode__ (you don't get the IDE or system SDKs but they are not
necessary for QGIS). When installing Xcode up through Snow Leopard, make sure to
supported for your system. For Lion and above, you can get Xcode from either a
free developer account or for a minimal fee from the app store.
When installing Xcode up through Snow Leopard, make sure to
do a custom install and install the Unix Development or Command Line Tools option.

On Lion, if you have installed Xcode 4.0 - 4.2 and are upgrading to 4.3, it's
Expand All @@ -73,8 +75,7 @@ sudo /Developer/Library/uninstall-devtools
```

On Lion and Mt. Lion, using Xcode 4.4+, the developer command line tools can be
installed via the Xcode preferences. The tools now appear to require an install
of Xcode, regardless of using a separate DMG installer for just the tools.
installed via the Xcode preferences.

Xcode 4.3+ also introduces the clang frontend to the LLVM compiler as default.

Expand Down Expand Up @@ -273,7 +274,7 @@ Double-click the source tarball to unpack, then, in Terminal.app, cd to the
source folder and:

```
./configure
./configure --disable-dependency-tracking CFLAGS=-Os
make
sudo make install
```
Expand All @@ -295,6 +296,9 @@ your own risk.

=== Additional dependencies: SIP ===

__Mt Lion note:__ SIP 4.15.7 appears to not work on Mt Lion. Install 4.14.6.
(or a later working version when available)

Retrieve the python bindings toolkit SIP from

http://www.riverbankcomputing.com/software/sip/download
Expand Down Expand Up @@ -345,11 +349,20 @@ python2.6 configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin
__Lion+ system Python__

Similar to Snow Leopard, you should install outside the system Python path.
There is no need for the SDK option or arch option:
The SDK option should match the system you are compiling on:

for Lion:

```
python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin \
-e /usr/local/include -v /usr/local/share/sip
-e /usr/local/include -v /usr/local/share/sip --arch=x86_64 -s MacOSX10.7.sdk
```

for Mt. Lion:

```
python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin \
-e /usr/local/include -v /usr/local/share/sip --arch=x86_64 -s MacOSX10.8.sdk
```

__continue...__
Expand Down Expand Up @@ -397,6 +410,7 @@ sudo make install
sudo install_name_tool -id /usr/local/lib/libqscintilla2.9.dylib \
/usr/local/lib/libqscintilla2.9.dylib
```

This installs QScintilla2's dylib in /usr/local/lib/ and the header files in
/usr/local/include/Qsci/, both of which should be automatically found when
building QGIS.
Expand Down Expand Up @@ -465,7 +479,7 @@ python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin \
__Lion and Mt. Lion system Python__

Similar to Snow Leopard, you should install outside the system Python path.
But you don't need the arch option:
But you don't need the use-arch option:

```
python2.7 configure.py -d /Library/Python/2.7/site-packages -b /usr/local/bin -n /usr/local/Qt4.8/qsci -v /usr/local/share/sip/PyQt4
Expand Down Expand Up @@ -494,7 +508,11 @@ cd <QScintilla2 source dir>
cd Python
python2.7 configure.py -o /usr/local/lib -n /usr/local/include \
-d /Library/Python/2.7/site-packages/PyQt4 -v /usr/local/share/sip/PyQt4 \
--pyqt-sipdir=/usr/local/share/sip/PyQt4
--sip-incdir=/usr/local/include --pyqt-sipdir=/usr/local/share/sip/PyQt4
cat >>Qsci.pro <<EOF
QMAKE_LFLAGS_PLUGIN -= -dynamiclib
QMAKE_LFLAGS_PLUGIN += -bundle
EOF
qmake -spec macx-g++ Qsci.pro
make -j [#cpus]
sudo make install
Expand Down Expand Up @@ -651,7 +669,7 @@ make install
sudo mkdir -p "/Library/Application Support/OpenSceneGraph/PlugIns"
```

Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
Open the staging folder you chose for the CMAKE_INSTALL_PREFIX option above.

Now move all .frameworks from the lib/ folder in the staging area to /Library/Frameworks. Move the files in the osgPlugins folder in the lib/ folder
to /Library/Application Support/OpenSceneGraph/PlugIns. The bin/ executables
Expand Down Expand Up @@ -679,6 +697,8 @@ http://github.com/gwaldron/osgearth/tags
Download a tarball for the latest stable release (sorting can be confusing here).
Double-click the source tarball to unpack it.

__Note:__ for now stick with version 2.3. There are compile errors in 2.4 that need attention.

This one also needs an intermediate staging area. Choose a folder similar to OSG.

In a new Terminal cd to the source folder and:
Expand All @@ -696,13 +716,14 @@ make install
sudo mkdir -p "/Library/Application Support/OpenSceneGraph/Headers"
```

Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
Also enter the OSG staging path /bin folder in the export above.
Open the staging folder you chose for the CMAKE_INSTALL_PREFIX option above.
Also open the OSG staging path /bin folder from the OSG build.

Move all the .frameworks from the lib/ folder to /Library/Frameworks.
Move the files in the osgPlugins folder in the lib/ folder to
/Library/Application Support/OpenSceneGraph/PlugIns. Move the osgEarthDrivers
folder in the include/ folder to /Library/Application Support/OpenSceneGraph/Headers.
(you may need to create this folder)
And as for OSG, you can leave the bin/ executables where they are.

== API documentation ==
Expand Down