Comment by xiaoyu2006

Comment by xiaoyu2006 3 months ago

5 replies

Autotools use M4 to meta-program a bash script that meta-programs a bunch of C(++) sources and generates C(++) sources that utilizes meta-programming for different configurations; after which the meta-programmed script, again, meta-programs monolithic makefiles.

This is peak engineering.

1718627440 3 months ago

Yes, that sound ridiculous, but it is that way, so that the user can modify each intermediate step, which is the main selling point. As a user I really prefer that experience, which is why I as a developer put up with the non-sense of M4. (Which I think is more due to M4 being a macro language, then inherent language flaws.)

krior 3 months ago

Sounds like a headache. Is there a nice Python lib to generate all this M4-mumbo-jumbo?

  • lionkor 3 months ago

    "Sounds complicated. I want it to throw exceptions and have significant whitespace on top of all that complexity!"

    • kazinator 3 months ago

      Oh it has significant white space. Make generally doesn't handle paths with spaces, so if you put the build or source directory somewhere where the absolute path has a space, all bets are off.