Next: , Previous: Syslog, Up: Usage


8.3 GNU Programs: how to avoid nana sometimes

Imagine you1 are building a GNU program. Ideally it should run on systems without any other software including GCC, GDB and even Nana.

To achieve this noble goal you can provide your configure script with a ‘--without-nana2 flag which then ‘#define's’ ‘WITHOUT_NANA’. You should also use the ‘VL’ macro rather than ‘L’ macro since ‘L’ takes a variable number of arguments and will break non GNU C preprocessors.

     int half(int n) {
       /* Don't use L(...) since it takes a variable number of args! */
       VL(("hello world = %d\n", 10)); /* Note the doubled (( */
       ...;
     }

Footnotes

[1] Gordon Matzigkeit contributed some of the ideas presented here and raised this problem.

[2] Or add a ‘--with-nana’ flag to configure that does the opposite.