aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac54
1 files changed, 48 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 1a19c07..ea988ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1456,16 +1456,16 @@ case "$have_compiler:$host:$target:$enable_bootstrap" in
;;
esac
-# When bootstrapping with GCC, build stage 1 in C++11 mode to ensure that a
-# C++11 compiler can still start the bootstrap. Otherwise, if building GCC,
-# require C++11 (or higher).
+# When bootstrapping with GCC, build stage 1 in C++14 mode to ensure that a
+# C++14 compiler can still start the bootstrap. Otherwise, if building GCC,
+# require C++14 (or higher).
if test "$enable_bootstrap:$GXX" = "yes:yes"; then
- CXX="$CXX -std=c++11"
+ CXX="$CXX -std=c++14"
elif test "$have_compiler" = yes; then
- AX_CXX_COMPILE_STDCXX(11)
+ AX_CXX_COMPILE_STDCXX(14)
if test "${build}" != "${host}"; then
- AX_CXX_COMPILE_STDCXX(11, [], [], [_FOR_BUILD])
+ AX_CXX_COMPILE_STDCXX(14, [], [], [_FOR_BUILD])
fi
fi
@@ -2036,6 +2036,29 @@ fi
AC_SUBST(PICFLAG)
+# Rust requires -ldl and -lpthread if you are using an old glibc that does not include them by
+# default, so we check for them here
+# We are doing the test here and not in the gcc/configure to be able to nicely disable the
+# build of the Rust frontend in case a dep is missing.
+missing_rust_dynlibs=none
+
+save_LIBS="$LIBS"
+LIBS=
+AC_SEARCH_LIBS([dlopen], [dl])
+AC_SEARCH_LIBS([pthread_create], [pthread])
+CRAB1_LIBS="$LIBS"
+LIBS="$save_LIBS"
+
+if test "$ac_cv_search_dlopen" = no; then
+ missing_rust_dynlibs="libdl"
+fi
+
+if test "$ac_cv_search_pthread_create" = no; then
+ missing_rust_dynlibs="$missing_rust_dynlibs, libpthread"
+fi
+
+AC_SUBST(CRAB1_LIBS, "$CRAB1_LIBS")
+
# If we are building PIC/PIE host executables, and we are building dependent
# libs (e.g. GMP) in-tree those libs need to be configured to generate PIC
# code.
@@ -2273,6 +2296,25 @@ if test -d ${srcdir}/gcc; then
;;
esac
+ # Disable Rust if we are missing some required C libraries for the Rust runtime.
+ case ${add_this_lang}:${language}:${missing_rust_dynlibs} in
+ *:rust:none)
+ # Nothing to do - we're not missing any C libraries
+ ;;
+ yes:rust:*)
+ AC_MSG_ERROR([some C libraries are required to build $language: $missing_rust_dynlibs])
+ add_this_lang=unsupported
+ ;;
+ all:rust:*)
+ AC_MSG_WARN([some C libraries are required to build $language: $missing_rust_dynlibs])
+ add_this_lang=unsupported
+ ;;
+ *:rust:*)
+ # Silently disable.
+ add_this_lang=unsupported
+ ;;
+ esac
+
# Disable jit if -enable-host-shared not specified
# but not if building for Mingw. All code in Windows
# is position independent code (PIC).