$OpenBSD: patch-configure_ac,v 1.10 2014/05/28 19:45:54 kili Exp $
--- configure.ac.orig	Fri May 23 20:05:06 2014
+++ configure.ac	Tue May 27 20:35:49 2014
@@ -557,6 +557,24 @@ AC_SUBST(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES)
 
 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
 
+AC_ARG_ENABLE(poppler-qt,
+	      AC_HELP_STRING([--disable-poppler-qt],
+			     [Don't compile poppler qt wrapper.]),
+	      enable_poppler_qt=$enableval,
+	      enable_poppler_qt="try")
+
+if test x$enable_poppler_qt = xyes; then
+  POPPLER_FIND_QT(POPPLER_QT,,)
+elif test x$enable_poppler_qt = xtry; then
+  POPPLER_FIND_QT(POPPLER_QT,
+		  [enable_poppler_qt="yes"],
+                  [enable_poppler_qt="no"])
+fi
+AC_SUBST(POPPLER_QT_CXXFLAGS)
+AC_SUBST(POPPLER_QT_LIBS)
+
+AM_CONDITIONAL(BUILD_POPPLER_QT, test "x$enable_poppler_qt" = "xyes")
+
 dnl 
 dnl Try Qt4
 dnl
@@ -589,7 +607,7 @@ AC_SUBST(POPPLER_QT4_LIBS)
 AC_SUBST(POPPLER_QT4_TEST_LIBS)
 
 if test x$enable_poppler_qt4 = xyes; then
-  AC_CHECK_TOOL(MOCQT4, moc)
+  AC_CHECK_TOOL(MOCQT4, moc4)
   AC_MSG_CHECKING([for Qt4 moc])
   mocversion=`$MOCQT4 -v 2>&1`
   mocversiongrep=`echo $mocversion | grep "Qt 4"`
@@ -844,6 +862,9 @@ glib/reference/Makefile
 glib/reference/version.xml
 glib/demo/Makefile
 test/Makefile
+poppler-qt.pc
+poppler-qt-uninstalled.pc
+qt/Makefile
 qt4/Makefile
 qt4/src/Makefile
 qt4/tests/Makefile
@@ -876,6 +897,7 @@ echo "Building poppler with support for:"
 echo "  font configuration: $with_font_configuration"
 echo "  splash output:      $enable_splash_output"
 echo "  cairo output:       $use_cairo"
+echo "  qt wrapper:         $enable_poppler_qt"
 echo "  qt4 wrapper:        $enable_poppler_qt4"
 echo "  qt5 wrapper:        $enable_poppler_qt5"
 echo "  glib wrapper:       $use_glib"
