X Server Build: 1.4 Development Version on Mac OS 10.5.5

These are instructions for building and installing the X server from the latest 1.4 development sources, using a fresh installation of Mac OS 10.5.5.

Since people frequently check in changes to the freedesktop.org git repository, it's possible these instructions won't work for you. They were last verified on 11 Oct 2008. If they don't work for you, please send email to the XQuartz mailing list.

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 latest 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 From freedesktop.org

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.

Determine and create X11 build directory

You can change /x11build to anything else you like

X11_BUILD_ROOT=/x11build
mkdir ${X11_BUILD_ROOT}
cd ${X11_BUILD_ROOT}

Define the versions of various components to be used

VER_APPLEWMPROTO=applewmproto-1.1.1
VER_PKGCONFIG=pkg-config-0.23
VER_PIXMAN=pixman-0.11.8
VER_GIT=git-1.6.0
VER_XTRANS=xtrans-1.2.2
VER_MESA3D=MesaLib-7.0.4

Download and unpackage most of the components

This also changes the names of most of the directories to remove the version numbers.

TB_APPLEWMPROTO=${VER_APPLEWMPROTO}.tar.bz2
curl -LO http://xorg.freedesktop.org/archive/individual/proto/${TB_APPLEWMPROTO}
tar xf ${TB_APPLEWMPROTO}
mv ${VER_APPLEWMPROTO} applewmproto

TB_PKGCONFIG=${VER_PKGCONFIG}.tar.gz
curl -LO http://pkgconfig.freedesktop.org/releases/${TB_PKGCONFIG}
tar xf ${TB_PKGCONFIG}
mv ${VER_PKGCONFIG} pkg-config

TB_PIXMAN=${VER_PIXMAN}.tar.gz
curl -LO http://cairographics.org/releases/${TB_PIXMAN}
tar xf ${TB_PIXMAN}
mv ${VER_PIXMAN} pixman

TB_GIT=${VER_GIT}.tar.gz
curl -LO http://www.kernel.org/pub/software/scm/git/${TB_GIT}
tar xf ${TB_GIT}
mv ${VER_GIT} git

TB_XTRANS=${VER_XTRANS}.tar.gz
curl -LO http://ftp.x.org/pub/individual/lib/${TB_XTRANS}
tar xf ${TB_XTRANS}
mv ${VER_XTRANS} xtrans

TB_MESA3D=${VER_MESA3D}.tar.gz
curl -LO http://downloads.sourceforge.net/mesa3d/${TB_MESA3D}
tar xf ${TB_MESA3D}

Build applewmproto, and install into the normal X11 location (make not needed)

cd ${X11_BUILD_ROOT}/applewmproto
./autogen.sh --prefix=/usr/X11
sudo make install

Build and install pkg-config

cd ${X11_BUILD_ROOT}/pkg-config
./configure
make
sudo make install

Build and install git

cd ${X11_BUILD_ROOT}/git
./configure --prefix=/usr/local
make all
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 ${X11_BUILD_ROOT}/pixman
./configure
make
sudo make install

Build and install xtrans

cd ${X11_BUILD_ROOT}/xtrans
./configure
make
sudo make install

Obtain xserver sources via git

cd ${X11_BUILD_ROOT}
git clone git://anongit.freedesktop.org/git/xorg/xserver.git

Get the 1.4 and 1.5 apple branches

cd ${X11_BUILD_ROOT}/xserver
git branch --track xorg-server-1.4-apple origin/xorg-server-1.4-apple
git branch --track xorg-server-1.5-apple origin/xorg-server-1.5-apple

Switch to the 1.4-apple branch, and build and install it and Mesa

git checkout -f xorg-server-1.4-apple
./autogen.sh --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. The version text should now be different from what you saw before.