Skip to content

Commit 371f3f6

Browse files
committed
qt5: fix --with-qt with no arguments
1 parent 2691cbc commit 371f3f6

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

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

src/m4/bitcoin_qt.m4

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dnl Helper for cases where a qt dependency is not met.
22
dnl Output: If qt version is auto, set bitcoin_enable_qt to false. Else, exit.
33
AC_DEFUN([BITCOIN_QT_FAIL],[
4-
if test "x$bitcoin_qt_want_version" = "xauto"; then
4+
if test "x$bitcoin_qt_want_version" = "xauto" && test x$bitcoin_qt_force != xyes; then
55
if test x$bitcoin_enable_qt != xno; then
66
AC_MSG_WARN([$1; bitcoin-qt frontend will not be built])
77
fi
@@ -50,7 +50,13 @@ AC_DEFUN([BITCOIN_QT_INIT],[
5050
AC_ARG_WITH([qt],
5151
[AS_HELP_STRING([--with-qt],
5252
[with qt (no|qt4|qt5|auto. default is auto, qt4 tried first.)])],
53-
[bitcoin_qt_want_version=$withval],
53+
[
54+
bitcoin_qt_want_version=$withval
55+
if test x$bitcoin_qt_want_version = xyes; then
56+
bitcoin_qt_force=yes
57+
bitcoin_qt_want_version=auto
58+
fi
59+
],
5460
[bitcoin_qt_want_version=auto])
5561
5662
AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])

0 commit comments

Comments
 (0)