Skip to content

Commit 89be42f

Browse files
hebastotheunivasild
committed
cmake: Check system symbols
Co-authored-by: Cory Fields <[email protected]> Co-authored-by: Vasil Dimov <[email protected]>
1 parent 64b1fd4 commit 89be42f

File tree

4 files changed

+390
-0
lines changed

4 files changed

+390
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ set(COPYRIGHT_HOLDERS "The %s developers")
3333
set(COPYRIGHT_HOLDERS_FINAL "The ${PROJECT_NAME} developers")
3434
set(PACKAGE_BUGREPORT "https://github.com/bitcoin/bitcoin/issues")
3535

36+
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module)
37+
3638
# Configurable options.
3739
# When adding a new option, end the <help_text> with a full stop for consistency.
3840
include(CMakeDependentOption)
@@ -58,6 +60,7 @@ else()
5860
endif()
5961
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
6062

63+
include(CheckSourceCompilesAndLinks)
6164
include(cmake/introspection.cmake)
6265

6366
add_subdirectory(src)

cmake/bitcoin-config.h.in

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,138 @@
3030
/* Copyright year */
3131
#define COPYRIGHT_YEAR @COPYRIGHT_YEAR@
3232

33+
/* Define this symbol if you have __builtin_clzl */
34+
#cmakedefine HAVE_BUILTIN_CLZL 1
35+
36+
/* Define this symbol if you have __builtin_clzll */
37+
#cmakedefine HAVE_BUILTIN_CLZLL 1
38+
3339
/* Define to 1 if you have the <byteswap.h> header file. */
3440
#cmakedefine HAVE_BYTESWAP_H 1
3541

42+
/* Define to 1 if you have the declaration of `be16toh', and to 0 if you
43+
don't. */
44+
#cmakedefine01 HAVE_DECL_BE16TOH
45+
46+
/* Define to 1 if you have the declaration of `be32toh', and to 0 if you
47+
don't. */
48+
#cmakedefine01 HAVE_DECL_BE32TOH
49+
50+
/* Define to 1 if you have the declaration of `be64toh', and to 0 if you
51+
don't. */
52+
#cmakedefine01 HAVE_DECL_BE64TOH
53+
54+
/* Define to 1 if you have the declaration of `bswap_16', and to 0 if you
55+
don't. */
56+
#cmakedefine01 HAVE_DECL_BSWAP_16
57+
58+
/* Define to 1 if you have the declaration of `bswap_32', and to 0 if you
59+
don't. */
60+
#cmakedefine01 HAVE_DECL_BSWAP_32
61+
62+
/* Define to 1 if you have the declaration of `bswap_64', and to 0 if you
63+
don't. */
64+
#cmakedefine01 HAVE_DECL_BSWAP_64
65+
66+
/* Define to 1 if you have the declaration of `fork', and to 0 if you don't.
67+
*/
68+
#cmakedefine01 HAVE_DECL_FORK
69+
70+
/* Define to 1 if you have the declaration of `freeifaddrs', and to 0 if you
71+
don't. */
72+
#cmakedefine01 HAVE_DECL_FREEIFADDRS
73+
74+
/* Define to 1 if you have the declaration of `getifaddrs', and to 0 if you
75+
don't. */
76+
#cmakedefine01 HAVE_DECL_GETIFADDRS
77+
78+
/* Define to 1 if you have the declaration of `htobe16', and to 0 if you
79+
don't. */
80+
#cmakedefine01 HAVE_DECL_HTOBE16
81+
82+
/* Define to 1 if you have the declaration of `htobe32', and to 0 if you
83+
don't. */
84+
#cmakedefine01 HAVE_DECL_HTOBE32
85+
86+
/* Define to 1 if you have the declaration of `htobe64', and to 0 if you
87+
don't. */
88+
#cmakedefine01 HAVE_DECL_HTOBE64
89+
90+
/* Define to 1 if you have the declaration of `htole16', and to 0 if you
91+
don't. */
92+
#cmakedefine01 HAVE_DECL_HTOLE16
93+
94+
/* Define to 1 if you have the declaration of `htole32', and to 0 if you
95+
don't. */
96+
#cmakedefine01 HAVE_DECL_HTOLE32
97+
98+
/* Define to 1 if you have the declaration of `htole64', and to 0 if you
99+
don't. */
100+
#cmakedefine01 HAVE_DECL_HTOLE64
101+
102+
/* Define to 1 if you have the declaration of `le16toh', and to 0 if you
103+
don't. */
104+
#cmakedefine01 HAVE_DECL_LE16TOH
105+
106+
/* Define to 1 if you have the declaration of `le32toh', and to 0 if you
107+
don't. */
108+
#cmakedefine01 HAVE_DECL_LE32TOH
109+
110+
/* Define to 1 if you have the declaration of `le64toh', and to 0 if you
111+
don't. */
112+
#cmakedefine01 HAVE_DECL_LE64TOH
113+
114+
/* Define to 1 if you have the declaration of `pipe2', and to 0 if you don't.
115+
*/
116+
#cmakedefine01 HAVE_DECL_PIPE2
117+
118+
/* Define to 1 if you have the declaration of `setsid', and to 0 if you don't.
119+
*/
120+
#cmakedefine01 HAVE_DECL_SETSID
121+
36122
/* Define to 1 if you have the <endian.h> header file. */
37123
#cmakedefine HAVE_ENDIAN_H 1
38124

