LWN.net Logo

Funny, but automake?

Funny, but automake?

Posted Mar 4, 2005 15:20 UTC (Fri) by vmole (subscriber, #111)
In reply to: Funny, but automake? by piman
Parent article: Electric Cloud Creates Open Source ''GNU Make Standard Library''

Automake/autoconf/libtool complicate things even with C code. Supposedly designed for portability, they promote the worst habits of writing system specific code, #ifdef'd to unreadability. They're disasters. Unfortunately, they seem to be ingrained in the FOSS community.

The sad part is that we knew this was the wrong approach 13 years ago. See Henry Spencer and Geoff Collyer's paper "#ifdef Considered Harmful" (only available as a PDF, so far as I can find.)


(Log in to post comments)

Funny, but automake?

Posted Mar 4, 2005 19:02 UTC (Fri) by Ross (subscriber, #4065) [Link]

The use of ifdef with the auto tools is mostly around header file inclusion
or the exclusion of entire functions or compilation units.

Anywhere you have ifdef ugliness with autoconf you would be likely to have
even more ugliness without it.

I personally prefer the use of standardized interfaces where possible and
thin wrappers and abstraction to get rid of system dependencies (actually
to relegate them to a small portion of the code) - but that doesn't always
make the most sense for every project.

It certainly doesn't have to result in pre-processor spaghetti code like
you often see with old C programs. In fact the use of autoconf gets rid of
that kind of cruft by testing the right thing: "is this feature avaliable"
vs. "is this SYSV but not Solaris or BSD but not Ultrix unless the version
is greater than X" and the tested macros have all combinations of leading
and trailing underscores, are sometimes lower-case or mixed-case, and use
the name for the hardware instead of the OS. That's what I consider
harmful.

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