Skip to content

Commit 06abcbf

Browse files
lemzwergfanquake
authored andcommitted
scripted-diff: Orthogonalize string quoting
Add double qoutes to string tests where arguments could (theoretically) contain spaces. Remove double quotes where not necessary. -BEGIN VERIFY SCRIPT- sed -iE -e 's/"x\(yes\|no\|auto\)\?"/x\1/g' -e 's/test \(x\$[^ ]*\)/test "\1"/g' build-aux/m4/bitcoin_qt.m4 -END VERIFY SCRIPT-
1 parent e0496d3 commit 06abcbf

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

build-aux/m4/bitcoin_qt.m4

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
dnl Helper for cases where a qt dependency is not met.
66
dnl Output: If qt version is auto, set bitcoin_enable_qt to false. Else, exit.
77
AC_DEFUN([BITCOIN_QT_FAIL],[
8-
if test "x$bitcoin_qt_want_version" = "xauto" && test x$bitcoin_qt_force != xyes; then
9-
if test x$bitcoin_enable_qt != xno; then
8+
if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then
9+
if test "x$bitcoin_enable_qt" != xno; then
1010
AC_MSG_WARN([$1; bitcoin-qt frontend will not be built])
1111
fi
1212
bitcoin_enable_qt=no
@@ -17,7 +17,7 @@ AC_DEFUN([BITCOIN_QT_FAIL],[
1717
])
1818

1919
AC_DEFUN([BITCOIN_QT_CHECK],[
20-
if test "x$bitcoin_enable_qt" != "xno" && test x$bitcoin_qt_want_version != xno; then
20+
if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then
2121
true
2222
$1
2323
else
@@ -35,12 +35,12 @@ dnl Inputs: $4: If "yes", don't fail if $2 is not found.
3535
dnl Output: $1 is set to the path of $2 if found. $2 are searched in order.
3636
AC_DEFUN([BITCOIN_QT_PATH_PROGS],[
3737
BITCOIN_QT_CHECK([
38-
if test "x$3" != "x"; then
38+
if test "x$3" != x; then
3939
AC_PATH_PROGS($1,$2,,$3)
4040
else
4141
AC_PATH_PROGS($1,$2)
4242
fi
43-
if test "x$$1" = "x" && test "x$4" != "xyes"; then
43+
if test "x$$1" = x && test "x$4" != xyes; then
4444
BITCOIN_QT_FAIL([$1 not found])
4545
fi
4646
])
@@ -57,7 +57,7 @@ AC_DEFUN([BITCOIN_QT_INIT],[
5757
[build bitcoin-qt GUI (default=auto, qt5 tried first)])],
5858
[
5959
bitcoin_qt_want_version=$withval
60-
if test x$bitcoin_qt_want_version = xyes; then
60+
if test "x$bitcoin_qt_want_version" = xyes; then
6161
bitcoin_qt_force=yes
6262
bitcoin_qt_want_version=auto
6363
fi
@@ -89,11 +89,11 @@ dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test
8989
AC_DEFUN([BITCOIN_QT_CONFIGURE],[
9090
use_pkgconfig=$1
9191
92-
if test x$use_pkgconfig = x; then
92+
if test "x$use_pkgconfig" = x; then
9393
use_pkgconfig=yes
9494
fi
9595
96-
if test x$use_pkgconfig = xyes; then
96+
if test "x$use_pkgconfig" = xyes; then
9797
BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG([$2])])
9898
else
9999
BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG])
@@ -113,9 +113,9 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
113113
TEMP_CXXFLAGS=$CXXFLAGS
114114
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
115115
CXXFLAGS="$PIC_FLAGS $CXXFLAGS"
116-
if test x$bitcoin_qt_got_major_vers = x5; then
116+
if test "x$bitcoin_qt_got_major_vers" = x5; then
117117
_BITCOIN_QT_IS_STATIC
118-
if test x$bitcoin_cv_static_qt = xyes; then
118+
if test "x$bitcoin_cv_static_qt" = xyes; then
119119
_BITCOIN_QT_FIND_STATIC_PLUGINS
120120
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
121121
AC_CACHE_CHECK(for Qt < 5.4, bitcoin_cv_need_acc_widget,[
@@ -133,25 +133,25 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
133133
[bitcoin_cv_need_acc_widget=yes],
134134
[bitcoin_cv_need_acc_widget=no])
135135
])
136-
if test "x$bitcoin_cv_need_acc_widget" = "xyes"; then
136+
if test "x$bitcoin_cv_need_acc_widget" = xyes; then
137137
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets])
138138
fi
139139
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal])
140140
AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists])
141-
if test x$TARGET_OS = xwindows; then
141+
if test "x$TARGET_OS" = xwindows; then
142142
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows])
143143
AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])
144-
elif test x$TARGET_OS = xlinux; then
144+
elif test "x$TARGET_OS" = xlinux; then
145145
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static])
146146
AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb])
147-
elif test x$TARGET_OS = xdarwin; then
147+
elif test "x$TARGET_OS" = xdarwin; then
148148
AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)])
149149
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa])
150150
AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa])
151151
fi
152152
fi
153153
else
154-
if test x$TARGET_OS = xwindows; then
154+
if test "x$TARGET_OS" = xwindows; then
155155
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
156156
_BITCOIN_QT_CHECK_STATIC_PLUGINS([
157157
Q_IMPORT_PLUGIN(qcncodecs)
@@ -166,13 +166,13 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
166166
CXXFLAGS=$TEMP_CXXFLAGS
167167
])
168168
169-
if test x$use_pkgconfig$qt_bin_path = xyes; then
170-
if test x$bitcoin_qt_got_major_vers = x5; then
169+
if test "x$use_pkgconfig$qt_bin_path" = xyes; then
170+
if test "x$bitcoin_qt_got_major_vers" = x5; then
171171
qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`"
172172
fi
173173
fi
174174
175-
if test x$use_hardening != xno; then
175+
if test "x$use_hardening" != xno; then
176176
BITCOIN_QT_CHECK([
177177
AC_MSG_CHECKING(whether -fPIE can be used with this Qt config)
178178
TEMP_CPPFLAGS=$CPPFLAGS
@@ -246,17 +246,17 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
246246
BITCOIN_QT_CHECK([
247247
bitcoin_enable_qt=yes
248248
bitcoin_enable_qt_test=yes
249-
if test x$have_qt_test = xno; then
249+
if test "x$have_qt_test" = xno; then
250250
bitcoin_enable_qt_test=no
251251
fi
252252
bitcoin_enable_qt_dbus=no
253-
if test x$use_dbus != xno && test x$have_qt_dbus = xyes; then
253+
if test "x$use_dbus" != xno && test "x$have_qt_dbus" = xyes; then
254254
bitcoin_enable_qt_dbus=yes
255255
fi
256-
if test x$use_dbus = xyes && test x$have_qt_dbus = xno; then
256+
if test "x$use_dbus" = xyes && test "x$have_qt_dbus" = xno; then
257257
AC_MSG_ERROR([libQtDBus not found. Install libQtDBus or remove --with-qtdbus.])
258258
fi
259-
if test x$LUPDATE = x; then
259+
if test "x$LUPDATE" = x; then
260260
AC_MSG_WARN([lupdate is required to update qt translations])
261261
fi
262262
],[
@@ -321,7 +321,7 @@ AC_DEFUN([_BITCOIN_QT_IS_STATIC],[
321321
[bitcoin_cv_static_qt=yes],
322322
[bitcoin_cv_static_qt=no])
323323
])
324-
if test x$bitcoin_cv_static_qt = xyes; then
324+
if test "x$bitcoin_cv_static_qt" = xyes; then
325325
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol for static Qt plugins])
326326
fi
327327
])
@@ -350,28 +350,28 @@ dnl Inputs: bitcoin_qt_got_major_vers. 4 or 5.
350350
dnl Inputs: qt_plugin_path. optional.
351351
dnl Outputs: QT_LIBS is appended
352352
AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
353-
if test x$bitcoin_qt_got_major_vers = x5; then
354-
if test x$qt_plugin_path != x; then
353+
if test "x$bitcoin_qt_got_major_vers" = x5; then
354+
if test "x$qt_plugin_path" != x; then
355355
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
356356
if test -d "$qt_plugin_path/accessible"; then
357357
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
358358
fi
359359
fi
360-
if test x$use_pkgconfig = xyes; then
360+
if test "x$use_pkgconfig" = xyes; then
361361
: dnl
362362
m4_ifdef([PKG_CHECK_MODULES],[
363363
PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
364-
if test x$TARGET_OS = xlinux; then
364+
if test "x$TARGET_OS" = xlinux; then
365365
PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
366366
if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then
367367
PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
368368
fi
369-
elif test x$TARGET_OS = xdarwin; then
369+
elif test "x$TARGET_OS" = xdarwin; then
370370
PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
371371
fi
372372
])
373373
else
374-
if test x$TARGET_OS = xwindows; then
374+
if test "x$TARGET_OS" = xwindows; then
375375
AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[
376376
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
377377
#include <QtCore/qconfig.h>
@@ -387,13 +387,13 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
387387
[bitcoin_cv_need_platformsupport=yes],
388388
[bitcoin_cv_need_platformsupport=no])
389389
])
390-
if test x$bitcoin_cv_need_platformsupport = xyes; then
390+
if test "x$bitcoin_cv_need_platformsupport" = xyes; then
391391
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}PlatformSupport not found)))
392392
fi
393393
fi
394394
fi
395395
else
396-
if test x$qt_plugin_path != x; then
396+
if test "x$qt_plugin_path" != x; then
397397
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
398398
QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
399399
fi
@@ -411,10 +411,10 @@ dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
411411
AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[
412412
m4_ifdef([PKG_CHECK_MODULES],[
413413
auto_priority_version=$1
414-
if test x$auto_priority_version = x; then
414+
if test "x$auto_priority_version" = x; then
415415
auto_priority_version=qt5
416416
fi
417-
if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then
417+
if test "x$bitcoin_qt_want_version" = xqt5 || ( test "x$bitcoin_qt_want_version" = xauto && test "x$auto_priority_version" = xqt5 ); then
418418
QT_LIB_PREFIX=Qt5
419419
bitcoin_qt_got_major_vers=5
420420
else
@@ -424,28 +424,28 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[
424424
qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets"
425425
qt4_modules="QtCore QtGui QtNetwork"
426426
BITCOIN_QT_CHECK([
427-
if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then
427+
if test "x$bitcoin_qt_want_version" = xqt5 || ( test "x$bitcoin_qt_want_version" = xauto && test "x$auto_priority_version" = xqt5 ); then
428428
PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" have_qt=yes],[have_qt=no])
429-
elif test x$bitcoin_qt_want_version = xqt4 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt4 ); then
429+
elif test "x$bitcoin_qt_want_version" = xqt4 || ( test "x$bitcoin_qt_want_version" = xauto && test "x$auto_priority_version" = xqt4 ); then
430430
PKG_CHECK_MODULES([QT4], [$qt4_modules], [QT_INCLUDES="$QT4_CFLAGS"; QT_LIBS="$QT4_LIBS" ; have_qt=yes], [have_qt=no])
431431
fi
432432
433433
dnl qt version is set to 'auto' and the preferred version wasn't found. Now try the other.
434-
if test x$have_qt = xno && test x$bitcoin_qt_want_version = xauto; then
435-
if test x$auto_priority_version = xqt5; then
434+
if test "x$have_qt" = xno && test "x$bitcoin_qt_want_version" = xauto; then
435+
if test "x$auto_priority_version" = xqt5; then
436436
PKG_CHECK_MODULES([QT4], [$qt4_modules], [QT_INCLUDES="$QT4_CFLAGS"; QT_LIBS="$QT4_LIBS" ; have_qt=yes; QT_LIB_PREFIX=Qt; bitcoin_qt_got_major_vers=4], [have_qt=no])
437437
else
438438
PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" ; have_qt=yes; QT_LIB_PREFIX=Qt5; bitcoin_qt_got_major_vers=5], [have_qt=no])
439439
fi
440440
fi
441-
if test x$have_qt != xyes; then
441+
if test "x$have_qt" != xyes; then
442442
have_qt=no
443443
BITCOIN_QT_FAIL([Qt dependencies not found])
444444
fi
445445
])
446446
BITCOIN_QT_CHECK([
447447
PKG_CHECK_MODULES([QT_TEST], [${QT_LIB_PREFIX}Test], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
448-
if test x$use_dbus != xno; then
448+
if test "x$use_dbus" != xno; then
449449
PKG_CHECK_MODULES([QT_DBUS], [${QT_LIB_PREFIX}DBus], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no])
450450
fi
451451
])
@@ -466,7 +466,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
466466
CXXFLAGS="$PIC_FLAGS $CXXFLAGS"
467467
TEMP_LIBS="$LIBS"
468468
BITCOIN_QT_CHECK([
469-
if test x$qt_include_path != x; then
469+
if test "x$qt_include_path" != x; then
470470
QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtWidgets -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus"
471471
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
472472
fi
@@ -477,10 +477,10 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
477477
BITCOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing))])
478478
479479
BITCOIN_QT_CHECK([
480-
if test x$bitcoin_qt_want_version = xauto; then
480+
if test "x$bitcoin_qt_want_version" = xauto; then
481481
_BITCOIN_QT_CHECK_QT5
482482
fi
483-
if test x$bitcoin_cv_qt5 = xyes || test x$bitcoin_qt_want_version = xqt5; then
483+
if test "x$bitcoin_cv_qt5" = xyes || test "x$bitcoin_qt_want_version" = xqt5; then
484484
QT_LIB_PREFIX=Qt5
485485
bitcoin_qt_got_major_vers=5
486486
else
@@ -491,11 +491,11 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
491491
492492
BITCOIN_QT_CHECK([
493493
LIBS=
494-
if test x$qt_lib_path != x; then
494+
if test "x$qt_lib_path" != x; then
495495
LIBS="$LIBS -L$qt_lib_path"
496496
fi
497497
498-
if test x$TARGET_OS = xwindows; then
498+
if test "x$TARGET_OS" = xwindows; then
499499
AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found))
500500
fi
501501
])
@@ -508,23 +508,23 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
508508
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Core not found)))
509509
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Gui not found)))
510510
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Network not found)))
511-
if test x$bitcoin_qt_got_major_vers = x5; then
511+
if test "x$bitcoin_qt_got_major_vers" = x5; then
512512
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Widgets not found)))
513513
fi
514514
QT_LIBS="$LIBS"
515515
LIBS="$TEMP_LIBS"
516516
517517
BITCOIN_QT_CHECK([
518518
LIBS=
519-
if test x$qt_lib_path != x; then
519+
if test "x$qt_lib_path" != x; then
520520
LIBS="-L$qt_lib_path"
521521
fi
522522
AC_CHECK_LIB([${QT_LIB_PREFIX}Test], [main],, have_qt_test=no)
523523
AC_CHECK_HEADER([QTest],, have_qt_test=no)
524524
QT_TEST_LIBS="$LIBS"
525-
if test x$use_dbus != xno; then
525+
if test "x$use_dbus" != xno; then
526526
LIBS=
527-
if test x$qt_lib_path != x; then
527+
if test "x$qt_lib_path" != x; then
528528
LIBS="-L$qt_lib_path"
529529
fi
530530
AC_CHECK_LIB([${QT_LIB_PREFIX}DBus], [main],, have_qt_dbus=no)

0 commit comments

Comments
 (0)