"avoid using Autotools if possible" - why?

I came across the comment below in Generic builder: minimal autoconf example? while getting deeper into Autotools and trying to find / understand the related parts in Nix/pkgs:

Is this an advice in general or only meant for the demonstration project in that thread?


(The linked thread is from 2018, so decided to open a new one instead of necrobumping it.)

Many people don’t like autotools because it is old and very complex.
The reality however is that many big free software projects still use it, precisely because being old and complex also means supporting a lot of platforms and being very stable.

1 Like

It’s one guy’s opinion.
(Though the guy in question is the creator of nix, so make of that what you will.)

In any case, for that specific example, it seems unnecessary to use a build system that’s more complex than the code itself :wink:

1 Like

When things do get big enough to warrant a decent build system, autotools is just an arcane pain to work with. For C stuff, a lot of Nix folks seem to prefer meson, and I tend to agree. It has served the systemd project very well, for instance.

4 Likes

Meson’s great for cross-compilation too! (With only small amounts of patching required for cross unaware upstreams.)

CMake is the worst for cross-compilation and simplicity. Avoid at all cost.

1 Like

Autotools is a gigantic pile of shell script code and m4 templating.
The methods it uses to detect some features are at best questionable. For example it detects if mkdir supports the -p flag not by creating a directory with it but by looking at the copyright header in the --version output.
It supports many arcane platforms which are not very relevant for many years and has collected very hacky shellcode to support all of those posix sh implementations.

Meson also tends to better schedule things and get done quicker with the same project.

5 Likes

My experience with updating Darwin stuff is that Autotools is the most fragile and prone to issues of the various build systems. It’s really annoying when you fix configure.ac or Makefile.am, add autoreconfHook, and the result is a broken mass.

1 Like