X Server Build: 1.4.2-apple19 on Mac OS 10.5.5

These are instructions for building and installing the X server from the 1.4.2-apple19 sources, using a fresh installation of Mac OS 10.5.5.

Note: This only builds the X server for your machine's native architecture. It doesn't build a universal binary.

Prepare Machine

  1. Install Mac OS 10.5.5, using the default install options - OR, install an earlier version of Leopard, and update to 10.5.5. You can find an updater here:  http://www.apple.com/support/downloads/macosx1055comboupdate.html
  2. Log in with an administrative account.
  3. Install XCode 3.1.1, using all the default install options
    • If you don't have this version of XCode, follow these instructions to download the installer.

Install and Verify Newer X11

  1. Use a web browser to download and install the development X11 version from  http://static.macosforge.org/xquartz/downloads/X11-2.3.1_rc6_10.5.5.pkg
  2. Run X11 (in the Utilities directory), make sure an xterm window appears, and check the about box. It should now say: XQuartz 2.3.1 (xorg-server 1.4.2-apple17)
  3. Quit X11.

Build and Install 1.4.2-apple19

Open Terminal (in the Utilities directory) and start entering commands the commands you see in this font. It's best to copy and paste these commands, and you can paste them in blocks as shown. For the lines that start with "sudo", you will often have to enter your administrative account's password.

Make X11 build directory

cd /
mkdir x11build
cd /x11build

Download support components

curl -LO http://xorg.freedesktop.org/archive/individual/proto/applewmproto-1.1.0.tar.bz2
curl -LO http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
curl -LO http://cairographics.org/releases/pixman-0.11.8.tar.gz
curl -LO http://www.kernel.org/pub/software/scm/git/git-1.6.0.tar.bz2

Unpackage support components

tar -xf applewmproto-1.1.0.tar.bz2
tar -xzf pkg-config-0.23.tar.gz
tar -zxf pixman-0.11.8.tar.gz 
tar xf git-1.6.0.tar.bz2

Build applewmproto, and install into the normal X11 location

applewmproto doesn't need a make step.

cd /x11build/applewmproto-1.1.0
./autogen.sh --prefix=/usr/X11
sudo make install

Build and install pkg-config

cd /x11build/pkg-config-0.23
./configure
make
sudo make install

Prepare for building pixman, mesa, and X server

export ACLOCAL="aclocal -I /usr/X11/share/aclocal"
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:/usr/X11/lib/pkgconfig
export CFLAGS="-I/usr/local/include -Wall -O2 -pipe"
export LDFLAGS="-Wall -O2 -pipe"

Build and install pixman

cd /x11build/pixman-0.11.8
./configure
make
sudo make install

Download mesa and X server

cd /x11build
curl -LO http://static.macosforge.org/xquartz/downloads/src/xorg-server-1.4.2-apple19.tar.bz2
tar -xjf xorg-server-1.4.2-apple19.tar.bz2
curl -LO http://superb-west.dl.sourceforge.net/sourceforge/mesa3d/MesaLib-7.0.4.tar.bz2
tar -xjf MesaLib-7.0.4.tar.bz2

Build and install mesa and X server

cd /x11build/xorg-server-1.4.2-apple19
./configure --prefix=/usr/X11 --with-mesa-source=`pwd`/../Mesa-7.0.4 --disable-dependency-tracking
make
sudo make install

That's it! You've built and installed the X server.

Verify X server

Run X11 again, make sure an xterm window appears, and check the about box. It should now say: XQuartz 2.3.2 (xorg-server 1.4.2-apple19), which is newer than either of the two earlier versions.