Re: Patches for Fedora 42 & 43
Collin Funk <[email protected]> Mon, 13 Oct 2025 21:00:45 -0700
| Newsgroups | gmane.comp.gnu.global.bugs |
|---|---|
| Message-ID | <[email protected]> |
"Andrew L. Moore" <[email protected]> writes: > Collin can correct me, but one way that using Gnulib's bootstrap > script makes life easier is in avoiding header conflicts: when Gnulib > is distributed as an integral part of a package, to _not_ build > against it requres hiding the Gnulib headers. In the case of GNU > Global, this can be done by excluding -I${top_srcdir}/libglibc from > AM_CPPFLAGS (one of the omissions in my latest patch), but in the more > general case, the Gnulib headers have to be renamed, which gets > complicated fast. I've never tried that. I would recommend using Gnulib's overriden standard headers though. We test them on many platforms. And it allows you to write code similar to if you were on a glibc system. Take the following code: while (getopt (argc, argv, shortopts) != -1) { /* Process arguments. */ } On a glibc system the preprocessed code will be the same. On a system that does not permute argv so that nonoptions are at the end, it will preprocess to: while (rpl_getopt (argc, argv, shortopts) != -1) { /* Process arguments. */ } Pretend we are compiling 'cp' from Coreutils, this allows us to run the following command: $ cp COPYING LICENSE -p Even if the system's 'getopt' function does not permute the arguments internally. Collin