So, here's my first entry in that shorter format.
If you're upgrading to Mac OS X Mountain Lion and Xcode 4.4.1, you'll find that Xcode does not include anymore the GNU Autoconf, Automake and Libtool build tools used by most open source projects to generate makefiles and dynamic libraries... That's not so great :(
I wanted to share what I did to build them myself from source, as it could help others too:
export build=~/devtools # or wherever you'd like to build
mkdir -p $build
cd $build
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.68.tar.gz
tar xzf autoconf-2.68.tar.gz
cd autoconf-2.68
./configure --prefix=$build/autotools-bin
make
make install
export PATH=$PATH:$build/autotools-bin/bin
cd $build
curl -OL http://ftpmirror.gnu.org/automake/automake-1.11.tar.gz
tar xzf automake-1.11.tar.gz
cd automake-1.11
./configure --prefix=$build/autotools-bin
make
make install
cd $build
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.tar.gz
tar xzf libtool-2.4.tar.gz
cd libtool-2.4
./configure --prefix=$build/autotools-bin
make
make install
mkdir -p $build
cd $build
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.68.tar.gz
tar xzf autoconf-2.68.tar.gz
cd autoconf-2.68
./configure --prefix=$build/autotools-bin
make
make install
export PATH=$PATH:$build/autotools-bin/bin
cd $build
curl -OL http://ftpmirror.gnu.org/automake/automake-1.11.tar.gz
tar xzf automake-1.11.tar.gz
cd automake-1.11
./configure --prefix=$build/autotools-bin
make
make install
cd $build
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.tar.gz
tar xzf libtool-2.4.tar.gz
cd libtool-2.4
./configure --prefix=$build/autotools-bin
make
make install
Notice how I configured to install in --prefix=$build/autotools-bin? You can also omit that to install the tools in your system dirs if you want. I usually install what I build under my own user dir to avoid polluting the system dirs, but it's really your choice.
Hope this helps
31 comments:
On my machine (OS X 10.7.4) I had to add $build/autotools-bin/bin to the path otherwise automake wouldn't find autoconf.
Good catch. I just fixed the steps to correctly set the path. Thanks!
Can't we just install MacPorts or Brew ?
I've tried your technique and the 2 above and still the system can't find aclocal - although it can find both automake and autoconf...
Any idea ?
Macports or Brew should work too but I usually prefer a more minimalistic approach and build just what I need from source. The steps I described build the strict minimum to get automake working without duplicating any of the tools installed by Apple.
If you can't find aclocal, check your path and how you invoke it. It should be in $build/autotools-bin/bin besides automake and autoconf.
Thanks for sharing.
Three minutes copy-and-paste instead of hours try-and-error.
Wishing you well!
Hi,
i had problems with the ./configure command:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking build system type... i386-apple-darwin12.1.0
checking host system type... i386-apple-darwin12.1.0
configure: autobuild project... GNU Autoconf
configure: autobuild revision... 2.68
configure: autobuild hostname... tommbp.fritz.box
configure: autobuild timestamp... 20120919T082822Z
checking whether /bin/sh -n is known to work... yes
checking for characters that cannot appear in file names... none
checking whether directories can have trailing spaces... yes
checking for expr... /bin/expr
checking for GNU M4 that supports accurate traces... configure: error: no acceptable m4 could be found in $PATH.
GNU M4 1.4.6 or later is required; 1.4.14 is recommended
how can i solve this?
Thanks Jean-Sebastien, really great stuff for a newbie like myself :)
Very helpful. Thank you.
clark@simplexable.com
Very helpful. Thank you.
clark@simplexable.com
Very useful.
Xcode 4.2 has a libtool, so I thought I might not need to build that; but it seems to be incomplete (no libtoolize).
After running your script, when I try to run autoconf, I get the error:
"autom4te: cannot create autom4te.cache: No such file or directory"
Any ideas?
This worked well for me on Mountain Lion 10.8.2 and XCode Version 4.6 (4H127).
Thank you.
This is great--thanks for posting. I chose to use /usr/local.
Thank you so much for this!!
Thanks a lot! :) Worked for me.
Thank you very much! This was awesome
Much, much appreciated!
Much appreciated!
Thank you very much!
Thank you!
Thank you!
Thank you for this! I was able to make a protocol buffer unix tool with your help.
Thanks a lot! I also need to make autoreconf work. Does a similar strategy work there?
Thanks for sharing. A quick comment, maybe replace autoconf-2.68.tar.gz with autoconf-latest.tar.gz (and likewise for the other autotools).
Awesome post. Thanks much. Used it on 10.8.5. For the person who had the M4 error, you need to install the Xcode command line tools (now a Download under Preferences after you install xcode). Or you could build your own m4 if you didn't want to download xcode.
Thanks! This was the top google result for "autoconf mac" when I realized Xcode on Mavericks didn't have it.
Thanks! This was the top google result for "autoconf mac" when I realized Xcode on Mavericks didn't have it.
Thank you, your instructions work flawlessly on 10.9.1. You saved a lot of people a lot of time. :)
Make sure to check the FTP server for the latest version. For autoconf you can simply use autoconf-latest.tar.gz which always points to the latest version. For automake and libtool, copy and paste the url without the filename in your browser and look for the latest version. The dates are included in the directory listings which may make it easier.
Muito obrigado! Seu "HowTo" ficou ótimo!
Thanks for this. You should probably update the links:
Latest autoconf is http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz (or, the link http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz always is the latest version)
Latest automake is http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz
Latest libtool is http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz
Post a Comment