== How to compile tmux on Mac OS X ==

How can you live without {{{tmux}}}? Don't ask me, I have no idea! :-)

I used to use this page to compile {{{tmux}}} on Mac OS X, but the latest version proved to be slightly more difficult than the previous ones.

So... Here it is: how to compile {{{tmux}}} on Mac OS X...

If you haven't done so already, please make sure you have all the GNU command line tools installed on your Macintosh first...

==== 1. Install the necessary GNU tools ====

Here is a short script that I used to download and install all the required GNU tools on Mac OS X:

{{{ #!/bin/sh

## # Install autoconf, automake and libtool smoothly on Mac OS X. # Newer versions of these libraries are available and may work better on OS X # # This script is originally from # SOURCE : # Changes come from the same URL as above. #

export build=~/devtools # or wherever you'd like to build mkdir -p $build

## # Autoconf # # --- MODIFIED --- # latest version is 2.69

cd $build curl -OL tar xzf autoconf-latest.tar.gz cd autoconf-2.69 ./configure --prefix=/usr/local make sudo make install export PATH=$PATH:/usr/local/bin

## # Automake #

cd $build # --- MODIFIED --- # latest version is 1.15 curl -OL tar xzf automake-1.15.tar.gz cd automake-1.15 ./configure --prefix=/usr/local make sudo make install

## # Libtool # # --- MODIFIED --- # latest version is 2.4.6

cd $build curl -OL tar xzf libtool-2.4.6.tar.gz cd libtool-2.4.6 ./configure --prefix=/usr/local make sudo make install

echo "Installation complete." }}}

This will install the required {{{autoconf}}}, {{{automake}}} and {{{libtool}}} in one fell swoop. I did not create this script, the github URL contained in it should get all the credit, my modest contribution is just to update the versions.

==== 2. Compile {{{libevent}}} ====

Use the following to compile {{{libevent}}}:

{{{ $ ./ $ ./configure --prefix=/opt --disable-openssl $ make && sudo make install }}}

==== 3. Compile tmux ====

Use the following to compile {{{tmux}}}:

{{{ $ ./configure LDFLAGS="-L/opt/lib" CPPFLAGS="-I/opt/include" LIBS="-lresolv" --prefix=/opt $ make && sudo make install }}}

You are done! The {{{tmux}}} binary should now live happily in {{{/opt/bin/tmux}}}:

{{{ $ lt -h /opt/bin/t* -rwxr-xr-x 1 root wheel 493K Jan 4 15:12 /opt/bin/tmux* }}}

== See Also: ==