Skip to content

Commit b77b4ed

Browse files
committed
Bugfix: Replace bashisms with standard sh to fix build on non-BASH systems
1 parent d6b0539 commit b77b4ed

File tree

3 files changed

+36
-33
lines changed

3 files changed

+36
-33
lines changed

autogen.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -e
33
srcdir="$(dirname $0)"
44
cd "$srcdir"
55
if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then
6-
export LIBTOOLIZE="${GLIBTOOLIZE}"
6+
LIBTOOLIZE="${GLIBTOOLIZE}"
7+
export LIBTOOLIZE
78
fi
89
autoreconf --install --force --warnings=all

build-aux/m4/bitcoin_qt.m4

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test
8484
AC_DEFUN([BITCOIN_QT_CONFIGURE],[
8585
use_pkgconfig=$1
8686
87-
if test x$use_pkgconfig == x; then
87+
if test x$use_pkgconfig = x; then
8888
use_pkgconfig=yes
8989
fi
9090
@@ -106,9 +106,9 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
106106
BITCOIN_QT_CHECK([
107107
TEMP_CPPFLAGS=$CPPFLAGS
108108
CPPFLAGS=$QT_INCLUDES
109-
if test x$bitcoin_qt_got_major_vers == x5; then
109+
if test x$bitcoin_qt_got_major_vers = x5; then
110110
_BITCOIN_QT_IS_STATIC
111-
if test x$bitcoin_cv_static_qt == xyes; then
111+
if test x$bitcoin_cv_static_qt = xyes; then
112112
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
113113
if test x$qt_plugin_path != x; then
114114
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
@@ -118,14 +118,14 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
118118
PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
119119
fi
120120
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets])
121-
if test x$TARGET_OS == xwindows; then
121+
if test x$TARGET_OS = xwindows; then
122122
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows])
123123
AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])
124-
elif test x$TARGET_OS == xlinux; then
124+
elif test x$TARGET_OS = xlinux; then
125125
PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
126126
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static])
127127
AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb])
128-
elif test x$TARGET_OS == xdarwin; then
128+
elif test x$TARGET_OS = xdarwin; then
129129
if test x$use_pkgconfig = xyes; then
130130
PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
131131
fi
@@ -135,7 +135,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
135135
fi
136136
fi
137137
else
138-
if test x$TARGET_OS == xwindows; then
138+
if test x$TARGET_OS = xwindows; then
139139
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
140140
if test x$qt_plugin_path != x; then
141141
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
@@ -196,7 +196,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
196196
if test x$use_dbus = xyes && test x$have_qt_dbus = xno; then
197197
AC_MSG_ERROR("libQtDBus not found. Install libQtDBus or remove --with-qtdbus.")
198198
fi
199-
if test x$LUPDATE == x; then
199+
if test x$LUPDATE = x; then
200200
AC_MSG_WARN("lupdate is required to update qt translations")
201201
fi
202202
],[
@@ -291,10 +291,10 @@ dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
291291
AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[
292292
m4_ifdef([PKG_CHECK_MODULES],[
293293
auto_priority_version=$1
294-
if test x$auto_priority_version == x; then
294+
if test x$auto_priority_version = x; then
295295
auto_priority_version=qt5
296296
fi
297-
if test x$bitcoin_qt_want_version == xqt5 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt5 ); then
297+
if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then
298298
QT_LIB_PREFIX=Qt5
299299
bitcoin_qt_got_major_vers=5
300300
else
@@ -304,14 +304,14 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[
304304
qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets"
305305
qt4_modules="QtCore QtGui QtNetwork"
306306
BITCOIN_QT_CHECK([
307-
if test x$bitcoin_qt_want_version == xqt5 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt5 ); then
307+
if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then
308308
PKG_CHECK_MODULES([QT], [$qt5_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes],[have_qt=no])
309-
elif test x$bitcoin_qt_want_version == xqt4 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt4 ); then
309+
elif test x$bitcoin_qt_want_version = xqt4 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt4 ); then
310310
PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes], [have_qt=no])
311311
fi
312312
313313
dnl qt version is set to 'auto' and the preferred version wasn't found. Now try the other.
314-
if test x$have_qt == xno && test x$bitcoin_qt_want_version == xauto; then
314+
if test x$have_qt = xno && test x$bitcoin_qt_want_version = xauto; then
315315
if test x$auto_priority_version = x$qt5; then
316316
PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes; QT_LIB_PREFIX=Qt; bitcoin_qt_got_major_vers=4], [have_qt=no])
317317
else
@@ -358,7 +358,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
358358
if test x$bitcoin_qt_want_version = xauto; then
359359
_BITCOIN_QT_CHECK_QT5
360360
fi
361-
if test x$bitcoin_cv_qt5 == xyes || test x$bitcoin_qt_want_version = xqt5; then
361+
if test x$bitcoin_cv_qt5 = xyes || test x$bitcoin_qt_want_version = xqt5; then
362362
QT_LIB_PREFIX=Qt5
363363
bitcoin_qt_got_major_vers=5
364364
else
@@ -373,7 +373,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
373373
LIBS="$LIBS -L$qt_lib_path"
374374
fi
375375
376-
if test x$TARGET_OS == xwindows; then
376+
if test x$TARGET_OS = xwindows; then
377377
AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found))
378378
fi
379379
])
@@ -385,7 +385,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
385385
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXCore not found)))
386386
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXGui not found)))
387387
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXNetwork not found)))
388-
if test x$bitcoin_qt_got_major_vers == x5; then
388+
if test x$bitcoin_qt_got_major_vers = x5; then
389389
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXWidgets not found)))
390390
fi
391391
QT_LIBS="$LIBS"

