Skip to content

Commit

Permalink
Merge #113: cmake: Backport PR29263 from the master branch
Browse files Browse the repository at this point in the history
33a454e fixup! cmake: Check system symbols (Hennadii Stepanov)
3cb2e65 fixup! cmake: Check system headers (Hennadii Stepanov)

Pull request description:

  This PR backports build system changes from bitcoin#29263.

ACKs for top commit:
  pablomartin4btc:
    ACK 33a454e

Tree-SHA512: 1793c6504a7190134c0ce075e959d22c4a3640d54a4d141f5117975bed267952cc8c7da488426e48022eba1eb77d3353783d77a20907b0cfa183e0b68d824133
  • Loading branch information
hebasto committed Mar 17, 2024
2 parents 822c3fc + 33a454e commit dda7fbc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 98 deletions.
69 changes: 0 additions & 69 deletions cmake/bitcoin-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,6 @@
/* Define this symbol if you have __builtin_clzll */
#cmakedefine HAVE_BUILTIN_CLZLL 1

/* Define to 1 if you have the <byteswap.h> header file. */
#cmakedefine HAVE_BYTESWAP_H 1

/* Define to 1 if you have the declaration of `be16toh', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_BE16TOH

/* Define to 1 if you have the declaration of `be32toh', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_BE32TOH

/* Define to 1 if you have the declaration of `be64toh', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_BE64TOH

/* Define to 1 if you have the declaration of `bswap_16', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_BSWAP_16

/* Define to 1 if you have the declaration of `bswap_32', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_BSWAP_32

/* Define to 1 if you have the declaration of `bswap_64', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_BSWAP_64

/* Define to 1 if you have the declaration of `fork', and to 0 if you don't.
*/
#cmakedefine01 HAVE_DECL_FORK
Expand All @@ -82,42 +55,6 @@
don't. */
#cmakedefine01 HAVE_DECL_GETIFADDRS

/* Define to 1 if you have the declaration of `htobe16', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_HTOBE16

/* Define to 1 if you have the declaration of `htobe32', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_HTOBE32

/* Define to 1 if you have the declaration of `htobe64', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_HTOBE64

/* Define to 1 if you have the declaration of `htole16', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_HTOLE16

/* Define to 1 if you have the declaration of `htole32', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_HTOLE32

/* Define to 1 if you have the declaration of `htole64', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_HTOLE64

/* Define to 1 if you have the declaration of `le16toh', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_LE16TOH

/* Define to 1 if you have the declaration of `le32toh', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_LE32TOH

/* Define to 1 if you have the declaration of `le64toh', and to 0 if you
don't. */
#cmakedefine01 HAVE_DECL_LE64TOH

/* Define to 1 if you have the declaration of `pipe2', and to 0 if you don't.
*/
#cmakedefine01 HAVE_DECL_PIPE2
Expand All @@ -132,9 +69,6 @@
/* Define if the dllexport attribute is supported. */
#cmakedefine HAVE_DLLEXPORT_ATTRIBUTE 1

/* Define to 1 if you have the <endian.h> header file. */
#cmakedefine HAVE_ENDIAN_H 1

/* Define to 1 if fdatasync is available. */
#cmakedefine HAVE_FDATASYNC 1

Expand Down Expand Up @@ -169,9 +103,6 @@
/* Define to 1 if std::system or ::wsystem is available. */
#cmakedefine HAVE_SYSTEM 1

/* Define to 1 if you have the <sys/endian.h> header file. */
#cmakedefine HAVE_SYS_ENDIAN_H 1

/* Define this symbol if the Linux getrandom system call is available */
#cmakedefine HAVE_SYS_GETRANDOM 1

Expand Down
29 changes: 0 additions & 29 deletions cmake/introspection.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

# The following HAVE_{HEADER}_H variables go to the bitcoin-config.h header.
check_include_file_cxx(byteswap.h HAVE_BYTESWAP_H)
check_include_file_cxx(endian.h HAVE_ENDIAN_H)
check_include_file_cxx(sys/endian.h HAVE_SYS_ENDIAN_H)
check_include_file_cxx(sys/prctl.h HAVE_SYS_PRCTL_H)
check_include_file_cxx(sys/resources.h HAVE_SYS_RESOURCES_H)
check_include_file_cxx(sys/vmmeter.h HAVE_SYS_VMMETER_H)
Expand All @@ -36,32 +33,6 @@ check_cxx_source_compiles("

check_cxx_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC)

if(HAVE_BYTESWAP_H)
check_cxx_symbol_exists(bswap_16 "byteswap.h" HAVE_DECL_BSWAP_16)
check_cxx_symbol_exists(bswap_32 "byteswap.h" HAVE_DECL_BSWAP_32)
check_cxx_symbol_exists(bswap_64 "byteswap.h" HAVE_DECL_BSWAP_64)
endif()

if(HAVE_ENDIAN_H OR HAVE_SYS_ENDIAN_H)
if(HAVE_ENDIAN_H)
set(ENDIAN_HEADER "endian.h")
else()
set(ENDIAN_HEADER "sys/endian.h")
endif()
check_cxx_symbol_exists(be16toh ${ENDIAN_HEADER} HAVE_DECL_BE16TOH)
check_cxx_symbol_exists(be32toh ${ENDIAN_HEADER} HAVE_DECL_BE32TOH)
check_cxx_symbol_exists(be64toh ${ENDIAN_HEADER} HAVE_DECL_BE64TOH)
check_cxx_symbol_exists(htobe16 ${ENDIAN_HEADER} HAVE_DECL_HTOBE16)
check_cxx_symbol_exists(htobe32 ${ENDIAN_HEADER} HAVE_DECL_HTOBE32)
check_cxx_symbol_exists(htobe64 ${ENDIAN_HEADER} HAVE_DECL_HTOBE64)
check_cxx_symbol_exists(htole16 ${ENDIAN_HEADER} HAVE_DECL_HTOLE16)
check_cxx_symbol_exists(htole32 ${ENDIAN_HEADER} HAVE_DECL_HTOLE32)
check_cxx_symbol_exists(htole64 ${ENDIAN_HEADER} HAVE_DECL_HTOLE64)
check_cxx_symbol_exists(le16toh ${ENDIAN_HEADER} HAVE_DECL_LE16TOH)
check_cxx_symbol_exists(le32toh ${ENDIAN_HEADER} HAVE_DECL_LE32TOH)
check_cxx_symbol_exists(le64toh ${ENDIAN_HEADER} HAVE_DECL_LE64TOH)
endif()

check_include_file_cxx(unistd.h HAVE_UNISTD_H)
if(HAVE_UNISTD_H)
check_cxx_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
Expand Down

0 comments on commit dda7fbc

Please sign in to comment.