aboutsummaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-12-22 08:04:25 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-22 12:42:02 +0800
commita0704d9fc68a84f3e7d29179c3f907fe3f10b2c3 (patch)
treed67df1840e49c8d1978a924b2ae2c434fde93735 /aclocal.m4
parentfe925cb04585dd1cfca4094b255b3390bc56f770 (diff)
downloadglibc-a0704d9fc68a84f3e7d29179c3f907fe3f10b2c3.zip
glibc-a0704d9fc68a84f3e7d29179c3f907fe3f10b2c3.tar.gz
glibc-a0704d9fc68a84f3e7d29179c3f907fe3f10b2c3.tar.bz2
Use -finput-charset=ascii only if supported
Check if -finput-charset=ascii is supported before using it in check-installed-headers.sh. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m429
1 files changed, 29 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index fb4c1ef..e06366c 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -167,6 +167,12 @@ AC_DEFUN([LIBC_TRY_CC_OPTION],
[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
[$2], [$3])])
+dnl Test a C++ compiler option or options with an empty input file.
+dnl LIBC_TRY_CXX_OPTION([options], [action-if-true], [action-if-false])
+AC_DEFUN([LIBC_TRY_CXX_OPTION],
+[AS_IF([AC_TRY_COMMAND([${CXX-c++} $1 -xc++ /dev/null -S -o /dev/null])],
+ [$2], [$3])])
+
dnl Find and source sysdeps/*/preconfigure.
dnl LIBC_PRECONFIGURE([$srcdir], [for])
AC_DEFUN([LIBC_PRECONFIGURE], [dnl
@@ -447,3 +453,26 @@ LIBC_CHECK_TEST_CXX(
fi])
)
rm -f conftest*])
+
+dnl Test a TEST_CC compiler option or options with an empty input file.
+dnl LIBC_TRY_TEST_CC_OPTION([message], [options],
+dnl [TEST_CC-cache-id], [TEST_CC-action-if-true], [TEST_CC-action-if-false])
+AC_DEFUN([LIBC_TRY_TEST_CC_OPTION],
+[
+LIBC_CHECK_TEST_CC(
+ AC_CACHE_CHECK([$1 in testing], $3,
+ [LIBC_TRY_CC_OPTION([$2], [$4], [$5])])
+ )
+])
+
+dnl Test a TEST_CXX compiler option or options with an empty input file.
+dnl LIBC_TRY_TEST_CXX_OPTION([message], [options],
+dnl [TEST_CXX-cache-id], [TEST_CXX-action-if-true],
+dnl [TEST_CXX-action-if-false])
+AC_DEFUN([LIBC_TRY_TEST_CXX_OPTION],
+[
+LIBC_CHECK_TEST_CXX(
+ AC_CACHE_CHECK([$1 in testing], $3,
+ [LIBC_TRY_CXX_OPTION([$2], [$4], [$5])])
+ )
+])