Re:Varnish guy's hatred for autoconf
by avar on Friday July 09, 2010 @08:34AM
(#1500410)
Since some here are suggesting to just use `uname -s` as an autoconf
replacement. I thought I'd provide some data for that. The Git project
is a very good showcase, because it can do both.
Git can optionally use autoconf. To do this you can run make configure
&& ./configure which'll use this configure.ac file to generate the
configure script: http://github.com/git/git/blob/pu/configure.ac#L1
That's where autoconf's involvement ends. All it's doing is turning
simple macros like this:
# Define NO_GETTEXT if you don't have libintl.h
AC_CHECK_HEADER([libintl.h],
[NO_GETTEXT=],
[NO_GETTEXT=YesPlease])
AC_SUBST(NO_GETTEXT)
Into this:
NO_GETTEXT=
Or, if libintl.h doesn't exist:
NO_GETTEXT=YesPlease
Which you would otherwise need to specify manually as arguments to the
Makefile when building the program:
http://github.com/git/git/blob/pu/Makefile#L37, after checking if you
have libintl.h on your system or not.
Autoconf can certainly get hairy, but in most cases using it is a lot
easier than not doing it. Consider this definition:
That's doing a lot of work checking if there's a libcurl on your
system, and making sure it has a curl_global_init function.
Also note that the autotools are more than just autoconf. You can
stop here, but you can also generate your makefiles with automake, and
create your libraries with libtool.
Git can optionally use autoconf. To do this you can run make configure && ./configure which'll use this configure.ac file to generate the configure script: http://github.com/git/git/blob/pu/configure.ac#L1
Autoconf will then write out a config.mak file, which is generated from this template: http://github.com/git/git/blob/pu/config.mak.in#L1
That's where autoconf's involvement ends. All it's doing is turning simple macros like this:
Into this: Or, if libintl.h doesn't exist: Which you would otherwise need to specify manually as arguments to the Makefile when building the program: http://github.com/git/git/blob/pu/Makefile#L37, after checking if you have libintl.h on your system or not.Autoconf can certainly get hairy, but in most cases using it is a lot easier than not doing it. Consider this definition:
That's doing a lot of work checking if there's a libcurl on your system, and making sure it has a curl_global_init function.Also note that the autotools are more than just autoconf. You can stop here, but you can also generate your makefiles with automake, and create your libraries with libtool.