LWN.net Logo

autoconf is OK, dunno about the rest

autoconf is OK, dunno about the rest

Posted Dec 24, 2005 11:28 UTC (Sat) by kleptog (subscriber, #1183)
In reply to: More information on the X11R7.0/X11R6.9 release by Zarathustra
Parent article: More information on the X11R7.0/X11R6.9 release

I think there's some confusion here. Just because you use autoconf, doesn't mean the Makefiles are automatically generated.

For example, PostgreSQL uses autoconf. Why? Because it has a standard interface for specifying extensions and where they are. Because it has standard methods for determine if header file X exists, what is the signature of signal, does the compiler understand inline, does the function pstat exist, etc? You should have seen the mess it was before.

I think people seriously overestimate source code compatability once you step outside of gcc/glibc or linux/*BSD. PostgreSQL has some of the best code I've seen, no #ifdef scattered through the code. The code is written for sane platforms and the quirks are dealt with in the ports directory.

The results of all this creates one header file to #include and one Makefile.global with various parameters substituted. All the other Makefiles are hand written. And it definitly increases portability because now no-one needs to write code to differentiate different releases of AIX or to remember whether the C compiler can do 64-bit arithmetic, because configure simply tells you what you need to know. If a new release of BSD changed the default signal semantics to POSIX, we wouldn't even notice, because configure would set the flag and the code will be compiled accordingly.

I agree with the comments about libtool, I havn't seen a compelling reason to use it, it seems to cause more problems that it solves. PostgreSQL compiles and links shared libraries on a dozen different platforms without that much difficulty. Completely autogenerating makefiles seems like a mess too, but you don't need to do that. autoconf, by itself, *is* useful.


(Log in to post comments)

autoconf is OK, dunno about the rest

Posted Dec 25, 2005 7:01 UTC (Sun) by evgeny (guest, #774) [Link]

> Just because you use autoconf, doesn't mean the Makefiles are automatically generated.

Agreed here absolutely. In all my projects, I generate only two files with autoconf - a config.h and a Make.conf, which are #included into all other source files and makefiles, respectively. This also greatly helps in portabilty to other platforms lacking autoconf support: as a rule, these are pretty API/ABI-stable, so a replacement for "configure" is trivially written in the native script language which basically fills in a predefined template modulus a few options the user might want to alter (equivalents of --with-options etc).

Having said that, there is, undeniably, quite a way ahead of autoconf for many possible improvements.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds