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