Skip to content

Commit 6a0e237

Browse files
committed
Merge pull request #3346
42cc967 qt5: fix typo causing broken selection logic (Cory Fields) 371f3f6 qt5: fix --with-qt with no arguments (Cory Fields) 2691cbc qt5: Force macports default include path to be searched last (Cory Fields) 8b0f608 qt5: tests: Make sure static plugin symbols are pulled in (Cory Fields) 47ffb50 qt5: Use QT_SELECT for debian-based distros. (Cory Fields) 60dc589 qt5: Use the info gleaned from configure for plugin importing (Cory Fields) c8ba8ef qt5: split out qt config and add qt5 support (Cory Fields) c614bd7 qt5: fix a build issue with osx and qtdbus (Cory Fields) 328bdb1 qt5: Ensure correct link order (Cory Fields)
2 parents 62e9d77 + 42cc967 commit 6a0e237

File tree

11 files changed

+465
-216
lines changed

11 files changed

+465
-216
lines changed

configure.ac

Lines changed: 32 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -63,38 +63,6 @@ AC_ARG_ENABLE([ipv6],
6363
[use_ipv6=$enableval],
6464
[use_ipv6=yes])
6565

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-
9866
AC_ARG_ENABLE(tests,
9967
AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]),
10068
[use_tests=$enableval],
@@ -116,12 +84,6 @@ AC_ARG_WITH([qrencode],
11684
[use_qr=$withval],
11785
[use_qr=auto])
11886

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-
12587
AC_ARG_ENABLE([hardening],
12688
[AS_HELP_STRING([--enable-hardening],
12789
[attempt to harden the resulting executables (default is yes)])],
@@ -140,10 +102,6 @@ AC_ARG_ENABLE([lcov],
140102
[use_lcov=yes],
141103
[use_lcov=no])
142104

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], [])
147105
AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], [])
148106

149107

@@ -168,13 +126,7 @@ AC_PATH_PROG(LCOV, lcov)
168126
AC_PATH_PROG(JAVA, java)
169127
AC_PATH_PROG(GENHTML, genhtml)
170128
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)
176129
AC_PATH_PROG(CCACHE,ccache)
177-
AC_PATH_PROGS([LUPDATE], [lupdate-qt4 lupdate4 lupdate],, $qt_bin_path:$PATH)
178130
AC_PATH_PROG(XGETTEXT,xgettext)
179131
AC_PATH_PROG(HEXDUMP,hexdump)
180132
PKG_PROG_PKG_CONFIG
@@ -239,7 +191,7 @@ case $host in
239191
AC_CHECK_PROG([PORT],port, port)
240192
if test x$PORT = xport; then
241193
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"
243195
LIBS="$LIBS -L/opt/local/lib -L/opt/local/lib/db48"
244196
fi
245197

@@ -254,12 +206,6 @@ case $host in
254206
fi
255207
fi
256208

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-
263209
CPPFLAGS="$CPPFLAGS -DMAC_OSX"
264210
TESTDEFS="-DBOOST_TEST_DYN_LINK"
265211
;;
@@ -452,6 +398,8 @@ if test x$boost_sleep != xyes; then
452398
AC_MSG_ERROR(No working boost sleep implementation found)
453399
fi
454400

401+
BITCOIN_QT_INIT
402+
455403
if test x$use_pkgconfig = xyes; then
456404

457405
if test x$PKG_CONFIG == x; then
@@ -464,23 +412,10 @@ if test x$use_pkgconfig = xyes; then
464412
[
465413
PKG_CHECK_MODULES([SSL], [libssl], [INCLUDES="$INCLUDES $SSL_CFLAGS"; LIBS="$LIBS $SSL_LIBS"], [AC_MSG_ERROR(openssl not found.)])
466414
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
484419
]
485420
)
486421
else
@@ -490,81 +425,18 @@ else
490425
AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
491426
AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR(libssl missing))
492427

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
518434

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)
523436

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])
527439

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
568440

