Skip to content

Commit 82a8521

Browse files
committed
Merge bitcoin/bitcoin#22845: build: improve check for ::(w)system
3ec633e 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 ACK 3ec633e Tree-SHA512: 02c39ba3179136ec1dc28df026b7fa5d732914c85622298ba7ec880f1ae9324208d322a47be451a5c2ff2e165ad1d446bae92e7018db8e517e7ac38fca25a0a3
2 parents 71bdf0b + 3ec633e commit 82a8521

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

configure.ac

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,13 +1229,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12291229
[ AC_MSG_RESULT(no); HAVE_WEAK_GETAUXVAL=0 ]
12301230
)
12311231

1232+
have_any_system=no
12321233
AC_MSG_CHECKING([for std::system])
12331234
AC_LINK_IFELSE(
12341235
[ AC_LANG_PROGRAM(
12351236
[[ #include <cstdlib> ]],
12361237
[[ int nErr = std::system(""); ]]
12371238
)],
1238-
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STD__SYSTEM, 1, Define to 1 if std::system is available.)],
1239+
[ AC_MSG_RESULT(yes); have_any_system=yes],
12391240
[ AC_MSG_RESULT(no) ]
12401241
)
12411242

@@ -1245,11 +1246,13 @@ AC_LINK_IFELSE(
12451246
[[ ]],
12461247
[[ int nErr = ::_wsystem(""); ]]
12471248
)],
1248-
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WSYSTEM, 1, Define to 1 if ::wsystem is available.)],
1249+
[ AC_MSG_RESULT(yes); have_any_system=yes],
12491250
[ AC_MSG_RESULT(no) ]
12501251
)
12511252

1252-
AC_DEFINE([HAVE_SYSTEM], [HAVE_STD__SYSTEM || HAVE_WSYSTEM], [std::system or ::wsystem])
1253+
if test "x$have_any_system" != "xno"; then
1254+
AC_DEFINE(HAVE_SYSTEM, 1, Define to 1 if std::system or ::wsystem is available.)
1255+
fi
12531256

12541257
LEVELDB_CPPFLAGS=
12551258
LIBLEVELDB=

0 commit comments

Comments
 (0)