76

I am trying reinstall pacman on my Arch Linux distribution. When I run the configure script "configure.ac", I get a bunch of undefined macros:

error: possibly undefined macro: AM_INIT_AUTOMAKE.
If this token and others are legitimate, please use m4_pattern_allow.
See the autoconf documentation.
error: possibly undefined macro: AC_PROG_LIBTOOL
error: possibly undefined macro: AM_GNU_GETTEXT 
error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
error: possibly undefined macro: AM_CONDITIONAL

Does anyone know what would cause these macros to be undefined? Having come from Ubuntu (where everything just works, and is therefore boring), I don't really know about automake.

4
  • Why are you building from source? Why don't you download the packages on another machine, copy them across and extract them to root as per wiki.archlinux.org/index.php/…
    – jasonwryan
    Commented Aug 13, 2011 at 4:31
  • 1
    It appears that what? Is that the whole sequence of errors? How did you retrieve the source? Commented Aug 13, 2011 at 14:24
  • 2
    Jason, I do not have pacman on my other machine, and I would rather not download another package manager. Plus if I was not building from source I would not have this wonderful opportunity to learn about M4 and automake. Sorry about the bad edit, I removed it. Yes, that is the whole sequence of errors. I retrieved the source from the ArchLinux website at projects.archlinux.org/pacman.git with wget.
    – SirTasty
    Commented Aug 13, 2011 at 20:14
  • 2
    configure.ac is not a configure script and is not runnable.
    – qdii
    Commented Apr 24, 2013 at 23:19

6 Answers 6

87

Try this, maybe it can help:

autoreconf --install

(See the manpage, there is a --force option also)

9
  • cvs program not found; autopoint failed with exit status 1. I am installing cvs from sources, will let you know how it goes.
    – SirTasty
    Commented Aug 13, 2011 at 19:41
  • 1
    @SirTasty: cvs?? hmm, maybe try to use autoconf and automake directly? Commented Aug 13, 2011 at 19:53
  • Autoconf gives me the undefined macro warnings. automake gives me (semicolons separate lines): Makefile.am:2: WANT_DOC does not appear in AM_CONDITIONAL ; Makefile.am: required file ./ChangeLog not found ; configure.ac:57: required file config.h.in not found`
    – SirTasty
    Commented Aug 13, 2011 at 20:10
  • 1
    I'm not an autotools expert (or fan either). Maybe wait for one to show up… By chance, what about aclocal first? Commented Aug 13, 2011 at 20:21
  • I had a similar autoconf error (on redhat fc19) and the autoreconf --install solved it.
    – gaoithe
    Commented May 25, 2015 at 11:14
30

The macros in the error message you posted are defined by automake and libtool; it looks like you need to install those packages.

Then try autoreconf --install

4
  • Both of those packages are installed, or at least "which automake" and "which libtool" return reasonable results.
    – SirTasty
    Commented Aug 13, 2011 at 8:51
  • 2
    @SirTasty Then you probably need to run "autoreconf" as Stéphane suggests. Commented Aug 13, 2011 at 13:51
  • 6
    On my CentOS6.7 system, I had to do this: sudo yum install autoconf automake libtool cmake autoconf-archive gcc-c++ Commented Mar 16, 2017 at 17:54
  • 1
    For me, with the error configure.ac:118: error: possibly undefined macro: AC_MSG_ERROR on Manjaro Linux, installing autoconf-archive did the trick, although another error resulted which has also now been avoided. The other packages were installed. Just for information, further details on that start from github.com/NixOS/nix/pull/3154#issuecomment-545207139.
    – James Ray
    Commented Oct 23, 2019 at 0:55
9

For anybody else looking: While automake and libtool are very likely candidates, some systems won't install gettext automatically. This is also required.

5

Install following packages that would solve the autoreconf issues.

$ sudo apt-get -y install autoconf automake libtool cmake autoconf-archive build-essential
3

I was pretty confused when getting these errors, because I had everything installed and autoreconf --install wasn't helping. The problem was just corrupted aclocal.m4 and deleting it before autoreconf solved the problem.

0

The aclocal.m4 needs to be generated first. aclocal generates the aclocal.m4 file based on the contents of configure.ac

libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .