>It has always bothered me a great deal that autoconf required GNU M4 and
>only GNU M4 (though that clearly wasn't the case in the past when I used
>NetBSD M4 with it, and clearly isn't the case today in that it now works
>with the OpenBSD M4). I can readily accept that there are inferior
>implementations of M4 but I cannot accept that something unique called
>"GNUM4", and that goes double if what makes it unique is undocumented
>magic.
The hardest dependency on GNU m4 is the sheer size of generated macro
calls. Most other M4 do have hard coded limits. A large part of my
work on OpenBSD M4 was to remove those limits, which proved to use some
very fun techniques.
After that, a few details of M4 have never been completely documented
from day 1. Like, dnl has fairly simple semantics, but # is completely
different: the concept of a comment that is passed through is something
weird.
The oldest implementations of m4 used to deactivate macro recognition
after # was seen. GNU m4 also deactivates parameter delimitation (,)
after #, which is consistent, but not really mandated, and which I had
to add.
After that, there is one sound design decision of gnu-m4, which is not
to recognize built-ins when they're not followed by (), which I took
(always annoyed me to have to -Uinclude before not tripping on
include/toto.h... besides, makes for less surprises in sendmail, which
is still one of the most basic consumers of m4). This is what makes it
simpler to add builtins without having to worry whether you're changing
the behavior of already existing applications (since barewords won't
match built-ins).
The rest was completely straight-forward, adding builtins is really simple,
even regexp stuff when you've got the right C library... have to cope with
the antiquated conventions of gnu-emacs for compatibility mode, but this
is trivial.
In retrospect, the part which is going to kill most m4 is the hard-coded
limits. autoconf really stretches the limits there, which is also what makes
it such an interesting test application when you're enhancing m4...
--
Marc Espie
|anime, sf, juggling, unicycle, acrobatics, comics...
|AmigaOS, OpenBSD, C++, perl, Icon, PostScript...
| `real programmers don't die, they just get out of beta'