I had a teeny pet project using GNU assembly that was going to target two platforms.

Instead of keeping my handwritten worst-practices Makefile I decided to try GNU Autotools for the educated reasons of:

  • Text scrolling by looks pretty
  • Vague memories of ./configure make make install tarballs

I got hit with mysterious macro errors, recompile with -fPIE errors (didn’t need this before?), autotools trying to run gcc on a .o file w/ the same options as an .s file, “no rule for all:”, and other things a noob would run into. (I don’t need a bugfix, since my handspun Makefile is “working on my machine” with uname -m.) So there’s a bit of a learning curve here, inhibited by old documentation and more quietly, genAI being shittier than normal in this department

With this I ask:

Do people still use Autotools for non-legacy stuff? If not, what do people choose for a new project’s build system and why?

edit: trimmed an aside

19 points

It’s nicknamed the autohell tools for a reason.

It’s neat but most of its functionality is completely useless to most people. The autotools are so old I think they even predate Linux itself, so it’s designed for portability between UNIXes of the time, so it checks the compiler’s capabilities and supported features and tries to find paths. That also wildly predate package managers, so they were the official way to install things so there was also a need to make sure to check for dependencies, find dependencies, and all that stuff. Nowadays you might as well just want to write a PKGBUILD if you want to install it, or a Dockerfile. Just no need to check for 99% of the stuff the autotools check. Everything it checks for has probably been standard compiler features for at least the last decade, and the package manager can ensure you have the build dependencies present.

Ultimately you eventually end up generating a Makefile via M4 macros through that whole process, so the Makefiles that get generated look as good as any other generated Makefiles from the likes of CMake and Meson. So you might as well just go for your hand written Makefile, and use a better tool when it’s time to generate a Makefile.

(If only c++ build systems caught up to Golang lol)

At least it’s not node_modules

permalink
report
reply
10 points

Wow, you’re right, autotools dev work started a decade prior to Linux 0.01’s release. And looking deeper into ./configure, there looks to be checks running here that only matter on old Solaris systems…

At least it’s not node_modules

They call it a polyfill because it polyfills your disk

permalink
report
parent
reply
5 points

They call it a polyfill because it polyfills your disk

nah, but storage is cheap bro, you really should just buy another hard drive! don’t even think about going below 4 TB, of course!

/s

permalink
report
parent
reply
16 points
*

Meson and CMake are the two major players I’ve seen along autotools. Are they better? In some respects, yes (especially Meson, imo), in others… not really. For a pet project that only targets two platforms, I’d just stick to handwritten worst-practices Makefile. You will likely have less trouble with that than any of the others, simply because you know it already.

permalink
report
reply
2 points

Yeah I was considering using one of these two, out of curiosity.

I’ve heard complaints about CMake… on pre-2015 forums, so I don’t know where it’s at now.

I’ve done very little from the developer side of Meson but I do recall having tried a sound theme that, inexplicably, had a Meson-based installer. (It was just .ogg files iirc.) That’s probably a good sign if someone picked it over an install.sh

Though you’re right, there’s probably little advantage in me not using a Makefile here, except again, curiosity

permalink
report
parent
reply
8 points

autoconf and stuff like this? Not anymore. Since ~5 years here it’s cmake everywhere, Conan, ninja.

permalink
report
reply
7 points

Try Meson first, it should support compiling GNU assembly via the C compiler from what I can find. I’ve been using CMake for years because it is more powerful (finally trying out Meson though for a new project) but in contrary to Meson it is easy to use the wrong way if you don’t know what you’re doing. Meson is very clean in comparison, and also very easy to get started with. (And both these are absolutely better than autotools)

(If only c++ build systems caught up to Golang lol)

Terrible bait

permalink
report
reply
3 points

Terrible bait

Is that considered bait? I’ll remove it, I don’t mean to be hostile.

What do you mean by “more powerful” wrt CMake? Are you referring to, say, integration abilities with other projects (since know CMake is really widely-used)?

Thanks for the advice and the example!

permalink
report
parent
reply
8 points
*

What do you mean by “more powerful” wrt CMake?

CMake is a turing-complete language with some APIs that Meson either doesn’t have an equivalent yet because it’s comparatively new (for example, until 2023, there was no built in way to get a relative path from two paths, and if you wanted that you had to shell out to an external program), or they aren’t going to add because it doesn’t fit their design.

Meson is (intentionally) limited in terms of extensibility, instead it tries to come with everything built in that you need, even down to specific library support like Qt, from what it seems like to me. For example, you cannot define your own functions, it ships builtin modules but does not allow other packages to provide their own (for example like KDE’s Extra CMake Modules), to name a few that I’m familiar with and why I was put off using it so far.

I have yet to see how actually limiting that is, going to try to move the project I’ve been working on for years that relies on some of these CMake features to Meson soon and see how it fares. But considering that big projects like GNOME use it all over the place it’s probably workable in practice, I’ll just have to rethink the existing approach a bit.

Is that considered bait?

Wasn’t it? Go’s build system is very much not what I would call an example of good design (exhibit A: load-bearing comments and file names).

permalink
report
parent
reply
5 points

I use autotools and don’t remember having such issues.

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 8K

    Monthly active users

  • 3.7K

    Posts

  • 48K

    Comments