Alternatives to Autoconf and Autotools?

CAutotoolsAutoconf

C Problem Overview


I'm a very frequent user of the GNU Autotools (mostly Autoconf, occasionally Libtool). I'm working on a project where portability is going to be a sticking point.. Yet, the rest of the team is just not comfortable working with m4. I got this in my inbox from not one, but four people:

m4 is NOT lisp, dammit!

Anyway, perhaps someone could recommend something Python or PHP based? I'm working on the C end of a much larger tree; I can be sure either Python or PHP 5 will be present, as they are prerequisites.

C Solutions


Solution 1 - C

I'm taking the chance of being downvoted but, I must admit, that unfortunately there is no real substitute for autotools. CMake, SCons, bjam are nice but, when it comes to serious work... it is quite clear that autotools are superior, not because CMake can't do the same thing, but because it is just much harder to do so with it.

For example, CMake, the most popular alternative to autotools, has the following drawbacks:

  • No support of gettext. This may be a real problem when you need to manage a lot of translations and translated source code.
  • No support for an uninstall target. It is quite unpleasant to find out that you can't uninstall the program you installed.
  • No automatic build of both shared and static libraries.
  • Documentation is very limited and bad.

And so on.

There are many other points. Unfortunately, there is no real high quality substitute for autotools. On the other hand, if you develop on Windows and for Visual Studio, then you can't use autotools and you need to choose CMake that provides such tools.

Solution 2 - C

I've had good success with SCons. It's built with Python and the build scripts are actually Python scripts themselves, which gives a great deal of expressive power. From the web site:

> SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software.

Solution 3 - C

I have heard good things about CMake which tries to solve the same problems. Here is the wikipedia article

Solution 4 - C

There are a lot of different alternative Makefile generators and build systems out there:

Also available, but not stringently targeted on C/C++:

  • Premake
  • Ant (for Java)
  • Rake (for Ruby)
  • (Definitely more, I just don't know them all...)

But after listing these all, autotools have the great advantage of not requiring any other dependency for the end-user. A configure script is only generated once by the developer and does not require anything special on the user end, as it is a shell script. The tools listed above have to be installed before anyone can build your source and they even might have dependencies themselves.

Solution 5 - C

How about simply using Make and pkg-config?

Here is a Makefile template to get you started.

Less is more people.

Solution 6 - C

One more auto* replacement - mk-configure. Docs can be found here

Solution 7 - C

I have had a look at CMake, which looks like a good alternative unless you are cross-compiling. If you are doing native compilation, you should try it

Solution 8 - C

There's a python version of make being created at Mozilla - pymake - which presumably supports cross-platform use.

Solution 9 - C

For building C/C++ software from ANT or maven you might be interested in terp. It includes a portable C++ compiler task that works with many C++ compilers on many platforms.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTim PostView Question on Stackoverflow
Solution 1 - CArtyomView Answer on Stackoverflow
Solution 2 - CGreg HewgillView Answer on Stackoverflow
Solution 3 - CepatelView Answer on Stackoverflow
Solution 4 - CraimueView Answer on Stackoverflow
Solution 5 - ChendryView Answer on Stackoverflow
Solution 6 - CcitrinView Answer on Stackoverflow
Solution 7 - CshodanexView Answer on Stackoverflow
Solution 8 - CPete KirkhamView Answer on Stackoverflow
Solution 9 - CalexView Answer on Stackoverflow