From: =?utf-8?b?IkNoYW5nWmh1byBDaGVuICjpmbPmmIzlgKwpIg==?=
 <czchen@debian.org>
Date: Wed, 15 Jun 2016 19:06:32 +0800
Subject: Use qtchooser to find moc

---
 configure | 31 ++-----------------------------
 1 file changed, 2 insertions(+), 29 deletions(-)

diff --git a/configure b/configure
index 3df832f..32f679b 100755
--- a/configure
+++ b/configure
@@ -317,13 +317,7 @@ if [ $QT4_IM = 'N' ]; then
   mv gcin.spec gcin.spec.tmp
   grep -v qt4/plugins/inputmethods gcin.spec.tmp > gcin.spec
 else
-  for i in /usr/share/qt4/bin/moc /usr/lib/qt4/bin/moc /usr/lib64/qt4/bin/moc /usr/bin/moc
-  do
-    [ ! -x $i ] && continue
-    QT4_MOC=$i
-    echo "QT4_MOC=$QT4_MOC"
-    break
-  done
+  QT4_MOC="qtchooser -run-tool=moc -qt=4"
 fi
 
 
@@ -331,28 +325,7 @@ if [ $QT5_IM = 'N' ]; then
   mv gcin.spec gcin.spec.tmp
   grep -v qt5/plugins/inputmethods gcin.spec.tmp > gcin.spec
 else
-  cd qt5-im
-  qtver=`pkg-config --modversion Qt5Core` 
-  minv=`echo $qtver | cut -d. -f2` 
-  if [ $minv -ge 5 ]; then
-    echo "You have Qt > 5.5.1 "
-    sed -e "s/FactoryInterface/FactoryInterface.5.1/" < gcin-qt5.h.in > gcin-qt5.h
-    if [ $minv -ge 9 ]; then
- 	cp -a Makefile59 Makefile	
-    else
- 	cp -a Makefile55 Makefile	
-    fi
-  else
-    cp gcin-qt5.h.in gcin-qt5.h
-  fi
-  cd ..
-  for i in /usr/share/qt5/bin/moc /usr/lib/qt5/bin/moc /usr/lib/x86_64-linux-gnu/qt5/bin/moc /usr/lib/i386-linux-gnu/qt5/bin/moc /usr/lib64/qt5/bin/moc /usr/bin/moc
-  do
-    [ ! -x $i ] && continue
-    QT5_MOC=$i
-    echo "QT5_MOC=$QT5_MOC"
-    break
-  done
+  QT5_MOC="qtchooser -run-tool=moc -qt=5"
 fi
 
 
