Skip to content

Commit c1c91bb

Browse files
committed
[build] detect std::system or ::wsystem
1 parent 03858b2 commit c1c91bb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

configure.ac

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,29 @@ if test x$use_reduce_exports = xyes; then
925925
[AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
926926
fi
927927

928+
AC_MSG_CHECKING([for std::system])
929+
AC_LINK_IFELSE(
930+
[ AC_LANG_PROGRAM(
931+
[[ #include <cstdlib> ]],
932+
[[ int nErr = std::system(""); ]]
933+
)],
934+
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STD__SYSTEM, 1, Define to 1 if you have the `std::system' function.)],
935+
[ AC_MSG_RESULT(no) ]
936+
)
937+
938+
AC_MSG_CHECKING([for ::_wsystem])
939+
AC_LINK_IFELSE(
940+
[ AC_LANG_PROGRAM(
941+
[[ ]],
942+
[[ int nErr = ::_wsystem(""); ]]
943+
)],
944+
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WSYSTEM, 1, Define to 1 if you have the `::wsystem' function.)],
945+
[ AC_MSG_RESULT(no) ]
946+
)
947+
948+
# Define to 1 if std::system or ::wsystem (Windows) is available
949+
AC_DEFINE([HAVE_SYSTEM], [HAVE_STD__SYSTEM || HAVE_WSYSTEM], [HAVE_WSYSTEM])
950+
928951
LEVELDB_CPPFLAGS=
929952
LIBLEVELDB=
930953
LIBMEMENV=

0 commit comments

Comments
 (0)