mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-04 13:55:23 -05:00
Merge bitcoin/bitcoin#22845: build: improve check for ::(w)system
3ec633ef1a
build: improve check for ::(w)system (fanquake) Pull request description: `AC_DEFINE()` takes `HAVE_STD__SYSTEM || HAVE_WSYSTEM` literally, meaning you end up with the following in bitcoin-config.h: ```cpp /* std::system or ::wsystem */ #define HAVE_SYSTEM HAVE_STD__SYSTEM || HAVE_WSYSTEM ``` This works for the preprocessor, because `HAVE_SYSTEM`, is defined, just unusually. Remove this in favor of setting `have_any_system` in either case, given we don't actually use `HAVE_STD__SYSTEM` or `HAVE_WSYSTEM`, and defining `HAVE_SYSTEM` to 1 thereafter. ACKs for top commit: laanwj: Code review ACK3ec633ef1a
Tree-SHA512: 02c39ba3179136ec1dc28df026b7fa5d732914c85622298ba7ec880f1ae9324208d322a47be451a5c2ff2e165ad1d446bae92e7018db8e517e7ac38fca25a0a3
This commit is contained in:
commit
82a85216c3
1 changed files with 6 additions and 3 deletions
|
@ -1229,13 +1229,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|||
[ AC_MSG_RESULT(no); HAVE_WEAK_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 std::system is available.)],
|
||||
[ AC_MSG_RESULT(yes); have_any_system=yes],
|
||||
[ AC_MSG_RESULT(no) ]
|
||||
)
|
||||
|
||||
|
@ -1245,11 +1246,13 @@ AC_LINK_IFELSE(
|
|||
[[ ]],
|
||||
[[ int nErr = ::_wsystem(""); ]]
|
||||
)],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WSYSTEM, 1, Define to 1 if ::wsystem is available.)],
|
||||
[ AC_MSG_RESULT(yes); have_any_system=yes],
|
||||
[ AC_MSG_RESULT(no) ]
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
LEVELDB_CPPFLAGS=
|
||||
LIBLEVELDB=
|
||||
|
|
Loading…
Add table
Reference in a new issue