After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608285 - GNOME_COMMON_INIT() does not work with autoreconf
GNOME_COMMON_INIT() does not work with autoreconf
Status: RESOLVED FIXED
Product: gnome-common
Classification: Core
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Gnome Common Maintainer(s)
Gnome Common Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-01-27 19:55 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-05-30 20:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove GNOME_COMMON_INIT (1.21 KB, patch)
2010-02-13 05:06 UTC, Javier Jardón (IRC: jjardon)
rejected Details | Review
Deprecate GNOME_COMMON_INIT() (1.07 KB, patch)
2010-02-14 03:59 UTC, Javier Jardón (IRC: jjardon)
none Details | Review

Description Javier Jardón (IRC: jjardon) 2010-01-27 19:55:15 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
Comment 1 Christian Persch 2010-01-27 20:02:27 UTC
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}.
Comment 2 Daniel Elstner 2010-02-02 18:47:11 UTC
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.
Comment 3 Javier Jardón (IRC: jjardon) 2010-02-13 05:06:21 UTC
Created attachment 153687 [details] [review]
Remove GNOME_COMMON_INIT
Comment 4 Christian Persch 2010-02-13 12:41:48 UTC
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.
Comment 5 Javier Jardón (IRC: jjardon) 2010-02-14 03:59:22 UTC
Created attachment 153746 [details] [review]
Deprecate GNOME_COMMON_INIT()
Comment 6 Christian Persch 2010-02-17 22:29:00 UTC
Simply changing the AC_DEFINE to AU_DEFINE should make the extra warning unnecessary.
Comment 7 Javier Jardón (IRC: jjardon) 2010-02-23 23:31:09 UTC
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.
Comment 8 Christian Persch 2010-05-30 20:49:03 UTC
Fixed on master.