1
votes

I'm trying to install osm2pgsql from source on OSX Mavericks. I'm following the basic steps in the readme, but when I try running ./autogen.sh I'm getting a libtool error:

autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
Can't exec "libtoolize": No such file or directory at /usr/local/share/autoconf/Autom4te/FileUtils.pm line 345,  line 4.
autoreconf: failed to run libtoolize: No such file or directory
autoreconf: libtoolize is needed because this package uses Libtool

I have installed all the dependencies, and have the latest versions of autoconf and automake. Can't figure out why it can't find libtoolize. If I run locate libtoolize I can see it's installed.

What's going on?

Update

As per suggestion in the first comment, I tried adding the following lines to the autogen.sh script:

case `uname` in Darwin*) glibtoolize --copy ;;
  *) libtoolize --copy ;; esac

This seems to get a little further, but still gets stuck. This is the output in Terminal:

$ ./autogen.sh && ./configure && make
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
Can't exec "libtoolize": No such file or directory at /usr/local/share/autoconf/Autom4te/FileUtils.pm line 345,  line 4.
autoreconf: failed to run libtoolize: No such file or directory
autoreconf: libtoolize is needed because this package uses Libtool
glibtoolize: putting auxiliary files in `.'.
glibtoolize: copying file `./ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
glibtoolize: copying file `m4/libtool.m4'
glibtoolize: copying file `m4/ltoptions.m4'
glibtoolize: copying file `m4/ltsugar.m4'
glibtoolize: copying file `m4/ltversion.m4'
glibtoolize: copying file `m4/lt~obsolete.m4'
-bash: ./configure: No such file or directory

Still no luck getting it to actually work yet... Any help?

2
You will need to modify the autogen.sh script. libtool is usually installed as glibtool and glibtoolize on OSX. - Brett Hale
Any idea how it needs to be modified? The autogen.sh script only contains the following two lines: #!/bin/sh autoreconf -vfi - kinkersnick
I have altered the autogen.sh script as suggested in the question you linked, but it hasn't worked – see update above - kinkersnick

2 Answers

0
votes

try this:

  1. backup your autogen.sh
  2. delete the libtoolize/libtool check code in the autogen.sh, something like

(libtoolize --version) < /dev/null > /dev/null 2>&1 || { ... }

  1. replace with this :

gprefix=which glibtoolize 2>&1 >/dev/null if [ $? -eq 0 ]; then glibtoolize --force else libtoolize --force fi

4.run autogen.sh again

0
votes

I had to add libtoolize to my $PATH in ~/.bash_profile:

export PATH=/path/that/contains/libtoolize:$PATH

I found the path that contains libtoolize using locate libtoolize