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

According to sundeep singh on 1/23/2007 11:38 PM:
> Hi,
> I have a file in which I want to conditionally include text, something like
> #ifdef DEBUG
>     print" abc....";
>     do something;
> #else
>     print" 123....";
>     do something else; 
> #endif
> How do I achieve this functionality with m4?

The ifelse and ifdef builtins:

ifdef(`DEBUG',
`   print" abc....";
   do something;',
`   print" 123....";
   do something else;')

See also
http://www.gnu.org/software/m4/manual/html_node/Conditionals.html#Conditionals,
(also available as 'info m4 conditionals' if you installed the
documentation properly), and let us know if there is anything we can do to
improve the manual.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFt1n384KuGfSFAYARAnB9AKDS1Czn/lyvPIVUmD2BGP39e/UzWwCaA6Ly
jsFssKp2cKNQUVTSRZMjAOM=
=aYQ7
-----END PGP SIGNATURE-----


_______________________________________________
M4-discuss mailing list
M4-discuss@gnu.org
http://lists.gnu.org/mailman/listinfo/m4-discuss

Reply via email to