]>
Commit | Line | Data |
---|---|---|
35b8af92 CF |
1 | dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) |
2 | AC_PREREQ([2.60]) | |
3 | define(_CLIENT_VERSION_MAJOR, 0) | |
d7492304 | 4 | define(_CLIENT_VERSION_MINOR, 10) |
ad6ae489 | 5 | define(_CLIENT_VERSION_REVISION, 99) |
35b8af92 | 6 | define(_CLIENT_VERSION_BUILD, 0) |
ad6ae489 | 7 | define(_CLIENT_VERSION_IS_RELEASE, false) |
edbc9045 | 8 | define(_COPYRIGHT_YEAR, 2015) |
fe14e8d7 | 9 | AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[[email protected]],[bitcoin]) |
e5438111 | 10 | AC_CONFIG_SRCDIR([src/main.cpp]) |
11 | AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) | |
52a5f903 | 12 | AC_CONFIG_AUX_DIR([build-aux]) |
13 | AC_CONFIG_MACRO_DIR([build-aux/m4]) | |
1723862e | 14 | |
35b8af92 | 15 | AC_CANONICAL_HOST |
1723862e | 16 | |
35b8af92 CF |
17 | AH_TOP([#ifndef BITCOIN_CONFIG_H]) |
18 | AH_TOP([#define BITCOIN_CONFIG_H]) | |
19 | AH_BOTTOM([#endif //BITCOIN_CONFIG_H]) | |
20 | ||
35b8af92 CF |
21 | dnl faketime breaks configure and is only needed for make. Disable it here. |
22 | unset FAKETIME | |
23 | ||
eefb766c | 24 | dnl Automake init set-up and checks |
35b8af92 CF |
25 | AM_INIT_AUTOMAKE([no-define subdir-objects foreign]) |
26 | ||
27 | dnl faketime messes with timestamps and causes configure to be re-run. | |
28 | dnl --disable-maintainer-mode can be used to bypass this. | |
29 | AM_MAINTAINER_MODE([enable]) | |
30 | ||
31 | dnl make the compilation flags quiet unless V=1 is used | |
32 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | |
33 | ||
eefb766c | 34 | dnl Compiler checks (here before libtool). |
35 | if test "x${CXXFLAGS+set}" = "xset"; then | |
36 | CXXFLAGS_overridden=yes | |
37 | else | |
38 | CXXFLAGS_overridden=no | |
39 | fi | |
52a5f903 | 40 | AC_PROG_CXX |
52a5f903 | 41 | m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX]) |
eefb766c | 42 | |
43 | dnl By default, libtool for mingw refuses to link static libs into a dll for | |
44 | dnl fear of mixing pic/non-pic objects, and import/export complications. Since | |
45 | dnl we have those under control, re-enable that functionality. | |
46 | case $host in | |
47 | *mingw*) | |
48 | lt_cv_deplibs_check_method="pass_all" | |
49 | ;; | |
50 | esac | |
51 | dnl Libtool init checks. | |
19df238a | 52 | LT_INIT([pic-only]) |
eefb766c | 53 | |
54 | dnl Check/return PATH for base programs. | |
52a5f903 | 55 | AC_PATH_TOOL(AR, ar) |
56 | AC_PATH_TOOL(RANLIB, ranlib) | |
57 | AC_PATH_TOOL(STRIP, strip) | |
58 | AC_PATH_TOOL(GCOV, gcov) | |
59 | AC_PATH_PROG(LCOV, lcov) | |
60 | AC_PATH_PROG(JAVA, java) | |
61 | AC_PATH_PROG(GENHTML, genhtml) | |
62 | AC_PATH_PROG([GIT], [git]) | |
63 | AC_PATH_PROG(CCACHE,ccache) | |
64 | AC_PATH_PROG(XGETTEXT,xgettext) | |
65 | AC_PATH_PROG(HEXDUMP,hexdump) | |
eefb766c | 66 | |
eefb766c | 67 | dnl pkg-config check. |
52a5f903 | 68 | PKG_PROG_PKG_CONFIG |
69 | ||
4f9e993b WL |
70 | # Enable wallet |
71 | AC_ARG_ENABLE([wallet], | |
72 | [AS_HELP_STRING([--enable-wallet], | |
73 | [enable wallet (default is yes)])], | |
74 | [enable_wallet=$enableval], | |
75 | [enable_wallet=yes]) | |
76 | ||
35b8af92 CF |
77 | AC_ARG_WITH([miniupnpc], |
78 | [AS_HELP_STRING([--with-miniupnpc], | |
79 | [enable UPNP (default is yes if libminiupnpc is found)])], | |
80 | [use_upnp=$withval], | |
81 | [use_upnp=auto]) | |
82 | ||
83 | AC_ARG_ENABLE([upnp-default], | |
84 | [AS_HELP_STRING([--enable-upnp-default], | |
85 | [if UPNP is enabled, turn it on at startup (default is no)])], | |
86 | [use_upnp_default=$enableval], | |
87 | [use_upnp_default=no]) | |
88 | ||
35b8af92 CF |
89 | AC_ARG_ENABLE(tests, |
90 | AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]), | |
91 | [use_tests=$enableval], | |
92 | [use_tests=yes]) | |
93 | ||
94 | AC_ARG_WITH([comparison-tool], | |
47b9374e | 95 | AS_HELP_STRING([--with-comparison-tool],[path to java comparison tool (requires --enable-tests)]), |
35b8af92 CF |
96 | [use_comparison_tool=$withval], |
97 | [use_comparison_tool=no]) | |
98 | ||
47b9374e MC |
99 | AC_ARG_ENABLE([comparison-tool-reorg-tests], |
100 | AS_HELP_STRING([--enable-comparison-tool-reorg-tests],[enable expensive reorg tests in the comparison tool (default no)]), | |
101 | [use_comparison_tool_reorg_tests=$enableval], | |
102 | [use_comparison_tool_reorg_tests=no]) | |
103 | ||
35b8af92 CF |
104 | AC_ARG_WITH([qrencode], |
105 | [AS_HELP_STRING([--with-qrencode], | |
106 | [enable QR code support (default is yes if qt is enabled and libqrencode is found)])], | |
107 | [use_qr=$withval], | |
108 | [use_qr=auto]) | |
109 | ||
35b8af92 CF |
110 | AC_ARG_ENABLE([hardening], |
111 | [AS_HELP_STRING([--enable-hardening], | |
112 | [attempt to harden the resulting executables (default is yes)])], | |
113 | [use_hardening=$enableval], | |
114 | [use_hardening=yes]) | |
115 | ||
e432a5f0 CF |
116 | AC_ARG_ENABLE([reduce-exports], |
117 | [AS_HELP_STRING([--enable-reduce-exports], | |
3ee028f1 | 118 | [attempt to reduce exported symbols in the resulting executables (default is no)])], |
e432a5f0 | 119 | [use_reduce_exports=$enableval], |
3ee028f1 | 120 | [use_reduce_exports=no]) |
e432a5f0 | 121 | |
35b8af92 CF |
122 | AC_ARG_ENABLE([ccache], |
123 | [AS_HELP_STRING([--enable-ccache], | |
e18e1001 | 124 | [use ccache for building (default is yes if ccache is found)])], |
35b8af92 CF |
125 | [use_ccache=$enableval], |
126 | [use_ccache=auto]) | |
127 | ||
128 | AC_ARG_ENABLE([lcov], | |
129 | [AS_HELP_STRING([--enable-lcov], | |
130 | [enable lcov testing (default is no)])], | |
131 | [use_lcov=yes], | |
132 | [use_lcov=no]) | |
133 | ||
d5aab704 CF |
134 | AC_ARG_ENABLE([glibc-back-compat], |
135 | [AS_HELP_STRING([--enable-glibc-back-compat], | |
aa367306 | 136 | [enable backwards compatibility with glibc])], |
d5aab704 CF |
137 | [use_glibc_compat=$enableval], |
138 | [use_glibc_compat=no]) | |
139 | ||
35b8af92 CF |
140 | AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], []) |
141 | ||
f5f157b8 | 142 | # Enable debug |
143 | AC_ARG_ENABLE([debug], | |
144 | [AS_HELP_STRING([--enable-debug], | |
145 | [use debug compiler flags and macros (default is no)])], | |
146 | [enable_debug=$enableval], | |
147 | [enable_debug=no]) | |
148 | ||
149 | if test "x$enable_debug" = xyes; then | |
150 | if test "x$GCC" = xyes; then | |
151 | CFLAGS="-g3 -O0 -DDEBUG" | |
152 | fi | |
153 | ||
154 | if test "x$GXX" = xyes; then | |
155 | CXXFLAGS="-g3 -O0 -DDEBUG" | |
156 | fi | |
157 | fi | |
158 | ||
35b8af92 CF |
159 | ## TODO: Remove these hard-coded paths and flags. They are here for the sake of |
160 | ## compatibility with the legacy buildsystem. | |
161 | ## | |
123e4f87 LD |
162 | if test "x$CXXFLAGS_overridden" = "xno"; then |
163 | CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter" | |
164 | fi | |
51ed9ec9 | 165 | CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS" |
35b8af92 | 166 | |
b7a4ecc1 LD |
167 | AC_ARG_WITH([utils], |
168 | [AS_HELP_STRING([--with-utils], | |
169 | [build bitcoin-cli bitcoin-tx (default=yes)])], | |
170 | [build_bitcoin_utils=$withval], | |
171 | [build_bitcoin_utils=yes]) | |
172 | ||
173 | AC_ARG_WITH([libs], | |
174 | [AS_HELP_STRING([--with-libs], | |
175 | [build libraries (default=yes)])], | |
176 | [build_bitcoin_libs=$withval], | |
177 | [build_bitcoin_libs=yes]) | |
178 | ||
179 | AC_ARG_WITH([daemon], | |
180 | [AS_HELP_STRING([--with-daemon], | |
181 | [build bitcoind daemon (default=yes)])], | |
182 | [build_bitcoind=$withval], | |
183 | [build_bitcoind=yes]) | |
184 | ||
35b8af92 CF |
185 | AC_LANG_PUSH([C++]) |
186 | ||
187 | use_pkgconfig=yes | |
188 | case $host in | |
189 | *mingw*) | |
190 | ||
96b9603c | 191 | #pkgconfig does more harm than good with MinGW |
35b8af92 CF |
192 | use_pkgconfig=no |
193 | ||
194 | TARGET_OS=windows | |
195 | AC_CHECK_LIB([mingwthrd], [main],, AC_MSG_ERROR(lib missing)) | |
196 | AC_CHECK_LIB([kernel32], [main],, AC_MSG_ERROR(lib missing)) | |
197 | AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(lib missing)) | |
198 | AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(lib missing)) | |
199 | AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(lib missing)) | |
200 | AC_CHECK_LIB([winspool], [main],, AC_MSG_ERROR(lib missing)) | |
201 | AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(lib missing)) | |
202 | AC_CHECK_LIB([shell32], [main],, AC_MSG_ERROR(lib missing)) | |
203 | AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(lib missing)) | |
204 | AC_CHECK_LIB([ole32], [main],, AC_MSG_ERROR(lib missing)) | |
205 | AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(lib missing)) | |
206 | AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(lib missing)) | |
207 | AC_CHECK_LIB([rpcrt4], [main],, AC_MSG_ERROR(lib missing)) | |
208 | AC_CHECK_LIB([advapi32], [main],, AC_MSG_ERROR(lib missing)) | |
209 | AC_CHECK_LIB([ws2_32], [main],, AC_MSG_ERROR(lib missing)) | |
210 | AC_CHECK_LIB([mswsock], [main],, AC_MSG_ERROR(lib missing)) | |
211 | AC_CHECK_LIB([shlwapi], [main],, AC_MSG_ERROR(lib missing)) | |
212 | AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing)) | |
c589f5f2 CF |
213 | AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing)) |
214 | ||
575e70c0 CF |
215 | # -static is interpreted by libtool, where it has a different meaning. |
216 | # In libtool-speak, it's -all-static. | |
e0077de5 | 217 | AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"]) |
575e70c0 | 218 | |
35b8af92 CF |
219 | AC_PATH_PROG([MAKENSIS], [makensis], none) |
220 | if test x$MAKENSIS = xnone; then | |
221 | AC_MSG_WARN("makensis not found. Cannot create installer.") | |
222 | fi | |
223 | ||
5ceb9c96 CF |
224 | AC_PATH_TOOL(WINDRES, windres, none) |
225 | if test x$WINDRES = xnone; then | |
226 | AC_MSG_ERROR("windres not found") | |
227 | fi | |
228 | ||
b77dfdc9 | 229 | CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB" |
35b8af92 | 230 | LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE" |
123e4f87 LD |
231 | if test "x$CXXFLAGS_overridden" = "xno"; then |
232 | CXXFLAGS="$CXXFLAGS -w" | |
233 | fi | |
2f87b38e WL |
234 | case $host in |
235 | i?86-*) WINDOWS_BITS=32 ;; | |
236 | x86_64-*) WINDOWS_BITS=64 ;; | |
237 | *) AC_MSG_ERROR("Could not determine win32/win64 for installer") ;; | |
238 | esac | |
239 | AC_SUBST(WINDOWS_BITS) | |
9ed8979e CF |
240 | |
241 | dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against. | |
242 | dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override | |
243 | dnl its command here, with the predeps/postdeps removed, and -static inserted. Postdeps are | |
244 | dnl also overridden to prevent their insertion later. | |
245 | dnl This should only affect dll's. | |
246 | archive_cmds_CXX="\$CC -shared \$libobjs \$deplibs \$compiler_flags -static -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib" | |
247 | postdeps_CXX= | |
248 | ||
35b8af92 CF |
249 | ;; |
250 | *darwin*) | |
251 | TARGET_OS=darwin | |
252 | LEVELDB_TARGET_FLAGS="TARGET_OS=Darwin" | |
253 | if test x$cross_compiling != xyes; then | |
b62bbb1f | 254 | BUILD_OS=darwin |
35b8af92 CF |
255 | AC_CHECK_PROG([PORT],port, port) |
256 | if test x$PORT = xport; then | |
257 | dnl add default macports paths | |
4c69ebed PJ |
258 | CPPFLAGS="$CPPFLAGS -isystem /opt/local/include" |
259 | LIBS="$LIBS -L/opt/local/lib" | |
260 | if test -d /opt/local/include/db48; then | |
261 | CPPFLAGS="$CPPFLAGS -I/opt/local/include/db48" | |
262 | LIBS="$LIBS -L/opt/local/lib/db48" | |
263 | fi | |
35b8af92 CF |
264 | fi |
265 | ||
266 | AC_CHECK_PROG([BREW],brew, brew) | |
267 | if test x$BREW = xbrew; then | |
27368e76 | 268 | dnl These Homebrew packages may be keg-only, meaning that they won't be found |
9fedafba CF |
269 | dnl in expected paths because they may conflict with system files. Ask |
270 | dnl Homebrew where each one is located, then adjust paths accordingly. | |
271 | dnl It's safe to add these paths even if the functionality is disabled by | |
272 | dnl the user (--without-wallet or --without-gui for example). | |
273 | ||
274 | openssl_prefix=`$BREW --prefix openssl 2>/dev/null` | |
275 | bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null` | |
276 | qt5_prefix=`$BREW --prefix qt5 2>/dev/null` | |
277 | if test x$openssl_prefix != x; then | |
b77b4eda | 278 | PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" |
f9e40fb0 | 279 | export PKG_CONFIG_PATH |
9fedafba CF |
280 | fi |
281 | if test x$bdb_prefix != x; then | |
282 | CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include" | |
283 | LIBS="$LIBS -L$bdb_prefix/lib" | |
284 | fi | |
285 | if test x$qt5_prefix != x; then | |
b77b4eda | 286 | PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" |
f9e40fb0 | 287 | export PKG_CONFIG_PATH |
9fedafba | 288 | fi |
35b8af92 | 289 | fi |
b62bbb1f CF |
290 | else |
291 | case $build_os in | |
292 | *darwin*) | |
293 | BUILD_OS=darwin | |
294 | ;; | |
295 | *) | |
296 | AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) | |
297 | AC_PATH_TOOL([OTOOL], [otool], otool) | |
298 | AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) | |
b7f2cdc8 CF |
299 | |
300 | dnl libtool will try to strip the static lib, which is a problem for | |
301 | dnl cross-builds because strip attempts to call a hard-coded ld, | |
302 | dnl which may not exist in the path. Stripping the .a is not | |
303 | dnl necessary, so just disable it. | |
304 | old_striplib= | |
b62bbb1f CF |
305 | ;; |
306 | esac | |
35b8af92 CF |
307 | fi |
308 | ||
9eb5a5fb | 309 | AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"]) |
35b8af92 | 310 | CPPFLAGS="$CPPFLAGS -DMAC_OSX" |
35b8af92 | 311 | ;; |
ab123ad4 CF |
312 | *linux*) |
313 | TARGET_OS=linux | |
314 | ;; | |
35b8af92 | 315 | *) |
35b8af92 CF |
316 | ;; |
317 | esac | |
318 | ||
35b8af92 CF |
319 | if test x$use_comparison_tool != xno; then |
320 | AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool) | |
321 | fi | |
322 | ||
47b9374e | 323 | if test x$use_comparison_tool_reorg_tests != xno; then |
b77b4eda | 324 | if test x$use_comparison_tool = x; then |
47b9374e MC |
325 | AC_MSG_ERROR("comparison tool reorg tests but comparison tool was not specified") |
326 | fi | |
327 | AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 1) | |
328 | else | |
329 | AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0) | |
330 | fi | |
331 | ||
b77b4eda LD |
332 | if test x$use_lcov = xyes; then |
333 | if test x$LCOV = x; then | |
35b8af92 CF |
334 | AC_MSG_ERROR("lcov testing requested but lcov not found") |
335 | fi | |
b77b4eda | 336 | if test x$GCOV = x; then |
35b8af92 CF |
337 | AC_MSG_ERROR("lcov testing requested but gcov not found") |
338 | fi | |
b77b4eda | 339 | if test x$JAVA = x; then |
35b8af92 CF |
340 | AC_MSG_ERROR("lcov testing requested but java not found") |
341 | fi | |
b77b4eda | 342 | if test x$GENHTML = x; then |
35b8af92 CF |
343 | AC_MSG_ERROR("lcov testing requested but genhtml not found") |
344 | fi | |
b77b4eda | 345 | if test x$use_comparison_tool = x; then |
35b8af92 CF |
346 | AC_MSG_ERROR("lcov testing requested but comparison tool was not specified") |
347 | fi | |
348 | LCOV="$LCOV --gcov-tool=$GCOV" | |
349 | AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"], | |
350 | [AC_MSG_ERROR("lcov testing requested but --coverage flag does not work")]) | |
351 | fi | |
352 | ||
353 | dnl Require little endian | |
354 | AC_C_BIGENDIAN([AC_MSG_ERROR("Big Endian not supported")]) | |
355 | ||
356 | dnl Check for pthread compile/link requirements | |
357 | AX_PTHREAD | |
35b8af92 CF |
358 | |
359 | # The following macro will add the necessary defines to bitcoin-config.h, but | |
360 | # they also need to be passed down to any subprojects. Pull the results out of | |
361 | # the cache and add them to CPPFLAGS. | |
362 | AC_SYS_LARGEFILE | |
a60838d0 WL |
363 | # detect POSIX or GNU variant of strerror_r |
364 | AC_FUNC_STRERROR_R | |
35b8af92 CF |
365 | |
366 | if test x$ac_cv_sys_file_offset_bits != x && | |
367 | test x$ac_cv_sys_file_offset_bits != xno && | |
368 | test x$ac_cv_sys_file_offset_bits != xunknown; then | |
369 | CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" | |
370 | fi | |
371 | ||
372 | if test x$ac_cv_sys_large_files != x && | |
373 | test x$ac_cv_sys_large_files != xno && | |
374 | test x$ac_cv_sys_large_files != xunknown; then | |
375 | CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files" | |
376 | fi | |
377 | ||
378 | AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"]) | |
379 | ||
f36a40f7 CF |
380 | AX_GCC_FUNC_ATTRIBUTE([visibility]) |
381 | AX_GCC_FUNC_ATTRIBUTE([dllexport]) | |
382 | AX_GCC_FUNC_ATTRIBUTE([dllimport]) | |
383 | ||
d5aab704 CF |
384 | if test x$use_glibc_compat != xno; then |
385 | ||
386 | #__fdelt_chk's params and return type have changed from long unsigned int to long int. | |
387 | # See which one is present here. | |
388 | AC_MSG_CHECKING(__fdelt_chk type) | |
e2a98d27 | 389 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE |
8021cf8d CF |
390 | #undef _FORTIFY_SOURCE |
391 | #endif | |
392 | #define _FORTIFY_SOURCE 2 | |
d5aab704 | 393 | #include <sys/select.h> |
e2a98d27 | 394 | extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])], |
d5aab704 CF |
395 | [ fdelt_type="long unsigned int"], |
396 | [ fdelt_type="long int"]) | |
397 | AC_MSG_RESULT($fdelt_type) | |
398 | AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk]) | |
399 | ||
400 | fi | |
401 | ||
35b8af92 CF |
402 | if test x$use_hardening != xno; then |
403 | AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"]) | |
4e57e238 | 404 | AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"]) |
35b8af92 | 405 | |
9b4e03b2 LD |
406 | AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[ |
407 | AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[ | |
408 | HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE" | |
409 | ]) | |
410 | HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2" | |
411 | ]) | |
35b8af92 CF |
412 | |
413 | AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"]) | |
414 | AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"]) | |
505867ac MM |
415 | AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"]) |
416 | AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"]) | |
35b8af92 CF |
417 | |
418 | if test x$TARGET_OS != xwindows; then | |
eccd5856 CF |
419 | # All windows code is PIC, forcing it on just adds useless compile warnings |
420 | AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"]) | |
35b8af92 CF |
421 | AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"]) |
422 | fi | |
423 | ||
811a765b CF |
424 | case $host in |
425 | *mingw*) | |
426 | AC_CHECK_LIB([ssp], [main],, AC_MSG_ERROR(lib missing)) | |
427 | ;; | |
428 | esac | |
429 | ||
35b8af92 CF |
430 | CXXFLAGS="$CXXFLAGS $HARDENED_CXXFLAGS" |
431 | CPPFLAGS="$CPPFLAGS $HARDENED_CPPFLAGS" | |
432 | LDFLAGS="$LDFLAGS $HARDENED_LDFLAGS" | |
433 | OBJCXXFLAGS="$CXXFLAGS" | |
434 | fi | |
435 | ||
436 | dnl this flag screws up non-darwin gcc even when the check fails. special-case it. | |
437 | if test x$TARGET_OS = xdarwin; then | |
438 | AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"]) | |
439 | fi | |
440 | ||
4c61ba40 | 441 | 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]) |
caf6150e HL |
442 | AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])]) |
443 | AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])]) | |
f2647cc0 | 444 | |
494f6e7d PJ |
445 | AC_CHECK_DECLS([strnlen]) |
446 | ||
f2647cc0 CF |
447 | AC_CHECK_DECLS([le32toh, le64toh, htole32, htole64, be32toh, be64toh, htobe32, htobe64],,, |
448 | [#if HAVE_ENDIAN_H | |
449 | #include <endian.h> | |
450 | #endif]) | |
35b8af92 CF |
451 | |
452 | dnl Check for MSG_NOSIGNAL | |
453 | AC_MSG_CHECKING(for MSG_NOSIGNAL) | |
e2a98d27 | 454 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], |
455 | [[ int f = MSG_NOSIGNAL; ]])], | |
35b8af92 CF |
456 | [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ], |
457 | [ AC_MSG_RESULT(no)] | |
458 | ) | |
459 | ||
460b32d7 CF |
460 | AC_SEARCH_LIBS([clock_gettime],[rt]) |
461 | ||
e432a5f0 CF |
462 | AC_MSG_CHECKING([for visibility attribute]) |
463 | AC_LINK_IFELSE([AC_LANG_SOURCE([ | |
464 | int foo_def( void ) __attribute__((visibility("default"))); | |
465 | int main(){} | |
466 | ])], | |
467 | [ | |
468 | AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.]) | |
469 | AC_MSG_RESULT(yes) | |
470 | ], | |
471 | [ | |
472 | AC_MSG_RESULT(no) | |
473 | if test x$use_reduce_exports = xyes; then | |
474 | AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.]) | |
475 | fi | |
e432a5f0 CF |
476 | ] |
477 | ) | |
478 | ||
3ee028f1 | 479 | if test x$use_reduce_exports = xyes; then |
e432a5f0 | 480 | AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"], |
3ee028f1 | 481 | [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.])]) |
e432a5f0 CF |
482 | fi |
483 | ||
4a290b52 LD |
484 | LEVELDB_CPPFLAGS= |
485 | LIBLEVELDB= | |
486 | LIBMEMENV= | |
487 | AM_CONDITIONAL([EMBEDDED_LEVELDB],[true]) | |
488 | AC_SUBST(LEVELDB_CPPFLAGS) | |
489 | AC_SUBST(LIBLEVELDB) | |
490 | AC_SUBST(LIBMEMENV) | |
491 | ||
4f9e993b WL |
492 | if test x$enable_wallet != xno; then |
493 | dnl Check for libdb_cxx only if wallet enabled | |
494 | BITCOIN_FIND_BDB48 | |
495 | fi | |
35b8af92 CF |
496 | |
497 | dnl Check for libminiupnpc (optional) | |
498 | if test x$use_upnp != xno; then | |
a26a3676 JT |
499 | AC_CHECK_HEADERS( |
500 | [miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h], | |
28d412ff | 501 | [AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])], |
a26a3676 JT |
502 | [have_miniupnpc=no] |
503 | ) | |
35b8af92 CF |
504 | fi |
505 | ||
b7a4ecc1 LD |
506 | BITCOIN_QT_INIT |
507 | ||
508 | dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus | |
509 | BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4]) | |
510 | ||
511 | if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then | |
512 | use_boost=no | |
513 | else | |
514 | use_boost=yes | |
515 | fi | |
516 | ||
517 | if test x$use_boost = xyes; then | |
518 | ||
35b8af92 CF |
519 | dnl Check for boost libs |
520 | AX_BOOST_BASE | |
521 | AX_BOOST_SYSTEM | |
522 | AX_BOOST_FILESYSTEM | |
523 | AX_BOOST_PROGRAM_OPTIONS | |
524 | AX_BOOST_THREAD | |
525 | AX_BOOST_CHRONO | |
526 | ||
e432a5f0 | 527 | |
3ee028f1 | 528 | if test x$use_reduce_exports = xyes; then |
e432a5f0 CF |
529 | AC_MSG_CHECKING([for working boost reduced exports]) |
530 | TEMP_CPPFLAGS="$CPPFLAGS" | |
531 | CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS" | |
532 | AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ | |
533 | @%:@include <boost/version.hpp> | |
534 | ]], [[ | |
535 | #if BOOST_VERSION >= 104900 | |
536 | // Everything is okay | |
537 | #else | |
538 | # error Boost version is too old | |
539 | #endif | |
540 | ]])],[ | |
541 | AC_MSG_RESULT(yes) | |
3ee028f1 CF |
542 | ],[ |
543 | AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.]) | |
e432a5f0 CF |
544 | ]) |
545 | CPPFLAGS="$TEMP_CPPFLAGS" | |
546 | fi | |
b7a4ecc1 LD |
547 | fi |
548 | ||
3ee028f1 | 549 | if test x$use_reduce_exports = xyes; then |
e432a5f0 CF |
550 | CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS" |
551 | AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"]) | |
552 | fi | |
553 | ||
35b8af92 | 554 | if test x$use_tests = xyes; then |
152e51c7 CF |
555 | |
556 | if test x$HEXDUMP = x; then | |
557 | AC_MSG_ERROR(hexdump is required for tests) | |
558 | fi | |
559 | ||
560 | ||
b7a4ecc1 LD |
561 | if test x$use_boost = xyes; then |
562 | ||
35b8af92 | 563 | AX_BOOST_UNIT_TEST_FRAMEWORK |
e4b991e5 WL |
564 | |
565 | dnl Determine if -DBOOST_TEST_DYN_LINK is needed | |
566 | AC_MSG_CHECKING([for dynamic linked boost test]) | |
567 | TEMP_LIBS="$LIBS" | |
a7d1f035 | 568 | LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB" |
e4b991e5 WL |
569 | TEMP_CPPFLAGS="$CPPFLAGS" |
570 | CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" | |
571 | AC_LINK_IFELSE([AC_LANG_SOURCE([ | |
572 | #define BOOST_TEST_DYN_LINK | |
573 | #define BOOST_TEST_MAIN | |
574 | #include <boost/test/unit_test.hpp> | |
575 | ||
576 | ])], | |
577 | [AC_MSG_RESULT(yes)] | |
578 | [TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"], | |
579 | [AC_MSG_RESULT(no)]) | |
580 | LIBS="$TEMP_LIBS" | |
581 | CPPFLAGS="$TEMP_CPPFLAGS" | |
b7a4ecc1 LD |
582 | |
583 | fi | |
35b8af92 CF |
584 | fi |
585 | ||
b7a4ecc1 LD |
586 | if test x$use_boost = xyes; then |
587 | ||
35b8af92 | 588 | BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB" |
35b8af92 CF |
589 | |
590 | dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however | |
591 | dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if | |
592 | dnl a working version is available, else fall back to sleep. sleep was removed | |
593 | dnl after 1.56. | |
594 | dnl If neither is available, abort. | |
595 | dnl If sleep_for is used, boost_chrono becomes a requirement. | |
596 | if test x$ax_cv_boost_chrono = xyes; then | |
597 | TEMP_LIBS="$LIBS" | |
460b32d7 | 598 | LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB $LIBS" |
714cdecb WL |
599 | TEMP_CPPFLAGS="$CPPFLAGS" |
600 | CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" | |
e2a98d27 | 601 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
35b8af92 CF |
602 | #include <boost/thread/thread.hpp> |
603 | #include <boost/version.hpp> | |
e2a98d27 | 604 | ]],[[ |
35b8af92 CF |
605 | #if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200) |
606 | boost::this_thread::sleep_for(boost::chrono::milliseconds(0)); | |
607 | #else | |
608 | choke me | |
609 | #endif | |
e2a98d27 | 610 | ]])], |
35b8af92 CF |
611 | [boost_sleep=yes; BOOST_LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB"; |
612 | AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])], | |
613 | [boost_sleep=no]) | |
614 | LIBS="$TEMP_LIBS" | |
714cdecb | 615 | CPPFLAGS="$TEMP_CPPFLAGS" |
35b8af92 CF |
616 | fi |
617 | ||
618 | if test x$boost_sleep != xyes; then | |
619 | TEMP_LIBS="$LIBS" | |
460b32d7 | 620 | LIBS="$BOOST_LIBS $LIBS" |
714cdecb WL |
621 | TEMP_CPPFLAGS="$CPPFLAGS" |
622 | CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" | |
e2a98d27 | 623 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
35b8af92 CF |
624 | #include <boost/version.hpp> |
625 | #include <boost/thread.hpp> | |
626 | #include <boost/date_time/posix_time/posix_time_types.hpp> | |
e2a98d27 | 627 | ]],[[ |
35b8af92 CF |
628 | #if BOOST_VERSION <= 105600 |
629 | boost::this_thread::sleep(boost::posix_time::milliseconds(0)); | |
630 | #else | |
631 | choke me | |
632 | #endif | |
e2a98d27 | 633 | ]])], |
35b8af92 CF |
634 | [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])], |
635 | [boost_sleep=no]) | |
636 | LIBS="$TEMP_LIBS" | |
714cdecb | 637 | CPPFLAGS="$TEMP_CPPFLAGS" |
35b8af92 CF |
638 | fi |
639 | ||
640 | if test x$boost_sleep != xyes; then | |
539abc47 | 641 | AC_MSG_ERROR(No working boost sleep implementation found.) |
35b8af92 CF |
642 | fi |
643 | ||
b7a4ecc1 | 644 | fi |
c8ba8ef6 | 645 | |
35b8af92 CF |
646 | if test x$use_pkgconfig = xyes; then |
647 | ||
b77b4eda | 648 | if test x"$PKG_CONFIG" = "x"; then |
12564aa1 | 649 | AC_MSG_ERROR(pkg-config not found.) |
35b8af92 CF |
650 | fi |
651 | ||
652 | : #NOP | |
653 | m4_ifdef( | |
654 | [PKG_CHECK_MODULES], | |
655 | [ | |
6b099402 CF |
656 | PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)]) |
657 | PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)]) | |
c8ba8ef6 CF |
658 | BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])]) |
659 | if test x$use_qr != xno; then | |
660 | BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])]) | |
661 | fi | |
35b8af92 CF |
662 | ] |
663 | ) | |
664 | else | |
665 | AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing)) | |
6b099402 | 666 | AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing)) |
35b8af92 CF |
667 | |
668 | AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),) | |
6b099402 | 669 | AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing)) |
35b8af92 | 670 | |
28d412ff | 671 | BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found))) |
c8ba8ef6 | 672 | if test x$use_qr != xno; then |
28d412ff | 673 | BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])]) |
c8ba8ef6 CF |
674 | BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)]) |
675 | fi | |
676 | fi | |
35b8af92 | 677 | |
a19eeace LD |
678 | CFLAGS_TEMP="$CFLAGS" |
679 | LIBS_TEMP="$LIBS" | |
680 | CFLAGS="$CFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS" | |
681 | LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS" | |
682 | AC_CHECK_HEADER([openssl/ec.h],, AC_MSG_ERROR(OpenSSL ec header missing),) | |
683 | CFLAGS="$CFLAGS_TEMP" | |
684 | LIBS="$LIBS_TEMP" | |
685 | ||
c8ba8ef6 | 686 | BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path) |
fcfbf547 | 687 | |
e18e1001 | 688 | AC_MSG_CHECKING([whether to build bitcoind]) |
f930341d LD |
689 | AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes]) |
690 | AC_MSG_RESULT($build_bitcoind) | |
691 | ||
c101c769 | 692 | AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)]) |
693 | AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes]) | |
694 | AC_MSG_RESULT($build_bitcoin_utils) | |
f930341d | 695 | |
cdd36c6c CF |
696 | AC_MSG_CHECKING([whether to build libraries]) |
697 | AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes]) | |
698 | if test x$build_bitcoin_libs = xyes; then | |
699 | AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built]) | |
eef747bb | 700 | AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in]) |
cdd36c6c CF |
701 | fi |
702 | AC_MSG_RESULT($build_bitcoin_libs) | |
703 | ||
35b8af92 CF |
704 | AC_LANG_POP |
705 | ||
706 | if test "x$use_ccache" != "xno"; then | |
e18e1001 | 707 | AC_MSG_CHECKING(if ccache should be used) |
35b8af92 CF |
708 | if test x$CCACHE = x; then |
709 | if test "x$use_ccache" = "xyes"; then | |
710 | AC_MSG_ERROR([ccache not found.]); | |
711 | else | |
35b8af92 CF |
712 | use_ccache=no |
713 | fi | |
714 | else | |
715 | use_ccache=yes | |
716 | CC="$ac_cv_path_CCACHE $CC" | |
717 | CXX="$ac_cv_path_CCACHE $CXX" | |
718 | fi | |
719 | AC_MSG_RESULT($use_ccache) | |
720 | fi | |
386efb76 CF |
721 | if test "x$use_ccache" = "xyes"; then |
722 | AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS="-Qunused-arguments $CPPFLAGS"]) | |
723 | fi | |
35b8af92 | 724 | |
4f9e993b WL |
725 | dnl enable wallet |
726 | AC_MSG_CHECKING([if wallet should be enabled]) | |
727 | if test x$enable_wallet != xno; then | |
728 | AC_MSG_RESULT(yes) | |
729 | AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions]) | |
730 | ||
731 | else | |
732 | AC_MSG_RESULT(no) | |
4f9e993b WL |
733 | fi |
734 | ||
35b8af92 | 735 | dnl enable upnp support |
e18e1001 | 736 | AC_MSG_CHECKING([whether to build with support for UPnP]) |
35b8af92 CF |
737 | if test x$have_miniupnpc = xno; then |
738 | if test x$use_upnp = xyes; then | |
e18e1001 | 739 | AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc") |
35b8af92 CF |
740 | fi |
741 | AC_MSG_RESULT(no) | |
742 | else | |
743 | if test x$use_upnp != xno; then | |
744 | AC_MSG_RESULT(yes) | |
e18e1001 | 745 | AC_MSG_CHECKING([whether to build with UPnP enabled by default]) |
35b8af92 CF |
746 | use_upnp=yes |
747 | upnp_setting=0 | |
748 | if test x$use_upnp_default != xno; then | |
749 | use_upnp_default=yes | |
750 | upnp_setting=1 | |
751 | fi | |
752 | AC_MSG_RESULT($use_upnp_default) | |
e18e1001 | 753 | AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state]) |
35b8af92 | 754 | if test x$TARGET_OS = xwindows; then |
9f7f504e | 755 | MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB" |
35b8af92 CF |
756 | fi |
757 | else | |
758 | AC_MSG_RESULT(no) | |
759 | fi | |
760 | fi | |
761 | ||
35b8af92 | 762 | dnl these are only used when qt is enabled |
c8ba8ef6 CF |
763 | if test x$bitcoin_enable_qt != xno; then |
764 | BUILD_QT=qt | |
35b8af92 | 765 | dnl enable dbus support |
e18e1001 | 766 | AC_MSG_CHECKING([whether to build GUI with support for D-Bus]) |
c8ba8ef6 | 767 | if test x$bitcoin_enable_qt_dbus != xno; then |
35b8af92 | 768 | AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in]) |
35b8af92 | 769 | fi |
c8ba8ef6 | 770 | AC_MSG_RESULT($bitcoin_enable_qt_dbus) |
35b8af92 CF |
771 | |
772 | dnl enable qr support | |
e18e1001 | 773 | AC_MSG_CHECKING([whether to build GUI with support for QR codes]) |
35b8af92 | 774 | if test x$have_qrencode = xno; then |
b77b4eda | 775 | if test x$use_qr = xyes; then |
35b8af92 CF |
776 | AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode") |
777 | fi | |
778 | AC_MSG_RESULT(no) | |
779 | else | |
780 | if test x$use_qr != xno; then | |
781 | AC_MSG_RESULT(yes) | |
782 | AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in]) | |
783 | use_qr=yes | |
784 | else | |
785 | AC_MSG_RESULT(no) | |
786 | fi | |
787 | fi | |
788 | ||
b77b4eda | 789 | if test x$XGETTEXT = x; then |
c8ba8ef6 CF |
790 | AC_MSG_WARN("xgettext is required to update qt translations") |
791 | fi | |
792 | ||
e18e1001 LD |
793 | AC_MSG_CHECKING([whether to build test_bitcoin-qt]) |
794 | if test x$use_tests$bitcoin_enable_qt_test = xyesyes; then | |
795 | AC_MSG_RESULT([yes]) | |
35b8af92 | 796 | BUILD_TEST_QT="test" |
e18e1001 LD |
797 | else |
798 | AC_MSG_RESULT([no]) | |
c8ba8ef6 | 799 | fi |
35b8af92 CF |
800 | fi |
801 | ||
e18e1001 | 802 | AC_MSG_CHECKING([whether to build test_bitcoin]) |
35b8af92 | 803 | if test x$use_tests = xyes; then |
e18e1001 | 804 | AC_MSG_RESULT([yes]) |
35b8af92 | 805 | BUILD_TEST="test" |
e18e1001 LD |
806 | else |
807 | AC_MSG_RESULT([no]) | |
35b8af92 CF |
808 | fi |
809 | ||
e432a5f0 | 810 | AC_MSG_CHECKING([whether to reduce exports]) |
3ee028f1 | 811 | if test x$use_reduce_exports = xyes; then |
e432a5f0 CF |
812 | AC_MSG_RESULT([yes]) |
813 | else | |
814 | AC_MSG_RESULT([no]) | |
815 | fi | |
816 | ||
2ecd2941 | 817 | if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then |
cdd36c6c | 818 | AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests]) |
a9dbcf03 LD |
819 | fi |
820 | ||
35b8af92 | 821 | AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) |
b62bbb1f | 822 | AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin]) |
35b8af92 | 823 | AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows]) |
b77b4eda LD |
824 | AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes]) |
825 | AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests = xyes]) | |
826 | AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes]) | |
65e8ba4d | 827 | AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes]) |
35b8af92 | 828 | AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes]) |
b77b4eda | 829 | AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes]) |
35b8af92 | 830 | AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno]) |
47b9374e | 831 | AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno]) |
d5aab704 | 832 | AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes]) |
55668266 | 833 | AM_CONDITIONAL([USE_LIBSECP256K1],[test x$use_libsecp256k1 = xyes]) |
35b8af92 CF |
834 | |
835 | AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version]) | |
836 | AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version]) | |
837 | AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision]) | |
838 | AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build]) | |
839 | AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release]) | |
840 | AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release]) | |
841 | AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR) | |
842 | AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR) | |
843 | AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION) | |
844 | AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD) | |
845 | AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) | |
846 | AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) | |
847 | ||
e432a5f0 | 848 | AC_SUBST(RELDFLAGS) |
e0077de5 | 849 | AC_SUBST(LIBTOOL_APP_LDFLAGS) |
35b8af92 CF |
850 | AC_SUBST(USE_UPNP) |
851 | AC_SUBST(USE_QRCODE) | |
35b8af92 | 852 | AC_SUBST(BOOST_LIBS) |
35b8af92 CF |
853 | AC_SUBST(TESTDEFS) |
854 | AC_SUBST(LEVELDB_TARGET_FLAGS) | |
35b8af92 | 855 | AC_SUBST(BUILD_TEST) |
c8ba8ef6 | 856 | AC_SUBST(BUILD_QT) |
35b8af92 | 857 | AC_SUBST(BUILD_TEST_QT) |
9f7f504e | 858 | AC_SUBST(MINIUPNPC_CPPFLAGS) |
28d412ff | 859 | AC_SUBST(MINIUPNPC_LIBS) |
41d67c78 | 860 | AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py]) |
35b8af92 | 861 | AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) |
7667850d | 862 | AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests-config.sh]) |
07a99017 PW |
863 | |
864 | dnl boost's m4 checks do something really nasty: they export these vars. As a | |
865 | dnl result, they leak into secp256k1's configure and crazy things happen. | |
866 | dnl Until this is fixed upstream and we've synced, we'll just un-export them. | |
0dc86138 | 867 | CPPFLAGS_TEMP="$CPPFLAGS" |
cf61b544 | 868 | unset CPPFLAGS |
0dc86138 CF |
869 | CPPFLAGS="$CPPFLAGS_TEMP" |
870 | ||
871 | LDFLAGS_TEMP="$LDFLAGS" | |
cf61b544 | 872 | unset LDFLAGS |
0dc86138 CF |
873 | LDFLAGS="$LDFLAGS_TEMP" |
874 | ||
875 | LIBS_TEMP="$LIBS" | |
876 | unset LIBS | |
877 | LIBS="$LIBS_TEMP" | |
878 | ||
879 | PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH" | |
880 | unset PKG_CONFIG_PATH | |
881 | PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP" | |
882 | ||
883 | PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR" | |
884 | unset PKG_CONFIG_LIBDIR | |
885 | PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP" | |
886 | ||
07a99017 PW |
887 | ac_configure_args="${ac_configure_args} --disable-shared --with-pic" |
888 | AC_CONFIG_SUBDIRS([src/secp256k1]) | |
889 | ||
35b8af92 | 890 | AC_OUTPUT |
a98356fe CF |
891 | |
892 | dnl Taken from https://wiki.debian.org/RpathIssue | |
893 | case $host in | |
894 | *-*-linux-gnu) | |
895 | AC_MSG_RESULT([Fixing libtool for -rpath problems.]) | |
896 | sed < libtool > libtool-2 \ | |
897 | 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' | |
898 | mv libtool-2 libtool | |
899 | chmod 755 libtool | |
900 | ;; | |
901 | esac |