autotoolsautoconf

possibly undefined macro: AC_MSG_ERROR


I have the following in configure.ac:

AC_CHECK_PROGS(MAKE,$MAKE make gmake,error)
if test "x$MAKE" = "xerror" ;then
  AC_MSG_ERROR([cannot find a make command])
fi

This has been in our project for a long time, but in some set ups, I get this error:

configure.ac:45: error: possibly undefined macro: AC_MSG_ERROR
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.

The lines that were recently added above this:

AC_CONFIG_MACRO_DIR([m4])
LT_INIT

Can anyone explain what causes this error and how to track down the problem?

EDIT: Adding details about the differences.

Box that works:

uname -a Linux host1 2.6.38-13-generic #53-Ubuntu SMP Mon Nov 28 19:33:45 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

automake: 1.11.1
autoconf: 2.67
m4: 1.4.14
libtoolize: 2.2.6b

Box that doesn't work:

Linux host2 2.6.32-35-generic-pae #78-Ubuntu SMP Tue Oct 11 17:01:12 UTC 2011 i686 GNU/Linux

automake: 1.11.1
autoconf: 2.65
m4: 1.4.13
libtoolize: 2.2.6b

NEW EDIT: only 32 bit machines experience this difficulty.

UPDATED I am able to reproduce the problem on a CentOS machine with autoconf 2.67, automake 1.11.1, libtool 2.2.6b, and m4 1.4.14. Is this just a bug with 32-bit machines?


Solution

  • I had this same issue and found that pkg-config package was missing.

    After installing the package, everything generated correctly.