[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CC and CFLAGS are ignored by part of the build
From: |
Gavin Smith |
Subject: |
Re: CC and CFLAGS are ignored by part of the build |
Date: |
Wed, 22 Nov 2023 20:41:10 +0000 |
On Tue, Nov 14, 2023 at 02:22:00PM +0200, Eli Zaretskii wrote:
> AFAIU, that's impossible in general, because CFLAGS could include
> flags that cannot be applied to both CC and PERL_CONF_cc due to
> compatibility issues, since Perl could have been built using a very
> different compiler.
>
> IMNSHO, it isn't a catastrophe that compiling Perl extensions needs a
> separate C flags variable. It is basically similar to CFLAGS and
> CXXFLAGS being separate for building the same project (which happens
> inj practice, for example, in GDB, which is part C and part C++). And
> if the GCS doesn't cater for these (relatively rare and specialized)
> situations, then I think the GCS needs to be amended. There's no need
> to be dogmatic about this.
>
These variables were mentioned in the output of ./configure --help
but we never documented anywhere why they were needed, as far as I could
tell. I've added text to the INSTALL file:
+ When `configure' is running in the XS subdirectory, instead of the
+ standard CC, CFLAGS, LDFLAGS etc., it uses special variables with a
+ PERL_EXT_ prefix. These are all listed in the output of `configure
+ --help'. This is necessary because it is possible that the C compiler
+ being used to compile Perl extension modules is a different compiler
+ to that used for the rest of the package. (However, if you need to
+ override these variables when running `make', use the unprefixed
+ variants, e.g. CFLAGS instead of PERL_EXT_CFLAGS. Exception: you
+ cannot override CPPFLAGS this way as gnulib uses this variable.)