22.3. Guidelines for Writing Macros

You should follow some guidelines when writing a macro. The criteria for a well-written macro are that it should be easy to use, well documented, and, most importantly, portable. Portability is a difficult problem that requires much anticipation on the part of the macro writer. This section discusses the design considerations for using a static Autoconf test at compile time versus a test at runtime. It also covers some of the characteristics of a good macro, including noninteractive behavior, properly formatted output, and a clean interface for the user of the macro.

Get GNU Autoconf, Automake, and Libtool now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.