569441
if test x$use_ipv6 = xyes; then
570442
dnl Check for ipv6 build requirements
@@ -613,10 +485,6 @@ if test x$enable_wallet != xno; then
613485

614486
else
615487
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
620488
fi
621489

622490
dnl enable ipv6 support
@@ -662,46 +530,15 @@ else
662530
fi
663531
fi
664532

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-
693533
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
696536
dnl enable dbus support
697537
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
700539
AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in])
701-
else
702-
use_dbus=no
703540
fi
704-
AC_MSG_RESULT($use_dbus)
541+
AC_MSG_RESULT($bitcoin_enable_qt_dbus)
705542

706543
dnl enable qr support
707544
AC_MSG_CHECKING([if qr should be enabled])
@@ -720,8 +557,18 @@ if test x$use_qt = xyes; then
720557
fi
721558
fi
722559

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
724565
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.])
725572
fi
726573
fi
727574

@@ -756,17 +603,10 @@ AC_SUBST(USE_QRCODE)
756603
AC_SUBST(USE_IPV6)
757604
AC_SUBST(INCLUDES)
758605
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)
766606
AC_SUBST(TESTDEFS)
767607
AC_SUBST(LEVELDB_TARGET_FLAGS)
768-
AC_SUBST(BUILD_QT)
769608
AC_SUBST(BUILD_TEST)
609+
AC_SUBST(BUILD_QT)
770610
AC_SUBST(BUILD_TEST_QT)
771611
AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile src/qt/Makefile src/qt/test/Makefile share/setup.nsi share/qt/Info.plist])
772612
AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])

qa/rpc-tests/send.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
TIMEOUT=10
3+
SIGNAL=HUP
4+
if [ $# -eq 0 ]; then
5+
echo -e "Usage:\t$0 <cmd>"
6+
echo -e "\tRuns <cmd> and wait ${TIMEOUT} seconds or until SIG${SIGNAL} is received."
7+
echo -e "\tReturns: 0 if SIG${SIGNAL} is received, 1 otherwise."
8+
exit 0
9+
fi
10+
trap '[[ ${PID} ]] && kill ${PID}' ${SIGNAL}
11+
"$@"
12+
sleep ${TIMEOUT} & PID=$!
13+
wait ${PID} && exit 1
14+
exit 0

qa/rpc-tests/util.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function CreateDataDir {
2323
echo "rpcuser=rt" >> $CONF
2424
echo "rpcpassword=rt" >> $CONF
2525
echo "rpcwait=1" >> $CONF
26+
echo "walletnotify=killall -HUP `basename ${SENDANDWAIT}`" >> $CONF
2627
shift
2728
while (( "$#" )); do
2829
echo $1 >> $CONF
@@ -59,7 +60,7 @@ function Send {
5960
to=$2
6061
amount=$3
6162
address=$(Address $to)
62-
txid=$( $CLI $from sendtoaddress $address $amount )
63+
txid=$( ${SENDANDWAIT} $CLI $from sendtoaddress $address $amount )
6364
}
6465

6566
# Use: Unspent <datadir> <n'th-last-unspent> <var>
@@ -80,7 +81,7 @@ function CreateTxn1 {
8081

8182
# Use: SendRawTxn <datadir> <hex_txn_data>
8283
function SendRawTxn {
83-
$CLI $1 sendrawtransaction $2
84+
${SENDANDWAIT} $CLI $1 sendrawtransaction $2
8485
}
8586

8687
# Use: GetBlocks <datadir>

qa/rpc-tests/wallet.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ BITCOIND=${1}/bitcoind
1212
CLI=${1}/bitcoin-cli
1313

1414
DIR="${BASH_SOURCE%/*}"
15+
SENDANDWAIT="${DIR}/send.sh"
1516
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
1617
. "$DIR/util.sh"
1718

0 commit comments

Comments
 (0)