Added /usr/include/qt4 to search path for C++ header files. Made Qt4 detection test portable.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8396 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index 257ff93..dfbcc90 100644
--- a/configure.in
+++ b/configure.in
@@ -52,6 +52,8 @@
 
 # Checks for programs.
 CFLAGS="-Wno-long-long"
+CXXFLAGS="-I/usr/include/qt4"
+CPPFLAGS="-I/usr/include/qt4"
 
 AC_PROG_LN_S
 AC_PROG_CC
@@ -1388,17 +1390,21 @@
 
 AC_MSG_CHECKING([for Qt4 core library])
 
-# The test below looks up some symbol definitions in the temporary file generated by the
-# configure script, namely confdefs.h.
-if grep -q -w '^#define HAVE_LIBQTCORE 1$' confdefs.h \
-   && grep -q -w '^#define HAVE_QTCORE_QMUTEX 1$' confdefs.h
-then
+AC_TRY_COMPILE([ ],
+[
+#if ! defined(HAVE_LIBQTCORE) || ! defined(HAVE_QTCORE_QMUTEX)
+#error Qt4 not supported.
+#endif
+  return 0;
+],
+[
   ac_have_qtcore=yes
   AC_MSG_RESULT([yes])
-else
+],
+[
   ac_have_qtcore=no
   AC_MSG_RESULT([no])
-fi
+])
 
 AM_CONDITIONAL([HAVE_QTCORE], [test x$ac_have_qtcore = xyes])