Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autoconf: dnl vs. #

Tags:

autoconf

The Autoconfig manual states that comment lines can start with either dnl or #.

Is there any difference between them, any reason to use one rather than the other in any circumstance? Or is it purely a matter of taste?

like image 255
DevSolar Avatar asked Jul 30 '10 12:07

DevSolar


People also ask

What is autoconf used for?

GNU Autoconf is a tool for producing configure scripts for building, installing, and packaging software on computer systems where a Bourne shell is available. Autoconf is agnostic about the programming languages used, but it is often used for projects using C, C++, Fortran, Fortran 77, Erlang, or Objective-C.

What is DNL in configure AC?

In configure.ac, lines commented with '#' that occur after AC_INIT will appear in the resulting configure script. dnl comments will not. One purpose of dnl is to discard unwanted newlines in an effort to make the configure script readable.

What is a configure AC file?

The configure.ac file is used to create the ./configure script. It consists of a series of macros which are processed and expanded by autoconf . These macros can check for packages and libraries, handle --enable and --with switches, and generate various files.

What is autoconf package?

Autoconf is an extensible package of M4 macros that produce shell scripts to automatically configure software source code packages. These scripts can adapt the packages to many kinds of UNIX-like systems without manual user intervention.


1 Answers

In configure.ac, lines commented with '#' that occur after AC_INIT will appear in the resulting configure script. dnl comments will not. One purpose of dnl is to discard unwanted newlines in an effort to make the configure script readable. Also, it is appropriate to use dnl comments to document an m4 macro; those comments make no sense in the configure script, since the m4 macro does not appear there, only its expansion.

Comments in Makefile.am are treated differently. Makefile.am is not processed by m4, but by automake, where the convention is to discard lines which begin with ## preceded only by whitespace. (Although ### comments carry through to the Makefile.in) Since Makefile.am is not processed by m4, 'dnl' does not introduce a comment.

like image 148
William Pursell Avatar answered Sep 19 '22 14:09

William Pursell