[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get autoconf to respect CC="gcc -std=c89"?
From: |
Niels Möller |
Subject: |
Re: How to get autoconf to respect CC="gcc -std=c89"? |
Date: |
Fri, 06 Oct 2023 18:03:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (berkeley-unix) |
"Zack Weinberg" <zack@owlfolio.org> writes:
> This is currently not possible, but you are not the only person who has
> asked for it to be made possible, and it's on our near-future list.
> However, none of the core Autoconf developers currently have time to work
> on it. Might you be willing to put some time into it?
I can have a look; I would hope it's not too difficult (I'm familiar
with m4 and sh programming, but not with autoconf-specifics, like how
AC_REQUIRE/AC_PROVIDE really works). I think this is the right piece of
code that needs a bit of configurability, in lib/autoconf/c.m4:
AC_DEFUN([_AC_PROG_CC_STDC_EDITION],
[ac_prog_cc_stdc=no
m4_map([_AC_PROG_CC_STDC_EDITION_TRY], [[11], [99], [89]])])
It's that list that should be modified by AC_C_STANDARD_VERSION, right?
We "only" need replace that fix list by a variable. Questions:
1. Should that variable be an m4 macro or a shell variable? I guess it
should be m4 (unless it should be overridable at configure time, and
then the m4_map has to be replaced by a shell loop?).
2. What should be the name of that variable?
3. What's the right way to assign a default value, when
AC_C_STANDARD_VERSION isn't used? Assign it early in some way? Or
check for empty/undefined where it is used, and replace with the
default?
> I think something like this in configure.ac
>
> AC_C_STANDARD_VERSION([c89])
> AC_PROG_CC
>
> would probably fit best with what we have now.
I agree that looks reasonable. Should AC_C_STANDARD_VERSION imply that
support for the given version is required for this package, i.e.,
configure fails if it can't find a compiler that supports that version?
(Which means that the list should collaps to a single entry)?
Perhaps AC_C_STANDARD_VERSION should take a list of acceptable versions,
in order of preference?
(For the time being, I'm going to use this wrapper script as CC,
https://git.lysator.liu.se/nettle/nettle/-/blob/master/misc/c89).
Regards,
/Niels
--
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.
- How to get autoconf to respect CC="gcc -std=c89"?, Niels Möller, 2023/10/05
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Zack Weinberg, 2023/10/06
- Re: How to get autoconf to respect CC="gcc -std=c89"?,
Niels Möller <=
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Niels Möller, 2023/10/06
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Paul Eggert, 2023/10/06
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Niels Möller, 2023/10/07
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Paul Eggert, 2023/10/07
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Niels Möller, 2023/10/08
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Jacob Bachmeyer, 2023/10/08
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Nick Bowler, 2023/10/09
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Niels Möller, 2023/10/11
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Evgeny Grin, 2023/10/11
- Re: How to get autoconf to respect CC="gcc -std=c89"?, Bob Friesenhahn, 2023/10/11