[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with AC_REQUIRE expansion order
From: |
Eric Blake |
Subject: |
Re: Problem with AC_REQUIRE expansion order |
Date: |
Tue, 05 Aug 2008 21:00:17 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[dropping bug-autoconf]
According to Ralf Wildenhues on 8/5/2008 1:43 PM:
|
|> AC_DEFUN([AC_PROG_CC],
|> +[AC_REQUIRE([_AC_PROG_CC])dnl
|> +m4_expand_once([m4_divert_text([DEFAULTS],
|> + [ac_prog_cc_list=])])dnl
|> +m4_ifval([$1], [m4_divert_text([INIT_PREPARE],
|> + [ac_prog_cc_list='$1'])])dnl
|
| This won't like
| AC_PROG_CC(['cc -m32' "cc -m64"])
Ouch. And that looks like a real possibility of being in existing code.
Oh well, time to update the testsuite to exercise this usage.
|
| and due to how AC_CHECK_TOOLS works, it's not fixed by a simple
| bpatsubst either. Sorry.
And in light of the suggestion in this thread [1], I also have to support
existing code that does:
AC_PROG_CC([$mylist])
[1] http://lists.gnu.org/archive/html/bug-autoconf/2007-03/msg00012.html
Sounds like an eval is in order, along with a m4_bpatsubsts([[$1]], ['],
['\'']) when assigning ac_prog_cc_list, but where exactly to stick the eval?
eval 'for prog in '"$ac_prog_cc_list"'; do echo "$prog" ; done'
works in isolation, but when it comes to AC_CHECK_TOOLS, there's really no
easy way to surround the entire macro inside an eval. So I guess I'm
stuck with:
eval set x "$ac_prog_cc_list"
shift
AC_CHECK_TOOLS(["address@hidden"])
I hope AC_PROG_CC is called after the point at which we can't nuke
address@hidden
Meanwhile, I'll try to build up a test case using your example.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkiZE8EACgkQ84KuGfSFAYD+qgCfYaIZ1NrXt0ZrqlLdJdxYWhrz
Du0AnAxr1EoGAxwQ84XMp3ZirTWebytT
=SraX
-----END PGP SIGNATURE-----