CompileTmuxOnMacOSX

== 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 http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html # SOURCE : https://gist.github.com/jellybeansoup/4192307 # Changes come from the same URL as above. #

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

## # Autoconf # http://ftpmirror.gnu.org/autoconf # --- MODIFIED --- # latest version is 2.69

cd $build curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz 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 # http://ftpmirror.gnu.org/automake

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

## # Libtool # http://ftpmirror.gnu.org/libtool # --- MODIFIED --- # latest version is 2.4.6

cd $build curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz 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}}}:

{{{ $ ./autogen.sh $ ./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: ==