[PATCH] really fix path expansion in hal-info

Andreas Hanke andreas.hanke at gmx-topmail.de
Wed Mar 21 14:33:55 PDT 2007


Hi,

this patch for hal-info really fixes configure path expansion in
hal-info by simply removing it, because it plain and simple doesn't
work. A ./configure invocation without arguments and with autoconf >=
2.60 currently prints the following:

                    hal-info 20070313
                  ========================

        prefix:                     /usr/local
        datadir:                    ${prefix}/share
        sysconfdir:                 /usr/local/etc
        hardware recall data:       yes
        video suspend data:         yes

As you can easily see, sysconfdir is expanded, but datadir is not.
That's because AS_AC_EXPAND messes around with autoconf internals that
have changed in autoconf 2.60.

It pretends to expand things, but doesn't actually do it. The proper fix
for that is to stop messing around with autoconf internals, i.e. to not
use AS_AC_EXPAND any more.

With the attached patch, configure prints all variables unexpanded and
as derived from each other, which is the truth. With autoconf 2.60 it
looks like this:

                    hal-info 20070313
                  ========================

        prefix:                     /usr/local
        datarootdir:                ${prefix}/share
        datadir:                    ${datarootdir}
        sysconfdir:                 ${prefix}/etc
        hardware recall data:       yes
        video suspend data:         yes

With autoconf 2.59 it looks a little different because it does not have
datarootdir yet:

                    hal-info 20070313
                  ========================

        prefix:                     /usr/local
        datarootdir:                unused
        datadir:                    ${prefix}/share
        sysconfdir:                 ${prefix}/etc
        hardware recall data:       yes
        video suspend data:         yes

There is no need to worry about unexpanded variables in output files
because hal-info does not have any. It has only Makefiles as output
files and in Makefiles, variables don't need to be expanded. In fact
they must not be expanded because that would prevent users from
redefining them while running make. This is the reason why stock
autoconf without AS_AC_EXPAND-style hacks does not offer any way to
expand them. If it had any output files where variables have to be
expanded, dedicated make rules would have to be written for them. See:

http://www.gnu.org/software/autoconf/manual/html_node/Installation-Directory-Variables.html#Installation-Directory-Variables
http://www.gnu.org/software/autoconf/manual/html_node/Defining-Directories.html

Other than the hal patch I submitted via bugzilla some time ago, which
was just a sample that somehow went in, this one is a distcheck tested
patch that can be applied as-is. It also removes two incorrect and
superfluous AC_SUBST usages as well as the GTK_DOC_CHECK which hal-info
never actually used at all.

hal itself needs more changes to entirely get rid of AS_AC_EXPAND and
comply with autotools coding rules. The good news is that in *most*
places it already does the right thing, but not everywhere. I can work
on a patch for that as well, if desired.

Andreas Hanke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-info-autoconf.patch
Type: text/x-patch
Size: 4335 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070321/aef322e6/hal-info-autoconf.bin


More information about the hal mailing list