07/07/2013 16:27, Stephan Witt:
Hmm… it looks like that:
1. /opt/qt-everywhere-opensource-src-4.8.2/bin has "moc" but not "moc-qt4"
2. LyX's configure checks for moc-qt4 first and is happy to find it in /usr/bin

Does the following patch make sense? It only searches for moc-qt4 when not looking in the specified Qt directory.

JMarc



>From fa196dc15197a630a9c691bb7045bbe6eb293fad Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Tue, 9 Jul 2013 17:20:25 +0200
Subject: [PATCH] Fix Qt tools search when a Qt directory has been specified

When --with-qt-dir has been specified, programs like "moc" in the Qt
directory are unlikely to have a qualified name like moc-qt4.
Therefore, such qualified names are only considered when the base
version has not been found.
---
 config/qt4.m4 |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/config/qt4.m4 b/config/qt4.m4
index 2ac6d70..5c4dcd0 100644
--- a/config/qt4.m4
+++ b/config/qt4.m4
@@ -58,6 +58,22 @@ AC_DEFUN([QT4_CHECK_COMPILE],
 	fi
 ])
 
+
+AC_DEFUN([QT4_FIND_TOOL],
+[
+	$1=
+	if test -n "$qt4_cv_bin" ; then
+		AC_PATH_PROGS($1, [$2], [], $qt4_cv_bin)
+	fi
+	if test -z "$$1"; then
+		AC_PATH_PROGS($1, [$2-qt4 $2],[],$PATH)
+	fi
+	if test -z "$$1"; then
+  	  AC_MSG_ERROR([cannot find $2 binary.])
+	fi
+])
+
+
 dnl get Qt version we're using
 AC_DEFUN([QT4_GET_VERSION],
 [
@@ -144,18 +160,9 @@ AC_DEFUN([QT4_DO_IT_ALL],
 	[AC_MSG_ERROR([LyX requires at least version $1 of Qt. Only version $QT4_VERSION has been found.])
 	])
 
-	AC_PATH_PROGS(MOC4, [moc-qt4 moc],[],$qt4_cv_bin:$PATH)
-	if test -z "$MOC4"; then
-  	  AC_MSG_ERROR([cannot find moc binary.])
-	fi
-	AC_PATH_PROGS(UIC4, [uic-qt4 uic],[],$qt4_cv_bin:$PATH)
-	if test -z "$UIC4"; then
-	  AC_MSG_ERROR([cannot find uic binary.])
-	fi
-	AC_PATH_PROGS(RCC4, [rcc-qt4 rcc],[],$qt4_cv_bin:$PATH)
-	if test -z "$RCC4"; then
-	  AC_MSG_ERROR([cannot find rcc binary.])
-	fi
+	QT4_FIND_TOOL([MOC4], [moc])
+	QT4_FIND_TOOL([UIC4], [uic])
+	QT4_FIND_TOOL([RCC4], [rcc])
 ])
 
 AC_DEFUN([QT4_DO_PKG_CONFIG],
-- 
1.7.0.4

Reply via email to