GNOME Bugzilla – Bug 491773
autoconf failure: .m4 files cannot be found
Last modified: 2009-04-21 17:50:27 UTC
Trying to build pygobject-2.14.0 from scratch on my OS X machine, autoreconf fails with: aclocal:configure.ac:70: warning: macro `AM_CHECK_PYTHON_HEADERS' not found in library aclocal:configure.ac:101: warning: macro `AM_CHECK_PYMOD' not found in library aclocal:configure.ac:70: warning: macro `AM_CHECK_PYTHON_HEADERS' not found in library aclocal:configure.ac:101: warning: macro `AM_CHECK_PYMOD' not found in library configure.ac:70: error: possibly undefined macro: AM_CHECK_PYTHON_HEADERS If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:70: error: possibly undefined macro: AC_MSG_ERROR configure.ac:101: error: possibly undefined macro: AM_CHECK_PYMOD configure.ac:128: error: possibly undefined macro: AS_AC_EXPAND autoreconf: /sw/bin/autoconf-2.60 failed with exit status: 1 This is a regression from what worked in pygobjwect-2.12.3, and appears to be caused by the 2.14.0 tarball not containing the m4/ directory. In 2.12.3, that directory contained .m4 files (python.m4 in particular) that defined those macros. Importing m4/ from 2.12.3 allowed 2.14.0 autoreconf to succeed...looks like that directory just somehow got omitted from the tarball this time?
One other fix is needed (it's been needed for many previous release versions, so I forgot I'd even hacked it locally): the autotools don't even know to look in the m4/ directory for macros. The solution is to add: ACLOCAL_AMFLAGS=-I m4 to the main Makefile.am file.
Still broken in pygopbject-2.14.1, also fails same way on linux, and same solution fixes it there,
the other bug has a patch for that. *** This bug has been marked as a duplicate of 496011 ***
The files exist now (2.14.2), but are still not found (Comment #1 still applies). If I try to recreate the whole autotools from scratch, it still fails: autoreconf -fi aclocal:configure.ac:70: warning: macro `AM_CHECK_PYTHON_HEADERS' not found in library aclocal:configure.ac:117: warning: macro `AM_CHECK_PYMOD' not found in library aclocal:configure.ac:70: warning: macro `AM_CHECK_PYTHON_HEADERS' not found in library aclocal:configure.ac:117: warning: macro `AM_CHECK_PYMOD' not found in library configure.ac:70: error: possibly undefined macro: AM_CHECK_PYTHON_HEADERS If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:70: error: possibly undefined macro: AC_MSG_ERROR configure.ac:117: error: possibly undefined macro: AM_CHECK_PYMOD configure.ac:144: error: possibly undefined macro: AS_AC_EXPAND autoreconf: /sw/bin/autoconf-2.62 failed with exit status: 1 I see that configure.ac has: AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .") but a variable set via AC_SUBST happens during the Makefile.in -> Makefile phase whereas the ACLOCAL_AMFLAGS variable is needed well before Makefile.in is even generated: it needs to be in Makefile.am
2008-07-14 Johan Dahlin <johan@gnome.org> Bug 491773 – autoconf failure: .m4 files cannot be found * Makefile.am: Patch by macks@netspace.org
*** Bug 519079 has been marked as a duplicate of this bug. ***