define LIBS for QtDBus only if configure detected it; using HAVE_QTDBUS variable

This commit is contained in:
Vadim Kurland
2009-10-12 22:03:08 +00:00
parent 53544861d2
commit ea2602910c
7 changed files with 49 additions and 27 deletions
+17 -20
View File
@@ -270,34 +270,31 @@ AC_SUBST(HAVE_EXTERNAL_ANTLR)
AC_SUBST(ANTLR_LIBS)
AC_SUBST(ANTLR_INCLUDEPATH)
# TODO: Probably need to repackage this as Autoconf macro
# TODO: Probably need to repackage this as Autoconf macro.
#
# QT DBus framework is not always available. It is not included in QT
# for Windows and is missing in QT 4.5.3 Commercial package for Mac OS
# X 10.6 SnowLeopard (but it is present in QT 4.4.1 Commercial for
# Mac OS X 10.5 Leopard. Go figure.)
#
AC_MSG_CHECKING(QT DBus framework)
( cd config_tests
cat <<EOF > test.pro
TEMPLATE = app
unix {
macx {
LIBS += -framework QtDBus
}
!macx {
# workaround for QT += dbus not working atm
LIBS += -lQtDBus
}
}
SOURCES = qtdbus_test.cpp
TARGET = qtdbus_test
EOF
C=""
test -n "$QMAKESPEC" && C="$C -spec $QMAKESPEC "
$QMAKE $C test.pro
$QMAKE $C qtdbus_test.pro || exit 1
test -f Makefile || exit 1
make >config.log 2>&1 ) && {
make >config.log 2>&1
)
if test $? -eq 0; then
HAVE_QTDBUS="1"
AC_MSG_RESULT(ok)
AC_DEFINE_UNQUOTED(HAVE_QTDBUS, 1, [qtdbus])
AC_SUBST(HAVE_QTDBUS)
} || {
else
HAVE_QTDBUS="0"
AC_MSG_RESULT(not available)
}
AC_DEFINE_UNQUOTED(HAVE_QTDBUS, 0, [qtdbus])
fi
AC_SUBST(HAVE_QTDBUS)
dnl ********************************************************************