[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ac_cv_sys_largefile_opts undocumented?

From: dmitrii . pasechnik
Subject: Re: ac_cv_sys_largefile_opts undocumented?
Date: Sun, 28 Apr 2024 00:03:49 +0100

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 
is a compiler option. But that's insane - after all, at the time 
is set up, it's perfectly known whether or not it's a compiler flag, but
this information appears  to be thrown away.


> 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

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]