diff options
author | Mike Frysinger <vapier@gentoo.org> | 2022-02-12 09:59:13 +0300 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-02-17 04:29:08 +0300 |
commit | e0c0ad8268af60a2413edcab84320eef1e6ce5f9 (patch) | |
tree | a2a4500e032c15999570484ffc923a4c31aca437 /libgloss/configure.ac | |
parent | 5ca1f8c7ff79f9b9d139de379af2edc25f38ee01 (diff) |
libgloss: build with -nostdinc
We don't want libgloss building against C library headers that happened
to be installed with the toolchain, so add -nostdinc to the build. We
still need access to the compiler internal headers, so probe those and
include them via -isystem. This uses a similar probing style as glibc,
which has used it for over a decade, so it should be safe & stable.
This should prevent any latent bugs due to testing with a toolchain that
is fully configured & installed already.
Diffstat (limited to 'libgloss/configure.ac')
-rw-r--r-- | libgloss/configure.ac | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libgloss/configure.ac b/libgloss/configure.ac index 78e92a0e8..06d17d8b5 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -336,6 +336,17 @@ m4_include([mcore/acinclude.m4]) m4_include([mn10300/acinclude.m4]) m4_include([moxie/acinclude.m4]) +AC_CACHE_CHECK([for compiler search settings], libc_cv_compiler_isystem, [dnl + for subdir in include include-fixed; do + AS_IF([dir=`$CC -print-file-name=$subdir`], [dnl + AS_IF([test -n "$dir"], [dnl + libc_cv_compiler_isystem="$libc_cv_compiler_isystem -isystem $dir" + ]) + ]) + done +]) +CC="$CC -nostdinc $libc_cv_compiler_isystem" + dnl We have to assign the same value to other variables because autoconf dnl doesn't provide a mechanism to substitute a replacement keyword with dnl arbitrary data or pathnames. |