GNU bug report logs - #21352
AC_CONFIG_MACRO_DIRS vs. ACLOCAL_FLAGS: different behavior wrt AM_COND_IF, aclocal fails

Previous Next

Package: automake;

Reported by: Christian Rössel <christian.roessel <at> gmx.de>

Date: Wed, 26 Aug 2015 15:53:01 UTC

Severity: normal

To reply to this bug, email your comments to 21352 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#21352; Package automake. (Wed, 26 Aug 2015 15:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Rössel <christian.roessel <at> gmx.de>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Wed, 26 Aug 2015 15:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christian Rössel <christian.roessel <at> gmx.de>
To: bug-automake <at> gnu.org
Subject: AC_CONFIG_MACRO_DIRS vs. ACLOCAL_FLAGS: different behavior wrt
 AM_COND_IF, aclocal fails
Date: Wed, 26 Aug 2015 17:09:00 +0200
automake 1.15/1.13.4 (other versions not tested)
autoconf 2.69

Dear all,

'AC_CONFIG_MACRO_DIRS([m4])' is supposed to replace 'ACLOCAL_FLAGS = -I 
m4'. Just using AC_CONFIG_MACRO_DIRS works fine unless I have a 
AM_COND_IF in configure.ac that references a <conditional> which is not 
defined in configure.ac but in a m4 file that lives in subdirectory m4. 
In this case aclocal (via autoreconf) fails with

> error: AM_COND_IF: no such condition "<conditional>"

When using 'ACLOCAL_FLAGS = -I m4', autoreconf succeeds.

The difference between AC_CONFIG_MACRO_DIRS and ACLOCAL_FLAGS when 
running autoreconf is that the latter passes '-I m4' to aclocal, the 
former doesn't (but still finds the macros in the m4 subdirectory). As 
ACLOCAL_AMFLAGS will be fully deprecated in Automake 2.0, 
AC_CONFIG_MACRO_DIRS/aclocal needs IMO to be fixed (unfortunately I 
can't help on that).

To reproduce:

$ cat > configure.ac <<'END'
AC_INIT([foo], [0])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([-Wall foreign])
MY_FEATURE
AM_COND_IF([HAVE_MY_FEATURE], [echo "bingo"])
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
END

$ cat > Makefile.am <<'END'
#ACLOCAL_FLAGS = -I m4
END

$ mkdir m4
cat > m4/my_feature.m4 <<'END'
AC_DEFUN([MY_FEATURE], [
AM_CONDITIONAL([HAVE_MY_FEATURE], [test 1 -eq 1])])
END

$ autoreconf -v --install
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal
configure.ac:5: error: AM_COND_IF: no such condition "HAVE_MY_FEATURE"
/opt/packages/afs-dev/01/share/aclocal-1.13/cond-if.m4:23: AM_COND_IF is 
expanded from...
configure.ac:5: the top level
autom4te: /opt/packages/afs-dev/01/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

Best regards,
Christian
-- 




This bug report was last modified 9 years and 295 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.