Re: ac_cv_sys_largefile_opts undocumented?
| Newsgroups | gmane.comp.sysutils.autoconf.bugs,gmane.comp.lib.gnulib.bugs |
|---|---|
| Message-ID | <Zi2EVYCZNxDsk4qF@hilbert> |
On Sat, Apr 27, 2024 at 11:42:23PM +0200, Bruno Haible wrote: > dmitrii.pasechnik wrote: > > By the way, ac_cv_sys_largefile_opts isn't fun to use - as sometimes > > it's a plain text, and sometimes flags which should be added to CFLAGS. > > So one has to write things like > > > > AS_CASE([$ac_cv_sys_largefile_opts], > > ["none needed"], [], > > ["support not detected"], [], > > dnl otherwise it is a compiler flag > > [LARGEFILECFLAGS="$ac_cv_sys_largefile_opts"] > > ) > > > > which are unnecessarily complicated. > > All ac_cv_* variables, and in fact all *_cv_* variables, are designed to > contain the answer to a > checking for <something>... > output line, in a way that is both machine-parseable and human-readable. > > As a consequence: > - Its values look sometimes odd (e.g. 'no (bad O_NOATIME, O_NOFOLLOW)'. > - Its values are not stable over time and therefore *cannot be documented*. From the documentation of AC_SYS_LARGEFILE (which is a wall of text, talking about many things, including year 2038 support, something that is quite surprising in the context) it's not possible to figure out what should be added to CFLAGS, if anything. So it seems that such a use of ac_cv_sys_largefile_opts as above may be described as "off-label". The AS_CASE() code above also suffers from a problem that in the future more non-compiler-flag alternatives may be added to ac_cv_sys_largefile_opts and so it might break. The only alternative seems to be calling the compiler to check whether $ac_cv_sys_largefile_opts is a compiler option. But that's insane - after all, at the time ac_cv_sys_largefile_opts is set up, it's perfectly known whether or not it's a compiler flag, but this information appears to be thrown away. Dima > > The entities which can often be documented are AC_SUBSTed variables and > the C/C++ preprocessor macro definitions (AC_DEFINE). > > If there is the need for an Autoconf macro to expose more details, in a > documented way, it should be done through a new AC_SUBSTed variable or > a new AC_DEFINE. > > Bruno > > > >
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEJVdDnfI7raAa4RJxoksLHjfJBTEFAmYthFUACgkQoksLHjfJ BTEh3AgAnYhA3+jUnRGOA+MmWKmn0YkhmXEXlcLn6fA5xbHOTkMlw2vyXb+QdJCd jQmd+A+hY1yUQkXeT2kX0wCNaMDtUQPB3ejTZGkVPD5ijPPHZWB1hLOmMOHy0GZd D1L/K7ITXjruksOOxpRqMvYkVnpl6aSLzIE4EPNX5AkEgcBLEKqUMdGnSNbcTcZb L+V5ygwhNtOufo8kl92ziFQbJFVAo9tYEZ64apyDTmyAq3Ix6RdbkvqCsv3PMlAa PGyofypgZGHfIxNDI1OLwBLWt0co3LNOWnvOjYdLPhFCfjOTPc2n2f0YJoHjJTHC U4MToTz3CHL2pklZ6lILw43cHR8S5Q== =e2Ux -----END PGP SIGNATURE-----