diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/util.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index ffd05ae4f8..55fc091bc5 100644 --- a/configure.ac +++ b/configure.ac @@ -378,7 +378,7 @@ if test x$TARGET_OS = xdarwin; then AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"]) fi -AC_CHECK_HEADERS([endian.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h]) +AC_CHECK_HEADERS([endian.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h]) AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])]) AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])]) diff --git a/src/util.cpp b/src/util.cpp index 93fefbac8a..ae2145a3a0 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3,6 +3,10 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "util.h" #include "chainparamsbase.h" @@ -24,7 +28,6 @@ #endif #define _POSIX_C_SOURCE 200112L -#include <sys/prctl.h> #endif // __linux__ @@ -61,6 +64,10 @@ #include <shlobj.h> #endif +#ifdef HAVE_SYS_PRCTL_H +#include <sys/prctl.h> +#endif + #include <boost/algorithm/string/case_conv.hpp> // for to_lower() #include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith() |