+ dnl compute the binary dir too
+ if test -n "$qt4_cv_dir"; then
+ qt4_cv_bin=$qt4_cv_dir/bin
+ fi
+
+ dnl Preprocessor flags
+ QT4_CPPFLAGS="-DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_STL -DQT_NO_KEYWORDS"
+ case ${host} in
+ *mingw*) QT4_CPPFLAGS="-DQT_DLL $QT4_CPPFLAGS";;
+ *cygwin*)
+ if test "x$with_x" = xno ; then
+ QT4_CPPFLAGS="$QT4_CPPFLAGS -DQ_CYGWIN_WIN"
+ fi;;
+ esac
+ AC_SUBST(QT4_CPPFLAGS)
+
+ dnl Check if it possible to do a pkg-config
+ PKG_PROG_PKG_CONFIG
+ if test -n "$PKG_CONFIG" ; then
+ QT4_DO_PKG_CONFIG
+ fi
+ if test "$pkg_failed" != "no" ; then
+ QT4_DO_MANUAL_CONFIG
+ fi
+ AC_PATH_PROGS(MOC4, [moc-qt4 moc],[],$qt4_cv_bin:$PATH)
+ AC_PATH_PROGS(UIC4, [uic-qt4 uic],[],$qt4_cv_bin:$PATH)
+ AC_PATH_PROGS(RCC4, [rcc-qt4 rcc],[],$qt4_cv_bin:$PATH)
+])
+
+AC_DEFUN([QT4_DO_PKG_CONFIG],
+[
+ dnl tell pkg-config to look also in $qt4_cv_dir/lib.
+ save_PKG_CONFIG_PATH=$PKG_CONFIG_PATH
+ if test -n "$qt4_cv_dir" ; then
+ PKG_CONFIG_PATH=$qt4_cv_dir/lib:$qt4_cv_dir/lib/pkgconfig:$PKG_CONFIG_PATH
+ export PKG_CONFIG_PATH
+ fi
+ PKG_CHECK_MODULES(QT4_CORE, QtCore,,[:])
+ if test "$pkg_failed" = "no" ; then
+ QT4_CORE_INCLUDES=$QT4_CORE_CFLAGS
+ AC_SUBST(QT4_CORE_INCLUDES)
+ QT4_CORE_LDFLAGS=`$PKG_CONFIG --libs-only-L QtCore`
+ AC_SUBST(QT4_CORE_LDFLAGS)
+ QT4_CORE_LIB=`$PKG_CONFIG --libs-only-l QtCore`
+ AC_SUBST(QT4_CORE_LIB)
+ fi
+ PKG_CHECK_MODULES(QT4_FRONTEND, QtCore QtGui,,[:])
+ if test "$pkg_failed" = "no" ; then
+ QT4_INCLUDES=$QT4_FRONTEND_CFLAGS
+ dnl QT4_LDFLAGS=$QT4_FRONTEND_LIBS
+ QT4_LDFLAGS=`$PKG_CONFIG --libs-only-L QtCore QtGui`
+ AC_SUBST(QT4_INCLUDES)
+ AC_SUBST(QT4_LDFLAGS)
+ QT4_VERSION=`$PKG_CONFIG --modversion QtCore`
+ AC_SUBST(QT4_VERSION)
+ QT4_LIB=`$PKG_CONFIG --libs-only-l QtCore QtGui`
+ AC_SUBST(QT4_LIB)
+ LIBS="$LIBS `$PKG_CONFIG --libs-only-other QtCore QtGui`"
+ fi
+ PKG_CONFIG_PATH=$save_PKG_CONFIG_PATH
+])
+
+AC_DEFUN([QT4_DO_MANUAL_CONFIG],
+[