Re: why doesn't this macro work!?

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

 



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

Please don't top-post on technical lists.

According to John Wohlbier on 3/8/2009 12:42 AM:
>> but other variations give me
>> -DDBC=\$withval
>> -DDBC=\$DBC
>>
>>                 AC_MSG_NOTICE([setting level of DBC to $withval])
>>                 AC_DEFINE(DBC, $withval)

> Of course I figured it out the minute after I sent the mail.
> AC_DEFINE_UNQUOTED.
> I can't claim to understand exactly why, but it works.

AC_DEFINE behaves as if it is part of a quoted shell here-doc (cat
<<\EOF), hence things such as $ are taken literally.  AC_DEFINE_UNQUOTED
behaves as if it is part of an unquoted shell her-doc (cat <<EOF), so
variable expansions can occur.  Thus, any time you want shell expansions,
you are correct that you have to use the alternate macro.

Meanwhile, you are missing recommended m4 quoting; the better way to write
this would be:

AC_DEFINE_UNQUOTED([DBC], [$withval])

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

iEYEARECAAYFAkmz2N8ACgkQ84KuGfSFAYDpRACguJMHck6fzOvl9Obx9xHvk7lC
3T0An1CvOamTTZWBPl8CdRWRK4Sk+vm1
=837D
-----END PGP SIGNATURE-----


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux