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.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8632
This commit is contained in:
Bart Van Assche 2008-09-21 15:00:58 +00:00
parent 9b49dd6e2e
commit 1f902e8a46

View File

@ -1436,7 +1436,25 @@ ifdef(
[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 @@ if test x$ac_have_qtcore = xyes; then
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>
],