-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Vincent Torri on 11/29/2009 3:17 AM: >> m4_pushdef([UP], m4_toupper([$1]))dnl >> m4_pushdef([DOWN], m4_tolower([$1]))dnl >> >> and everything else should fall into place. For example, > > it seems to work with autoconf 2.64 and 2.65. It works on 2.65. On 2.64, it is underquoted, but as long as you don't have any macro with the same name as $1 (once converted to the resulting case), it is safe. And if you followed decent rules about always using decent macro namespacing, then yes, it is sufficient. >>> have_ecore_[]m4_defn([DOWN])=no > > i don't understand what i have to change here. Nothing - I was just pointing out how the behavior of this line depends on whether the previous pushdef involved an extra set of quotes. > well, m4 quoting is still like voodoo magic for me. I guess i have to > carefully read the doc... And if you have any suggestions for how we can make the doc better, I'm all ears. > >> In order to write a configure.ac script that will work with both 2.64 and >> younger, and with 2.65, you will need a wrapper function. Here's one way >> to write it: >> >> m4_pushdef([AAA],[BBB])dnl >> m4_if(m4_toupper([aaa]),[BBB], >> [m4_define([my_toupper],[m4_toupper([[$1]])])], >> [m4_copy([m4_toupper], [my_toupper])]) >> m4_popdef([AAA]) > > I really use AAA, BBB and aaa ? (that sounds like a really stupid > question) or should I replace them by something ? I meant for AAA to be used literally. But on re-reading that, it won't work (if you have a macro BBB defined). So, even better: m4_pushdef([AAA],[---])dnl m4_if(m4_toupper([aaa]), [---], [m4_define([my_toupper], [m4_toupper([[$1]])])], [m4_copy([m4_toupper], [my_toupper])]) m4_popdef([AAA]) The point was to use a snoop whether the result of m4_toupper is further macro expanded, by temporarily defining a macro of the resulting case and seeing if it gets expanded. It doesn't matter what name you use for the temporary macro (I used aaa/AAA), but whether the first argument to m4_if uses a lower case name and the temporary macro is the same name in upper case. - -- Don't work too hard, make some time for fun as well! Eric Blake ebb9@xxxxxxx -----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/ iEYEARECAAYFAksTw00ACgkQ84KuGfSFAYB+mACfYBKueB609XEcWQO4K1tUDF71 r2wAnjOBBb3xxZufUsfnvGoWlj6eMDMM =O187 -----END PGP SIGNATURE----- _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf