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 377175 - autogen.sh unconditionally scans all configure.in files
autogen.sh unconditionally scans all configure.in files
Status: RESOLVED FIXED
Product: gnome-common
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Gnome Common Maintainer(s)
Gnome Common Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-11-19 22:27 UTC by Mariano Suárez-Alvarez
Modified: 2007-01-16 07:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Look at CONFIGURE_FILES before doing a search for configure.in files (1.05 KB, patch)
2006-11-19 22:28 UTC, Mariano Suárez-Alvarez
none Details | Review
A better patch (1.27 KB, patch)
2006-12-02 08:24 UTC, Mariano Suárez-Alvarez
none Details | Review

Description Mariano Suárez-Alvarez 2006-11-19 22:27:31 UTC
gnome-autogen.sh unconditionally does

configure_files="`find $srcdir -name '{arch}' -prune -o -name '_darcs' -prune
-o -name '.??*' -prune -o -name configure.ac -print -o -name configure.in
-print`"

to get the list of configure.in files to scan to see what the package wants.

This can be a problem is the package includes a configure.in which requests something which the package explicitely does not want, as an example, say. A Real World example is on bug 376908.

Here comes a patch that only sets configure_files using the above command when the environment variable CONFIGURE_FILES is not set; when it is set, it simply uses its value. This allows complete control in the (rare) cases when it is needed.
Comment 1 Mariano Suárez-Alvarez 2006-11-19 22:28:25 UTC
Created attachment 76871 [details] [review]
Look at CONFIGURE_FILES before doing a search for configure.in files
Comment 2 Mariano Suárez-Alvarez 2006-12-02 08:24:30 UTC
Created attachment 77528 [details] [review]
A better patch

This is a small variation of the previous patch, using CONFIGURE_AC_FILES instead of CONFIGURE_FILES, because it is more precise. 

<jamesh> and autogen.sh runs configure
<jamesh> you can do "cvs checkout foo", change to the "foo" directory, create a "build" subdir, and then run "../autogen.sh" in the build subdir
<jamesh> in that case, configure_files would contain "../configure.ac" rather than "./configure.ac"
<mariano> can't one turn CONFIGURE_FILES into a list of dirs relative to $topsrcdir?
<jamesh> whose responsibility should it be to do that?
<mariano> autogen's I guess
<mariano> nothing else has been run before that ;-)
<jamesh> okay.  Then the patch needs to do that :)
<mariano> so, you want the dirs to be offset rel to the location of autogen.sh?
<jamesh> I mean, is it the responsibility of the package's autogen.sh stub, or the common gnome-autogen.sh script?
<mariano> ah
<jamesh> they'd need to be relative to $srcdir
<mariano> gnome's
<mariano> that makes it easier to get it right without people knowing about builddir ;-)
<mariano> realtive to srcdir as set in the package autogen.sh, then
<jamesh> well, whatever $srcdir is set to by the time your patch was checking $CONFIGURE_FILES

I thought a bit more about this and the conclusion was that this patch does not do any offsetting to srcdir: if one looks are autogen.sh scripts on gnome's cvs, one notices they are already offsetting things to $srcdir manually, so it would be more confusing than helpful to have CONFIGURE_AC_FILES *not* be manually offset.

This patch does remove (with a warning) files that do not exist from the variable, as a minor sanity check.
Comment 3 Shaun McCance 2007-01-12 19:18:49 UTC
Christian had the wonderful idea of just skipping configure.(ac|in) files in directories with a NO-AUTO-GEN file, which solves the problem from #376908 well.  Closing this bug.
Comment 4 Mariano Suárez-Alvarez 2007-01-16 04:29:54 UTC
For the record, Christian's idea only partially works: if you have a subdir with its own autogen.sh and configure.ac, which should *not* be picked up when autogen'ing the main project, but which should work correctly when autogen'ed itself, then putting a NO-AUTO-GEN dir in the subdir breaks (one could special-case . when computing configure_files, of course...)

I had considered NO-AUTO-GEN originally and rejected it for this reason. It is probably abstract, so...
Comment 5 Shaun McCance 2007-01-16 05:45:38 UTC
Mariano, I filed bug #395898 for exactly this problem.
Comment 6 Mariano Suárez-Alvarez 2007-01-16 07:50:57 UTC
This got fixed by <http://svn.gnome.org/viewcvs/gnome-common/trunk/macros2/gnome-autogen.sh?rev=3899&r1=3898&r2=3899>; probably useful to know in order to get to bug 395898.