From 3cb2e65a3b0606eba8ad16dd75d527b427ec0cb1 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 8 Mar 2024 21:00:38 +0000 Subject: [PATCH 1/2] fixup! cmake: Check system headers --- cmake/bitcoin-config.h.in | 9 --------- cmake/introspection.cmake | 3 --- 2 files changed, 12 deletions(-) diff --git a/cmake/bitcoin-config.h.in b/cmake/bitcoin-config.h.in index bb44dae42eb0..d9ddaa69dd99 100644 --- a/cmake/bitcoin-config.h.in +++ b/cmake/bitcoin-config.h.in @@ -43,9 +43,6 @@ /* Define this symbol if you have __builtin_clzll */ #cmakedefine HAVE_BUILTIN_CLZLL 1 -/* Define to 1 if you have the 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 @@ -132,9 +129,6 @@ /* Define if the dllexport attribute is supported. */ #cmakedefine HAVE_DLLEXPORT_ATTRIBUTE 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_ENDIAN_H 1 - /* Define to 1 if fdatasync is available. */ #cmakedefine HAVE_FDATASYNC 1 @@ -169,9 +163,6 @@ /* Define to 1 if std::system or ::wsystem is available. */ #cmakedefine HAVE_SYSTEM 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_ENDIAN_H 1 - /* Define this symbol if the Linux getrandom system call is available */ #cmakedefine HAVE_SYS_GETRANDOM 1 diff --git a/cmake/introspection.cmake b/cmake/introspection.cmake index d9865874901a..8ccbd8ad9f77 100644 --- a/cmake/introspection.cmake +++ b/cmake/introspection.cmake @@ -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) From 33a454e552d11353b4a3516a1c56228e1ea9f524 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 8 Mar 2024 21:02:11 +0000 Subject: [PATCH 2/2] fixup! cmake: Check system symbols --- cmake/bitcoin-config.h.in | 60 --------------------------------------- cmake/introspection.cmake | 26 ----------------- 2 files changed, 86 deletions(-) diff --git a/cmake/bitcoin-config.h.in b/cmake/bitcoin-config.h.in index d9ddaa69dd99..012af29059b0 100644 --- a/cmake/bitcoin-config.h.in +++ b/cmake/bitcoin-config.h.in @@ -43,30 +43,6 @@ /* Define this symbol if you have __builtin_clzll */ #cmakedefine HAVE_BUILTIN_CLZLL 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 @@ -79,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 diff --git a/cmake/introspection.cmake b/cmake/introspection.cmake index 8ccbd8ad9f77..3df6aea6faa8 100644 --- a/cmake/introspection.cmake +++ b/cmake/introspection.cmake @@ -33,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)