@@ -79,25 +79,12 @@ AC_DEFUN([BITCOIN_QT_INIT],[
79
79
AC_SUBST ( QT_TRANSLATION_DIR ,$qt_translation_path )
80
80
] )
81
81
82
- dnl Find the appropriate version of Qt libraries and includes.
83
- dnl Inputs: $1: Whether or not pkg-config should be used. yes|no. Default: yes.
84
- dnl Inputs: $2: If $1 is "yes" and --with-gui=auto, which qt version should be
85
- dnl tried first.
86
- dnl Outputs: See _BITCOIN_QT_FIND_LIBS_*
82
+ dnl Find Qt libraries and includes.
83
+ dnl Outputs: See _BITCOIN_QT_FIND_LIBS
87
84
dnl Outputs: Sets variables for all qt-related tools.
88
85
dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test
89
86
AC_DEFUN ( [ BITCOIN_QT_CONFIGURE] ,[
90
- use_pkgconfig=$1
91
-
92
- if test "x$use_pkgconfig" = x; then
93
- use_pkgconfig=yes
94
- fi
95
-
96
- if test "x$use_pkgconfig" = xyes; then
97
- BITCOIN_QT_CHECK([ _BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG] )
98
- else
99
- BITCOIN_QT_CHECK([ _BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG] )
100
- fi
87
+ BITCOIN_QT_CHECK([ _BITCOIN_QT_FIND_LIBS] )
101
88
102
89
dnl This is ugly and complicated. Yuck. Works as follows:
103
90
dnl For Qt5, we can check a header to find out whether Qt is build
@@ -117,8 +104,8 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
117
104
_BITCOIN_QT_FIND_STATIC_PLUGINS
118
105
AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol if qt plugins are static] )
119
106
if test "x$TARGET_OS" != xandroid; then
120
- _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)] ,[ -lqminimal] )
121
- AC_DEFINE ( QT_QPA_PLATFORM_MINIMAL , 1 , [ Define this symbol if the minimal qt platform exists] )
107
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)] ,[ -lqminimal] )
108
+ AC_DEFINE ( QT_QPA_PLATFORM_MINIMAL , 1 , [ Define this symbol if the minimal qt platform exists] )
122
109
fi
123
110
if test "x$TARGET_OS" = xwindows; then
124
111
_BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)] ,[ -lqwindows] )
@@ -139,7 +126,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
139
126
CXXFLAGS=$TEMP_CXXFLAGS
140
127
] )
141
128
142
- if test "x$use_pkgconfig$ qt_bin_path" = xyes ; then
129
+ if test "x$qt_bin_path" = x ; then
143
130
qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`"
144
131
fi
145
132
@@ -213,7 +200,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
213
200
214
201
215
202
dnl enable qt support
216
- AC_MSG_CHECKING ( whether to build ]AC_PACKAGE_NAME [ GUI)
203
+ AC_MSG_CHECKING ( [ whether to build ] AC_PACKAGE_NAME [ GUI] )
217
204
BITCOIN_QT_CHECK([
218
205
bitcoin_enable_qt=yes
219
206
bitcoin_enable_qt_test=yes
@@ -255,57 +242,15 @@ dnl All macros below are internal and should _not_ be used from the main
255
242
dnl configure.ac.
256
243
dnl ----
257
244
258
- dnl Internal. Check included version of Qt against minimum specified in doc/dependencies.md
259
- dnl Requires: INCLUDES must be populated as necessary.
260
- dnl Output: bitcoin_cv_qt5=yes|no
261
- AC_DEFUN ( [ _BITCOIN_QT_CHECK_QT5] ,[
262
- AC_CACHE_CHECK ( for Qt 5 , bitcoin_cv_qt5 ,[
263
- AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
264
- #include <QtCore/qconfig.h>
265
- #ifndef QT_VERSION
266
- # include <QtCore/qglobal.h>
267
- #endif
268
- ] ] ,
269
- [ [
270
- #if QT_VERSION < 0x050501
271
- choke
272
- #endif
273
- ] ] ) ] ,
274
- [ bitcoin_cv_qt5=yes] ,
275
- [ bitcoin_cv_qt5=no] )
276
- ] ) ] )
277
-
278
- dnl Internal. Check if the included version of Qt is greater than Qt58.
279
- dnl Requires: INCLUDES must be populated as necessary.
280
- dnl Output: bitcoin_cv_qt58=yes|no
281
- AC_DEFUN ( [ _BITCOIN_QT_CHECK_QT58] ,[
282
- AC_CACHE_CHECK ( for > Qt 5.7 , bitcoin_cv_qt58 ,[
283
- AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
284
- #include <QtCore/qconfig.h>
285
- #ifndef QT_VERSION
286
- # include <QtCore/qglobal.h>
287
- #endif
288
- ] ] ,
289
- [ [
290
- #if QT_VERSION_MINOR < 8
291
- choke
292
- #endif
293
- ] ] ) ] ,
294
- [ bitcoin_cv_qt58=yes] ,
295
- [ bitcoin_cv_qt58=no] )
296
- ] ) ] )
297
-
298
-
299
245
dnl Internal. Check if the linked version of Qt was built as static libs.
300
246
dnl Requires: Qt5.
301
247
dnl Requires: INCLUDES and LIBS must be populated as necessary.
302
248
dnl Output: bitcoin_cv_static_qt=yes|no
303
- dnl Output: Defines QT_STATICPLUGIN if plugins are static.
304
249
AC_DEFUN ( [ _BITCOIN_QT_IS_STATIC] ,[
305
250
AC_CACHE_CHECK ( for static Qt , bitcoin_cv_static_qt ,[
306
251
AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
307
252
#include <QtCore/qconfig.h>
308
- #ifndef QT_VERSION OR QT_VERSION_STR
253
+ #ifndef QT_VERSION
309
254
# include <QtCore/qglobal.h>
310
255
#endif
311
256
] ] ,
@@ -317,9 +262,6 @@ AC_DEFUN([_BITCOIN_QT_IS_STATIC],[
317
262
[ bitcoin_cv_static_qt=yes] ,
318
263
[ bitcoin_cv_static_qt=no] )
319
264
] )
320
- if test "x$bitcoin_cv_static_qt" = xyes; then
321
- AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol for static Qt plugins] )
322
- fi
323
265
] )
324
266
325
267
dnl Internal. Check if the link-requirements for static plugins are met.
@@ -353,70 +295,32 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
353
295
if test -d "$qt_plugin_path/platforms/android"; then
354
296
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL"
355
297
fi
356
- if test "x$use_pkgconfig" = xyes; then
357
- : dnl
358
- m4_ifdef ( [ PKG_CHECK_MODULES] ,[
359
- if test x$bitcoin_cv_qt58 = xno; then
360
- PKG_CHECK_MODULES([ QTPLATFORM] , [ Qt5PlatformSupport] , [ QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"] )
361
- else
362
- PKG_CHECK_MODULES([ QTFONTDATABASE] , [ Qt5FontDatabaseSupport] , [ QT_LIBS="-lQt5FontDatabaseSupport $QT_LIBS"] )
363
- PKG_CHECK_MODULES([ QTEVENTDISPATCHER] , [ Qt5EventDispatcherSupport] , [ QT_LIBS="-lQt5EventDispatcherSupport $QT_LIBS"] )
364
- PKG_CHECK_MODULES([ QTTHEME] , [ Qt5ThemeSupport] , [ QT_LIBS="-lQt5ThemeSupport $QT_LIBS"] )
365
- PKG_CHECK_MODULES([ QTDEVICEDISCOVERY] , [ Qt5DeviceDiscoverySupport] , [ QT_LIBS="-lQt5DeviceDiscoverySupport $QT_LIBS"] )
366
- PKG_CHECK_MODULES([ QTACCESSIBILITY] , [ Qt5AccessibilitySupport] , [ QT_LIBS="-lQt5AccessibilitySupport $QT_LIBS"] )
367
- PKG_CHECK_MODULES([ QTFB] , [ Qt5FbSupport] , [ QT_LIBS="-lQt5FbSupport $QT_LIBS"] )
368
- fi
369
- if test "x$TARGET_OS" = xlinux; then
370
- PKG_CHECK_MODULES([ QTXCBQPA] , [ Qt5XcbQpa] , [ QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"] )
371
- elif test "x$TARGET_OS" = xdarwin; then
372
- PKG_CHECK_MODULES([ QTCLIPBOARD] , [ Qt5ClipboardSupport] , [ QT_LIBS="-lQt5ClipboardSupport $QT_LIBS"] )
373
- PKG_CHECK_MODULES([ QTGRAPHICS] , [ Qt5GraphicsSupport] , [ QT_LIBS="-lQt5GraphicsSupport $QT_LIBS"] )
374
- PKG_CHECK_MODULES([ QTCGL] , [ Qt5CglSupport] , [ QT_LIBS="-lQt5CglSupport $QT_LIBS"] )
375
- fi
376
- ] )
377
- else
378
- if test "x$TARGET_OS" = xwindows; then
379
- AC_CACHE_CHECK ( for Qt >= 5.6 , bitcoin_cv_need_platformsupport ,[
380
- AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
381
- #include <QtCore/qconfig.h>
382
- #ifndef QT_VERSION
383
- # include <QtCore/qglobal.h>
384
- #endif
385
- ] ] ,
386
- [ [
387
- #if QT_VERSION < 0x050600 || QT_VERSION_MINOR < 6
388
- choke
389
- #endif
390
- ] ] ) ] ,
391
- [ bitcoin_cv_need_platformsupport=yes] ,
392
- [ bitcoin_cv_need_platformsupport=no] )
393
- ] )
394
- if test "x$bitcoin_cv_need_platformsupport" = xyes; then
395
- if test x$bitcoin_cv_qt58 = xno; then
396
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}PlatformSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXPlatformSupport not found )) )
397
- else
398
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}FontDatabaseSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXFontDatabaseSupport not found )) )
399
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}EventDispatcherSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXEventDispatcherSupport not found )) )
400
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}ThemeSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXThemeSupport not found )) )
401
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}FbSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXFbSupport not found )) )
402
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}DeviceDiscoverySupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXDeviceDiscoverySupport not found )) )
403
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}AccessibilitySupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXAccessibilitySupport not found )) )
404
- QT_LIBS="$QT_LIBS -lversion -ldwmapi -luxtheme"
405
- fi
406
- fi
407
- fi
408
- fi
409
- fi
298
+ m4_ifdef ( [ PKG_CHECK_MODULES] ,[
299
+ if test x$bitcoin_cv_qt58 = xno; then
300
+ PKG_CHECK_MODULES([ QTPLATFORM] , [ Qt5PlatformSupport] , [ QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"] )
301
+ else
302
+ PKG_CHECK_MODULES([ QTFONTDATABASE] , [ Qt5FontDatabaseSupport] , [ QT_LIBS="-lQt5FontDatabaseSupport $QT_LIBS"] )
303
+ PKG_CHECK_MODULES([ QTEVENTDISPATCHER] , [ Qt5EventDispatcherSupport] , [ QT_LIBS="-lQt5EventDispatcherSupport $QT_LIBS"] )
304
+ PKG_CHECK_MODULES([ QTTHEME] , [ Qt5ThemeSupport] , [ QT_LIBS="-lQt5ThemeSupport $QT_LIBS"] )
305
+ PKG_CHECK_MODULES([ QTDEVICEDISCOVERY] , [ Qt5DeviceDiscoverySupport] , [ QT_LIBS="-lQt5DeviceDiscoverySupport $QT_LIBS"] )
306
+ PKG_CHECK_MODULES([ QTACCESSIBILITY] , [ Qt5AccessibilitySupport] , [ QT_LIBS="-lQt5AccessibilitySupport $QT_LIBS"] )
307
+ PKG_CHECK_MODULES([ QTFB] , [ Qt5FbSupport] , [ QT_LIBS="-lQt5FbSupport $QT_LIBS"] )
308
+ fi
309
+ if test "x$TARGET_OS" = xlinux; then
310
+ PKG_CHECK_MODULES([ QTXCBQPA] , [ Qt5XcbQpa] , [ QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"] )
311
+ elif test "x$TARGET_OS" = xdarwin; then
312
+ PKG_CHECK_MODULES([ QTCLIPBOARD] , [ Qt5ClipboardSupport] , [ QT_LIBS="-lQt5ClipboardSupport $QT_LIBS"] )
313
+ PKG_CHECK_MODULES([ QTGRAPHICS] , [ Qt5GraphicsSupport] , [ QT_LIBS="-lQt5GraphicsSupport $QT_LIBS"] )
314
+ PKG_CHECK_MODULES([ QTCGL] , [ Qt5CglSupport] , [ QT_LIBS="-lQt5CglSupport $QT_LIBS"] )
315
+ fi
316
+ ] )
317
+ fi
410
318
] )
411
319
412
320
dnl Internal. Find Qt libraries using pkg-config.
413
- dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check
414
- dnl first.
415
- dnl Inputs: $1 : If bitcoin_qt_want_version is "auto", check for this version
416
- dnl first.
417
321
dnl Outputs: All necessary QT_* variables are set.
418
322
dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
419
- AC_DEFUN ( [ _BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG ] ,[
323
+ AC_DEFUN ( [ _BITCOIN_QT_FIND_LIBS ] ,[
420
324
m4_ifdef ( [ PKG_CHECK_MODULES] ,[
421
325
QT_LIB_PREFIX=Qt5
422
326
qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets"
@@ -437,83 +341,3 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[
437
341
] )
438
342
true; dnl
439
343
] )
440
-
441
- dnl Internal. Find Qt libraries without using pkg-config. Version is deduced
442
- dnl from the discovered headers.
443
- dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to use.
444
- dnl If "auto", the version will be discovered by _BITCOIN_QT_CHECK_QT5.
445
- dnl Outputs: All necessary QT_* variables are set.
446
- dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
447
- AC_DEFUN ( [ _BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG] ,[
448
- TEMP_CPPFLAGS="$CPPFLAGS"
449
- TEMP_CXXFLAGS="$CXXFLAGS"
450
- CXXFLAGS="$PIC_FLAGS $CXXFLAGS"
451
- TEMP_LIBS="$LIBS"
452
- BITCOIN_QT_CHECK([
453
- if test "x$qt_include_path" != x; then
454
- 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"
455
- CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
456
- fi
457
- ] )
458
-
459
- BITCOIN_QT_CHECK([ AC_CHECK_HEADER ( [ QtPlugin] ,,BITCOIN_QT_FAIL ( QtCore headers missing )) ] )
460
- BITCOIN_QT_CHECK([ AC_CHECK_HEADER ( [ QApplication] ,, BITCOIN_QT_FAIL ( QtGui headers missing )) ] )
461
- BITCOIN_QT_CHECK([ AC_CHECK_HEADER ( [ QLocalSocket] ,, BITCOIN_QT_FAIL ( QtNetwork headers missing )) ] )
462
-
463
- BITCOIN_QT_CHECK([
464
- if test "x$bitcoin_qt_want_version" = xauto; then
465
- _BITCOIN_QT_CHECK_QT5
466
- _BITCOIN_QT_CHECK_QT58
467
- fi
468
- QT_LIB_PREFIX=Qt5
469
- ] )
470
-
471
- BITCOIN_QT_CHECK([
472
- LIBS=
473
- if test "x$qt_lib_path" != x; then
474
- LIBS="$LIBS -L$qt_lib_path"
475
- fi
476
-
477
- if test "x$TARGET_OS" = xwindows; then
478
- AC_CHECK_LIB ( [ imm32] , [ main] ,, BITCOIN_QT_FAIL ( libimm32 not found ))
479
- fi
480
- ] )
481
-
482
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ z] ,[ main] ,,AC_MSG_WARN ( [ zlib not found. Assuming qt has it built-in] ) ) )
483
- if test x$bitcoin_cv_qt58 = xno; then
484
- BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ png_error] ,[ qtpng png] ,,AC_MSG_WARN ( [ libpng not found. Assuming qt has it built-in] ) ) )
485
- BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ pcre16_exec] , [ qtpcre pcre16] ,,AC_MSG_WARN ( [ libpcre16 not found. Assuming qt has it built-in] ) ) )
486
- else
487
- BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ png_error] ,[ qtlibpng png] ,,AC_MSG_WARN ( [ libpng not found. Assuming qt has it built-in] ) ) )
488
- BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ pcre2_match_16] , [ qtpcre2 libqtpcre2] ,,AC_MSG_WARN ( [ libqtpcre2 not found. Assuming qt has it built-in] ) ) )
489
- fi
490
- BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ hb_ot_tags_from_script] ,[ qtharfbuzzng qtharfbuzz harfbuzz] ,,AC_MSG_WARN ( [ libharfbuzz not found. Assuming qt has it built-in or support is disabled] ) ) )
491
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Core] ,[ main] ,,BITCOIN_QT_FAIL ( lib${QT_LIB_PREFIX}Core not found )) )
492
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Gui] ,[ main] ,,BITCOIN_QT_FAIL ( lib${QT_LIB_PREFIX}Gui not found )) )
493
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Network] ,[ main] ,,BITCOIN_QT_FAIL ( lib${QT_LIB_PREFIX}Network not found )) )
494
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Widgets] ,[ main] ,,BITCOIN_QT_FAIL ( lib${QT_LIB_PREFIX}Widgets not found )) )
495
- QT_LIBS="$LIBS"
496
- LIBS="$TEMP_LIBS"
497
-
498
- BITCOIN_QT_CHECK([
499
- LIBS=
500
- if test "x$qt_lib_path" != x; then
501
- LIBS="-L$qt_lib_path"
502
- fi
503
- AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Test] , [ main] ,, have_qt_test=no )
504
- AC_CHECK_HEADER ( [ QTest] ,, have_qt_test=no )
505
- QT_TEST_LIBS="$LIBS"
506
- if test "x$use_dbus" != xno; then
507
- LIBS=
508
- if test "x$qt_lib_path" != x; then
509
- LIBS="-L$qt_lib_path"
510
- fi
511
- AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}DBus] , [ main] ,, have_qt_dbus=no )
512
- AC_CHECK_HEADER ( [ QtDBus] ,, have_qt_dbus=no )
513
- QT_DBUS_LIBS="$LIBS"
514
- fi
515
- ] )
516
- CPPFLAGS="$TEMP_CPPFLAGS"
517
- CXXFLAGS="$TEMP_CXXFLAGS"
518
- LIBS="$TEMP_LIBS"
519
- ] )
0 commit comments