@@ -63,38 +63,6 @@ AC_ARG_ENABLE([ipv6],
63
63
[ use_ipv6=$enableval] ,
64
64
[ use_ipv6=yes] )
65
65
66
- dnl enable qt support
67
- AC_ARG_WITH ( [ qt] ,
68
- [ AS_HELP_STRING ( [ --with-qt] ,
69
- [ enable qt (default is yes)] ) ] ,
70
- [ use_qt=$withval] ,
71
- [ use_qt=auto] )
72
- AC_DEFUN ( [ BITCOIN_QT_FAIL] ,[
73
- if test "x$use_qt" = "xauto"; then
74
- AC_MSG_WARN ( [ $1 ; bitcoin-qt frontend will not be built] )
75
- use_qt=no
76
- else
77
- AC_MSG_ERROR ( [ $1 ] )
78
- fi
79
- ] )
80
- AC_DEFUN ( [ BITCOIN_QT_CHECK] ,[
81
- if test "x$use_qt" != "xno"; then
82
- true
83
- $1
84
- else
85
- true
86
- $2
87
- fi
88
- ] )
89
- AC_DEFUN ( [ BITCOIN_QT_PATH_PROGS] ,[
90
- BITCOIN_QT_CHECK([
91
- AC_PATH_PROGS ( $1 ,$2 ,$3 ,$4 )
92
- if test "x$$1 " = "x"; then
93
- BITCOIN_QT_FAIL([ $1 not found] )
94
- fi
95
- ] )
96
- ] )
97
-
98
66
AC_ARG_ENABLE ( tests ,
99
67
AS_HELP_STRING ( [ --enable-tests] ,[ compile tests (default is yes)] ) ,
100
68
[ use_tests=$enableval] ,
@@ -116,12 +84,6 @@ AC_ARG_WITH([qrencode],
116
84
[ use_qr=$withval] ,
117
85
[ use_qr=auto] )
118
86
119
- AC_ARG_WITH ( [ qtdbus] ,
120
- [ AS_HELP_STRING ( [ --with-qtdbus] ,
121
- [ enable DBus support (default is yes if qt is enabled and QtDBus is found)] ) ] ,
122
- [ use_dbus=$withval] ,
123
- [ use_dbus=auto] )
124
-
125
87
AC_ARG_ENABLE ( [ hardening] ,
126
88
[ AS_HELP_STRING ( [ --enable-hardening] ,
127
89
[ attempt to harden the resulting executables (default is yes)] ) ] ,
@@ -140,10 +102,6 @@ AC_ARG_ENABLE([lcov],
140
102
[ use_lcov=yes] ,
141
103
[ use_lcov=no] )
142
104
143
- AC_ARG_WITH ( [ qt-incdir] ,[ AS_HELP_STRING ( [ --with-qt-incdir=INC_DIR] ,[ specify qt include path (overridden by pkgconfig)] ) ] , [ qt_include_path=$withval] , [ ] )
144
- AC_ARG_WITH ( [ qt-libdir] ,[ AS_HELP_STRING ( [ --with-qt-libdir=LIB_DIR] ,[ specify qt lib path (overridden by pkgconfig)] ) ] , [ qt_lib_path=$withval] , [ ] )
145
- AC_ARG_WITH ( [ qt-bindir] ,[ AS_HELP_STRING ( [ --with-qt-bindir=BIN_DIR] ,[ specify qt bin path] ) ] , [ qt_bin_path=$withval] , [ ] )
146
- AC_ARG_WITH ( [ qt-plugindir] ,[ AS_HELP_STRING ( [ --with-qt-plugindir=PLUGIN_DIR] ,[ specify qt plugin path (overridden by pkgconfig)] ) ] , [ qt_plugin_path=$withval] , [ ] )
147
105
AC_ARG_WITH ( [ protoc-bindir] ,[ AS_HELP_STRING ( [ --with-protoc-bindir=BIN_DIR] ,[ specify protoc bin path] ) ] , [ protoc_bin_path=$withval] , [ ] )
148
106
149
107
@@ -168,13 +126,7 @@ AC_PATH_PROG(LCOV, lcov)
168
126
AC_PATH_PROG ( JAVA , java )
169
127
AC_PATH_PROG ( GENHTML , genhtml )
170
128
AC_PATH_PROG ( [ GIT] , [ git] )
171
- BITCOIN_QT_PATH_PROGS([ MOC] , [ moc-qt4 moc4 moc] ,, $qt_bin_path:$PATH)
172
- BITCOIN_QT_PATH_PROGS([ UIC] , [ uic-qt4 uic4 uic] ,, $qt_bin_path:$PATH)
173
- BITCOIN_QT_PATH_PROGS([ RCC] , [ rcc-qt4 rcc4 rcc] ,, $qt_bin_path:$PATH)
174
- BITCOIN_QT_PATH_PROGS([ LRELEASE] , [ lrelease-qt4 lrelease4 lrelease] ,, $qt_bin_path:$PATH)
175
- BITCOIN_QT_PATH_PROGS([ PROTOC] , [ protoc] ,, $protoc_bin_path:$PATH)
176
129
AC_PATH_PROG ( CCACHE ,ccache )
177
- AC_PATH_PROGS ( [ LUPDATE] , [ lupdate-qt4 lupdate4 lupdate] ,, $qt_bin_path:$PATH )
178
130
AC_PATH_PROG ( XGETTEXT ,xgettext )
179
131
AC_PATH_PROG ( HEXDUMP ,hexdump )
180
132
PKG_PROG_PKG_CONFIG
@@ -239,7 +191,7 @@ case $host in
239
191
AC_CHECK_PROG ( [ PORT] ,port , port )
240
192
if test x$PORT = xport; then
241
193
dnl add default macports paths
242
- CPPFLAGS="$CPPFLAGS -I /opt/local/include -I/opt/local/include/db48"
194
+ CPPFLAGS="$CPPFLAGS -isystem /opt/local/include -I/opt/local/include/db48"
243
195
LIBS="$LIBS -L/opt/local/lib -L/opt/local/lib/db48"
244
196
fi
245
197
@@ -254,12 +206,6 @@ case $host in
254
206
fi
255
207
fi
256
208
257
- BITCOIN_QT_CHECK([
258
- MOC_DEFS="-DQ_OS_MAC"
259
- base_frameworks="-framework Foundation -framework ApplicationServices -framework AppKit"
260
- AX_CHECK_LINK_FLAG ( [ [ $base_frameworks] ] ,[ LIBS="$LIBS $base_frameworks"] ,[ AC_MSG_ERROR ( could not find base frameworks ) ] )
261
- ] )
262
-
263
209
CPPFLAGS="$CPPFLAGS -DMAC_OSX"
264
210
TESTDEFS="-DBOOST_TEST_DYN_LINK"
265
211
;;
@@ -452,6 +398,8 @@ if test x$boost_sleep != xyes; then
452
398
AC_MSG_ERROR ( No working boost sleep implementation found )
453
399
fi
454
400
401
+ BITCOIN_QT_INIT
402
+
455
403
if test x$use_pkgconfig = xyes; then
456
404
457
405
if test x$PKG_CONFIG == x; then
@@ -464,23 +412,10 @@ if test x$use_pkgconfig = xyes; then
464
412
[
465
413
PKG_CHECK_MODULES([ SSL] , [ libssl] , [ INCLUDES="$INCLUDES $SSL_CFLAGS"; LIBS="$LIBS $SSL_LIBS"] , [ AC_MSG_ERROR ( openssl not found. ) ] )
466
414
PKG_CHECK_MODULES([ CRYPTO] , [ libcrypto] , [ INCLUDES="$INCLUDES $CRYPTO_CFLAGS"; LIBS="$LIBS $CRYPTO_LIBS"] , [ AC_MSG_ERROR ( libcrypto not found. ) ] )
467
-
468
- BITCOIN_QT_CHECK([
469
- PKG_CHECK_MODULES([ QT] , [ QtCore QtGui QtNetwork] , [ QT_INCLUDES="$QT_CFLAGS"; have_qt=yes] ,[
470
- have_qt=no
471
- BITCOIN_QT_FAIL([ Qt dependencies not found] )
472
- ] )
473
- if test x$use_tests = xyes; then
474
- PKG_CHECK_MODULES([ QT_TEST] , [ QtTest] , [ QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes] , [ have_qt_test=no] )
475
- fi
476
- if test x$use_dbus != xno; then
477
- PKG_CHECK_MODULES([ QT_DBUS] , [ QtDBus] , [ QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes] , [ have_qt_dbus=no] )
478
- fi
479
- if test x$use_qr != xno; then
480
- PKG_CHECK_MODULES([ QR] , [ libqrencode] , [ have_qrencode=yes] , [ have_qrencode=no] )
481
- fi
482
- PKG_CHECK_MODULES([ PROTOBUF] , [ protobuf] , [ have_protobuf=yes] , [ AC_MSG_ERROR ( libprotobuf not found. ) ] )
483
- ] )
415
+ BITCOIN_QT_CHECK([ PKG_CHECK_MODULES([ PROTOBUF] , [ protobuf] , [ have_protobuf=yes] , [ BITCOIN_QT_FAIL(libprotobuf not found)] )] )
416
+ if test x$use_qr != xno; then
417
+ BITCOIN_QT_CHECK([ PKG_CHECK_MODULES([ QR] , [ libqrencode] , [ have_qrencode=yes] , [ have_qrencode=no] )] )
418
+ fi
484
419
]
485
420
)
486
421
else
@@ -490,81 +425,18 @@ else
490
425
AC_CHECK_HEADER ( [ openssl/ssl.h] ,, AC_MSG_ERROR ( libssl headers missing ) ,)
491
426
AC_CHECK_LIB ( [ ssl] , [ main] ,, AC_MSG_ERROR ( libssl missing ) )
492
427
493
- BITCOIN_QT_CHECK([
494
- TEMP_LIBS="$LIBS"
495
- LIBS=
496
- if test x$qt_lib_path != x; then
497
- QT_LIBS="$QT_LIBS -L$qt_lib_path"
498
- LIBS="$QT_LIBS"
499
- fi
500
- if test x$qt_plugin_path != x; then
501
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
502
- LIBS="$QT_LIBS"
503
- fi
504
-
505
- if test x$TARGET_OS == xwindows; then
506
- AC_CHECK_LIB ( [ imm32] , [ main] ,, BITCOIN_QT_FAIL ( libimm32 not found ))
507
- fi
508
- ] )
509
-
510
- # TODO: These are only needed when they're linked directly to parent libs. It really has nothing to do with windows.
511
- # Instead, check for missing functions in parent libs and assume static if they're absent.
512
- if test x$TARGET_OS == xwindows; then
513
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ qcncodecs] ,[ main] ,,BITCOIN_QT_FAIL ( libqcncodecs not found )) )
514
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ qjpcodecs] ,[ main] ,,BITCOIN_QT_FAIL ( libqjpcodecs not found )) )
515
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ qkrcodecs] ,[ main] ,,BITCOIN_QT_FAIL ( libqkrcodecs not found )) )
516
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ qtwcodecs] ,[ main] ,,BITCOIN_QT_FAIL ( libqtwcodecs not found )) )
517
- fi
428
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ protobuf] ,[ main] ,,BITCOIN_QT_FAIL ( libprotobuf not found )) )
429
+ if test x$use_qr != xno; then
430
+ BITCOIN_QT_CHECK([ AC_CHECK_LIB ( [ qrencode] , [ main] ,, [ have_qrencode=no] ) ] )
431
+ BITCOIN_QT_CHECK([ AC_CHECK_HEADER ( [ qrencode.h] ,, have_qrencode=no ) ] )
432
+ fi
433
+ fi
518
434
519
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ QtCore] ,[ main] ,,BITCOIN_QT_FAIL ( libQtCore not found )) )
520
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ QtGui] ,[ main] ,,BITCOIN_QT_FAIL ( libQtGui not found )) )
521
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ QtNetwork] ,[ main] ,,BITCOIN_QT_FAIL ( libQtNetwork not found )) )
522
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ protobuf] ,[ main] ,,BITCOIN_QT_FAIL ( libprotobuf not found )) )
435
+ BITCOIN_QT_PATH_PROGS([ PROTOC] , [ protoc] ,$protoc_bin_path)
523
436
524
- BITCOIN_QT_CHECK([
525
- QT_LIBS="$LIBS"
526
- LIBS="$TEMP_LIBS"
437
+ dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
438
+ BITCOIN_QT_CONFIGURE([ $use_pkgconfig] , [ qt4] )
527
439
528
- TEMP_CPPFLAGS="$CPPFLAGS"
529
- if test x$qt_include_path != x; then
530
- QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus"
531
- CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
532
- fi
533
- ] )
534
- BITCOIN_QT_CHECK([ AC_CHECK_HEADER ( [ QtPlugin] ,,BITCOIN_QT_FAIL ( QtCore headers missing )) ] )
535
- BITCOIN_QT_CHECK([ AC_CHECK_HEADER ( [ QApplication] ,, BITCOIN_QT_FAIL ( QtGui headers missing )) ] )
536
- BITCOIN_QT_CHECK([ AC_CHECK_HEADER ( [ QLocalSocket] ,, BITCOIN_QT_FAIL ( QtNetwork headers missing )) ] )
537
-
538
- BITCOIN_QT_CHECK([
539
- if test x$use_tests = xyes; then
540
- TEMP_LIBS="$LIBS"
541
- LIBS=
542
- if test x$qt_lib_path != x; then
543
- LIBS="-L$qt_lib_path"
544
- fi
545
- AC_CHECK_LIB ( [ QtTest] , [ main] ,, have_qt_test=no )
546
- AC_CHECK_HEADER ( [ QTest] ,, have_qt_test=no )
547
- QT_TEST_LIBS="$LIBS"
548
- LIBS="$TEMP_LIBS"
549
- fi
550
- if test x$use_dbus != xno; then
551
- TEMP_LIBS="$LIBS"
552
- LIBS=
553
- if test x$qt_lib_path != x; then
554
- LIBS="-L$qt_lib_path"
555
- fi
556
- AC_CHECK_LIB ( [ QtDBus] , [ main] ,, have_qt_dbus=no )
557
- AC_CHECK_HEADER ( [ QtDBus] ,, have_qt_dbus=no )
558
- QT_DBUS_LIBS="$LIBS"
559
- LIBS="$TEMP_LIBS"
560
- fi
561
- CPPFLAGS="$TEMP_CPPFLAGS"
562
- if test x$use_qr != xno; then
563
- AC_CHECK_LIB ( [ qrencode] , [ main] ,, [ have_qrencode=no] )
564
- AC_CHECK_HEADER ( [ qrencode.h] ,, have_qrencode=no )
565
- fi
566
- ] )
567
- fi
568
440
569
441
if test x$use_ipv6 = xyes; then
570
442
dnl Check for ipv6 build requirements
@@ -613,10 +485,6 @@ if test x$enable_wallet != xno; then
613
485
614
486
else
615
487
AC_MSG_RESULT ( no )
616
-
617
- if test "x$use_qt" != "xno"; then
618
- AC_MSG_ERROR ( [ Cannot currently build Qt GUI with wallet disabled. Use --without-qt.] )
619
- fi
620
488
fi
621
489
622
490
dnl enable ipv6 support
@@ -662,46 +530,15 @@ else
662
530
fi
663
531
fi
664
532
665
- dnl enable qt support
666
- AC_MSG_CHECKING ( [ if qt should be enabled] )
667
- BITCOIN_QT_CHECK([
668
- use_qt=yes
669
- BUILD_QT=qt
670
- if test x$use_tests = xyes; then
671
- if test x$have_qt_test = xno; then
672
- AC_MSG_ERROR ( "libQtTest not found. Use -- disable-tests or -- without-qt." )
673
- fi
674
- fi
675
- if test x$have_qt_dbus = xno; then
676
- if test x$use_dbus = xyes; then
677
- AC_MSG_ERROR ( "libQtDBus not found. Install libQtDBus or remove -- with-qtdbus." )
678
- fi
679
- use_dbus=no
680
- fi
681
- if test x$XGETTEXT == x; then
682
- AC_MSG_WARN ( "xgettext is required to update qt translations" )
683
- fi
684
- if test x$LUPDATE == x; then
685
- AC_MSG_WARN ( "lupdate is required to update qt translations" )
686
- fi
687
- ] ,[
688
- use_qt=no
689
- ] )
690
-
691
- AC_MSG_RESULT ( $use_qt )
692
-
693
533
dnl these are only used when qt is enabled
694
- if test x$use_qt = xyes ; then
695
-
534
+ if test x$bitcoin_enable_qt != xno ; then
535
+ BUILD_QT=qt
696
536
dnl enable dbus support
697
537
AC_MSG_CHECKING ( [ if dbus should be enabled] )
698
- if test x$use_dbus != xno; then
699
- use_dbus=yes
538
+ if test x$bitcoin_enable_qt_dbus != xno; then
700
539
AC_DEFINE ( [ USE_DBUS] ,[ 1] ,[ Define if dbus support should be compiled in] )
701
- else
702
- use_dbus=no
703
540
fi
704
- AC_MSG_RESULT ( $use_dbus )
541
+ AC_MSG_RESULT ( $bitcoin_enable_qt_dbus )
705
542
706
543
dnl enable qr support
707
544
AC_MSG_CHECKING ( [ if qr should be enabled] )
@@ -720,8 +557,18 @@ if test x$use_qt = xyes; then
720
557
fi
721
558
fi
722
559
723
- if test x$use_tests$have_qt_test = xyesyes; then
560
+ if test x$XGETTEXT == x; then
561
+ AC_MSG_WARN ( "xgettext is required to update qt translations" )
562
+ fi
563
+
564
+ if test x$use_tests = xyes; then
724
565
BUILD_TEST_QT="test"
566
+ if test x$bitcoin_enable_qt_test != xyes; then
567
+ AC_MSG_ERROR ( "QT Test lib not found. Use -- disable-tests or -- without-qt." )
568
+ fi
569
+ fi
570
+ if test x$enable_wallet == xno; then
571
+ AC_MSG_ERROR ( [ Cannot currently build Qt GUI with wallet disabled. Use --without-qt.] )
725
572
fi
726
573
fi
727
574
@@ -756,17 +603,10 @@ AC_SUBST(USE_QRCODE)
756
603
AC_SUBST ( USE_IPV6 )
757
604
AC_SUBST ( INCLUDES )
758
605
AC_SUBST ( BOOST_LIBS )
759
- AC_SUBST ( MOC_DEFS )
760
- AC_SUBST ( QT_INCLUDES )
761
- AC_SUBST ( QT_TEST_LIBS )
762
- AC_SUBST ( QT_LIBS )
763
- AC_SUBST ( QT_DBUS_LIBS )
764
- AC_SUBST ( QT_DBUS_INCLUDES )
765
- AC_SUBST ( QT_TEST_INCLUDES )
766
606
AC_SUBST ( TESTDEFS )
767
607
AC_SUBST ( LEVELDB_TARGET_FLAGS )
768
- AC_SUBST ( BUILD_QT )
769
608
AC_SUBST ( BUILD_TEST )
609
+ AC_SUBST ( BUILD_QT )
770
610
AC_SUBST ( BUILD_TEST_QT )
771
611
AC_CONFIG_FILES ( [ Makefile src/Makefile src/test/Makefile src/qt/Makefile src/qt/test/Makefile share/setup.nsi share/qt/Info.plist] )
772
612
AC_CONFIG_FILES ( [ qa/pull-tester/run-bitcoind-for-test.sh] ,[ chmod +x qa/pull-tester/run-bitcoind-for-test.sh] )
0 commit comments