在autotools中,什么是dnl'ed?

时间:2009-10-27 19:12:02

标签: autotools autoconf m4

我在autoconf代码中看到了很多有关dnl'ed而不是dnl'ed的内容。什么是dnl'ed?

2 个答案:

答案 0 :(得分:7)

来自GNU M4 1.4.13 macro processor手册:

  

8.1 Deleting whitespace in input

     

内置dnl代表“放弃下一行”:

     

- 内置: dnl

     
    

除了执行任何宏扩展之外,所有字符(包括下一个换行符)都将被丢弃。如果在没有换行符的情况下遇到文件末尾,则会发出警告。

         

dnl的扩展无效。

  
     

它通常与define结合使用,以删除调用define之后的换行符。因此

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

将放弃包含下一个换行符的输入,而不是处理注释的方式(参见Comments)。

     

[...]

答案 1 :(得分:2)

IIRC,dnldo-next-line。它只是跳过当前行的其余部分。这就是你在M4文件中写评论的方式。

dnl preprocessor will eat this
but not this dnl though this

将产生结果文档

but not this

(未经测试;可能还会终止空闲进程或使硬盘崩溃)。