diff options
| author | H.J. Lu <hjl.tools@gmail.com> | 2024-12-18 03:25:09 +0800 |
|---|---|---|
| committer | H.J. Lu <hjl.tools@gmail.com> | 2024-12-18 18:50:18 +0800 |
| commit | eb02fb7739c321b0ec0498fcb3ea1dd3989945e3 (patch) | |
| tree | fb98fb4b1e1815298bf464a513cb96d35afc3d12 /configure.ac | |
| parent | cd90d3ca7d5b515cb096d8c1d7c83b94ef6eba71 (diff) | |
| download | glibc-eb02fb7739c321b0ec0498fcb3ea1dd3989945e3.tar.xz glibc-eb02fb7739c321b0ec0498fcb3ea1dd3989945e3.zip | |
Check if clang and clang++ are used to test glibc
Set have-test-clang to yes if clang is used to test glibc. Set
have-test-clangxx to yes if clang++ is used to test glibc.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 1de79bd729..85c92e5083 100644 --- a/configure.ac +++ b/configure.ac @@ -641,6 +641,30 @@ fi rm -f conftest*]) AC_SUBST(libc_cv_with_fp) +conftest_code=" +#ifndef __clang__ +#error Not Clang! +#endif +" + +dnl Check if clang is used to test glibc. +LIBC_TRY_TEST_CC_COMMAND([for clang], + [$conftest_code], + [-c], + libc_cv_test_clang, + [libc_cv_test_clang=yes], [libc_cv_test_clang=no], +) +LIBC_CONFIG_VAR([have-test-clang], [$libc_cv_test_clang]) + +dnl Check if clang++ is used to test glibc. +LIBC_TRY_TEST_CXX_COMMAND([for clang++], + [$conftest_code], + [-c], + libc_cv_test_clangxx, + [libc_cv_test_clangxx=yes], [libc_cv_test_clangxx=no], +) +LIBC_CONFIG_VAR([have-test-clangxx], [$libc_cv_test_clangxx]) + AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl LIBC_TRY_CC_OPTION([$CFLAGS $CPPFLAGS -Werror -fstack-protector], [libc_cv_ssp=yes], |
