Better support of using AUTOCONF environment variable
authorDodji Seketeli <dodji@seketeli.org>
Mon, 10 Dec 2012 15:38:04 +0000 (16:38 +0100)
committerDodji Seketeli <dodji@seketeli.org>
Mon, 10 Dec 2012 20:26:37 +0000 (21:26 +0100)
When I launch gnome-autogen.sh by telling it to use a version of
autoconf that is at a particular path -- by using the AUTOCONF
environment variable -- I can see that there is a spot in the script
that fails to honour that variable.  I thus get the error message
(that I trim to just keep the relevant part):

    AUTOCONF=/my/autoconf AUTOM4TE=/my/autom4te /bin/sh -x /usr/bin/gnome-autogen.sh

    [...]

    +++ find_configure_files /home/dodji/devel/git/gdl/master
    +++ configure_ac=
    +++ test -f /home/dodji/devel/git/gdl/master/configure.ac
    +++ test -f /home/dodji/devel/git/gdl/master/configure.in
    +++ configure_ac=/home/dodji/devel/git/gdl/master/configure.in
    +++ test x/home/dodji/devel/git/gdl/master/configure.in '!=' x
    +++ echo /home/dodji/devel/git/gdl/master/configure.in
    +++ autoconf -t 'AC_CONFIG_SUBDIRS:$1' /home/dodji/devel/git/gdl/master/configure.in
    +++ read dir
    /home/dodji/devel/git/gdl/master/configure.in:8: error: Autoconf version 2.65 or higher is required
    /home/dodji/devel/git/gdl/master/configure.in:8: the top level
    autom4te: /bin/m4 failed with exit status: 63

I think the problem is that the find_configure_files function uses
'autoconf' directly instead of using $AUTOCONF.  So it's taking the
autoconf binary that is in my path, and that one doesn't satisfy the
version requirement of the configure.in script template that is in.
/home/dodji/devel/git/gdl/master/configure.in.

The patch below fixes that essentially by s/autoconf/$AUTOCONF there,
and also by moving the definition point of the AUTOCONF variable --
that is done by a call to version_check -- before the first spot that
actually uses it.

It's worth noting that this bug appears to have been introduced by the
patch attached to bug #510713.

Tested on my Fedora Rawhide system.

* macros2/gnome-autogen.sh (find_configure_files): Use the
AUTOCONF variable, rather than calling the autoconf program
directly.  Remove the now useless comment.
(<at global scope>): Move the definition of the AUTOCONF variable
before its first use.

macros2/gnome-autogen.sh

index 2c40620..71cab72 100644 (file)
@@ -265,6 +265,13 @@ want_gtk_doc=false
 want_gnome_doc_utils=false
 want_maintainer_mode=false
 
+#tell Mandrake autoconf wrapper we want autoconf 2.5x, not 2.13
+WANT_AUTOCONF_2_5=1
+export WANT_AUTOCONF_2_5
+version_check autoconf AUTOCONF 'autoconf2.50 autoconf autoconf-2.53' $REQUIRED_AUTOCONF_VERSION \
+    "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-$REQUIRED_AUTOCONF_VERSION.tar.gz"
+AUTOHEADER=`echo $AUTOCONF | sed s/autoconf/autoheader/`
+
 find_configure_files() {
     configure_ac=
     if test -f "$1/configure.ac"; then
@@ -274,8 +281,7 @@ find_configure_files() {
     fi
     if test "x$configure_ac" != x; then
        echo "$configure_ac"
-       # TODO We have not detected the right autoconf yet!
-       autoconf -t 'AC_CONFIG_SUBDIRS:$1' "$configure_ac" | while read dir; do
+       $AUTOCONF -t 'AC_CONFIG_SUBDIRS:$1' "$configure_ac" | while read dir; do
            find_configure_files "$1/$dir"
        done
     fi
@@ -337,13 +343,6 @@ for configure_ac in $configure_files; do
     fi
 done
 
-#tell Mandrake autoconf wrapper we want autoconf 2.5x, not 2.13
-WANT_AUTOCONF_2_5=1
-export WANT_AUTOCONF_2_5
-version_check autoconf AUTOCONF 'autoconf2.50 autoconf autoconf-2.53' $REQUIRED_AUTOCONF_VERSION \
-    "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-$REQUIRED_AUTOCONF_VERSION.tar.gz"
-AUTOHEADER=`echo $AUTOCONF | sed s/autoconf/autoheader/`
-
 case $REQUIRED_AUTOMAKE_VERSION in
     1.4*) automake_progs="automake-1.4" ;;
     1.5*) automake_progs="automake-1.12 automake-1.11 automake-1.10 automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake-1.5" ;;