aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-06-20 15:28:13 -0700
committerH.J. Lu <hjl.tools@gmail.com>2024-07-02 00:51:34 -0700
commitba144c179eb12a6aff145582671cbb8b1045c5b9 (patch)
tree1b7a38ea0ab4bd50303d2f71bc2f5ab6bfe190e2 /configure.ac
parent23f12e6e0c95aaf8b5b4973d029db794a43f248a (diff)
downloadglibc-ba144c179eb12a6aff145582671cbb8b1045c5b9.zip
glibc-ba144c179eb12a6aff145582671cbb8b1045c5b9.tar.gz
glibc-ba144c179eb12a6aff145582671cbb8b1045c5b9.tar.bz2
Add --disable-static-c++-tests option [BZ #31797]
By default, if the C++ toolchain lacks support for static linking, configure fails to find the C++ header files and the glibc build fails. The --disable-static-c++-link-check option allows the glibc build to finish, but static C++ tests will fail if the C++ toolchain doesn't have the necessary static C++ libraries which may not be easily installed. Add --disable-static-c++-tests option to skip the static C++ link check and tests. This fixes BZ #31797. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 11 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index ee64d49..e48957f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,16 @@ fi
AC_SUBST(cross_compiling)
AC_PROG_CPP
+# This will get text that should go into config.make.
+config_vars=
+
+AC_ARG_ENABLE([static-c++-tests],
+ AS_HELP_STRING([--disable-static-c++-tests],
+ [disable static C++ tests@<:@default=no@:>@]),
+ [static_cxx_tests=$enableval],
+ [static_cxx_tests=yes])
+LIBC_CONFIG_VAR([static-cxx-tests], [$static_cxx_tests])
+
AC_ARG_ENABLE([static-c++-link-check],
AS_HELP_STRING([--disable-static-c++-link-check],
[disable static C++ link check @<:@default=no@:>@]),
@@ -67,7 +77,7 @@ AC_LANG_PUSH([C++])
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[libc_cv_cxx_link_ok=yes],
[libc_cv_cxx_link_ok=no])
-if test $static_cxx_link_check = yes; then
+if test $static_cxx_link_check$static_cxx_tests = yesyes; then
# Static case.
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -static"
@@ -92,9 +102,6 @@ if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then
AC_MSG_ERROR([you must configure in a separate build directory])
fi
-# This will get text that should go into config.make.
-config_vars=
-
# Check for a --with-gd argument and set libgd-LDFLAGS in config.make.
AC_ARG_WITH([gd],
AS_HELP_STRING([--with-gd=DIR],