125+
/* Define to 1 if fdatasync is available. */
126+
#cmakedefine HAVE_FDATASYNC 1
127+
128+
/* Define this symbol if the BSD getentropy system call is available with
129+
sys/random.h */
130+
#cmakedefine HAVE_GETENTROPY_RAND 1
131+
132+
/* Define this symbol if gmtime_r is available */
133+
#cmakedefine HAVE_GMTIME_R 1
134+
135+
/* Define this symbol if you have malloc_info */
136+
#cmakedefine HAVE_MALLOC_INFO 1
137+
138+
/* Define this symbol if you have mallopt with M_ARENA_MAX */
139+
#cmakedefine HAVE_MALLOPT_ARENA_MAX 1
140+
141+
/* Define to 1 if O_CLOEXEC flag is available. */
142+
#cmakedefine01 HAVE_O_CLOEXEC
143+
144+
/* Define this symbol if you have posix_fallocate */
145+
#cmakedefine HAVE_POSIX_FALLOCATE 1
146+
147+
/* Define this symbol to build code that uses getauxval) */
148+
#cmakedefine HAVE_STRONG_GETAUXVAL 1
149+
150+
/* Define this symbol if the BSD sysctl() is available */
151+
#cmakedefine HAVE_SYSCTL 1
152+
153+
/* Define this symbol if the BSD sysctl(KERN_ARND) is available */
154+
#cmakedefine HAVE_SYSCTL_ARND 1
155+
156+
/* Define to 1 if std::system or ::wsystem is available. */
157+
#cmakedefine HAVE_SYSTEM 1
158+
39159
/* Define to 1 if you have the <sys/endian.h> header file. */
40160
#cmakedefine HAVE_SYS_ENDIAN_H 1
41161

162+
/* Define this symbol if the Linux getrandom system call is available */
163+
#cmakedefine HAVE_SYS_GETRANDOM 1
164+
42165
/* Define to 1 if you have the <sys/prctl.h> header file. */
43166
#cmakedefine HAVE_SYS_PRCTL_H 1
44167

@@ -63,6 +186,9 @@
63186
/* Define to the version of this package. */
64187
#define PACKAGE_VERSION "@PROJECT_VERSION@"
65188

189+
/* Define to 1 if strerror_r returns char *. */
190+
#cmakedefine STRERROR_R_CHAR_P 1
191+
66192
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
67193
significant byte first (like Motorola and SPARC, unlike Intel). */
68194
#cmakedefine WORDS_BIGENDIAN 1

0 commit comments

Comments
 (0)