17

I got an error while trying to compile a library in centOS 7, and i tried reinstall libtool but it does not help. Below is the error

+ autoreconf --install
configure.ac:32: warning: macro 'AM_PROG_LIBTOOL' not found in library
configure.ac:32: error: possibly undefined macro: AM_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
Moses Liao GZ
  • 1,556
  • 5
  • 20
  • 45

2 Answers2

35

I solved it just by:

sudo yum install libtool

SzB
  • 1,027
  • 10
  • 12
10

You might need: autoreconf -fvi to make sure everything is updated.

It's also worth noting that AM_PROG_LIBTOOL is deprecated, and should be replaced with LT_INIT, and optionally with LT_PREREQ beforehand.

Brett Hale
  • 21,653
  • 2
  • 61
  • 90
  • since what version of libtool is AM_PROG_LIBTOOL deprecated in favour of LT_INIT? do you know? I ask because, before I replace it with LT_INIT in my project, I guess I should require this version in LT_PREREQ() call first – knocte Feb 13 '16 at 09:53
  • @knocte - If it's *your* project, then there's no reason why you shouldn't be using the latest autotools to generate the build system. At this time: `LT_PREREQ([2.4.6])` – Brett Hale Feb 15 '16 at 06:12
  • there's always a reason to require older versions instead of latest: reach to a bigger audience of systems/devs, so I want to know the oldest version that supported LT_INIT – knocte Feb 15 '16 at 06:18
  • (`my project` can also mean `open source`, not internal ;) ) – knocte Feb 15 '16 at 06:19
  • 1
    @knocte - but if you `make dist` - i.e., distribute the build system created by *applying* the autotools - the end user doesn't need to have the autotools installed. Which is the whole point:) – Brett Hale Feb 15 '16 at 06:23
  • well, by `end user` I mean the developer that git clones my project, not the one that installs the tarball – knocte Feb 15 '16 at 06:24
  • @knocte - I myself think it's reasonable to expect anyone who is using the autotools in 'maintainer' mode to have the latest versions installed. [Opinions](http://stackoverflow.com/questions/33675547/using-git-for-distribution-with-autotools) will vary about this. – Brett Hale Feb 15 '16 at 06:27
  • why don't you just say that you don't know the first autoconf version that introduced LT_INIT? :) – knocte Feb 15 '16 at 06:40
  • @knocte - because I don't know off-hand. Why not just grep the ChangeLog? – Brett Hale Feb 15 '16 at 07:25
  • it turns out it's not as easy as you think, the first mention of LT_INIT is: `2004-02-23 Gary V. Vaughan * bin/autoreconf.in (autoreconf_current_directory): Recognize LT_INIT from the next generation of Libtool.` But not sure what version is that commit included in, and not sure if that's really the correct commit. – knocte Feb 15 '16 at 07:50