GNOME Bugzilla – Bug 377175
autogen.sh unconditionally scans all configure.in files
Last modified: 2007-01-16 07:50:57 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.
Created attachment 76871 [details] [review] Look at CONFIGURE_FILES before doing a search for configure.in files
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.
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.
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...
Mariano, I filed bug #395898 for exactly this problem.
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.