Rejuvenating Autoconf
Rejuvenating Autoconf
Posted Oct 24, 2020 5:46 UTC (Sat) by ncm (guest, #165)Parent article: Rejuvenating Autoconf
All the C library feature test dreck can be stripped out. There is an ISO Standard for C implemented everywhere, and there is no reason to use a non-standard compiler and library, or test for them.
All the Bourne shell backward-compatibility and bug avoidance hacks can be stripped out. There is a Posix Standard for shells that is implemented everywhere a shell exists at all.
We don't need to support Eunice anymore.
Posted Oct 24, 2020 7:47 UTC (Sat)
by rurban (guest, #96594)
[Link] (6 responses)
Posted Oct 24, 2020 13:11 UTC (Sat)
by smurf (subscriber, #17840)
[Link] (5 responses)
So maybe you want to check for features in order to be helpful to the user. Fine, but you can do that with a simple test program or two. In more complicated cases you can create one file with flags and other constants (OK, one for each language that needs to digest this) and #include lines, and another with a list of libraries to link against. Done.
There's no longer a need for a program which uses an arcane ancient macro language to create a script which, when run, generates your Makefile from the side effect of mangling a Makefile.am to a Makefile.in during the first step, only to then use "make" to process the result. That's three levels of indirection and three sets of tools, which is at least two too many.
Once upon a time, when "make" was stupid (no conditionals, no functions …), the shell was randomly posixly incorrect, system include files had "sys/" in their path depending on OS subrelease and/or the phase of the moon, and other basic tools like "sed" couldn't be trusted with >254 character and/or non-ASCII lines … at that time the whole Autotools infrastructure may have made sense.
Today? not so much.
Posted Oct 25, 2020 15:48 UTC (Sun)
by tdz (subscriber, #58733)
[Link] (3 responses)
Please go and build your software with cygwin, where half of the math functions are there but broken. That might widen your perspective.
Posted Oct 26, 2020 10:30 UTC (Mon)
by intgr (subscriber, #39733)
[Link] (1 responses)
Maybe time would be better spent just fixing Cygwin, instead of subjecting all developers over the world to horribly complicated build-system-level work-arounds?
What you're describing is a manifestation of the platform problem https://lwn.net/Articles/443531/
> the platform problem comes about when developers view the platform they are developing for as fixed and immutable. These developers feel that the component they are working on specifically (a device driver, say) is the only part that they have any control over. If the kernel somehow makes their job harder, the only alternatives are to avoid or work around it. It is easy to see how such an attitude may come about, but the costs can be high.
Posted Oct 26, 2020 10:48 UTC (Mon)
by tdz (subscriber, #58733)
[Link]
It's easier to fix the code than to roll-out the fix.
Posted Oct 26, 2020 10:48 UTC (Mon)
by mathstuf (subscriber, #69389)
[Link]
[1]This lets those working on the known-broken platforms and new platforms not have to masquerade as something else to get past your arbitrary checkpoints (cf. basically every compiler emulating GCC and/or Clang at some point in their lifecycle to get past silly `#error "unknown compiler"` shenanigans).
Posted Oct 26, 2020 19:28 UTC (Mon)
by wahern (subscriber, #37304)
[Link]
People seem to be confusing automake and autoconf in their autotools tirades. Autoconf can be used independently of automake and libtool, and this forthcoming release is just autoconf. IME, autoconf still works exceptionally well at writing feature tests. I've tried many alternatives, and even invented some of my own, but today I prefer using autoconf to generate config.h[1] and a simple make include (e.g. defaults.mk). I usually use plain POSIX make for my builds these days; GNU Make if I forget myself and decide to get unnecessarily fancy. Technically someone could build such a project of mine without invoking ./configure so long as they [re-]define'd all the necessary macros: CFLAGS, CPPFLAGS, SOFLAGS, LDLIBS, HAVE_FOO, etc when invoking make. Which, IMO, is how any [Unix] build system should work--in independent layers.
[1] Except I tweak output generation so that a macro is only define'd if not yet defined. For example, at the top of configure.ac,
Posted Oct 24, 2020 11:10 UTC (Sat)
by nilsmeyer (guest, #122604)
[Link] (5 responses)
Posted Oct 24, 2020 11:49 UTC (Sat)
by willy (subscriber, #9762)
[Link] (1 responses)
Posted Oct 25, 2020 10:18 UTC (Sun)
by nix (subscriber, #2304)
[Link]
Posted Oct 25, 2020 8:10 UTC (Sun)
by ncm (guest, #165)
[Link] (2 responses)
Posted Oct 26, 2020 6:59 UTC (Mon)
by nilsmeyer (guest, #122604)
[Link]
Posted Oct 26, 2020 14:05 UTC (Mon)
by Kamiccolo (subscriber, #95159)
[Link]
Rejuvenating Autoconf
Rejuvenating Autoconf
Rejuvenating Autoconf
Rejuvenating Autoconf
Rejuvenating Autoconf
Rejuvenating Autoconf
Rejuvenating Autoconf
That makes it possible to override config.h from CPPFLAGS (or CFLAGS or w'ever). While autoconf is much better, IME, at being forward compatible than the alternatives, nothing is ever 100%. Sometimes a feature test will get things wrong, or perhaps a builder wants to manually mask some API (that invariably lacks a build switch). No matter what solution a project uses for its build, there's nothing worse than being forced to modify the build itself to quickly route around some trivial issue, regardless of whether it should or will end up as a proper patch.
# Redefine AH_TEMPLATE so that feature macros can be overridden from CPPFLAGS
m4_define([AH_TEMPLATE],
[AH_VERBATIM([$1],
m4_text_wrap([$2 */], [ ], [/* ])[
@%:@ifndef ]_m4_expand([$1])[
@%:@undef ]_m4_expand([$1])[
@%:@endif])])
Rejuvenating Autoconf
Rejuvenating Autoconf
Rejuvenating Autoconf
Rejuvenating Autoconf
Rejuvenating Autoconf
Rejuvenating Autoconf
