build: Fix Qt5PlatformSupport check without pkg-config

The non-pkg-config case can't use pkg-config to check the version.

Also, make sure that the check is properly guarded in the case of missing
pkg-config macros.
This commit is contained in:
Cory Fields 2016-07-07 13:46:59 -04:00
parent 91abb77970
commit 0c928cb13c

View file

@ -331,8 +331,9 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
fi fi
fi fi
m4_ifdef([PKG_CHECK_MODULES],[
if test x$use_pkgconfig = xyes; then if test x$use_pkgconfig = xyes; then
: dnl
m4_ifdef([PKG_CHECK_MODULES],[
PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
if test x$TARGET_OS = xlinux; then if test x$TARGET_OS = xlinux; then
PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"]) PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
@ -342,12 +343,23 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
elif test x$TARGET_OS = xdarwin; then elif test x$TARGET_OS = xdarwin; then
PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"]) PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
fi fi
])
else else
if ${PKG_CONFIG} --exists "Qt5Core >= 5.6" 2>/dev/null; then if test x$TARGET_OS = xwindows; then
QT_LIBS="-lQt5PlatformSupport $QT_LIBS" AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <QtCore>]],[[
#if QT_VERSION < 0x050600
choke;
#endif
]])],
[bitcoin_cv_need_platformsupport=yes],
[bitcoin_cv_need_platformsupport=no])
])
if test x$bitcoin_cv_need_platformsupport = xyes; then
BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXPlatformSupport not found)))
fi
fi fi
fi fi
])
else else
if test x$qt_plugin_path != x; then if test x$qt_plugin_path != x; then
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"