GNOME Bugzilla – Bug 608285
GNOME_COMMON_INIT() does not work with autoreconf
Last modified: 2010-05-30 20:49:03 UTC
<jjardon> also, what is better, use GNOME_COMMON_INIT() or manuall add the gile to Makefile.am? <danielk> I'd would set "ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}" in Makefile.am <danielk> this will make it all work and will be picked up by autoreconf
The automake manual says to just set ACLOCAL_AMFLAGS=-I m4. Why do you add the ACLOCAL_FLAGS env var too? Also, when you say to add -I m4, you ought to also say to declare it using AC_CONFIG_MACRO_DIR() in configure.{in,ac}.
First, I don't think this bug is fixable, since GNOME_COMMON_INIT() sets up variables at configure time which autoreconf needs to know statically at a time even before Autoconf has run. (In reply to comment #1) > The automake manual says to just set ACLOCAL_AMFLAGS=-I m4. Why do you add the > ACLOCAL_FLAGS env var too? Also, when you say to add -I m4, you ought to also > say to declare it using AC_CONFIG_MACRO_DIR() in configure.{in,ac}. The ACLOCAL_AMFLAGS assignment in the top-level Makefile.am is extracted by autoreconf, and the assigned value is appended to the aclocal command-line. Now, many users expect ACLOCAL_FLAGS to be honored as well, but autoreconf won't pick it up from the environment automatically. Thus the expansion of ${ACLOCAL_FLAGS} in ACLOCAL_AMFLAGS, which will work with autoreconf because it evaluates it in the shell. It also ensures that ACLOCAL_FLAGS will be picked up when aclocal is invoked by make during the build. (Side note: jhbuild solves the same problem by appending the value of ACLOCAL_FLAGS to the ACLOCAL environment variable, relying on word splitting by the shell. That's rather ugly in my opinion, and not necessary if ACLOCAL_AMFLAGS include the expansion of ACLOCAL_FLAGS.) And yep, AC_CONFIG_MACRO_DIR() should be used literally in configure.ac so that tools which parse configure.ac can extract the macro directory name from it. This is an independent matter. Note that the ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} trick is used throughout the C++ binding modules, and it's always been working sweetly for us.
Created attachment 153687 [details] [review] Remove GNOME_COMMON_INIT
Comment on attachment 153687 [details] [review] Remove GNOME_COMMON_INIT We can't just remove the macro, it'll break all configures out there using it. Let's just deprecate it, maybe even adding a AC_MSG_WARN([... deprecated...]) to it.
Created attachment 153746 [details] [review] Deprecate GNOME_COMMON_INIT()
Simply changing the AC_DEFINE to AU_DEFINE should make the extra warning unnecessary.
Hello Christian, I think you mean AU_DEFUN: AU_DEFUN (old-macro, implementation, [message]) the problem here is that GNOME_COMMON_INIT() should not be used, so there is not a replacement macro.
Fixed on master.