From 84de780d46097681bffa1e9a166e1bdcb955ae37 Mon Sep 17 00:00:00 2001 From: Jerome Lambourg Date: Fri, 20 Dec 2019 15:30:41 +0000 Subject: [PATCH] libstdc++: Test setrlimit with c++ in configure * acinclude.m4 (GLIBCXX_CHECK_SETRLIMIT): Test with AC_LANG_CPLUSPLUS. * configure: Regenerate. From-SVN: r279644 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/acinclude.m4 | 3 +++ libstdc++-v3/configure | 27 ++++++++++++++++++++------- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ceebebcc1fd..81f7bb9b853 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2019-12-20 Jerome Lambourg + + * acinclude.m4 (GLIBCXX_CHECK_SETRLIMIT): Test with AC_LANG_CPLUSPLUS. + * configure: Regenerate. + 2019-12-20 François Dumont * testsuite/23_containers/map/48101_neg.cc: Add versioned namespace diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 8401696b5b5..c0d1059c6ed 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -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) ]) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 3c51166fe9f..f2d52fd05f3 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -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; } -- 2.30.2