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)
commit4bb2a2450f67550ae761c75cb7ff2325bad54c8b
tree6d2aa4a95438e8a47c93e9e00673c91f80d03d30
parenta550d04a1b3552373f882f1482166c942e490451
Better support of using AUTOCONF environment variable

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