libstdc++: Test setrlimit with c++ in configure
authorJerome Lambourg <lambourg@adacore.com>
Fri, 20 Dec 2019 15:30:41 +0000 (15:30 +0000)
committerJerome Lambourg <lambourg@gcc.gnu.org>
Fri, 20 Dec 2019 15:30:41 +0000 (15:30 +0000)
* acinclude.m4 (GLIBCXX_CHECK_SETRLIMIT): Test with AC_LANG_CPLUSPLUS.
* configure: Regenerate.

From-SVN: r279644

libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/configure

index ceebebcc1fd6c42ae8eebd8e3c9712dfe8a2c6a9..81f7bb9b853dfe2fea292ada22760be522ac8cc4 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-20  Jerome Lambourg  <lambourg@adacore.com>
+
+       * acinclude.m4 (GLIBCXX_CHECK_SETRLIMIT): Test with AC_LANG_CPLUSPLUS.
+       * configure: Regenerate.
+
 2019-12-20  François Dumont  <fdumont@gcc.gnu.org>
 
        * testsuite/23_containers/map/48101_neg.cc: Add versioned namespace
index 8401696b5b5695156456367d853abdc2a7565e83..c0d1059c6ed69a7dd0c19fab378b9d4d0d8dd350 100644 (file)
@@ -316,6 +316,8 @@ AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT_ancilliary], [
 ])
 
 AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT], [
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
   setrlimit_have_headers=yes
   AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
                   [],
@@ -352,6 +354,7 @@ AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT], [
   else
     ac_res_limits=no
   fi
+  AC_LANG_RESTORE
   AC_MSG_RESULT($ac_res_limits)
 ])
 
index 3c51166fe9fee1885583a3c8749a9f7d3d149df3..f2d52fd05f36d881057495f9207c6f15b0b15f18 100755 (executable)
@@ -74233,11 +74233,18 @@ $as_echo "$ac_cv_x86_rdseed" >&6; }
 
   # Do checks for resource limit functions.
 
+
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+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
+
   setrlimit_have_headers=yes
   for ac_header in unistd.h sys/time.h sys/resource.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -74270,7 +74277,7 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
   glibcxx_mresult=1
 else
   glibcxx_mresult=0
@@ -74302,7 +74309,7 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
   glibcxx_mresult=1
 else
   glibcxx_mresult=0
@@ -74334,7 +74341,7 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
   glibcxx_mresult=1
 else
   glibcxx_mresult=0
@@ -74366,7 +74373,7 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
   glibcxx_mresult=1
 else
   glibcxx_mresult=0
@@ -74398,7 +74405,7 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
   glibcxx_mresult=1
 else
   glibcxx_mresult=0
@@ -74434,7 +74441,7 @@ struct rlimit r;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
   glibcxx_cv_setrlimit=yes
 else
   glibcxx_cv_setrlimit=no
@@ -74455,6 +74462,12 @@ $as_echo "#define _GLIBCXX_RES_LIMITS 1" >>confdefs.h
   else
     ac_res_limits=no
   fi
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res_limits" >&5
 $as_echo "$ac_res_limits" >&6; }