about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2015-10-26 09:41:10 +0100
committerFlorian Weimer <fweimer@redhat.com>2015-10-26 09:41:10 +0100
commitd337ceb76d898935560dc264cf2ad36b17017db7 (patch)
tree84cb919ecbbd180c08340109d723ecf84ec198b3 /configure
parent6d834d2216bcc733fa04c5a59b5ac6f6f1134f2b (diff)
downloadglibc-d337ceb76d898935560dc264cf2ad36b17017db7.tar.gz
glibc-d337ceb76d898935560dc264cf2ad36b17017db7.tar.xz
glibc-d337ceb76d898935560dc264cf2ad36b17017db7.zip
Use the CXX compiler only if it can create dynamic and static programs
	* configure.ac (CXX): Clear the variable if the C++ toolchain does
	not support static linking.
	* configure: Regenerate.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure25
1 files changed, 25 insertions, 0 deletions
diff --git a/configure b/configure
index 8aea9925aa..ff3ad55b1d 100755
--- a/configure
+++ b/configure
@@ -3173,6 +3173,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
+# Default, dynamic case.
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3191,6 +3192,30 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+# Static case.
+old_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -static"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <iostream>
+
+int
+main()
+{
+  std::cout << "Hello, world!";
+  return 0;
+}
+
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+else
+  libc_cv_cxx_link_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LDFLAGS="$old_LDFLAGS"
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'