merge bitcoin#22845: improve check for ::(w)system

This commit is contained in:
Kittywhiskers Van Gogh 2024-06-25 11:52:37 +00:00
parent 5b86009d40
commit 54be58b494
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -1272,13 +1272,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[ AC_MSG_RESULT(no); HAVE_STRONG_GETAUXVAL=0 ]
)
have_any_system=no
AC_MSG_CHECKING([for std::system])
AC_LINK_IFELSE(
[ AC_LANG_PROGRAM(
[[ #include <cstdlib> ]],
[[ int nErr = std::system(""); ]]
)],
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STD__SYSTEM, 1, Define to 1 if you have the `std::system' function.)],
[ AC_MSG_RESULT(yes); have_any_system=yes],
[ AC_MSG_RESULT(no) ]
)
@ -1288,12 +1289,13 @@ AC_LINK_IFELSE(
[[ #include <stdlib.h> ]],
[[ int nErr = ::_wsystem(NULL); ]]
)],
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WSYSTEM, 1, Define to 1 if you have the `::wsystem' function.)],
[ AC_MSG_RESULT(yes); have_any_system=yes],
[ AC_MSG_RESULT(no) ]
)
# Define to 1 if std::system or ::wsystem (Windows) is available
AC_DEFINE([HAVE_SYSTEM], [HAVE_STD__SYSTEM || HAVE_WSYSTEM], [std::system or ::wsystem])
if test "x$have_any_system" != "xno"; then
AC_DEFINE(HAVE_SYSTEM, 1, Define to 1 if std::system or ::wsystem is available.)
fi
dnl SUPPRESSED_CPPFLAGS=SUPPRESS_WARNINGS([$SOME_CPPFLAGS])
dnl Replace -I with -isystem in $SOME_CPPFLAGS to suppress warnings from