]> Git Repo - VerusCoin.git/blame - configure.ac
Merge pull request #5360
[VerusCoin.git] / configure.ac
CommitLineData
35b8af92
CF
1dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
2AC_PREREQ([2.60])
3define(_CLIENT_VERSION_MAJOR, 0)
d7492304 4define(_CLIENT_VERSION_MINOR, 10)
ad6ae489 5define(_CLIENT_VERSION_REVISION, 99)
35b8af92 6define(_CLIENT_VERSION_BUILD, 0)
ad6ae489 7define(_CLIENT_VERSION_IS_RELEASE, false)
edbc9045 8define(_COPYRIGHT_YEAR, 2015)
fe14e8d7 9AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[[email protected]],[bitcoin])
e5438111 10AC_CONFIG_SRCDIR([src/main.cpp])
11AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
52a5f903 12AC_CONFIG_AUX_DIR([build-aux])
13AC_CONFIG_MACRO_DIR([build-aux/m4])
1723862e 14
35b8af92 15AC_CANONICAL_HOST
1723862e 16
35b8af92
CF
17AH_TOP([#ifndef BITCOIN_CONFIG_H])
18AH_TOP([#define BITCOIN_CONFIG_H])
19AH_BOTTOM([#endif //BITCOIN_CONFIG_H])
20
35b8af92
CF
21dnl faketime breaks configure and is only needed for make. Disable it here.
22unset FAKETIME
23
eefb766c 24dnl Automake init set-up and checks
35b8af92
CF
25AM_INIT_AUTOMAKE([no-define subdir-objects foreign])
26
27dnl faketime messes with timestamps and causes configure to be re-run.
28dnl --disable-maintainer-mode can be used to bypass this.
29AM_MAINTAINER_MODE([enable])
30
31dnl make the compilation flags quiet unless V=1 is used
32m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33
eefb766c 34dnl Compiler checks (here before libtool).
35if test "x${CXXFLAGS+set}" = "xset"; then
36 CXXFLAGS_overridden=yes
37else
38 CXXFLAGS_overridden=no
39fi
52a5f903 40AC_PROG_CXX
52a5f903 41m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX])
eefb766c 42
43dnl By default, libtool for mingw refuses to link static libs into a dll for
44dnl fear of mixing pic/non-pic objects, and import/export complications. Since
45dnl we have those under control, re-enable that functionality.
46case $host in
47 *mingw*)
48 lt_cv_deplibs_check_method="pass_all"
49 ;;
50esac
51dnl Libtool init checks.
19df238a 52LT_INIT([pic-only])
eefb766c 53
54dnl Check/return PATH for base programs.
52a5f903 55AC_PATH_TOOL(AR, ar)
56AC_PATH_TOOL(RANLIB, ranlib)
57AC_PATH_TOOL(STRIP, strip)
58AC_PATH_TOOL(GCOV, gcov)
59AC_PATH_PROG(LCOV, lcov)
60AC_PATH_PROG(JAVA, java)
61AC_PATH_PROG(GENHTML, genhtml)
62AC_PATH_PROG([GIT], [git])
63AC_PATH_PROG(CCACHE,ccache)
64AC_PATH_PROG(XGETTEXT,xgettext)
65AC_PATH_PROG(HEXDUMP,hexdump)
eefb766c 66
eefb766c 67dnl pkg-config check.
52a5f903 68PKG_PROG_PKG_CONFIG
69
4f9e993b
WL
70# Enable wallet
71AC_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
77AC_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
83AC_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
89AC_ARG_ENABLE(tests,
90 AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]),
91 [use_tests=$enableval],
92 [use_tests=yes])
93
94AC_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
99AC_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
104AC_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
110AC_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
116AC_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
122AC_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
128AC_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
134AC_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
140AC_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
143AC_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
149if 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
157fi
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
162if test "x$CXXFLAGS_overridden" = "xno"; then
163 CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter"
164fi
51ed9ec9 165CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
35b8af92 166
b7a4ecc1
LD
167AC_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
173AC_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
179AC_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
185AC_LANG_PUSH([C++])
186
187use_pkgconfig=yes
188case $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 ;;
317esac
318
35b8af92
CF
319if test x$use_comparison_tool != xno; then
320 AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool)
321fi
322
47b9374e 323if 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)
328else
329 AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0)
330fi
331
b77b4eda
LD
332if 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")])
351fi
352
4414f5ff
WL
353dnl Check for endianness
354AC_C_BIGENDIAN
35b8af92
CF
355
356dnl Check for pthread compile/link requirements
357AX_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.
362AC_SYS_LARGEFILE
a60838d0
WL
363# detect POSIX or GNU variant of strerror_r
364AC_FUNC_STRERROR_R
35b8af92
CF
365
366if 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"
370fi
371
372if 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"
376fi
377
378AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"])
379
f36a40f7
CF
380AX_GCC_FUNC_ATTRIBUTE([visibility])
381AX_GCC_FUNC_ATTRIBUTE([dllexport])
382AX_GCC_FUNC_ATTRIBUTE([dllimport])
383
d5aab704
CF
384if 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
400fi
401
35b8af92
CF
402if 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"
434fi
435
436dnl this flag screws up non-darwin gcc even when the check fails. special-case it.
437if test x$TARGET_OS = xdarwin; then
438 AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
439fi
440
4414f5ff 441AC_CHECK_HEADERS([endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])
caf6150e
HL
442AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])])
443AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])])
f2647cc0 444
494f6e7d
PJ
445AC_CHECK_DECLS([strnlen])
446
4414f5ff 447AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
f2647cc0
CF
448 [#if HAVE_ENDIAN_H
449 #include <endian.h>
450 #endif])
35b8af92 451
4414f5ff
WL
452AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,,
453 [#if HAVE_BYTESWAP_H
454 #include <byteswap.h>
455 #endif])
456
35b8af92
CF
457dnl Check for MSG_NOSIGNAL
458AC_MSG_CHECKING(for MSG_NOSIGNAL)
e2a98d27 459AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
460 [[ int f = MSG_NOSIGNAL; ]])],
35b8af92
CF
461 [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ],
462 [ AC_MSG_RESULT(no)]
463)
464
460b32d7
CF
465AC_SEARCH_LIBS([clock_gettime],[rt])
466
e432a5f0
CF
467AC_MSG_CHECKING([for visibility attribute])
468AC_LINK_IFELSE([AC_LANG_SOURCE([
469 int foo_def( void ) __attribute__((visibility("default")));
470 int main(){}
471 ])],
472 [
473 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.])
474 AC_MSG_RESULT(yes)
475 ],
476 [
477 AC_MSG_RESULT(no)
478 if test x$use_reduce_exports = xyes; then
3448b132 479 AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.])
e432a5f0 480 fi
e432a5f0
CF
481 ]
482)
483
3ee028f1 484if test x$use_reduce_exports = xyes; then
e432a5f0 485 AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
3448b132 486 [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
e432a5f0
CF
487fi
488
4a290b52
LD
489LEVELDB_CPPFLAGS=
490LIBLEVELDB=
491LIBMEMENV=
492AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
493AC_SUBST(LEVELDB_CPPFLAGS)
494AC_SUBST(LIBLEVELDB)
495AC_SUBST(LIBMEMENV)
496
4f9e993b
WL
497if test x$enable_wallet != xno; then
498 dnl Check for libdb_cxx only if wallet enabled
499 BITCOIN_FIND_BDB48
500fi
35b8af92
CF
501
502dnl Check for libminiupnpc (optional)
503if test x$use_upnp != xno; then
a26a3676
JT
504 AC_CHECK_HEADERS(
505 [miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
28d412ff 506 [AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],
a26a3676
JT
507 [have_miniupnpc=no]
508 )
35b8af92
CF
509fi
510
b7a4ecc1
LD
511BITCOIN_QT_INIT
512
513dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
514BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
515
516if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then
517 use_boost=no
518else
519 use_boost=yes
520fi
521
522if test x$use_boost = xyes; then
523
35b8af92
CF
524dnl Check for boost libs
525AX_BOOST_BASE
526AX_BOOST_SYSTEM
527AX_BOOST_FILESYSTEM
528AX_BOOST_PROGRAM_OPTIONS
529AX_BOOST_THREAD
530AX_BOOST_CHRONO
531
e432a5f0 532
3ee028f1 533if test x$use_reduce_exports = xyes; then
e432a5f0
CF
534 AC_MSG_CHECKING([for working boost reduced exports])
535 TEMP_CPPFLAGS="$CPPFLAGS"
536 CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
537 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
538 @%:@include <boost/version.hpp>
539 ]], [[
540 #if BOOST_VERSION >= 104900
541 // Everything is okay
542 #else
543 # error Boost version is too old
544 #endif
545 ]])],[
546 AC_MSG_RESULT(yes)
3ee028f1 547 ],[
3448b132 548 AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.])
e432a5f0
CF
549 ])
550 CPPFLAGS="$TEMP_CPPFLAGS"
551fi
b7a4ecc1
LD
552fi
553
3ee028f1 554if test x$use_reduce_exports = xyes; then
e432a5f0
CF
555 CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS"
556 AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"])
557fi
558
35b8af92 559if test x$use_tests = xyes; then
152e51c7
CF
560
561 if test x$HEXDUMP = x; then
562 AC_MSG_ERROR(hexdump is required for tests)
563 fi
564
565
b7a4ecc1
LD
566 if test x$use_boost = xyes; then
567
35b8af92 568 AX_BOOST_UNIT_TEST_FRAMEWORK
e4b991e5
WL
569
570 dnl Determine if -DBOOST_TEST_DYN_LINK is needed
571 AC_MSG_CHECKING([for dynamic linked boost test])
572 TEMP_LIBS="$LIBS"
a7d1f035 573 LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB"
e4b991e5
WL
574 TEMP_CPPFLAGS="$CPPFLAGS"
575 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
576 AC_LINK_IFELSE([AC_LANG_SOURCE([
577 #define BOOST_TEST_DYN_LINK
578 #define BOOST_TEST_MAIN
579 #include <boost/test/unit_test.hpp>
580
581 ])],
582 [AC_MSG_RESULT(yes)]
583 [TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"],
584 [AC_MSG_RESULT(no)])
585 LIBS="$TEMP_LIBS"
586 CPPFLAGS="$TEMP_CPPFLAGS"
b7a4ecc1
LD
587
588 fi
35b8af92
CF
589fi
590
b7a4ecc1
LD
591if test x$use_boost = xyes; then
592
35b8af92 593BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB"
35b8af92
CF
594
595dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
596dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if
597dnl a working version is available, else fall back to sleep. sleep was removed
598dnl after 1.56.
599dnl If neither is available, abort.
600dnl If sleep_for is used, boost_chrono becomes a requirement.
601if test x$ax_cv_boost_chrono = xyes; then
602TEMP_LIBS="$LIBS"
460b32d7 603LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB $LIBS"
714cdecb
WL
604TEMP_CPPFLAGS="$CPPFLAGS"
605CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
e2a98d27 606AC_LINK_IFELSE([AC_LANG_PROGRAM([[
35b8af92
CF
607 #include <boost/thread/thread.hpp>
608 #include <boost/version.hpp>
e2a98d27 609 ]],[[
35b8af92
CF
610 #if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200)
611 boost::this_thread::sleep_for(boost::chrono::milliseconds(0));
612 #else
613 choke me
614 #endif
e2a98d27 615 ]])],
35b8af92
CF
616 [boost_sleep=yes; BOOST_LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB";
617 AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],
618 [boost_sleep=no])
619LIBS="$TEMP_LIBS"
714cdecb 620CPPFLAGS="$TEMP_CPPFLAGS"
35b8af92
CF
621fi
622
623if test x$boost_sleep != xyes; then
624TEMP_LIBS="$LIBS"
460b32d7 625LIBS="$BOOST_LIBS $LIBS"
714cdecb
WL
626TEMP_CPPFLAGS="$CPPFLAGS"
627CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
e2a98d27 628AC_LINK_IFELSE([AC_LANG_PROGRAM([[
35b8af92
CF
629 #include <boost/version.hpp>
630 #include <boost/thread.hpp>
631 #include <boost/date_time/posix_time/posix_time_types.hpp>
e2a98d27 632 ]],[[
35b8af92
CF
633 #if BOOST_VERSION <= 105600
634 boost::this_thread::sleep(boost::posix_time::milliseconds(0));
635 #else
636 choke me
637 #endif
e2a98d27 638 ]])],
35b8af92
CF
639 [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])],
640 [boost_sleep=no])
641LIBS="$TEMP_LIBS"
714cdecb 642CPPFLAGS="$TEMP_CPPFLAGS"
35b8af92
CF
643fi
644
645if test x$boost_sleep != xyes; then
539abc47 646 AC_MSG_ERROR(No working boost sleep implementation found.)
35b8af92
CF
647fi
648
b7a4ecc1 649fi
c8ba8ef6 650
35b8af92
CF
651if test x$use_pkgconfig = xyes; then
652
b77b4eda 653 if test x"$PKG_CONFIG" = "x"; then
12564aa1 654 AC_MSG_ERROR(pkg-config not found.)
35b8af92
CF
655 fi
656
657 : #NOP
658 m4_ifdef(
659 [PKG_CHECK_MODULES],
660 [
6b099402
CF
661 PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
662 PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
c8ba8ef6
CF
663 BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])])
664 if test x$use_qr != xno; then
665 BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
666 fi
35b8af92
CF
667 ]
668 )
669else
670 AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
6b099402 671 AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
35b8af92
CF
672
673 AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
6b099402 674 AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))
35b8af92 675
28d412ff 676 BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found)))
c8ba8ef6 677 if test x$use_qr != xno; then
28d412ff 678 BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])
c8ba8ef6
CF
679 BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)])
680 fi
681fi
35b8af92 682
a19eeace
LD
683CFLAGS_TEMP="$CFLAGS"
684LIBS_TEMP="$LIBS"
685CFLAGS="$CFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS"
686LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS"
687AC_CHECK_HEADER([openssl/ec.h],, AC_MSG_ERROR(OpenSSL ec header missing),)
688CFLAGS="$CFLAGS_TEMP"
689LIBS="$LIBS_TEMP"
690
c8ba8ef6 691BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)
fcfbf547 692
e18e1001 693AC_MSG_CHECKING([whether to build bitcoind])
f930341d
LD
694AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
695AC_MSG_RESULT($build_bitcoind)
696
c101c769 697AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)])
698AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
699AC_MSG_RESULT($build_bitcoin_utils)
f930341d 700
cdd36c6c
CF
701AC_MSG_CHECKING([whether to build libraries])
702AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
703if test x$build_bitcoin_libs = xyes; then
704 AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built])
eef747bb 705 AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in])
cdd36c6c
CF
706fi
707AC_MSG_RESULT($build_bitcoin_libs)
708
35b8af92
CF
709AC_LANG_POP
710
711if test "x$use_ccache" != "xno"; then
e18e1001 712 AC_MSG_CHECKING(if ccache should be used)
35b8af92
CF
713 if test x$CCACHE = x; then
714 if test "x$use_ccache" = "xyes"; then
715 AC_MSG_ERROR([ccache not found.]);
716 else
35b8af92
CF
717 use_ccache=no
718 fi
719 else
720 use_ccache=yes
721 CC="$ac_cv_path_CCACHE $CC"
722 CXX="$ac_cv_path_CCACHE $CXX"
723 fi
724 AC_MSG_RESULT($use_ccache)
725fi
386efb76
CF
726if test "x$use_ccache" = "xyes"; then
727 AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS="-Qunused-arguments $CPPFLAGS"])
728fi
35b8af92 729
4f9e993b
WL
730dnl enable wallet
731AC_MSG_CHECKING([if wallet should be enabled])
732if test x$enable_wallet != xno; then
733 AC_MSG_RESULT(yes)
734 AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions])
735
736else
737 AC_MSG_RESULT(no)
4f9e993b
WL
738fi
739
35b8af92 740dnl enable upnp support
e18e1001 741AC_MSG_CHECKING([whether to build with support for UPnP])
35b8af92
CF
742if test x$have_miniupnpc = xno; then
743 if test x$use_upnp = xyes; then
e18e1001 744 AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc")
35b8af92
CF
745 fi
746 AC_MSG_RESULT(no)
747else
748 if test x$use_upnp != xno; then
749 AC_MSG_RESULT(yes)
e18e1001 750 AC_MSG_CHECKING([whether to build with UPnP enabled by default])
35b8af92
CF
751 use_upnp=yes
752 upnp_setting=0
753 if test x$use_upnp_default != xno; then
754 use_upnp_default=yes
755 upnp_setting=1
756 fi
757 AC_MSG_RESULT($use_upnp_default)
e18e1001 758 AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state])
35b8af92 759 if test x$TARGET_OS = xwindows; then
9f7f504e 760 MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
35b8af92
CF
761 fi
762 else
763 AC_MSG_RESULT(no)
764 fi
765fi
766
35b8af92 767dnl these are only used when qt is enabled
c8ba8ef6
CF
768if test x$bitcoin_enable_qt != xno; then
769 BUILD_QT=qt
35b8af92 770 dnl enable dbus support
e18e1001 771 AC_MSG_CHECKING([whether to build GUI with support for D-Bus])
c8ba8ef6 772 if test x$bitcoin_enable_qt_dbus != xno; then
35b8af92 773 AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in])
35b8af92 774 fi
c8ba8ef6 775 AC_MSG_RESULT($bitcoin_enable_qt_dbus)
35b8af92
CF
776
777 dnl enable qr support
e18e1001 778 AC_MSG_CHECKING([whether to build GUI with support for QR codes])
35b8af92 779 if test x$have_qrencode = xno; then
b77b4eda 780 if test x$use_qr = xyes; then
35b8af92
CF
781 AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode")
782 fi
783 AC_MSG_RESULT(no)
784 else
785 if test x$use_qr != xno; then
786 AC_MSG_RESULT(yes)
787 AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in])
788 use_qr=yes
789 else
790 AC_MSG_RESULT(no)
791 fi
792 fi
793
b77b4eda 794 if test x$XGETTEXT = x; then
c8ba8ef6
CF
795 AC_MSG_WARN("xgettext is required to update qt translations")
796 fi
797
e18e1001
LD
798 AC_MSG_CHECKING([whether to build test_bitcoin-qt])
799 if test x$use_tests$bitcoin_enable_qt_test = xyesyes; then
800 AC_MSG_RESULT([yes])
35b8af92 801 BUILD_TEST_QT="test"
e18e1001
LD
802 else
803 AC_MSG_RESULT([no])
c8ba8ef6 804 fi
35b8af92
CF
805fi
806
e18e1001 807AC_MSG_CHECKING([whether to build test_bitcoin])
35b8af92 808if test x$use_tests = xyes; then
e18e1001 809 AC_MSG_RESULT([yes])
35b8af92 810 BUILD_TEST="test"
e18e1001
LD
811else
812 AC_MSG_RESULT([no])
35b8af92
CF
813fi
814
e432a5f0 815AC_MSG_CHECKING([whether to reduce exports])
3ee028f1 816if test x$use_reduce_exports = xyes; then
e432a5f0
CF
817 AC_MSG_RESULT([yes])
818else
819 AC_MSG_RESULT([no])
820fi
821
2ecd2941 822if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
cdd36c6c 823 AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests])
a9dbcf03
LD
824fi
825
35b8af92 826AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
b62bbb1f 827AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
35b8af92 828AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
b77b4eda
LD
829AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
830AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests = xyes])
831AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
65e8ba4d 832AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes])
35b8af92 833AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
b77b4eda 834AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
35b8af92 835AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])
47b9374e 836AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno])
d5aab704 837AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
35b8af92
CF
838
839AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
840AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
841AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision])
842AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build])
843AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release])
844AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release])
845AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR)
846AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR)
847AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION)
848AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD)
849AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE)
850AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)
851
e432a5f0 852AC_SUBST(RELDFLAGS)
e0077de5 853AC_SUBST(LIBTOOL_APP_LDFLAGS)
35b8af92
CF
854AC_SUBST(USE_UPNP)
855AC_SUBST(USE_QRCODE)
35b8af92 856AC_SUBST(BOOST_LIBS)
35b8af92
CF
857AC_SUBST(TESTDEFS)
858AC_SUBST(LEVELDB_TARGET_FLAGS)
35b8af92 859AC_SUBST(BUILD_TEST)
c8ba8ef6 860AC_SUBST(BUILD_QT)
35b8af92 861AC_SUBST(BUILD_TEST_QT)
9f7f504e 862AC_SUBST(MINIUPNPC_CPPFLAGS)
28d412ff 863AC_SUBST(MINIUPNPC_LIBS)
41d67c78 864AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
35b8af92 865AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
7667850d 866AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests-config.sh])
07a99017
PW
867
868dnl boost's m4 checks do something really nasty: they export these vars. As a
869dnl result, they leak into secp256k1's configure and crazy things happen.
870dnl Until this is fixed upstream and we've synced, we'll just un-export them.
0dc86138 871CPPFLAGS_TEMP="$CPPFLAGS"
cf61b544 872unset CPPFLAGS
0dc86138
CF
873CPPFLAGS="$CPPFLAGS_TEMP"
874
875LDFLAGS_TEMP="$LDFLAGS"
cf61b544 876unset LDFLAGS
0dc86138
CF
877LDFLAGS="$LDFLAGS_TEMP"
878
879LIBS_TEMP="$LIBS"
880unset LIBS
881LIBS="$LIBS_TEMP"
882
883PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
884unset PKG_CONFIG_PATH
885PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP"
886
887PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
888unset PKG_CONFIG_LIBDIR
889PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
890
07a99017
PW
891ac_configure_args="${ac_configure_args} --disable-shared --with-pic"
892AC_CONFIG_SUBDIRS([src/secp256k1])
893
35b8af92 894AC_OUTPUT
a98356fe
CF
895
896dnl Taken from https://wiki.debian.org/RpathIssue
897case $host in
898 *-*-linux-gnu)
899 AC_MSG_RESULT([Fixing libtool for -rpath problems.])
900 sed < libtool > libtool-2 \
901 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
902 mv libtool-2 libtool
903 chmod 755 libtool
904 ;;
905esac
This page took 0.228016 seconds and 4 git commands to generate.