I noticed today that while Mac OS 10.6 (specifically, 10.6.2) comes with automake and autoconf, the versions are a little bit dated. Normally I wouldn’t care, but I ran into an issue when trying to generate a portable distribution using those tools on my mac, and then configure, compile, and install the result on a linux box. What I discovered is that the version of autoconf and automake on OSX can generate a “configure” file which doesn’t work as expected on linux (at least one with gcc 4.3) — specifically, the step “checking for working mktime…” can hang and eventually return “no”, when that is not the correct result. Apparently you need at least autoconf 2.62 in order to avoid this bug.
I figured as long as I was updating autoconf i’d update automake, m4, and libtool as well. Here’s the quick script (as always, I assume you prefer the installation prefix /usr/local as i do). It’s nothing too fancy, but the sequence of the installs is important:
curl -O http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz tar -xzvf m4-1.4.13.tar.gz cd m4-1.4.13 ./configure --prefix=/usr/local make sudo make install cd .. curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz tar -xzvf autoconf-2.65.tar.gz cd autoconf-2.65 ./configure --prefix=/usr/local # ironic, isn't it? make sudo make install cd .. # here you might want to restart your terminal session, to ensure the new autoconf is picked up and used in the rest of the script curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz tar xzvf automake-1.11.tar.gz cd automake-1.11 ./configure --prefix=/usr/local make sudo make install cd .. curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz tar xzvf libtool-2.2.6b.tar.gz cd libtool-2.2.6b ./configure --prefix=/usr/local make sudo make install
and now, (assuming you have /usr/local in your path), when you use autotools your distribution should be correctly portable (at least in regards to this mktime bug).
This discussion helped me on my way to a solution:
http://old.nabble.com/mktime-not-working–td18496196.html
cheers!
{ 2 comments… read them below or add one }
Thanks for the summary, it helped.
http://www.mattvsworld.com/blog/2010/02/install-the-latest-autoconf-and-automake-on-mac-os-10-6/
I was trying to do autoconf on latest flam3 (from Google Code)
http://code.google.com/p/flam3/source/checkout
But this failed, because the script was created with a newer version 2.63 than the default ‘autoconf’ on Snow Leopard. So I upgraded to 2.65 with your help.
For the sake of other readers…
Just a small correction, there was an error in the line:
“cd autoconf-2.65.tar.gz”
it SHOULD read:
“cd autoconf-2.65″
–
My Snow Leopard 10.6.3 path was “/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin”.
Since I already had ‘/usr/local’ *after* the normal system path loading “autoconf” then I needed something different because I did not want to change the order of everything, just these tools. I created an ‘overrideOrder’ directory in “/usr/local”.
Like this:
“cd /usr/local”
“sudo mkdir overrideOrder”
then I did “sudo edit /etc/paths” (TextWrangler) and put the ‘bin’ directory of that override directory *before* the other paths, like this:
/usr/local/overrideOrder/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
(note that the X11 path in the $PATH variable mentioned at the top comes from ‘/etc/paths.d/’ which is searched *after* the rest of these directories. You can add text files with other paths there. See it like this: ‘open /etc/paths.d/’ )
Then I made a new directory on the Desktop, ‘cd’ to it and followed your instructions edited/updated to latest stable versions and prefixed to the override directory (note that it’s *not* ‘bin’ here):
curl -O http://mirrors.kernel.org/gnu/m4/m4-1.4.14.tar.gz
tar -xzvf m4-1.4.14.tar.gz
cd m4-1.4.14
./configure –prefix=/usr/local/overrideOrder
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
tar -xzvf autoconf-2.65.tar.gz
cd autoconf-2.65
./configure –prefix=/usr/local/overrideOrder
make
sudo make install
cd ..
# here you might want to restart your terminal session, to ensure the new autoconf is picked up and used in the rest of the script
curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.1.tar.gz
tar xzvf automake-1.11.1.tar.gz
cd automake-1.11.1
./configure –prefix=/usr/local/overrideOrder
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz
tar xzvf libtool-2.2.6b.tar.gz
cd libtool-2.2.6b
./configure –prefix=/usr/local/overrideOrder
make
sudo make install
That upgraded the tools and worked as intended. Verify by typing “autoconf –version”.
Thanks again!
Thanks for the nice comment! I fixed the script for that “cd” bug you mentioned. Cheers!