|
From: <sv...@va...> - 2008-09-21 15:01:07
|
Author: bart
Date: 2008-09-21 16:00:58 +0100 (Sun, 21 Sep 2008)
New Revision: 8632
Log:
Don't trust the result reported by pkg-config about QtCore, but try whether linking succeeds. This additional test is necessary when running configure with the flag --enable-only32bit.
Modified:
trunk/configure.in
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2008-09-21 11:24:00 UTC (rev 8631)
+++ trunk/configure.in 2008-09-21 15:00:58 UTC (rev 8632)
@@ -1436,7 +1436,25 @@
[QtCore],
[
PKG_CHECK_MODULES([QTCORE], [QtCore])
- ac_have_qtcore=yes
+ # Paranoia: don't trust the result reported by pkg-config, but when
+ # pkg-config reports that QtCore has been found, verify whether linking
+ # programs with QtCore succeeds.
+ AC_LANG(C++)
+ safe_CXXFLAGS="${CXXFLAGS}"
+ CXXFLAGS="${QTCORE_CFLAGS} ${QTCORE_LIBS}"
+ if test x$vg_cv_only32bit = xyes; then
+ CXXFLAGS="${CXXFLAGS} -m32"
+ fi
+ AC_TRY_LINK(
+ [#include <QMutex>],
+ [QMutex Mutex;],
+ [ac_have_qtcore=yes],
+ [
+ AC_MSG_WARN([Although pkg-config detected Qt4, linking Qt4 programs fails. Skipping Qt4.])
+ ac_have_qtcore=no
+ ]
+ )
+ CXXFLAGS="${safe_CXXFLAGS}"
],
[
ac_have_qtcore=no
@@ -1457,7 +1475,7 @@
AC_MSG_CHECKING([for Qt4 QMutex::tryLock(int)])
AC_LANG(C++)
safe_CXXFLAGS="${CXXFLAGS}"
- CXXFLAGS="${pkg_cv_QTCORE_CFLAGS}"
+ CXXFLAGS="${QTCORE_CFLAGS}"
AC_TRY_COMPILE([
#include <QtCore/QMutex>
],
|