3 ms·
I don't recommend learning how to use Autotools unless you need to work on a project that uses it (and even then, try to avoid it). Highly recommend learning C
by sfpotter 4y ago
I don't recommend learning how to use Autotools unless you need to work on a project that uses it (and even then, try to avoid it).
Highly recommend learning CMake or Meson instead.
If you're just getting started, there's no need to tie yourself into knots learning "how to set up a project the right way". It's a waste of time. Your time would initially be better spent just calling the C compiler directly. This will help you learn a bit about the compilation and linking phase and will expose you to the C compiler's flags---useful skills for debugging automated builds later. Once you get to the point where you are working on a larger project, then you will be in a better position to decide what build tools are most useful for you.
- liendolucas 4y ago> If you're just getting started, there's no need to tie ... Yes, this is sane advice! Note that I'm not promoting autotools, I personally suffered it a lot before I got it for my builds, but is a tool that can be reliable across platforms. Yes I would leave the "how to set up a project" for the time when you really need it, no need to spend time on this if you're learning a language.
- varjag 4y agoYou probably don't need autotools as a beginner but if you intend to study those it makes no point starting with cmake. This is more of a C++ crowd thing with tiny mindshare among C programmers.
- tmtvl 4y agoI disagree, I find autoconf and automake very pleasant in operation. Mainly due to the OOTB support for things like bindir, libdir, and so on, all properly documented via /path/to/configure --help.
- mikewarot 4y agoI have a C project I picked up (and got working thanks to help from HN users) that was heavily dependent on Autotools. I wanted to be able to compile it under Windows and couldn't make heads nor tails of it. After guessing and tweaking a config.h file to replace the one it didn't create, I was finally able to get gcc to compile everything using a batch file. Eventually I'll be purging Autotools, make and all build systems, replacing it with a single batch file that wipes the slate then compiles. It only takes a few seconds to run, and removes a huge set of dependencies. I hope to port the code to run under the Cosmopolitan library so I can be cross-platform and more.