@@ -94,6 +94,63 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
94
94
BITCOIN_QT_CHECK([ _BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG] )
95
95
fi
96
96
97
+ dnl This is ugly and complicated. Yuck. Works as follows:
98
+ dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can
99
+ dnl check a header to find out. When Qt is built statically, some plugins must
100
+ dnl be linked into the final binary as well. These plugins have changed between
101
+ dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration
102
+ dnl plugin was added. Since we can't tell if Qt4 is static or not, it is
103
+ dnl assumed for windows builds.
104
+ dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the
105
+ dnl results to QT_LIBS.
106
+ BITCOIN_QT_CHECK([
107
+ TEMP_CPPFLAGS=$CPPFLAGS
108
+ CPPFLAGS=$QT_INCLUDES
109
+ if test x$bitcoin_qt_got_major_vers == x5; then
110
+ _BITCOIN_QT_IS_STATIC
111
+ if test x$bitcoin_cv_static_qt == xyes; then
112
+ AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol if qt plugins are static] )
113
+ if test x$qt_plugin_path != x; then
114
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
115
+ if test x$bitcoin_qt_got_major_vers == x5; then
116
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
117
+ else
118
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
119
+ fi
120
+ fi
121
+ if test x$use_pkgconfig = xyes; then
122
+ PKG_CHECK_MODULES([ QTPLATFORM] , [ Qt5PlatformSupport] , [ QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"] )
123
+ fi
124
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(AccessibleFactory)] , [ -lqtaccessiblewidgets] )
125
+ if test x$TARGET_OS == xwindows; then
126
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)] ,[ -lqwindows] )
127
+ AC_DEFINE ( QT_QPA_PLATFORM_WINDOWS , 1 , [ Define this symbol if the qt platform is windows] )
128
+ elif test x$TARGET_OS == xlinux; then
129
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)] ,[ -lqxcb -lxcb-static -lxcb] )
130
+ AC_DEFINE ( QT_QPA_PLATFORM_XCB , 1 , [ Define this symbol if the qt platform is xcb] )
131
+ elif test x$TARGET_OS == xdarwin; then
132
+ if test x$use_pkgconfig = xyes; then
133
+ PKG_CHECK_MODULES([ QTPRINT] , [ Qt5PrintSupport] , [ QT_LIBS="$QTPRINT_LIBS $QT_LIBS"] )
134
+ fi
135
+ AX_CHECK_LINK_FLAG ( [ [ -framework IOKit] ] ,[ QT_LIBS="$QT_LIBS -framework IOKit"] ,[ AC_MSG_ERROR ( could not iokit framework ) ] )
136
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([ Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)] ,[ -lqcocoa] )
137
+ AC_DEFINE ( QT_QPA_PLATFORM_COCOA , 1 , [ Define this symbol if the qt platform is cocoa] )
138
+ fi
139
+ fi
140
+ else
141
+ if test x$TARGET_OS == xwindows; then
142
+ AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol if qt plugins are static] )
143
+ _BITCOIN_QT_CHECK_STATIC_PLUGINS([
144
+ Q_IMPORT_PLUGIN(qcncodecs)
145
+ Q_IMPORT_PLUGIN(qjpcodecs)
146
+ Q_IMPORT_PLUGIN(qtwcodecs)
147
+ Q_IMPORT_PLUGIN(qkrcodecs)
148
+ Q_IMPORT_PLUGIN(AccessibleFactory)] ,
149
+ [ -lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets] )
150
+ fi
151
+ fi
152
+ CPPFLAGS=$TEMP_CPPFLAGS
153
+ ] )
97
154
BITCOIN_QT_PATH_PROGS([ MOC] , [ moc-qt${bitcoin_qt_got_major_vers} moc${bitcoin_qt_got_major_vers} moc] , $qt_bin_path)
98
155
BITCOIN_QT_PATH_PROGS([ UIC] , [ uic-qt${bitcoin_qt_got_major_vers} uic${bitcoin_qt_got_major_vers} uic] , $qt_bin_path)
99
156
BITCOIN_QT_PATH_PROGS([ RCC] , [ rcc-qt${bitcoin_qt_got_major_vers} rcc${bitcoin_qt_got_major_vers} rcc] , $qt_bin_path)
@@ -303,26 +360,15 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
303
360
] )
304
361
305
362
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
363
if test x$TARGET_OS == xwindows; then
320
364
AC_CHECK_LIB ( [ imm32] , [ main] ,, BITCOIN_QT_FAIL ( libimm32 not found ))
321
365
fi
322
366
] )
323
367
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 )) )
368
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ z] ,[ main] ,,AC_MSG_WARN ( [ zlib not found. Assuming qt has it built-in] ) ) )
369
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ png] ,[ main] ,,AC_MSG_WARN ( [ libpng not found. Assuming qt has it built-in] ) ) )
370
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ jpeg] ,[ main] ,,AC_MSG_WARN ( [ libjpeg not found. Assuming qt has it built-in] ) ) )
371
+ BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ pcre] ,[ main] ,,AC_MSG_WARN ( [ libpcre not found. Assuming qt has it built-in] ) ) )
326
372
BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Core] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXCore not found )) )
327
373
BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Gui] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXGui not found )) )
328
374
BITCOIN_QT_CHECK(AC_CHECK_LIB ( [ ${QT_LIB_PREFIX}Network] ,[ main] ,,BITCOIN_QT_FAIL ( lib$QT_LIB_PREFIXNetwork not found )) )
@@ -332,37 +378,6 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
332
378
QT_LIBS="$LIBS"
333
379
LIBS="$TEMP_LIBS"
334
380
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
381
BITCOIN_QT_CHECK([
367
382
LIBS=
368
383
if test x$qt_lib_path != x; then
0 commit comments