]> Git Repo - VerusCoin.git/blame - configure.ac
gitian: fix x86_64 build with static libstdc++
[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
353dnl Require little endian
354AC_C_BIGENDIAN([AC_MSG_ERROR("Big Endian not supported")])
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
4c61ba40 441AC_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
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
f2647cc0
CF
447AC_CHECK_DECLS([le32toh, le64toh, htole32, htole64, be32toh, be64toh, htobe32, htobe64],,,
448 [#if HAVE_ENDIAN_H
449 #include <endian.h>
450 #endif])
35b8af92
CF
451
452dnl Check for MSG_NOSIGNAL
453AC_MSG_CHECKING(for MSG_NOSIGNAL)
e2a98d27 454AC_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
460AC_SEARCH_LIBS([clock_gettime],[rt])
461
e432a5f0
CF
462AC_MSG_CHECKING([for visibility attribute])
463AC_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 479if 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
482fi
483
4a290b52
LD
484LEVELDB_CPPFLAGS=
485LIBLEVELDB=
486LIBMEMENV=
487AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
488AC_SUBST(LEVELDB_CPPFLAGS)
489AC_SUBST(LIBLEVELDB)
490AC_SUBST(LIBMEMENV)
491
4f9e993b
WL
492if test x$enable_wallet != xno; then
493 dnl Check for libdb_cxx only if wallet enabled
494 BITCOIN_FIND_BDB48
495fi
35b8af92
CF
496
497dnl Check for libminiupnpc (optional)
498if 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
504fi
505
b7a4ecc1
LD
506BITCOIN_QT_INIT
507
508dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
509BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
510
511if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then
512 use_boost=no
513else
514 use_boost=yes
515fi
516
517if test x$use_boost = xyes; then
518
35b8af92
CF
519dnl Check for boost libs
520AX_BOOST_BASE
521AX_BOOST_SYSTEM
522AX_BOOST_FILESYSTEM
523AX_BOOST_PROGRAM_OPTIONS
524AX_BOOST_THREAD
525AX_BOOST_CHRONO
526
e432a5f0 527
3ee028f1 528if 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"
546fi
b7a4ecc1
LD
547fi
548
3ee028f1 549if 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"])
552fi
553
35b8af92 554if 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
584fi
585
b7a4ecc1
LD
586if test x$use_boost = xyes; then
587
35b8af92 588BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB"
35b8af92
CF
589
590dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
591dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if
592dnl a working version is available, else fall back to sleep. sleep was removed
593dnl after 1.56.
594dnl If neither is available, abort.
595dnl If sleep_for is used, boost_chrono becomes a requirement.
596if test x$ax_cv_boost_chrono = xyes; then
597TEMP_LIBS="$LIBS"
460b32d7 598LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB $LIBS"
714cdecb
WL
599TEMP_CPPFLAGS="$CPPFLAGS"
600CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
e2a98d27 601AC_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])
614LIBS="$TEMP_LIBS"
714cdecb 615CPPFLAGS="$TEMP_CPPFLAGS"
35b8af92
CF
616fi
617
618if test x$boost_sleep != xyes; then
619TEMP_LIBS="$LIBS"
460b32d7 620LIBS="$BOOST_LIBS $LIBS"
714cdecb
WL
621TEMP_CPPFLAGS="$CPPFLAGS"
622CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
e2a98d27 623AC_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])
636LIBS="$TEMP_LIBS"
714cdecb 637CPPFLAGS="$TEMP_CPPFLAGS"
35b8af92
CF
638fi
639
640if test x$boost_sleep != xyes; then
539abc47 641 AC_MSG_ERROR(No working boost sleep implementation found.)
35b8af92
CF
642fi
643
b7a4ecc1 644fi
c8ba8ef6 645
35b8af92
CF
646if 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 )
664else
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
676fi
35b8af92 677
a19eeace
LD
678CFLAGS_TEMP="$CFLAGS"
679LIBS_TEMP="$LIBS"
680CFLAGS="$CFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS"
681LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS"
682AC_CHECK_HEADER([openssl/ec.h],, AC_MSG_ERROR(OpenSSL ec header missing),)
683CFLAGS="$CFLAGS_TEMP"
684LIBS="$LIBS_TEMP"
685
c8ba8ef6 686BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)
fcfbf547 687
e18e1001 688AC_MSG_CHECKING([whether to build bitcoind])
f930341d
LD
689AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
690AC_MSG_RESULT($build_bitcoind)
691
c101c769 692AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)])
693AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
694AC_MSG_RESULT($build_bitcoin_utils)
f930341d 695
cdd36c6c
CF
696AC_MSG_CHECKING([whether to build libraries])
697AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
698if 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
701fi
702AC_MSG_RESULT($build_bitcoin_libs)
703
35b8af92
CF
704AC_LANG_POP
705
706if 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)
720fi
386efb76
CF
721if test "x$use_ccache" = "xyes"; then
722 AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS="-Qunused-arguments $CPPFLAGS"])
723fi
35b8af92 724
4f9e993b
WL
725dnl enable wallet
726AC_MSG_CHECKING([if wallet should be enabled])
727if 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
731else
732 AC_MSG_RESULT(no)
4f9e993b
WL
733fi
734
35b8af92 735dnl enable upnp support
e18e1001 736AC_MSG_CHECKING([whether to build with support for UPnP])
35b8af92
CF
737if 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)
742else
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
760fi
761
35b8af92 762dnl these are only used when qt is enabled
c8ba8ef6
CF
763if 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
800fi
801
e18e1001 802AC_MSG_CHECKING([whether to build test_bitcoin])
35b8af92 803if test x$use_tests = xyes; then
e18e1001 804 AC_MSG_RESULT([yes])
35b8af92 805 BUILD_TEST="test"
e18e1001
LD
806else
807 AC_MSG_RESULT([no])
35b8af92
CF
808fi
809
e432a5f0 810AC_MSG_CHECKING([whether to reduce exports])
3ee028f1 811if test x$use_reduce_exports = xyes; then
e432a5f0
CF
812 AC_MSG_RESULT([yes])
813else
814 AC_MSG_RESULT([no])
815fi
816
2ecd2941 817if 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
819fi
820
35b8af92 821AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
b62bbb1f 822AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
35b8af92 823AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
b77b4eda
LD
824AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
825AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests = xyes])
826AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
65e8ba4d 827AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes])
35b8af92 828AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
b77b4eda 829AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
35b8af92 830AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])
47b9374e 831AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno])
d5aab704 832AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
55668266 833AM_CONDITIONAL([USE_LIBSECP256K1],[test x$use_libsecp256k1 = xyes])
35b8af92
CF
834
835AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
836AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
837AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision])
838AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build])
839AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release])
840AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release])
841AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR)
842AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR)
843AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION)
844AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD)
845AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE)
846AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)
847
e432a5f0 848AC_SUBST(RELDFLAGS)
e0077de5 849AC_SUBST(LIBTOOL_APP_LDFLAGS)
35b8af92
CF
850AC_SUBST(USE_UPNP)
851AC_SUBST(USE_QRCODE)
35b8af92 852AC_SUBST(BOOST_LIBS)
35b8af92
CF
853AC_SUBST(TESTDEFS)
854AC_SUBST(LEVELDB_TARGET_FLAGS)
35b8af92 855AC_SUBST(BUILD_TEST)
c8ba8ef6 856AC_SUBST(BUILD_QT)
35b8af92 857AC_SUBST(BUILD_TEST_QT)
9f7f504e 858AC_SUBST(MINIUPNPC_CPPFLAGS)
28d412ff 859AC_SUBST(MINIUPNPC_LIBS)
41d67c78 860AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
35b8af92 861AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
7667850d 862AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests-config.sh])
07a99017
PW
863
864dnl boost's m4 checks do something really nasty: they export these vars. As a
865dnl result, they leak into secp256k1's configure and crazy things happen.
866dnl Until this is fixed upstream and we've synced, we'll just un-export them.
0dc86138 867CPPFLAGS_TEMP="$CPPFLAGS"
cf61b544 868unset CPPFLAGS
0dc86138
CF
869CPPFLAGS="$CPPFLAGS_TEMP"
870
871LDFLAGS_TEMP="$LDFLAGS"
cf61b544 872unset LDFLAGS
0dc86138
CF
873LDFLAGS="$LDFLAGS_TEMP"
874
875LIBS_TEMP="$LIBS"
876unset LIBS
877LIBS="$LIBS_TEMP"
878
879PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
880unset PKG_CONFIG_PATH
881PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP"
882
883PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
884unset PKG_CONFIG_LIBDIR
885PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
886
07a99017
PW
887ac_configure_args="${ac_configure_args} --disable-shared --with-pic"
888AC_CONFIG_SUBDIRS([src/secp256k1])
889
35b8af92 890AC_OUTPUT
a98356fe
CF
891
892dnl Taken from https://wiki.debian.org/RpathIssue
893case $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 ;;
901esac
This page took 0.211205 seconds and 4 git commands to generate.