From e06740b9481b135c4d7608e2cfeb520935a6710c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Mon, 9 Jul 2018 15:55:31 +0200 Subject: [PATCH] fix qt plugin path detection --- ax_check_qt.m4 | 21 ++++++++++++++++++--- scripts/ax_check_qt.m4 | 21 ++++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index e0eecf2..dfd8ac2 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -119,10 +119,25 @@ AC_DEFUN([AX_CHECK_QT], [ AC_DEFINE([HAVE_$1]) QTDIR=$(${PKG_CONFIG} --variable=prefix Qt5Core) qt_host_bins=$(${PKG_CONFIG} --variable=host_bins Qt5Core) - if test -d "${qt_host_bins}"; then - QT_PLUGIN_PATH=${qt_host_bins}/../plugins + qt_libdir=$(${PKG_CONFIG} --variable=libdir Qt5Core) + if test -d "${qt_libdir}" -a -d "${qt_libdir}/plugins"; then + QT_PLUGIN_PATH="${qt_libdir}/plugins" + elif test -d "${qt_libdir}/qt5" -a -d "${qt_libdir}/qt5/plugins"; then + QT_PLUGIN_PATH="${qt_libdir}/qt5/plugins" + elif test -d "${qt_host_bins}" -a -d "${qt_host_bins}/../plugins"; then + QT_PLUGIN_PATH="${qt_host_bins}/../plugins" + elif test -d "${QTDIR}/plugins; then + QT_PLUGIN_PATH="${QTDIR}/plugins" + elif test -d "${QTDIR}/share/qt5/plugins; then + QT_PLUGIN_PATH="${QTDIR}/share/qt5/plugins" else - QT_PLUGIN_PATH=${QTDIR}/share/qt5/plugins + AC_MSG_ERROR([QT_PLUGIN_PATH not found + - not in: ${qt_libdir}/plugins + - not in: ${qt_libdir}/qt5/plugins + - not in: ${qt_host_bins}/../plugins + - not in: ${QTDIR}/plugins + - not in: ${QTDIR}/share/qt5/plugins +]) fi MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}" [$1]_CPPFLAGS="${[$1]5_CFLAGS}" diff --git a/scripts/ax_check_qt.m4 b/scripts/ax_check_qt.m4 index e0eecf2..dfd8ac2 100644 --- a/scripts/ax_check_qt.m4 +++ b/scripts/ax_check_qt.m4 @@ -119,10 +119,25 @@ AC_DEFUN([AX_CHECK_QT], [ AC_DEFINE([HAVE_$1]) QTDIR=$(${PKG_CONFIG} --variable=prefix Qt5Core) qt_host_bins=$(${PKG_CONFIG} --variable=host_bins Qt5Core) - if test -d "${qt_host_bins}"; then - QT_PLUGIN_PATH=${qt_host_bins}/../plugins + qt_libdir=$(${PKG_CONFIG} --variable=libdir Qt5Core) + if test -d "${qt_libdir}" -a -d "${qt_libdir}/plugins"; then + QT_PLUGIN_PATH="${qt_libdir}/plugins" + elif test -d "${qt_libdir}/qt5" -a -d "${qt_libdir}/qt5/plugins"; then + QT_PLUGIN_PATH="${qt_libdir}/qt5/plugins" + elif test -d "${qt_host_bins}" -a -d "${qt_host_bins}/../plugins"; then + QT_PLUGIN_PATH="${qt_host_bins}/../plugins" + elif test -d "${QTDIR}/plugins; then + QT_PLUGIN_PATH="${QTDIR}/plugins" + elif test -d "${QTDIR}/share/qt5/plugins; then + QT_PLUGIN_PATH="${QTDIR}/share/qt5/plugins" else - QT_PLUGIN_PATH=${QTDIR}/share/qt5/plugins + AC_MSG_ERROR([QT_PLUGIN_PATH not found + - not in: ${qt_libdir}/plugins + - not in: ${qt_libdir}/qt5/plugins + - not in: ${qt_host_bins}/../plugins + - not in: ${QTDIR}/plugins + - not in: ${QTDIR}/share/qt5/plugins +]) fi MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}" [$1]_CPPFLAGS="${[$1]5_CFLAGS}"