Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In autotools, what is dnl'ed?

I see a lot in autoconf code about stuff being dnl'ed and not dnl'ed. What is dnl'ed?

like image 972
Crazy Chenz Avatar asked Oct 31 '25 00:10

Crazy Chenz


2 Answers

from the GNU M4 1.4.13 macro processor manual:

8.1 Deleting whitespace in input

The builtin dnl stands for “Discard to Next Line”:

— Builtin: dnl

All characters, up to and including the next newline, are discarded without performing any macro expansion. A warning is issued if the end of the file is encountered without a newline.

The expansion of dnl is void.

It is often used in connection with define, to remove the newline that follows the call to define. Thus

   define(`foo', `Macro `foo'.')dnl A very simple macro, indeed.
   foo
   ⇒Macro foo.

The input up to and including the next newline is discarded, as opposed to the way comments are treated (see Comments).

[...]

like image 55
ax. Avatar answered Nov 02 '25 13:11

ax.


IIRC, dnl is do-next-line. It simply skips the remainder of the current line. It's how you write comments in M4 files.

dnl preprocessor will eat this
but not this dnl though this

will yield the result document

but not this

(untested; might also kill the idle process or crash your hard disk).

like image 21
Dirk Avatar answered Nov 02 '25 13:11

Dirk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!