9 ms·
Strengths, weaknesses, opportunities, and threats facing the GNU Autotools
- themerone 5y agoThe ratio of times autotools checked my system for a Fortran compared to the number of times I compiled something with a Fortran dependancy must be at least 200:1.
- mistrial9 5y agothe detailed feature tests really are intense and strange
- trasz 5y agoAnd pretty much useless.
- viraptor 5y agoYou can disable most of the unnecessary checks. For Fortran / other languages, I believe that's AC_LANG https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Language-Choice.html https://www.gnu.org/software/autoconf/manual/autoconf-2.63/h... Unfortunately the defaults are what they are and many people don't care to fine tune their builds.
- pdw 5y agoNo, OP was referencing a long-standing bug where libtool would force Fortran checks even in projects that didn't need it at all.
- themerone 5y agoI never new it was a bug, I just assumed the Autotools was too complicated for most developers to configure it correctly.
- viraptor 5y agoI'm not familiar with that one and my searches are failing. Have you got a link?
- pdw 5y agoThis StackOverflow question references it: https://stackoverflow.com/questions/4292683/how-do-i-tell-autoconf-not-to-probe-for-fortran-c-etc-when-my-package-is-bui https://stackoverflow.com/questions/4292683/how-do-i-tell-au... It took years for the GNU maintainers to publish a libtool that fixed this bug, and then years for libtool users to upgrade to the new version.
- mort96 5y agoThis is one of my other peeves with the whole GNU build system; they will have serious bugs, they will fix those serious bugs promptly, but then take years to publish a release with the bug fix. My favorite example is when a new version of GNU libc broke GNU m4, then they quickly updated GNU m4 to support the new GNU m4, but they didn't actually release their fix for years. So for something like 2 or 3 years, you literally had a situation where the latest GNU libc couldn't be used to compile the latest GNU m4. I hate GNU so much.
- raverbashing 5y agoThe analysis on the whole seems to make sense What we need is a converter from Autotools to cmake, or some other system and then take Autotools to a farm upstate for retirement
- kergonath 5y agoCmake is just another hair ball, with its arcane syntax and incomprehensible errors. Plus, as mentioned it’s way less friendly to final users who have to compile the code from a tarball without knowing the intricacies of the build system. There is pretty much no advantage in going from autotools to cmake. If there is a jump to make, it’s to something better like meson.
- charcircuit 5y ago>There is pretty much no advantage in going from autotools to cmake. - faster builds - progress indicator
- kergonath 5y agoYes, the project indicator is nice, good point. Personally I haven’t really noticed any big difference in building time, parallel make seems good enough for my uses.
- rurban 5y agoWhat we really need is a tool to convert from an arcane and underpowered silly build tool like cmake to proper autotools, like autoupdate. And then farm cmake to retirement. Or keep it to the poor windows folks. A maintain dozens of mixed autotools, cmake and some header-only/makefile-only projects. The cmake build recipes are constantly behind and fragile. The makefile-only projects are a dirty hack, and very limited. autotools is easily the best, with support for everything. And if it's not in autoconf, then it's in autoconf-archive. meson and ninja are cool, but overkill mostly. We had dozens of such build tools before, and they all died. I even have to teach GNU maintainers how to use autotools/automake properly, as they cannot deal with recursive subdirs, rather have their own configure.in in each subdir. Of course this doesn't scale well.
- jonstewart 5y agoI dearly regret that I adopted autotools for some of my projects. As TFA identifies, the primary problem autotools solved is no longer a problem: Linux, BSD, Darwin, and Cygwin are the targets today and they're more-or-less portable and compliant. Meanwhile, autotools is a constant tax on the development cycle. 1. autoconf is awful to learn. 2. autoconf can be useful in determining the platform, dealing with a few quirks, and ensuring that system dependencies/libraries are satisfied. 3. autoconf's usefulness here is completely undermined by automake, as changing Makefile.am requires rerunning autoreconf, which then requires rerunning configure. So, developers must constantly rerun the configure script, even though nothing about their system environment has materially changed. For example, this happens when a new source file is created and added to Makefile.am. 4. Perhaps the most egregious missing weakness from TFA is acknowledgement that configure scripts are horrifically slow. It's 2022 and developers have their time wasted by configure checking whether printf() exists. 5. automake documentation discourages developers from globbing source files in source directories, and insists they list them individually. It's silly and just results in needless running of configure. 6. The complex interdependencies between generated files is nigh-impossible to understand and reason about. It's cruft. 7. libtool is completely braindead, the absolute worst of it all. It serves absolutely no purpose on contemporary systems, but the docs continue to admonish developers that they must use it to stand a chance of creating a shared library (no, just learn to specify -fPIC). Instead of analyzing a project once, as part of autoconf, libtool determines what to do on the fly for every source file--and all in bash. It doubles a project's compilation time. 8. Creating alternatives to libtool with new autoconf macros, deprecating libtool, and cleansing all traces of it from the planet should absolutely be the highest priority of the autotools project.
- marshallward 5y agoI find autoconf to be good at its job - building a standalone script which runs micro tests - and still use it, but that automake and libtool add very little value for the reasons you described. I do agree that m4 is rather unpleasant to write, and that the resulting tests are too slow (often because user defined macros do a poor job of cacheing) but I also think that these things could be addressed (newer macro languages, bundled or threaded micro-tests) while still preserving the good bits of autoconf.
- rascul 5y agoAs an end user, I like how simple autotools is to build a project: ./configure && make && make install And I like that I can very easily see all the various build options: ./configure --help I don't like that configure takes a long time and checks things that don't seem like they really need to be checked. Nor do I like how difficult autotools is to use as a developer (I have some, but not much experience working on a project using autotools, over a decade ago). I've yet to see a competing build system that makes the end user usage and option discovery as simple. Edit: I've not necessarily used and explored all the various build systems, but the few I have used have generally not been as simple, or at least weren't to me obviously as simple.
- downut 5y agoI build a lot of cmake and meson projects. I was an expert at cmake for quite some time (bleh), but now I use meson for everything I can. The end user experience is in every aspect superior to autotools. There is a small downside for cmake compared to autotools: while you have to install the bits for autotools it runs on a shell. There is a bigger downside for meson: you need a minimal python infrastructure up and working. Over time you need that python infrastructure to keep working. Sometimes it doesn't. I still vastly prefer meson over cmake and much more so autotools. If I have to fix cmake or meson builds, well, really, if you know their languages, it's just no comparison to debugging the 1000s of lines of shell code autotools generates.
- rascul 5y agoI'm not very familiar with meson. I can use cmake to build a project but I don't know how to find various build options without searching through that project's documentation. I probably haven't explored cmake enough.
- throwaway82652 5y agoUse cmake-gui and it lists all the options for you. Or for the manual method, search in the project's cmake sources for lines starting with "option(".
- PaulDavisThe1st 5y agoThe biggest problem I ever encountered with autotools when working on a distributed open source project was that every developer must have the same version of autotools installed. Backward compatibility was never a priority, and if one developer was a single release step ahead of anyone else, they would need some macro changed, removed or added that broke things for everyone else. We switched to waf, which is customarily embedded within the source tree, and that just ends this problem forever.
- stockerta 5y agoAs and end user (as in one who just takes the code and compiles it on his system) I very much prefer autotools. It is much simpler to use.
- charcircuit 5y agoCould you elaborate more on what makes it simpler to use? As an end user and for writing build stuff it both seems to be more complicated than its competitors.
- IshKebab 5y agoSimpler to use than what? It's not simpler to use than CMake which is what has replaced it for almost everyone.
- marsven_422 5y ago
- deleted 5y ago[deleted]
- smartmic 5y agoThere is a really great book for everyone who seriously wants to learn autotools: Autotools: a practitioner's guide to GNU Autoconf, Automake, and Libtool / by John Calcote (2nd edition from 2020) This is not specific to Autotools, but I like learning from well-structured books written by experts in its fields. The book provides a good path on how to handle this rather complex collection of tools without searching and jumping from one obscure internet resource to the other. And after a few hours of reading and experimentation, Autotools are not so unapproachable any more as the common preconception suggests. I agree with others that, once understood and the entry barrier removed, Autotools can be used quite pragmatically and are probably not harder to grasp as competitors in the field.
- flohofwoe 5y agoAs someone who started coding cross-platform C/C++ stuff in the mid-90's with Windows being the main platform, I never understood the appeal of autotools. Trying to compile any C/C++ project which used autotools+make on Windows never worked out of the box, best one could was trying to generate a Makefile (and config headers) on a Linux system and hope that it works on Windows (which it actually did surprisingly often because most C/C++ code was portable enough to not actually need any system-specific configuration). Later it dawned on me that autotools did actually make sense at one time, when there have been dozens of competing UNIX implementations which hadn't been standardized yet. But that time is long gone, autotools no longer has a purpose, just let it rest.
- blippage 5y agoI use autotools for an OS project I have. But here's the thing: AFAIK lua builds from just a Makefile. libopencm3 also builds from just a Makefile, and it will build multiple examples for multiple microcontrollers. The BSD guys seem to do just fine with Makefiles. So, could we not just add a few features to Makefiles so that we can do away with all this other infrastructure? Personally, I just try to use Makefiles wherever possible. My heart sinks when someone comes out with a new build tool. If you must have a build tool, use either autotools or cmake. Please please please don't introduce some new shiny toy that is "autotools done right" but in practise is at least as much pain. And, for the love of all that is holy, don't write your build tool in Python. There's nothing wrong with Python. It just doesn't belong in build systems. Build systems should be written in C or C++, and nothing else. Not Rust, not Haskell, not anything else.
- AHTERIX5000 5y agoWell if you have a library or app without dependencies producing working Makefile for multiple platforms can work as with lua. But the moment you start introducing dependencies on external libraries everything breaks very easily even between different flavors of Linux and build tools such as automake or cmake can mitigate the problem of finding correct paths and names. No-one loves such tools but they are not used without a reason.
- trasz 5y agoDependencies are handled by pkg-config, not autotools.
- bjourne 5y agoI've been using WAF for years and it is indeed written in Python. For complex configuration+build+deployments you need a scripting language and Python is probably the best language for that purpose. Because if you already know Python you don't need to learn a new language.
- jpe90 5y agoMy main grievance with guile scheme is that libraries are often distributed with autotools. The installation scripts are very brittle and I've had to spend a lot more time than I'd like picking apart how they work.
- GartzenDeHaes 5y agoI gave up on autotools and wrote a small c program that compiles the project along with a configure script that compiles the compile program. Never again will I waste hours diagnosing the latest inexplicable autotools script error. Yes, someone compiling the project on some weird system will have to spend one or two minutes editing my "make.c" program. I wish them well.
- phendrenad2 5y agoI have a simple Ruby script that invokes clang to compile each .c file and then link them together. It's extremely fast for plain C code, even without doing the smart thing and only recompiling changed files.