These notes are for building and installing PCP on Mac OS X

The recipe is known to work with PCP 3.10.9 and Mac OS X 10.8
(Mountain Lion).

Preliminaries
=============

These are the main requirements, do not move forward without installing these.

- XCode  (as always, needs an Apple developer ID now too)
	(https://itunes.apple.com/us/app/xcode/id497799835?mt=12)

- pkgbuild (Latest MacOS comes with this preinstalled but later versions may need additional files)

- MacPorts.org  (now needed for pkg-config, gnutar)
	(https://www.macports.org/install.php)

- Qt (install and set QTDIR, as before)
	(https://www.qt.io/download)

Other prerequisites
===================

Based on http://cairographics.org/end_to_end_build_for_mac_os_x/

But skipping the pkg-config stuff there and installing directly
into /usr/local rather than some local staging area.

For each package below, poke around in the ftp download area to find
an appropriate setting for LATEST.

$ export MACOSX_DEPLOYMENT_TARGET=10.5

# we don't care about -arch ppc and -arch ppc64 so omit these
#
$ export LDFLAGS="-arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk"
$ export CFLAGS="-Os -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk"

Latest cario tarball is compressed with xz, so need to get, make and
install that first.

$ LATEST=5.2.3
$ curl -L http://tukaani.org/xz/xz-$LATEST.tar.gz -o xz.tgz
$ tar xpf xz.tgz
$ rm -rf xz
$ mv xz-$LATEST xz
$ cd xz
$ sudo ./configure --disable-dependency-tracking
$ make
$ sudo make install
$ cd ..

$ LATEST=1.6.34
$ DIR=`echo $LATEST | sed -e 's/\.[^.]*$//' -e 's/\.//' -e 's/^/libpng/'`
# should be libpng16 for LATEST=1.6.17
$ curl ftp://ftp.simplesystems.org/pub/libpng/png/src/$DIR/libpng-$LATEST.tar.gz -o libpng.tgz
$ tar zxpf libpng.tgz
$ rm -rf libpng
$ mv libpng-$LATEST libpng
$ cd libpng
$ sudo ./configure --disable-dependency-tracking
$ make
$ sudo make install
$ cd ..

$ LATEST=0.34.0
$ curl -L http://www.cairographics.org/releases/pixman-$LATEST.tar.gz -o pixman.tgz
$ tar zxpf pixman.tgz
$ rm -rf pixman
$ mv pixman-$LATEST pixman
$ cd pixman
$ sudo ./configure --disable-dependency-tracking
$ make
$ sudo make install
$ cd ..

$ LATEST=1.14.12
$ curl -L http://www.cairographics.org/releases/cairo-$LATEST.tar.xz -o cairo.txz
$ xzcat cairo.txz | tar xpf -
$ rm -rf cairo
$ mv cairo-$LATEST cairo
$ cd cairo
$ sudo ./configure --disable-dependency-tracking
$ make
$ sudo make install
$ cd ..

$ LATEST=0.9.59
$ curl ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-$LATEST.tar.gz -o libmicrohttpd.tgz
$ tar zxpf libmicrohttpd.tgz 
$ rm -rf libmicrohttpd
$ mv libmicrohttpd-$LATEST libmicrohttpd
$ cd libmicrohttpd
$ sudo ./configure --disable-dependency-tracking
$ make
$ sudo make install
$ cd ..

PCP Build
=========

$ unset LDFLAGS
$ unset CFLAGS
$ cd <to top of PCP tree>
$ ./Makepkgs

Good luck!

Ken McDonell, Dec 2015
