From 96435265e873a71cad93e60c47ebd1b190386228 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 13 Apr 2021 20:48:16 +0300 Subject: [PATCH 48/48] Fix false positive when looking for moc-qt5/moc-qt6 See osdn #41997 Signed-off-by: Marko Lindqvist --- m4/qt5.m4 | 7 ++++--- m4/qt6.m4 | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/m4/qt5.m4 b/m4/qt5.m4 index 667e7fd7e2..f5ce7f7abc 100644 --- a/m4/qt5.m4 +++ b/m4/qt5.m4 @@ -153,9 +153,10 @@ AC_DEFUN([FC_QT5_LINKTEST], dnl If $1 is Qt 5's moc command then $2 else $3 AC_DEFUN([FC_QT5_IF_QT5_MOC], - AS_IF([test "`$1 -v 2<&1 | grep -o 'Qt [[[0-9]]]\+'`" = "Qt 5" || - test "`$1 -v 2<&1 | grep -o 'moc [[[0-9]]]\+'`" = "moc 5" || - test "`$1 -v 2<&1 | grep -o 'moc-qt[[[0-9]]]\+'`" = "moc-qt5"], + AS_IF([$1 -v >/dev/null 2>/dev/null && + (test "`$1 -v 2<&1 | grep -o 'Qt [[[0-9]]]\+'`" = "Qt 5" || + test "`$1 -v 2<&1 | grep -o 'moc [[[0-9]]]\+'`" = "moc 5" || + test "`$1 -v 2<&1 | grep -o 'moc-qt[[[0-9]]]\+'`" = "moc-qt5")], [$2], [$3])) dnl Set MOCCMD to $1 if it is the Qt 5 "moc". If not run $2 parameter. diff --git a/m4/qt6.m4 b/m4/qt6.m4 index eca661752f..84ed7a578e 100644 --- a/m4/qt6.m4 +++ b/m4/qt6.m4 @@ -153,9 +153,10 @@ AC_DEFUN([FC_QT6_LINKTEST], dnl If $1 is Qt 6's moc command then $2 else $3 AC_DEFUN([FC_QT6_IF_QT6_MOC], - AS_IF([test "`$1 -v 2<&1 | grep -o 'Qt [[[0-9]]]\+'`" = "Qt 6" || - test "`$1 -v 2<&1 | grep -o 'moc [[[0-9]]]\+'`" = "moc 6" || - test "`$1 -v 2<&1 | grep -o 'moc-qt[[[0-9]]]\+'`" = "moc-qt6"], + AS_IF([$1 -v >/dev/null 2>/dev/null && + (test "`$1 -v 2<&1 | grep -o 'Qt [[[0-9]]]\+'`" = "Qt 6" || + test "`$1 -v 2<&1 | grep -o 'moc [[[0-9]]]\+'`" = "moc 6" || + test "`$1 -v 2<&1 | grep -o 'moc-qt[[[0-9]]]\+'`" = "moc-qt6")], [$2], [$3])) dnl Set MOCCMD to $1 if it is the Qt 6 "moc". If not run $2 parameter. -- 2.30.2