]> git.ipfire.org Git - thirdparty/gcc.git/commit
configure, Darwin: Adjust handing of stdlib option.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 16 Sep 2023 07:40:49 +0000 (08:40 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Mon, 18 Sep 2023 18:32:28 +0000 (19:32 +0100)
commitce7a757fd9ecb99c4f54cfde5cf5ef9a9e7819fc
treed49aad4e0e04a2bc784d5da9fa8be27b78af9c86
parent094091958654bae07a9ad53a63fd69468efcd3e3
configure, Darwin: Adjust handing of stdlib option.

The intent of the configuration choices for -stdlib is that default
setting should choose reasonable options for the target.  This should
enable -stdlib= for Darwin targets where libc++ is the default on the
system (so that it is only necessary to provide the headers).

However, it seems that there are some cases where (external) config
scripts are using -stdlib (incorrectly) to determine if the compiler
in use is GCC or clang.

In order to allow for these cases, this patch refines the setting
like so:

--with-gxx-libcxx-include-dir= is used to configure the path containing
libc++ headers; it also controls the enabling of the -stdlib option.

We are adding a special value for path:
if --with-gxx-libcxx-include-dir is 'no' we disable the stdlib option.

Otherwise if the --with-gxx-libcxx-include-dir is set we use the path
provided, and enable the stdlib option.

if --with-gxx-libcxx-include-dir is unset
We decide on the stdlib option based on the OS type and revision being
targeted.  The path is set to a fixed position relative to the compiler
install (similar logic to that used for libstdc++ headers).

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:

* configure: Regenerate.
* configure.ac: Handle explict disable of stdlib option, set
defaults for Darwin.
gcc/configure
gcc/configure.ac