@@ -111,9 +111,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
111
111
dnl For Qt5, we can check a header to find out whether Qt is build
112
112
dnl statically. When Qt is built statically, some plugins must be linked into
113
113
dnl the final binary as well.
114
- dnl With Qt5, languages moved into core and the WindowsIntegration plugin was
115
- dnl added.
116
- dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the
114
+ dnl _BITCOIN_QT_CHECK_STATIC_PLUGIN does a quick link-check and appends the
117
115
dnl results to QT_LIBS.
118
116
BITCOIN_QT_CHECK([
119
117
TEMP_CPPFLAGS=$CPPFLAGS
@@ -122,20 +120,31 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
122
120
CXXFLAGS="$PIC_FLAGS $CXXFLAGS"
123
121
_BITCOIN_QT_IS_STATIC
124
122
if test "x$bitcoin_cv_static_qt" = xyes; then
125
- _BITCOIN_QT_FIND_STATIC_PLUGINS
123
+ _BITCOIN_QT_CHECK_STATIC_LIBS
124
+
125
+ if test "x$qt_plugin_path" != x; then
126
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
127
+ if test -d "$qt_plugin_path/accessible"; then
128
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
129
+ fi
130
+ if test -d "$qt_plugin_path/platforms/android"; then
131
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL"
132
+ fi
133
+ fi
134
+
126
135
AC_DEFINE ( QT_STATICPLUGIN , 1 , [ Define this symbol if qt plugins are static] )
127
136
if test "x$TARGET_OS" != xandroid; then
128
- _BITCOIN_QT_CHECK_STATIC_PLUGINS( [ Q_IMPORT_PLUGIN( QMinimalIntegrationPlugin) ] , [ -lqminimal] )
137
+ _BITCOIN_QT_CHECK_STATIC_PLUGIN( [ QMinimalIntegrationPlugin] , [ -lqminimal] )
129
138
AC_DEFINE ( QT_QPA_PLATFORM_MINIMAL , 1 , [ Define this symbol if the minimal qt platform exists] )
130
139
fi
131
140
if test "x$TARGET_OS" = xwindows; then
132
- _BITCOIN_QT_CHECK_STATIC_PLUGINS( [ Q_IMPORT_PLUGIN( QWindowsIntegrationPlugin) ] , [ -lqwindows] )
141
+ _BITCOIN_QT_CHECK_STATIC_PLUGIN( [ QWindowsIntegrationPlugin] , [ -lqwindows] )
133
142
AC_DEFINE ( QT_QPA_PLATFORM_WINDOWS , 1 , [ Define this symbol if the qt platform is windows] )
134
143
elif test "x$TARGET_OS" = xlinux; then
135
- _BITCOIN_QT_CHECK_STATIC_PLUGINS( [ Q_IMPORT_PLUGIN( QXcbIntegrationPlugin) ] , [ -lqxcb -lxcb-static] )
144
+ _BITCOIN_QT_CHECK_STATIC_PLUGIN( [ QXcbIntegrationPlugin] , [ -lqxcb -lxcb-static] )
136
145
AC_DEFINE ( QT_QPA_PLATFORM_XCB , 1 , [ Define this symbol if the qt platform is xcb] )
137
146
elif test "x$TARGET_OS" = xdarwin; then
138
- _BITCOIN_QT_CHECK_STATIC_PLUGINS( [ Q_IMPORT_PLUGIN( QCocoaIntegrationPlugin) ] , [ -lqcocoa] )
147
+ _BITCOIN_QT_CHECK_STATIC_PLUGIN( [ QCocoaIntegrationPlugin] , [ -lqcocoa] )
139
148
AC_DEFINE ( QT_QPA_PLATFORM_COCOA , 1 , [ Define this symbol if the qt platform is cocoa] )
140
149
elif test "x$TARGET_OS" = xandroid; then
141
150
QT_LIBS="-Wl,--export-dynamic,--undefined=JNI_OnLoad -lqtforandroid -ljnigraphics -landroid -lqtfreetype -lQt5EglSupport $QT_LIBS"
@@ -284,51 +293,46 @@ AC_DEFUN([_BITCOIN_QT_IS_STATIC],[
284
293
] )
285
294
] )
286
295
287
- dnl Internal. Check if the link-requirements for static plugins are met.
296
+ dnl Internal. Check if the link-requirements for a static plugin are met.
297
+ dnl
298
+ dnl _BITCOIN_QT_CHECK_STATIC_PLUGIN(PLUGIN, LIBRARIES)
299
+ dnl --------------------------------------------------
300
+ dnl
288
301
dnl Requires: INCLUDES and LIBS must be populated as necessary.
289
- dnl Inputs: $1: A series of Q_IMPORT_PLUGIN() .
302
+ dnl Inputs: $1: A static plugin name .
290
303
dnl Inputs: $2: The libraries that resolve $1.
291
304
dnl Output: QT_LIBS is prepended or configure exits.
292
- AC_DEFUN ( [ _BITCOIN_QT_CHECK_STATIC_PLUGINS ] , [
293
- AC_MSG_CHECKING ( for static Qt plugins: $2 )
305
+ AC_DEFUN ( [ _BITCOIN_QT_CHECK_STATIC_PLUGIN ] , [
306
+ AC_MSG_CHECKING ( [ for $1 ( $2 ) ] )
294
307
CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS"
295
308
LIBS="$2 ${qt_lib_suffix} $QT_LIBS $LIBS"
296
- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
297
- #define QT_STATICPLUGIN
298
- #include <QtPlugin>
299
- $1 ] ] ,
300
- [ [ return 0;] ] ) ] ,
301
- [ AC_MSG_RESULT ( yes ) ; QT_LIBS="$2 ${qt_lib_suffix} $QT_LIBS"] ,
302
- [ AC_MSG_RESULT ( no ) ; BITCOIN_QT_FAIL(Could not resolve: $2 )] )
309
+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [ #include <QtPlugin> Q_IMPORT_PLUGIN($1 )] ] ) ] ,
310
+ [ AC_MSG_RESULT ( [ yes] ) ; QT_LIBS="$2 ${qt_lib_suffix} $QT_LIBS"] ,
311
+ [ AC_MSG_RESULT ( [ no] ) ; BITCOIN_QT_FAIL([ $1 not found.] )] )
303
312
LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS"
304
313
] )
305
314
306
- dnl Internal. Find paths necessary for linking qt static plugins
307
- dnl Inputs: qt_plugin_path. optional.
308
- dnl Outputs: QT_LIBS is appended
309
- AC_DEFUN ( [ _BITCOIN_QT_FIND_STATIC_PLUGINS] ,[
310
- if test "x$qt_plugin_path" != x; then
311
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
312
- if test -d "$qt_plugin_path/accessible"; then
313
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
314
- fi
315
- if test -d "$qt_plugin_path/platforms/android"; then
316
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL"
317
- fi
318
- PKG_CHECK_MODULES([ QTFONTDATABASE] , [ Qt5FontDatabaseSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5FontDatabaseSupport${qt_lib_suffix} $QT_LIBS"] )
319
- PKG_CHECK_MODULES([ QTEVENTDISPATCHER] , [ Qt5EventDispatcherSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5EventDispatcherSupport${qt_lib_suffix} $QT_LIBS"] )
320
- PKG_CHECK_MODULES([ QTTHEME] , [ Qt5ThemeSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5ThemeSupport${qt_lib_suffix} $QT_LIBS"] )
321
- PKG_CHECK_MODULES([ QTDEVICEDISCOVERY] , [ Qt5DeviceDiscoverySupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5DeviceDiscoverySupport${qt_lib_suffix} $QT_LIBS"] )
322
- PKG_CHECK_MODULES([ QTACCESSIBILITY] , [ Qt5AccessibilitySupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5AccessibilitySupport${qt_lib_suffix} $QT_LIBS"] )
323
- PKG_CHECK_MODULES([ QTFB] , [ Qt5FbSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5FbSupport${qt_lib_suffix} $QT_LIBS"] )
324
- if test "x$TARGET_OS" = xlinux; then
325
- PKG_CHECK_MODULES([ QTXCBQPA] , [ Qt5XcbQpa] , [ QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"] )
326
- elif test "x$TARGET_OS" = xdarwin; then
327
- PKG_CHECK_MODULES([ QTCLIPBOARD] , [ Qt5ClipboardSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5ClipboardSupport${qt_lib_suffix} $QT_LIBS"] )
328
- PKG_CHECK_MODULES([ QTGRAPHICS] , [ Qt5GraphicsSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5GraphicsSupport${qt_lib_suffix} $QT_LIBS"] )
329
- PKG_CHECK_MODULES([ QTCGL] , [ Qt5CglSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5CglSupport${qt_lib_suffix} $QT_LIBS"] )
330
- fi
331
- fi
315
+ dnl Internal. Check Qt static libs with PKG_CHECK_MODULES.
316
+ dnl
317
+ dnl _BITCOIN_QT_CHECK_STATIC_LIBS
318
+ dnl -----------------------------
319
+ dnl
320
+ dnl Inputs: no inputs.
321
+ dnl Outputs: QT_LIBS is prepended.
322
+ AC_DEFUN ( [ _BITCOIN_QT_CHECK_STATIC_LIBS] , [
323
+ PKG_CHECK_MODULES([ QTFONTDATABASE] , [ Qt5FontDatabaseSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5FontDatabaseSupport${qt_lib_suffix} $QT_LIBS"] )
324
+ PKG_CHECK_MODULES([ QTEVENTDISPATCHER] , [ Qt5EventDispatcherSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5EventDispatcherSupport${qt_lib_suffix} $QT_LIBS"] )
325
+ PKG_CHECK_MODULES([ QTTHEME] , [ Qt5ThemeSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5ThemeSupport${qt_lib_suffix} $QT_LIBS"] )
326
+ PKG_CHECK_MODULES([ QTDEVICEDISCOVERY] , [ Qt5DeviceDiscoverySupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5DeviceDiscoverySupport${qt_lib_suffix} $QT_LIBS"] )
327
+ PKG_CHECK_MODULES([ QTACCESSIBILITY] , [ Qt5AccessibilitySupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5AccessibilitySupport${qt_lib_suffix} $QT_LIBS"] )
328
+ PKG_CHECK_MODULES([ QTFB] , [ Qt5FbSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5FbSupport${qt_lib_suffix} $QT_LIBS"] )
329
+ if test "x$TARGET_OS" = xlinux; then
330
+ PKG_CHECK_MODULES([ QTXCBQPA] , [ Qt5XcbQpa] , [ QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"] )
331
+ elif test "x$TARGET_OS" = xdarwin; then
332
+ PKG_CHECK_MODULES([ QTCLIPBOARD] , [ Qt5ClipboardSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5ClipboardSupport${qt_lib_suffix} $QT_LIBS"] )
333
+ PKG_CHECK_MODULES([ QTGRAPHICS] , [ Qt5GraphicsSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5GraphicsSupport${qt_lib_suffix} $QT_LIBS"] )
334
+ PKG_CHECK_MODULES([ QTCGL] , [ Qt5CglSupport${qt_lib_suffix}] , [ QT_LIBS="-lQt5CglSupport${qt_lib_suffix} $QT_LIBS"] )
335
+ fi
332
336
] )
333
337
334
338
dnl Internal. Find Qt libraries using pkg-config.
0 commit comments