@@ -86,14 +86,68 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
86
86
fi
87
87
88
88
if test x$use_pkgconfig = xyes; then
89
- if test x$PKG_CONFIG == x; then
90
- AC_MSG_ERROR ( pkg-config not found. )
91
- fi
92
89
BITCOIN_QT_CHECK([ _BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG([ $2 ] )] )
93
90
else
94
91
BITCOIN_QT_CHECK([ _BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG] )
95
92
fi
96
93
94
+ dnl This is ugly and complicated. Yuck. Works as follows:
95
+ dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can
96
+ dnl check a header to find out. When Qt is built statically, some plugins must
97
+ dnl be linked into the final binary as well. These plugins have changed between
98
+ dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration
99
+ dnl plugin was added. Since we can't tell if Qt4 is static or not, it is
100
+ dnl assumed for windows builds.
101
+ dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the
102
+ dnl results to QT_LIBS.
103
+ BITCOIN_QT_CHECK([
104
+ TEMP_CPPFLAGS=$CPPFLAGS
105
+ CPPFLAGS=$QT_INCLUDES
106
+ if test x$bitcoin_qt_got_major_vers == x5; then
107
+ _BITCOIN_QT_IS_STATIC
108
+ if test x$bitcoin_cv_static_qt == xyes; then
109
+ AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol if qt plugins are static] )
110
+ if test x$qt_plugin_path != x; then
111
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
112
+ if test x$bitcoin_qt_got_major_vers == x5; then
113
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
114
+ else
115
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
116
+ fi
117
+ fi
118
+ if test x$use_pkgconfig = xyes; then
119
+ PKG_CHECK_MODULES([ QTPLATFORM] , [ Qt5PlatformSupport] , [ QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"] )
120
+ fi
121
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(AccessibleFactory)] , [ -lqtaccessiblewidgets] )
122
+ if test x$TARGET_OS == xwindows; then
123
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)] ,[ -lqwindows] )
124
+ AC_DEFINE ( QT_QPA_PLATFORM_WINDOWS , 1 , [ Define this symbol if the qt platform is windows] )
125
+ elif test x$TARGET_OS == xlinux; then
126
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)] ,[ -lqxcb -lxcb-static -lxcb] )
127
+ AC_DEFINE ( QT_QPA_PLATFORM_XCB , 1 , [ Define this symbol if the qt platform is xcb] )
128
+ elif test x$TARGET_OS == xdarwin; then
129
+ if test x$use_pkgconfig = xyes; then
130
+ PKG_CHECK_MODULES([ QTPRINT] , [ Qt5PrintSupport] , [ QT_LIBS="$QTPRINT_LIBS $QT_LIBS"] )
131
+ fi
132
+ AX_CHECK_LINK_FLAG ( [ [ -framework IOKit] ] ,[ QT_LIBS="$QT_LIBS -framework IOKit"] ,[ AC_MSG_ERROR ( could not iokit framework ) ] )
133
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)] ,[ -lqcocoa] )
134
+ AC_DEFINE ( QT_QPA_PLATFORM_COCOA , 1 , [ Define this symbol if the qt platform is cocoa] )
135
+ fi
136
+ fi
137
+ else
138
+ if test x$TARGET_OS == xwindows; then
139
+ AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol if qt plugins are static] )
140
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([
141
+ Q_IMPORT_PLUGIN(qcncodecs)
142
+ Q_IMPORT_PLUGIN(qjpcodecs)
143
+ Q_IMPORT_PLUGIN(qtwcodecs)
144
+ Q_IMPORT_PLUGIN(qkrcodecs)
145
+ Q_IMPORT_PLUGIN(AccessibleFactory)] ,
146
+ [ -lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets] )
147
+ fi
148
+ fi
149
+ CPPFLAGS=$TEMP_CPPFLAGS
150
+ ] )
97
151
BITCOIN_QT_PATH_PROGS([ MOC] , [ moc-qt${bitcoin_qt_got_major_vers} moc${bitcoin_qt_got_major_vers} moc] , $qt_bin_path)
98
152
BITCOIN_QT_PATH_PROGS([ UIC] , [ uic-qt${bitcoin_qt_got_major_vers} uic${bitcoin_qt_got_major_vers} uic] , $qt_bin_path)
99
153
BITCOIN_QT_PATH_PROGS([ RCC] , [ rcc-qt${bitcoin_qt_got_major_vers} rcc${bitcoin_qt_got_major_vers} rcc] , $qt_bin_path)
@@ -303,26 +357,15 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
303
357
] )
304
358
305
359
BITCOIN_QT_CHECK([
306
- LIBS=
307
- if test x$qt_lib_path != x; then
308
- LIBS="$LIBS -L$qt_lib_path"
309
- fi
310
- if test x$qt_plugin_path != x; then
311
- LIBS="$LIBS -L$qt_plugin_path/accessible"
312
- if test x$bitcoin_qt_got_major_vers == x5; then
313
- LIBS="$LIBS -L$qt_plugin_path/platforms"
314
- else
315
- LIBS="$LIBS -L$qt_plugin_path/codecs"
316
- fi
317
- fi
318
-
319
360
if test x$TARGET_OS == xwindows; then
320
361
AC_CHECK_LIB ( [ imm32] , [ main] ,, BITCOIN_QT_FAIL ( libimm32 not found ))
321
362
fi
322
363
] )
323
364
324
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ z] ,[ main] ,,BITCOIN_QT_FAIL ( zlib not found )) )
325
- BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ png] ,[ main] ,,BITCOIN_QT_FAIL ( png not found )) )
365
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ z] ,[ main] ,,AC_MSG_WARN ( [ zlib not found. Assuming qt has it built-in] ) ) )
366
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ png] ,[ main] ,,AC_MSG_WARN ( [ libpng not found. Assuming qt has it built-in] ) ) )
367
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ jpeg] ,[ main] ,,AC_MSG_WARN ( [ libjpeg not found. Assuming qt has it built-in] ) ) )
368
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ pcre] ,[ main] ,,AC_MSG_WARN ( [ libpcre not found. Assuming qt has it built-in] ) ) )
326
369
BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Core] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXCore not found )) )
327
370
BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Gui] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXGui not found )) )
328
371
BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Network] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXNetwork not found )) )
@@ -332,37 +375,6 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
332
375
QT_LIBS="$LIBS"
333
376
LIBS="$TEMP_LIBS"
334
377
335
- dnl This is ugly and complicated. Yuck. Works as follows:
336
- dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can
337
- dnl check a header to find out. When Qt is built statically, some plugins must
338
- dnl be linked into the final binary as well. These plugins have changed between
339
- dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration
340
- dnl plugin was added. Since we can't tell if Qt4 is static or not, it is
341
- dnl assumed for all non-pkg-config builds.
342
- dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the
343
- dnl results to QT_LIBS.
344
- BITCOIN_QT_CHECK([
345
- if test x$bitcoin_qt_got_major_vers == x5; then
346
- _BITCOIN_QT_IS_STATIC
347
- if test x$bitcoin_cv_static_qt == xyes; then
348
- AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol if qt plugins are static] )
349
- _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(AccessibleFactory)] , [ -lqtaccessiblewidgets] )
350
- if test x$TARGET_OS == xwindows; then
351
- _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)] ,[ -lqwindows] )
352
- fi
353
- fi
354
- else
355
- AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol if qt plugins are static] )
356
- _BITCOIN_QT_CHECK_STATIC_PLUGINS([
357
- Q_IMPORT_PLUGIN(qcncodecs)
358
- Q_IMPORT_PLUGIN(qjpcodecs)
359
- Q_IMPORT_PLUGIN(qtwcodecs)
360
- Q_IMPORT_PLUGIN(qkrcodecs)
361
- Q_IMPORT_PLUGIN(AccessibleFactory)] ,
362
- [ -lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets] )
363
- fi
364
- ] )
365
-
366
378
BITCOIN_QT_CHECK([
367
379
LIBS=
368
380
if test x$qt_lib_path != x; then
0 commit comments