commit f0aa129938d0d874c6197f2886e9fc840ef23a2e
Author: Enrico Forestieri <[email protected]>
Date:   Thu Jul 7 23:12:07 2016 +0200

    Account for the case in which Qt tools are not in PATH
    
    If the Qt directory is specified by --with-qt-dir, the full path
    of the tools is retained. Otherwise, if qtchooser is detected,
    the generic names are attempted with proper arguments to select
    the desired Qt version. Otherwise, the generic names with and without
    proper suffixes (either -qt5 or -qt4) are checked in the PATH.
    
    This means that --with-qt-dir=qtdir should be used only if the tools
    are not in the PATH, or qtdir/bin/{moc,rcc,uic} are the right versions
    for the desired Qt. In any case, it is later checked that the selected
    tools are the right ones and a warning is issued if there is a mismatch.
---
 config/qt4.m4 |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/config/qt4.m4 b/config/qt4.m4
index 14390f8..0e357a4 100644
--- a/config/qt4.m4
+++ b/config/qt4.m4
@@ -72,16 +72,13 @@ AC_DEFUN([QT_FIND_TOOL],
                qt_ext=qt5
        fi
 
-       lyx_qt_path=$PATH
        if test -n "$qt_cv_bin" ; then
-               lyx_qt_path=$qt_cv_bin:$PATH
-       fi
-
-       if qtchooser -l 2>/dev/null | grep -q ^$qt_ext\$ >/dev/null ; then
-               AC_CHECK_PROG($1, $2, [$2 -qt=$qt_ext],, [$lyx_qt_path])
+               AC_PATH_PROGS($1, [$2], [], $qt_cv_bin)
+       elif qtchooser -l 2>/dev/null | grep -q ^$qt_ext\$ >/dev/null ; then
+               AC_CHECK_PROG($1, $2, [$2 -qt=$qt_ext],, [$PATH])
        fi
        if test -z "$$1"; then
-               AC_CHECK_PROGS($1, [$2-$qt_ext $2],[],$lyx_qt_path)
+               AC_CHECK_PROGS($1, [$2-$qt_ext $2],[],$PATH)
        fi
        if test -z "$$1"; then
                AC_MSG_ERROR([cannot find $2 binary.])

Reply via email to