DEV Community

Discussion on: How To Make A Makefile

Collapse
 
jmcp profile image
James McPherson

aaaargggghghhhh please Cthulhu no!

autotools' library and feature detection is definitely not clean, it's difficult to maintain and hack around the writer's assumptions, and there are much better systems around like CMake and pkg-config. [For the record, I hate CMake, but it's easier to beat a project into shape with it than autotools.]

Where does my bias come from? I've got nearly 30 years experience at this cross-platform feature detection caper if you count automake and before that xmkmf with Imakefiles. Every time I have to hack on an aclocal+friends feature check I come across comments like this: (intltool 0.50.2)

# This macro actually does too much.  Some checks are only needed if
# your package does certain things.  But this isn't really a big deal.


# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-


# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used.  Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
fi

SunOS 4.1.3 - an OS that even in 2014 (when that version of intltool was released) had been obsoleted many years prior. Nobody, however, had bothered to remove that comment or check.

To me, autotools are the promotion of bitrot - and a maintenance nightmare.

Use something better.

/me takes curmudgeon hat off for a bit.