GNU-M4: Strip empty lines

m4, preprocessor

Solution

I use `divert()` around my definitions :

- `divert(-1)` will suppress the output

- `divert(0)` will restore the output

Eg:

divert(-1)dnl output supressed starting here

define(..)

define(..)

divert(0)dnl normal output starting here
use_my_definitions()...

Problem

How can I strip empty lines (surplus empy lines) from an input file using M4? I know I can append `dnl` to the end of each line of my script to suppress the newline output, but the blank lines I mean are not in my script, but in a data file that is included (where I am not supposed to put `dnl's`). I tried something like that: ``` define(` ',`') ``` (replace a new-line by nothing) But it didn't work. Thanks.

Original source