autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iterating over arguments


From: Eric Blake
Subject: Re: iterating over arguments
Date: Mon, 14 Sep 2009 06:31:13 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 9/11/2009 8:40 PM:
> This assumes that your arguments to CL_CLISP_REQUIRE_FEATURE won't cause
> further macro expansion or quote removal; to be safer, you'd have to use
> m4_defn([cl_feat]) rather than cl_feat in several places.  Also, if you
> are requiring newer autoconf, it may be more efficient to use
> m4_map_args_w rather than m4_foreach_w:
> 
> m4_define([_CL_CLISP_REQUIRE_FEATURE_1],
> [_CL_CLISP_REQUIRE_FEATURE_2([$1], m4_toupper([$1]))])
> m4_define([_CL_CLISP_REQUIRE_FEATURE_2],
> [AC_CACHE_CHECK([for $2 in CLISP], [cl_cv_clisp_$1],
>   [CLISP_SET([cl_cv_clisp_$1], [[#+$1 "yes" #-$1 "no"]])])
> test $cl_cv_clisp_$1 = no && AC_MSG_ERROR([$2 is missing in CLISP])])
> AC_DEFUN([CL_LISP_REQUIRE_FEATURE],
> [m4_map_args_w([$1], [_CL_CLISP_REQUIRE_FEATURE_1(], [)], [
> ])

I haven't seen any mention of you trying this variant; it still uses
m4_toupper, but avoids m4_pushdef of a temporary macro name, and so it may
react better to the fact that m4_toupper does not quote its argument.  At
any rate, using 'autoconf --trace=_CL_CLISP_REQUIRE_FEATURE_2' would show
what the result of m4_toupper turns out to be in this case.

- --
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/

iEYEARECAAYFAkquN5EACgkQ84KuGfSFAYB6KgCguBUQeBpNn6ZefdzmduLQAHLE
YZkAoLhWYDB6LGBJcr/pV3LbM9SWx+0h
=2jZ3
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]