[clug] Why the autotools hate? (Was: Why isn't Java popular on the Linux Desktop?)

Jack Kelly endgame.dos at gmail.com
Fri Jul 10 00:40:22 MDT 2009


On Fri, Jul 10, 2009 at 4:13 PM, Brad Hards<bradh at frogmouth.net> wrote:
> My dislikes are based on some very unfortunate syntax changes, and some not
> very good use of what autoconf (and to a lesser extent, automake) can do. As
> examples:

Can you elaborate w.r.t. the syntax changes? I only started using
autotools at around autoconf 2.61 and automake 1.10 (or autoconf 2.56
and automake 1.7 on MSYS.)

> * I still have trouble getting gcc to autoconf itself after making changes (it
> requires specific versions, and 2.63 Just Will Not Do).
> http://gcc.gnu.org/wiki/Regenerating_GCC_Configuration

Personally, I don't have experience with the GCC build system. From
the sounds of it, it's something mortals Should Not Contemplate.

> * I've seen a fair amount of stuff that attempted to deal with portability
> problems on an ad-hoc basis (e.g. trying to find installed include / lib
> directories without using pkg-config).

In an ideal world, we'd all just use PKG_CHECK_MODULES in configure.ac
. I've hit this with Tcl/Tk, which doesn't ship .pc files. It comes
with a fairly hairy m4 file that turns up in /usr/share/aclocal.
Partial points for effort, I guess.

> * Occasional attempts to generate Makefile.am (ocropus does this).

Yuk!

> Probably the biggest problem is that it is very easy to make a mistake that
> isn't picked up by the tools.

This is true - the manual needs to be read carefully to get some
things right (as opposed to almost-right-but-breaking-in-edge-cases:
particular offenders are AC_ARG_ENABLE, AC_ARG_WITH and
AC_CACHE_CHECK).

> I like the declarative power of CMake, and also that it is pretty good on the
> cross-platform stuff. I also like the proper automated dependency tracking. In
> fact, the only thing I really like is to get the book updated to 2.6.

CMake is very good (and pretty!), but the macros it ships with (the
FindFoo.cmake ones) are a bit patchy, from memory. Not all of them
respect the REQUIRED flag, for instance. The use of
semicolon-separated lists was also a bad move: I recall one of the
pkg-config macros putting the compiler flags into a
semicolon-separated list and this list finding its way to the shell,
with hilarious results (-I/usr/include/SDL: command not found).
Hacking around it with:

set(real_cflags "")
foreach(flag ${foo_CFLAGS})
set(real_cflags "${real_cflags} ${flag}")
foreach(flag)

feels really dirty because passing compiler flags is something that a
build tool Must Get Right. (autoconf loses points here, too, for
AC_SEARCH_LIBS putting the found lib into LIBS, which means everything
tries to link against the found lib. Saving it to a variable seems
cleaner.)

All good points. I'd like to hear some more stories from autohell, if
anyone else has been there.

-- Jack


More information about the linux mailing list