On 06/11/2011 03:32 AM, Luca Formaggia wrote: > Dear all, > > I am rather new to Autoconf and I could not find an answer to this > question in the manual. I would like to know if there is a command to > produce > conditional defines. Something that from > > AC_CONDEFINE(FOO, "1") > > would produce > > #ifndef FOO > #define FOO 1 > #endif According to the manual, doing this directly in config.h is discouraged; you should instead strive to make config.h self-contained (perhaps by having your separate libraries define separate macro names, then in a non-config.h header you can probe all of those macro names to determine whether to define FOO). http://www.gnu.org/software/autoconf/manual/autoconf.html#Header-Templates However, it is indeed possible to use AH_VERBATIM to produce a template that looks like: #ifndef FOO # undef FOO #endif for inclusion into config.h.in; at which point the #undef FOO line will be replaced with either a comment or a #define FOO value line by config.status. Gnulib's size_max.m4 is an example of this idiom: http://git.savannah.gnu.org/cgit/gnulib.git/tree/m4/size_max.m4 -- Eric Blake eblake@xxxxxxxxxx +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx https://lists.gnu.org/mailman/listinfo/autoconf