configure.ac

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,16 @@ case $host in
250250
bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null`
251251
qt5_prefix=`$BREW --prefix qt5 2>/dev/null`
252252
if test x$openssl_prefix != x; then
253-
export PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
253+
PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
254+
export PKG_CONFIG_PATH
254255
fi
255256
if test x$bdb_prefix != x; then
256257
CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
257258
LIBS="$LIBS -L$bdb_prefix/lib"
258259
fi
259260
if test x$qt5_prefix != x; then
260-
export PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
261+
PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
262+
export PKG_CONFIG_PATH
261263
fi
262264
fi
263265
else
@@ -287,28 +289,28 @@ if test x$use_comparison_tool != xno; then
287289
fi
288290

289291
if test x$use_comparison_tool_reorg_tests != xno; then
290-
if test x$use_comparison_tool == x; then
292+
if test x$use_comparison_tool = x; then
291293
AC_MSG_ERROR("comparison tool reorg tests but comparison tool was not specified")
292294
fi
293295
AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 1)
294296
else
295297
AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0)
296298
fi
297299

298-
if test x$use_lcov == xyes; then
299-
if test x$LCOV == x; then
300+
if test x$use_lcov = xyes; then
301+
if test x$LCOV = x; then
300302
AC_MSG_ERROR("lcov testing requested but lcov not found")
301303
fi
302-
if test x$GCOV == x; then
304+
if test x$GCOV = x; then
303305
AC_MSG_ERROR("lcov testing requested but gcov not found")
304306
fi
305-
if test x$JAVA == x; then
307+
if test x$JAVA = x; then
306308
AC_MSG_ERROR("lcov testing requested but java not found")
307309
fi
308-
if test x$GENHTML == x; then
310+
if test x$GENHTML = x; then
309311
AC_MSG_ERROR("lcov testing requested but genhtml not found")
310312
fi
311-
if test x$use_comparison_tool == x; then
313+
if test x$use_comparison_tool = x; then
312314
AC_MSG_ERROR("lcov testing requested but comparison tool was not specified")
313315
fi
314316
LCOV="$LCOV --gcov-tool=$GCOV"
@@ -607,7 +609,7 @@ BITCOIN_QT_INIT
607609

608610
if test x$use_pkgconfig = xyes; then
609611

610-
if test x"$PKG_CONFIG" == "x"; then
612+
if test x"$PKG_CONFIG" = "x"; then
611613
AC_MSG_ERROR(pkg-config not found.)
612614
fi
613615

@@ -721,7 +723,7 @@ if test x$bitcoin_enable_qt != xno; then
721723
dnl enable qr support
722724
AC_MSG_CHECKING([whether to build GUI with support for QR codes])
723725
if test x$have_qrencode = xno; then
724-
if test x$use_qr == xyes; then
726+
if test x$use_qr = xyes; then
725727
AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode")
726728
fi
727729
AC_MSG_RESULT(no)
@@ -735,7 +737,7 @@ if test x$bitcoin_enable_qt != xno; then
735737
fi
736738
fi
737739

738-
if test x$XGETTEXT == x; then
740+
if test x$XGETTEXT = x; then
739741
AC_MSG_WARN("xgettext is required to update qt translations")
740742
fi
741743

@@ -770,12 +772,12 @@ fi
770772
AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
771773
AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
772774
AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
773-
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet == xyes])
774-
AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests == xyes])
775-
AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt == xyes])
775+
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
776+
AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests = xyes])
777+
AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
776778
AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes])
777779
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
778-
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes])
780+
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
779781
AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])
780782
AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno])
781783
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])

0 commit comments

Comments
 (0)