|
|
Subscribe / Log in / New account

Modernizing Fedora's C code

Modernizing Fedora's C code

Posted Nov 7, 2022 12:59 UTC (Mon) by eru (subscriber, #2753)
Parent article: Modernizing Fedora's C code

... is complicated by the use of Autoconf in many of the packages ...

I have long wondered what is the point of Autoconf (and other build tools that do similar autoprobing) these days. The environments and compilers are much more standard now than when Autoconf was born and had to deal with a zoo of twisty unix variants, all different. Now the configure step sometimes takes as much time than the actual compilation while it checks for the presence of features every realistic environment has had for the past 30 years. I would like to just say "I have Linux and GCC, build it".


to post comments

Modernizing Fedora's C code

Posted Nov 7, 2022 14:02 UTC (Mon) by mathstuf (subscriber, #69389) [Link] (1 responses)

Checking for functions and their signatures doesn't make a lot of sense anymore, but there are still open questions:

- musl or glibc?
- is dep X available? is it a sufficient version?
- is libdl a separate library?

My pet peeve is when I see checks being performed that get put into `config.h` and then…never used. Those patches at least tend to get some traction even if removing unnecessary-but-used checks is not as well-received.

And, not that it's relevant for autoconf, but Windows support does tend to require probing (or embedding tables for things like "the XYZ toolchain finally supports snprintf"). These checks can be dropped as older toolchain support is dropped.

Modernizing Fedora's C code

Posted Nov 8, 2022 13:45 UTC (Tue) by eru (subscriber, #2753) [Link]

Maybe we could standardise something like the tripled defining the environment in GCC, but only with compiler and libc: compiler-vers-libc-vers. "uname" will provide the architecture and OS on POSIX-compatible hosts.

Existence of external dependencies could be pre-checked with pkg-config and/or the host's package manager. If the package is not found, warn, but barge on regardless, in case it was installed without such metadata. (The build would then fail if it does not exist).

Modernizing Fedora's C code

Posted Nov 7, 2022 14:11 UTC (Mon) by farnz (subscriber, #17727) [Link]

A big part of it is that nobody uses site defaults to set up a site-wide cache file for configure to use, so nobody's configure scripts are set up to cope with a site-wide cache, and it all thus falls apart.

In theory, a Linux distribution could take responsibility for this, but the mess that results from autoconf allowing you to override linkers, compilers etc via environment variables makes it problematic.


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