From: Enrico Forestieri Date: Mon, 29 Aug 2016 20:35:09 +0000 (+0200) Subject: If available, use qtchooser to select correct Qt tools X-Git-Tag: 2.2.2~38 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=874bbe216608e3d4db4ae8692a82d1525d0f6951;p=features.git If available, use qtchooser to select correct Qt tools When the Qt directory is specified by --with-qt-dir, the tools are only searched for in the corresponding bin subdir and their full path is retained, so that it is not necessary modifying the PATH and PKG_CONFIG_PATH environment variables to select a custom Qt version. Otherwise, if qtchooser is detected early in the PATH, the generic names are attempted with proper arguments to select the desired Qt version (e.g., "moc -qt=qt5" if --enable-qt5 is specified). Failing all of the above, the generic names with and without proper suffixes (either -qt4 or -qt5) are checked in the PATH. Eventually, a check is performed and a warning is issued if the selected tools do not match the chosen Qt libraries. --- diff --git a/config/qt4.m4 b/config/qt4.m4 index 33029b933d..93663712fc 100644 --- a/config/qt4.m4 +++ b/config/qt4.m4 @@ -71,11 +71,20 @@ AC_DEFUN([QT_FIND_TOOL], if test "x$USE_QT5" != "xno" ; then qt_ext=qt5 fi + if test -n "$qt_cv_bin" ; then AC_PATH_PROGS($1, [$2], [], $qt_cv_bin) + elif qtchooser -l 2>/dev/null | grep -q ^$qt_ext\$ >/dev/null ; then + AC_PATH_PROG(qtc_path, qtchooser, [], [$PATH]) + AC_PATH_PROG($2_path, $2, [], [$PATH]) + qtc_path=`dirname "$qtc_path"` + $2_path=`dirname "$$2_path"` + if test "$qtc_path" = "$$2_path" ; then + AC_CHECK_PROG($1, $2, [$2 -qt=$qt_ext],, [$PATH]) + fi fi if test -z "$$1"; then - AC_PATH_PROGS($1, [$2-$qt_ext $2],[],$PATH) + AC_CHECK_PROGS($1, [$2-$qt_ext $2],[],$PATH) fi if test -z "$$1"; then AC_MSG_ERROR([cannot find $2 binary.]) diff --git a/status.22x b/status.22x index b27f6d7710..327f979cd4 100644 --- a/status.22x +++ b/status.22x @@ -40,6 +40,7 @@ What's new * BUILD/INSTALLATION +- If available, use qtchooser to select correct Qt tools when configuring.