|
From: Bart V. A. <bar...@gm...> - 2008-08-01 17:04:27
|
On Tue, Jul 29, 2008 at 10:14 AM, Julian Seward <js...@ac...> wrote:
>> [ ... pkg-config ... ]
> I prefer not; we spent already a lot of time and effort getting rid of
> dependencies of various kinds.
The patch below changes the Qt4 test as follows:
- AC_CHECK_HEADERS() / AC_CHECK_LIBS() tests are removed.
- If pkg-config was not installed at the time autogen.sh was run,
./configure prints a warning and proceeds as if Qt4 has not been
installed.
- If pkg-config was installed at the time autogen.sh was run,
./configure will detect the presence of the Qt4 QtCore library.
pkg-config settings can be overridden via the configure variables
QTCORE_CFLAGS and QTCORE_LIBS (added by the pkg-config m4 macro's).
Please let me know if there are any objections against this patch.
Bart.
diff -u configure.in ../valgrind-drddev/configure.in
--- configure.in 2008-07-29 19:51:53.000000000 +0200
+++ ../valgrind-drddev/configure.in 2008-08-01 18:57:39.000000000 +0200
@@ -1251,15 +1251,6 @@
sys/types.h \
])
-# Checks for C++ header files.
-AC_LANG(C++)
-AC_CHECK_HEADERS([ \
- QtCore/QMutex \
- QtCore/QSemaphore \
- QtCore/QThread \
- ])
-AC_LANG(C)
-
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_TYPE_OFF_T
@@ -1273,7 +1264,6 @@
AC_TYPE_SIGNAL
AC_CHECK_LIB([rt], [clock_gettime])
-AC_CHECK_LIB([QtCore], [_ZN6QMutex4lockEv]) # QMutex::lock()
AC_CHECK_FUNCS([ \
clock_gettime\
@@ -1401,26 +1391,25 @@
AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
-# does this compiler have the include file <Qt/qmutex.h> and does it have
-# libQtCore.so ?
-
-AC_MSG_CHECKING([for Qt4 core library])
+# Has the QtCore package been installed ?
-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])
-],
-[
- ac_have_qtcore=no
- AC_MSG_RESULT([no])
-])
+ifdef(
+ [PKG_CHECK_EXISTS],
+ [PKG_CHECK_EXISTS(
+ [QtCore],
+ [
+ PKG_CHECK_MODULES([QTCORE], [QtCore])
+ ac_have_qtcore=yes
+ ],
+ [
+ ac_have_qtcore=no
+ ]
+ )
+ ],
+ AC_MSG_WARN([pkg-config has not been installed or is too old.])
+ AC_MSG_WARN([Detection of Qt4 will be skipped.])
+ [ac_have_qtcore=no]
+)
AM_CONDITIONAL([HAVE_QTCORE], [test x$ac_have_qtcore = xyes])
|