@@ -24,6 +24,12 @@ m4_include([pkg.m4])
24
24
dnl faketime breaks configure and is only needed for make. Disable it here.
25
25
unset FAKETIME
26
26
27
+ if test "x${CXXFLAGS+set}" = "xset"; then
28
+ CXXFLAGS_overridden=yes
29
+ else
30
+ CXXFLAGS_overridden=no
31
+ fi
32
+
27
33
dnl ==============================================================
28
34
dnl Setup for automake
29
35
dnl ==============================================================
@@ -92,7 +98,7 @@ AC_ARG_ENABLE([hardening],
92
98
93
99
AC_ARG_ENABLE ( [ ccache] ,
94
100
[ AS_HELP_STRING ( [ --enable-ccache] ,
95
- [ enable building with ccache (default is yes if ccache is found)] ) ] ,
101
+ [ use ccache for building (default is yes if ccache is found)] ) ] ,
96
102
[ use_ccache=$enableval] ,
97
103
[ use_ccache=auto] )
98
104
@@ -134,7 +140,9 @@ PKG_PROG_PKG_CONFIG
134
140
# # TODO: Remove these hard-coded paths and flags. They are here for the sake of
135
141
# # compatibility with the legacy buildsystem.
136
142
# #
137
- CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter"
143
+ if test "x$CXXFLAGS_overridden" = "xno"; then
144
+ CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter"
145
+ fi
138
146
CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
139
147
140
148
AC_LANG_PUSH ( [ C++] )
@@ -182,7 +190,9 @@ case $host in
182
190
183
191
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D__USE_MINGW_ANSI_STDIO"
184
192
LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE"
185
- CXXFLAGS="$CXXFLAGS -w"
193
+ if test "x$CXXFLAGS_overridden" = "xno"; then
194
+ CXXFLAGS="$CXXFLAGS -w"
195
+ fi
186
196
;;
187
197
*darwin*)
188
198
TARGET_OS=darwin
@@ -276,7 +286,12 @@ if test x$use_hardening != xno; then
276
286
AX_CHECK_COMPILE_FLAG ( [ -Wstack-protector] ,[ HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"] )
277
287
AX_CHECK_COMPILE_FLAG ( [ -fPIE] ,[ HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"] )
278
288
279
- AX_CHECK_PREPROC_FLAG ( [ -D_FORTIFY_SOURCE=2] ,[ HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"] )
289
+ AX_CHECK_PREPROC_FLAG ( [ -D_FORTIFY_SOURCE=2] ,[
290
+ AX_CHECK_PREPROC_FLAG ( [ -U_FORTIFY_SOURCE] ,[
291
+ HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE"
292
+ ] )
293
+ HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
294
+ ] )
280
295
281
296
AX_CHECK_LINK_FLAG ( [ [ -Wl,--dynamicbase] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"] )
282
297
AX_CHECK_LINK_FLAG ( [ [ -Wl,--nxcompat] ] , [ HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"] )
@@ -313,6 +328,14 @@ AC_TRY_COMPILE([#include <sys/socket.h>],
313
328
[ AC_MSG_RESULT ( no ) ]
314
329
)
315
330
331
+ LEVELDB_CPPFLAGS=
332
+ LIBLEVELDB=
333
+ LIBMEMENV=
334
+ AM_CONDITIONAL([ EMBEDDED_LEVELDB] ,[ true] )
335
+ AC_SUBST ( LEVELDB_CPPFLAGS )
336
+ AC_SUBST ( LIBLEVELDB )
337
+ AC_SUBST ( LIBMEMENV )
338
+
316
339
if test x$enable_wallet != xno; then
317
340
dnl Check for libdb_cxx only if wallet enabled
318
341
BITCOIN_FIND_BDB48
@@ -423,6 +446,18 @@ if test x$boost_sleep != xyes; then
423
446
AC_MSG_ERROR ( No working boost sleep implementation found. If on ubuntu 13.10 with libboost1.54-all-dev remove libboost.1.54-all-dev and use libboost1.53-all-dev )
424
447
fi
425
448
449
+ AC_ARG_WITH ( [ cli] ,
450
+ [ AS_HELP_STRING ( [ --with-cli] ,
451
+ [ with CLI (default is yes)] ) ] ,
452
+ [ build_bitcoin_cli=$withval] ,
453
+ [ build_bitcoin_cli=yes] )
454
+
455
+ AC_ARG_WITH ( [ daemon] ,
456
+ [ AS_HELP_STRING ( [ --with-daemon] ,
457
+ [ with daemon (default is yes)] ) ] ,
458
+ [ build_bitcoind=$withval] ,
459
+ [ build_bitcoind=yes] )
460
+
426
461
BITCOIN_QT_INIT
427
462
428
463
if test x$use_pkgconfig = xyes; then
459
494
460
495
BITCOIN_QT_PATH_PROGS([ PROTOC] , [ protoc] ,$protoc_bin_path)
461
496
497
+ AC_MSG_CHECKING ( [ whether to build bitcoind] )
498
+ AM_CONDITIONAL([ BUILD_BITCOIND] , [ test x$build_bitcoind = xyes] )
499
+ AC_MSG_RESULT ( $build_bitcoind )
500
+
501
+ AC_MSG_CHECKING ( [ whether to build bitcoin-cli] )
502
+ AM_CONDITIONAL([ BUILD_BITCOIN_CLI] , [ test x$build_bitcoin_cli = xyes] )
503
+ AC_MSG_RESULT ( $build_bitcoin_cli )
504
+
462
505
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
463
506
BITCOIN_QT_CONFIGURE([ $use_pkgconfig] , [ qt4] )
464
507
465
508
466
509
if test x$use_ipv6 = xyes; then
467
510
dnl Check for ipv6 build requirements
468
- AC_MSG_CHECKING ( for IPV6 build support )
511
+ AC_MSG_CHECKING ( for operating system IPv6 support )
469
512
AC_TRY_LINK ( [
470
513
#if defined(_WINDOWS)
471
514
#include <winsock2.h>
@@ -480,18 +523,17 @@ if test x$use_ipv6 = xyes; then
480
523
struct sockaddr_in6 addr;
481
524
#endif
482
525
int temp = socket(AF_INET6, SOCK_STREAM, 0);] ,
483
- [ AC_MSG_RESULT ( yes ) ; have_ipv6=yes; AC_DEFINE ( HAVE_IPV6 , 1 , [ Define this symbol if you have ipv6 build support] ) ] ,
526
+ [ AC_MSG_RESULT ( yes ) ; have_ipv6=yes; AC_DEFINE ( HAVE_IPV6 , 1 , [ Define this symbol if you have operating system IPv6 support] ) ] ,
484
527
[ AC_MSG_RESULT ( no ) ] ; have_ipv6=no )
485
528
fi
486
529
AC_LANG_POP
487
530
488
531
if test "x$use_ccache" != "xno"; then
489
- AC_MSG_CHECKING ( if ccache should be enabled )
532
+ AC_MSG_CHECKING ( if ccache should be used )
490
533
if test x$CCACHE = x; then
491
534
if test "x$use_ccache" = "xyes"; then
492
535
AC_MSG_ERROR ( [ ccache not found.] ) ;
493
536
else
494
- AC_MSG_NOTICE ( [ ccache not found. Falling back to default CC] )
495
537
use_ccache=no
496
538
fi
497
539
else
@@ -513,40 +555,40 @@ else
513
555
fi
514
556
515
557
dnl enable ipv6 support
516
- AC_MSG_CHECKING ( [ if ipv6 should be enabled ] )
558
+ AC_MSG_CHECKING ( [ whether to build with support for IPv6 ] )
517
559
if test x$have_ipv6 = xno; then
518
560
if test x$use_ipv6 = xyes; then
519
- AC_MSG_ERROR ( "ipv6 requested but cannot be built. use -- disable-ipv6" )
561
+ AC_MSG_ERROR ( [ IPv6 requested, but cannot be built. use --disable-ipv6] )
520
562
fi
521
563
AC_MSG_RESULT ( no )
522
564
else
523
565
if test x$use_ipv6 = xyes; then
524
566
AC_MSG_RESULT ( yes )
525
- AC_DEFINE ( [ USE_IPV6] ,[ 1] ,[ Define if ipv6 support should be compiled in] )
567
+ AC_DEFINE ( [ USE_IPV6] ,[ 1] ,[ Define if IPv6 support should be compiled in] )
526
568
else
527
569
AC_MSG_RESULT ( no )
528
570
fi
529
571
fi
530
572
531
573
dnl enable upnp support
532
- AC_MSG_CHECKING ( [ if upnp should be enabled ] )
574
+ AC_MSG_CHECKING ( [ whether to build with support for UPnP ] )
533
575
if test x$have_miniupnpc = xno; then
534
576
if test x$use_upnp = xyes; then
535
- AC_MSG_ERROR ( "upnp requested but cannot be built. use -- without-miniupnpc" )
577
+ AC_MSG_ERROR ( "UPnP requested but cannot be built. use -- without-miniupnpc" )
536
578
fi
537
579
AC_MSG_RESULT ( no )
538
580
else
539
581
if test x$use_upnp != xno; then
540
582
AC_MSG_RESULT ( yes )
541
- AC_MSG_CHECKING ( [ if upnp should be on by default] )
583
+ AC_MSG_CHECKING ( [ whether to build with UPnP enabled by default] )
542
584
use_upnp=yes
543
585
upnp_setting=0
544
586
if test x$use_upnp_default != xno; then
545
587
use_upnp_default=yes
546
588
upnp_setting=1
547
589
fi
548
590
AC_MSG_RESULT ( $use_upnp_default )
549
- AC_DEFINE_UNQUOTED ( [ USE_UPNP] ,[ $upnp_setting] ,[ Define to 1 for upnp runtime support ] )
591
+ AC_DEFINE_UNQUOTED ( [ USE_UPNP] ,[ $upnp_setting] ,[ UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state ] )
550
592
if test x$TARGET_OS = xwindows; then
551
593
CPPFLAGS="$CPPFLAGS -DSTATICLIB"
552
594
fi
@@ -559,14 +601,14 @@ dnl these are only used when qt is enabled
559
601
if test x$bitcoin_enable_qt != xno; then
560
602
BUILD_QT=qt
561
603
dnl enable dbus support
562
- AC_MSG_CHECKING ( [ if dbus should be enabled ] )
604
+ AC_MSG_CHECKING ( [ whether to build GUI with support for D-Bus ] )
563
605
if test x$bitcoin_enable_qt_dbus != xno; then
564
606
AC_DEFINE ( [ USE_DBUS] ,[ 1] ,[ Define if dbus support should be compiled in] )
565
607
fi
566
608
AC_MSG_RESULT ( $bitcoin_enable_qt_dbus )
567
609
568
610
dnl enable qr support
569
- AC_MSG_CHECKING ( [ if qr should be enabled ] )
611
+ AC_MSG_CHECKING ( [ whether to build GUI with support for QR codes ] )
570
612
if test x$have_qrencode = xno; then
571
613
if test x$use_qr == xyes; then
572
614
AC_MSG_ERROR ( "QR support requested but cannot be built. use -- without-qrencode" )
@@ -586,16 +628,25 @@ if test x$bitcoin_enable_qt != xno; then
586
628
AC_MSG_WARN ( "xgettext is required to update qt translations" )
587
629
fi
588
630
589
- if test x$use_tests = xyes; then
631
+ AC_MSG_CHECKING ( [ whether to build test_bitcoin-qt] )
632
+ if test x$use_tests$bitcoin_enable_qt_test = xyesyes; then
633
+ AC_MSG_RESULT ( [ yes] )
590
634
BUILD_TEST_QT="test"
591
- if test x$bitcoin_enable_qt_test != xyes; then
592
- AC_MSG_ERROR ( "QT Test lib not found. Use -- disable-tests or -- without-qt." )
593
- fi
635
+ else
636
+ AC_MSG_RESULT ( [ no] )
594
637
fi
595
638
fi
596
639
640
+ AC_MSG_CHECKING ( [ whether to build test_bitcoin] )
597
641
if test x$use_tests = xyes; then
642
+ AC_MSG_RESULT ( [ yes] )
598
643
BUILD_TEST="test"
644
+ else
645
+ AC_MSG_RESULT ( [ no] )
646
+ fi
647
+
648
+ if test "x$use_tests$build_bitcoind$use_qt" = "xnonono"; then
649
+ AC_MSG_ERROR ( [ No targets! Please specify at least one of: --enable-cli --enable-daemon --enable-gui or --enable-tests] )
599
650
fi
600
651
601
652
AM_CONDITIONAL([ TARGET_DARWIN] , [ test x$TARGET_OS = xdarwin] )
0 commit comments