Comment by IshKebab

Comment by IshKebab 3 months ago

22 replies

I don't think it's fair to say "because they are lazy or don't understand". Who would want to understand that mess? It isn't a virtue.

A fairer criticism would be that they have no sense to use a more sane build system. CMake is a mess but even that is faaaaar saner than autotools, and probably more popular at this point.

smartmic 3 months ago

I took the trouble (and even spent the money) to get to grips with autotools in a structured and detailed way by buying a book [1] about it and reading as much as possible. Yes, it's not trivial, but autotools are not witchcraft either, but as written elsewhere, a masterpiece of engineering. I have dealt with it without prejudice and since then I have been more of a fan of autotools than a hater. Anyway, I highly recommend the book and yes, after reading it, I think autotools is better than its reputation.

[1] https://nostarch.com/autotools2e

  • [removed] 3 months ago
    [deleted]
xiaoyu2006 3 months ago

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 2 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.

knorker 3 months ago

autotools is the worst, except for all the others.

I'd like to think of myself as reasonable, so I'll just say that reasonable people may disagree with your assertion that cmake is in any way at all better than autotools.

  • IshKebab 3 months ago

    Nope, autotools is actually the worst.

    There is no way in hell anyone reasonable could say that Autotools is better than CMake.

    • knorker 3 months ago

      My experience with cmake, though dated, is that it's simpler because it simply cannot do what autotools can do.

      It really smelled of "oh I can do this better", and you rewrite it, and as part of rewriting it you realise oh, this is why the previous solution was complicated. It's because the problem is actually more complex than I though.

      And then of course there's the problem where you need to install on an old release. But the thing you want to install requires a newer cmake (autotools doesn't have this problem because it's self contained). But this is an old system that you cannot upgrade, because the vendor support contract for what the server runs would be invalidated. So now you're down a rabbit hole of trying to get a new version of cmake to build on an unsupported system. Sigh. It's less work to just try to construct `gcc` commands yourself, even for a medium sized project. Either way, this is now your whole day, or whole week.

      If only the project had used autotools.

      • IshKebab 3 months ago

        No, CMake can do everything Autotools does, but a hell of a lot simpler and without checking for a gazillion flags and files that you don't actually need to but you're checking them anyway because you copied the script from a someone who copied the script from... all the way back to the 90s when C compilers actually existed that didn't have stdint.h or whatever.

        CMake is easy to upgrade. There are binary downloads. You can even install it with pip (although recently the Python people in their usual wisdom have broken that).

    • jeroenhd 3 months ago

      I've seen programs replicate autotools in their Makefiles. That's actually worse. I've also used the old Visual Studio build tooling.

      Autotools is terrible, but it's not the worst.

    • pletnes 3 months ago

      Configure-make is easier to use for someone else. Configuring a cmake based project is slightly harder. In every other conceivable way I agree 100% (until someone can convince me otherwise)

    • tpoacher 3 months ago

      And presumably the measure by which they are judged to be reasonable or not is if they prefer CMake over Autotools, correct? :D

      • ordu 3 months ago

        Correct. I avoid autotools and cmake as much as I can. I'd better write Makefiles by hand. But when I need to deal with them, I'd prefer cmake. I can can modify CMakeLists.txt in a meaningful way and get the results I want. I wouldn't touch autotools build system because I never was able to figure out which of the files is the configuration that is meant to be edited by hands and not generated by scripts in other files. I tried to dig the documentation but I never made it.

NekkoDroid 3 months ago

> CMake is a mess but even that is faaaaar saner than autotools, and probably more popular at this point.

Having done a deep dive into CMake I actually kinda like it (really modern cmake is actually very nice, except the DSL but that probably isn't changing any time soon), but that is also the problem: I had to do a deep dive into learning it.

kazinator 3 months ago

Someone who doesn't want to understand a huge mess should probably not be bringing it into their project.

In software you sometimes have to have the courage to reject doing what others do, especially if they're only doing it because of others.