@@ -226,7 +226,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
226
226
227
227
228
228
dnl enable qt support
229
- AC_MSG_CHECKING ( whether to build ] AC_PACKAGE_NAME [ GUI)
229
+ AC_MSG_CHECKING ( whether to build [ AC_PACKAGE_NAME ] GUI )
230
230
BITCOIN_QT_CHECK([
231
231
bitcoin_enable_qt=yes
232
232
bitcoin_enable_qt_test=yes
@@ -272,36 +272,57 @@ AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[
272
272
AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM (
273
273
[ [ #include <QtCore>] ] ,
274
274
[ [
275
- #if QT_VERSION < 0x050000
276
- choke me
277
- #else
278
- return 0;
275
+ #if QT_VERSION < 0x050000 || QT_VERSION_MAJOR < 5
276
+ choke
279
277
#endif
280
278
] ] ) ] ,
281
279
[ bitcoin_cv_qt5=yes] ,
282
280
[ bitcoin_cv_qt5=no] )
283
281
] ) ] )
284
282
283
+ dnl Internal. Check if the included version of Qt is greater than Qt58.
284
+ dnl Requires: INCLUDES must be populated as necessary.
285
+ dnl Output: bitcoin_cv_qt5=yes|no
286
+ AC_DEFUN ( [ _BITCOIN_QT_CHECK_QT58] ,[
287
+ AC_CACHE_CHECK ( for > Qt 5.7 , bitcoin_cv_qt58 ,[
288
+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
289
+ #include <QtCore/qconfig.h>
290
+ #ifndef QT_VERSION
291
+ # include <QtCore/qglobal.h>
292
+ #endif
293
+ ] ] ,
294
+ [ [
295
+ #if QT_VERSION_MINOR < 8
296
+ choke
297
+ #endif
298
+ ] ] ) ] ,
299
+ [ bitcoin_cv_qt58=yes] ,
300
+ [ bitcoin_cv_qt58=no] )
301
+ ] ) ] )
302
+
303
+
285
304
dnl Internal. Check if the linked version of Qt was built as static libs.
286
- dnl Requires: Qt5. This check cannot determine if Qt4 is static.
305
+ dnl Requires: Qt5.
287
306
dnl Requires: INCLUDES and LIBS must be populated as necessary.
288
307
dnl Output: bitcoin_cv_static_qt=yes|no
289
308
dnl Output: Defines QT_STATICPLUGIN if plugins are static.
290
309
AC_DEFUN ( [ _BITCOIN_QT_IS_STATIC] ,[
291
310
AC_CACHE_CHECK ( for static Qt , bitcoin_cv_static_qt ,[
292
- AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM (
293
- [ [ #include <QtCore>] ] ,
294
- [ [
295
- #if defined(QT_STATIC)
296
- return 0;
297
- #else
298
- choke me
299
- #endif
300
- ] ] ) ] ,
301
- [ bitcoin_cv_static_qt=yes] ,
302
- [ bitcoin_cv_static_qt=no] )
303
- ] )
304
- if test xbitcoin_cv_static_qt = xyes; then
311
+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
312
+ #include <QtCore/qconfig.h>
313
+ #ifndef QT_VERSION OR QT_VERSION_STR
314
+ # include <QtCore/qglobal.h>
315
+ #endif
316
+ ] ] ,
317
+ [ [
318
+ #if !defined(QT_STATIC)
319
+ choke
320
+ #endif
321
+ ] ] ) ] ,
322
+ [ bitcoin_cv_static_qt=yes] ,
323
+ [ bitcoin_cv_static_qt=no] )
324
+ ] )
325
+ if test "x$bitcoin_cv_static_qt" = xyes; then
305
326
AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol for static Qt plugins] )
306
327
fi
307
328
] )
@@ -337,32 +358,59 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
337
358
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
338
359
fi
339
360
fi
340
- if test x$use_pkgconfig = xyes; then
361
+ if test " x$use_pkgconfig" = xyes; then
341
362
: dnl
342
363
m4_ifdef ( [ PKG_CHECK_MODULES] ,[
343
- PKG_CHECK_MODULES([ QTPLATFORM] , [ Qt5PlatformSupport] , [ QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"] )
344
- if test x$TARGET_OS = xlinux; then
364
+ if test x$bitcoin_cv_qt58 = xno; then
365
+ PKG_CHECK_MODULES([ QTPLATFORM] , [ Qt5PlatformSupport] , [ QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"] )
366
+ else
367
+ PKG_CHECK_MODULES([ QTEVENTDISPATCHER] , [ Qt5EventDispatcherSupport] , [ QT_LIBS="-lQt5EventDispatcherSupport $QT_LIBS"] )
368
+ PKG_CHECK_MODULES([ QTTHEME] , [ Qt5ThemeSupport] , [ QT_LIBS="-lQt5ThemeSupport $QT_LIBS"] )
369
+ PKG_CHECK_MODULES([ QTDEVICEDISCOVERY] , [ Qt5DeviceDiscoverySupport] , [ QT_LIBS="-lQt5DeviceDiscoverySupport $QT_LIBS"] )
370
+ PKG_CHECK_MODULES([ QTACCESSIBILITY] , [ Qt5AccessibilitySupport] , [ QT_LIBS="-lQt5AccessibilitySupport $QT_LIBS"] )
371
+ PKG_CHECK_MODULES([ QTFB] , [ Qt5FbSupport] , [ QT_LIBS="-lQt5FbSupport $QT_LIBS"] )
372
+ fi
373
+ if test "x$TARGET_OS" = xlinux; then
345
374
PKG_CHECK_MODULES([ X11XCB] , [ x11-xcb] , [ QT_LIBS="$X11XCB_LIBS $QT_LIBS"] )
346
375
if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then
347
376
PKG_CHECK_MODULES([ QTXCBQPA] , [ Qt5XcbQpa] , [ QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"] )
348
377
fi
349
- elif test x$TARGET_OS = xdarwin; then
350
- PKG_CHECK_MODULES([ QTPRINT] , [ Qt5PrintSupport] , [ QT_LIBS="$QTPRINT_LIBS $QT_LIBS"] )
378
+ elif test "x$TARGET_OS" = xdarwin; then
379
+ PKG_CHECK_MODULES([ QTFONTDATABASE] , [ Qt5FontDatabaseSupport] , [ QT_LIBS="-lQt5FontDatabaseSupport $QT_LIBS"] )
380
+ PKG_CHECK_MODULES([ QTCLIPBOARD] , [ Qt5ClipboardSupport] , [ QT_LIBS="-lQt5ClipboardSupport $QT_LIBS"] )
381
+ PKG_CHECK_MODULES([ QTGRAPHICS] , [ Qt5GraphicsSupport] , [ QT_LIBS="-lQt5GraphicsSupport $QT_LIBS"] )
382
+ PKG_CHECK_MODULES([ QTCGL] , [ Qt5CglSupport] , [ QT_LIBS="-lQt5CglSupport $QT_LIBS"] )
351
383
fi
352
384
] )
353
385
else
354
- if test x$TARGET_OS = xwindows; then
355
- AC_CACHE_CHECK ( for Qt >= 5.6 , bitcoin_cv_need_platformsupport ,[ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM (
356
- [ [ #include <QtCore>] ] ,[ [
357
- #if QT_VERSION < 0x050600
358
- choke;
359
- #endif
386
+ if test "x$TARGET_OS" = xwindows; then
387
+ AC_CACHE_CHECK ( for Qt >= 5.6 , bitcoin_cv_need_platformsupport ,[
388
+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [
389
+ #include <QtCore/qconfig.h>
390
+ #ifndef QT_VERSION
391
+ # include <QtCore/qglobal.h>
392
+ #endif
393
+ ] ] ,
394
+ [ [
395
+ #if QT_VERSION < 0x050600 || QT_VERSION_MINOR < 6
396
+ choke
397
+ #endif
360
398
] ] ) ] ,
361
399
[ bitcoin_cv_need_platformsupport=yes] ,
362
400
[ bitcoin_cv_need_platformsupport=no] )
363
401
] )
364
- if test x$bitcoin_cv_need_platformsupport = xyes; then
365
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}PlatformSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXPlatformSupport not found )) )
402
+ if test "x$bitcoin_cv_need_platformsupport" = xyes; then
403
+ if test x$bitcoin_cv_qt58 = xno; then
404
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}PlatformSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXPlatformSupport not found )) )
405
+ else
406
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}FontDatabaseSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXFontDatabaseSupport not found )) )
407
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}EventDispatcherSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXEventDispatcherSupport not found )) )
408
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}ThemeSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXThemeSupport not found )) )
409
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}FbSupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXFbSupport not found )) )
410
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}DeviceDiscoverySupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXDeviceDiscoverySupport not found )) )
411
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}AccessibilitySupport] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXAccessibilitySupport not found )) )
412
+ QT_LIBS="$QT_LIBS -lversion -ldwmapi -luxtheme"
413
+ fi
366
414
fi
367
415
fi
368
416
fi
@@ -453,6 +501,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
453
501
BITCOIN_QT_CHECK([
454
502
if test x$bitcoin_qt_want_version = xauto; then
455
503
_BITCOIN_QT_CHECK_QT5
504
+ _BITCOIN_QT_CHECK_QT58
456
505
fi
457
506
if test x$bitcoin_cv_qt5 = xyes || test x$bitcoin_qt_want_version = xqt5; then
458
507
QT_LIB_PREFIX=Qt5
@@ -475,16 +524,19 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
475
524
] )
476
525
477
526
BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ z] ,[ main] ,,AC_MSG_WARN ( [ zlib not found. Assuming qt has it built-in] ) ) )
478
- BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ png_error] ,[ qtpng png] ,,AC_MSG_WARN ( [ libpng not found. Assuming qt has it built-in] ) ) )
479
527
BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ jpeg_create_decompress] ,[ qtjpeg jpeg] ,,AC_MSG_WARN ( [ libjpeg not found. Assuming qt has it built-in] ) ) )
480
- BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ pcre16_exec] , [ qtpcre pcre16] ,,AC_MSG_WARN ( [ libpcre16 not found. Assuming qt has it built-in] ) ) )
481
- BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ hb_ot_tags_from_script] ,[ qtharfbuzzng harfbuzz] ,,AC_MSG_WARN ( [ libharfbuzz not found. Assuming qt has it built-in or support is disabled] ) ) )
482
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Core] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXCore not found )) )
483
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Gui] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXGui not found )) )
484
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Network] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXNetwork not found )) )
485
- if test x$bitcoin_qt_got_major_vers = x5; then
486
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Widgets] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXWidgets not found )) )
528
+ if test x$bitcoin_cv_qt58 = xno; then
529
+ BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ png_error] ,[ qtpng png] ,,AC_MSG_WARN ( [ libpng not found. Assuming qt has it built-in] ) ) )
530
+ BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ pcre16_exec] , [ qtpcre pcre16] ,,AC_MSG_WARN ( [ libpcre16 not found. Assuming qt has it built-in] ) ) )
531
+ else
532
+ BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ png_error] ,[ qtlibpng png] ,,AC_MSG_WARN ( [ libpng not found. Assuming qt has it built-in] ) ) )
533
+ BITCOIN_QT_CHECK(AC_SEARCH_LIBS ( [ pcre2_match_16] , [ qtpcre2 libqtpcre2] ,,AC_MSG_WARN ( [ libqtpcre2 not found. Assuming qt has it built-in] ) ) )
487
534
fi
535
+ 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] ) ) )
536
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Core] ,[ main] ,,BITCOIN_QT_FAIL ( lib${QT_LIB_PREFIX}Core not found )) )
537
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Gui] ,[ main] ,,BITCOIN_QT_FAIL ( lib${QT_LIB_PREFIX}Gui not found )) )
538
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Network] ,[ main] ,,BITCOIN_QT_FAIL ( lib${QT_LIB_PREFIX}Network not found )) )
539
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Widgets] ,[ main] ,,BITCOIN_QT_FAIL ( lib${QT_LIB_PREFIX}Widgets not found )) )
488
540
QT_LIBS="$LIBS"
489
541
LIBS="$TEMP_LIBS"
490
542
0 commit comments