From b4c01c73ebed43838a1342c17ea129865c9b9a2e Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Fri, 19 Mar 2010 14:45:16 +1000 Subject: Add configure test for Maemo Internet Connection Daemon. Task: QTBUG-9156 --- config.tests/unix/icd/icd.cpp | 55 ++++++++++++++++++++++++++++++++++++++++++ config.tests/unix/icd/icd.pro | 3 +++ configure | 44 +++++++++++++++++++++++++++++++++ src/plugins/bearer/bearer.pro | 10 +++++--- src/plugins/bearer/icd/icd.pro | 4 +-- 5 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 config.tests/unix/icd/icd.cpp create mode 100644 config.tests/unix/icd/icd.pro diff --git a/config.tests/unix/icd/icd.cpp b/config.tests/unix/icd/icd.cpp new file mode 100644 index 0000000..e3701ac --- /dev/null +++ b/config.tests/unix/icd/icd.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +//#include +#include + +#include +#include + +int main(int, char **) +{ + dbus_shutdown(); + return 0; +} diff --git a/config.tests/unix/icd/icd.pro b/config.tests/unix/icd/icd.pro new file mode 100644 index 0000000..d736b41 --- /dev/null +++ b/config.tests/unix/icd/icd.pro @@ -0,0 +1,3 @@ +SOURCES = icd.cpp +CONFIG -= qt +mac:CONFIG -= app_bundle diff --git a/configure b/configure index f9351d1..5786764 100755 --- a/configure +++ b/configure @@ -788,6 +788,7 @@ CFG_GRAPHICS_SYSTEM=default CFG_ALSA=auto CFG_PULSEAUDIO=auto CFG_COREWLAN=auto +CFG_ICD=auto # initalize variables used for installation QT_INSTALL_PREFIX= @@ -826,6 +827,10 @@ QT_LIBS_GLIB= QT_CFLAGS_GSTREAMER= QT_LIBS_GSTREAMER= +# flags for icd (Maemo Internet Connection Daemon) +QT_CFLAGS_ICD= +QT_LIBS_ICD= + #------------------------------------------------------------------------------- # check SQL drivers, mouse drivers and decorations available in this package #------------------------------------------------------------------------------- @@ -5149,6 +5154,39 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then CFG_PHONON=yes fi fi + + # auto-detect icd support + if [ "$CFG_GLIB" = "yes" -a "$CFG_ICD" != "no" ]; then + # ICD support has a cyclic dependency on Qt. + if [ -n "$PKG_CONFIG" ]; then + QT_CFLAGS_ICD=`$PKG_CONFIG --cflags dbus-glib-1 gconf-2.0 osso-ic conninet 2>/dev/null` + QT_LIBS_ICD=`$PKG_CONFIG --libs dbus-glib-1 gconf-2.0 osso-ic conninet 2>/dev/null` + QT_CFLAGS_QTNETWORK=`$PKG_CONFIG --cflags QtNetwork 2>/dev/null` + QT_LIBS_QTNETWORK=`$PKG_CONFIG --libs QtNetwork 2>/dev/null` + else + QT_CFLAGS_QTNETOWRK= + QT_LIBS_QTNETWORK= + fi + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/icd "ICD" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_ICD $QT_LIBS_ICD $QT_CFLAGS_QTNETWORK $QT_LIBS_QTNETWORK; then + [ "$CFG_ICD" = "auto" ] && CFG_ICD=yes + QMakeVar set QT_CFLAGS_ICD "$QT_CFLAGS_ICD" + QMakeVar set QT_LIBS_ICD "$QT_LIBS_ICD" + else + if [ "$CFG_ICD" = "auto" ]; then + CFG_ICD=no + elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then + # CFG_ICD is "yes" + + echo "The ICD Bearer Management plugin cannot be enabled because dbus-glib-1, gconf-2.0, osso-ic or conninet was not found." + echo " Turn on verbose messaging (-v) to $0 to see the final report." + echo " If you believe this message is in error you may use the continue" + echo " switch (-continue) to $0 to continue." + exit 101 + fi + fi + elif [ "$CFG_GLIB" = "no" ]; then + CFG_ICD=no + fi fi # X11/QWS # x11 @@ -6493,6 +6531,10 @@ if [ "$CFG_COREWLAN" = "yes" ]; then QT_CONFIG="$QT_CONFIG corewlan" fi +if [ "$CFG_ICD" = "yes" ]; then + QT_CONFIG="$QT_CONFIG icd" +fi + # # Some Qt modules are too advanced in C++ for some old compilers # Detect here the platforms where they are known to work. @@ -7218,6 +7260,7 @@ fi [ "$CFG_ALSA" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ALSA" [ "$CFG_PULSEAUDIO" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PULSEAUDIO" [ "$CFG_COREWLAN" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_COREWLAN" +[ "$CFG_ICD" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICD" # sort QCONFIG_FLAGS for neatness if we can [ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq` @@ -7734,6 +7777,7 @@ echo "Pulse Audio support .... $CFG_PULSEAUDIO" if [ "$PLATFORM_MAC" = "yes" ]; then echo "CoreWlan support ....... $CFG_COREWLAN" fi +echo "ICD support ............ $CFG_ICD" echo [ "$CFG_PTMALLOC" != "no" ] && echo "Use ptmalloc ........... $CFG_PTMALLOC" diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro index 00be80e..f95e8af 100644 --- a/src/plugins/bearer/bearer.pro +++ b/src/plugins/bearer/bearer.pro @@ -1,14 +1,18 @@ TEMPLATE = subdirs -!maemo6:contains(QT_CONFIG, dbus) { - SUBDIRS += networkmanager generic +contains(QT_CONFIG, dbus) { + contains(QT_CONFIG, icd) { + SUBDIRS += icd + } else { + SUBDIRS += networkmanager generic + } } + #win32:SUBDIRS += nla win32:SUBDIRS += generic win32:!wince*:SUBDIRS += nativewifi macx:contains(QT_CONFIG, corewlan):SUBDIRS += corewlan macx:SUBDIRS += generic symbian:SUBDIRS += symbian -maemo6:contains(QT_CONFIG, dbus):SUBDIRS += icd isEmpty(SUBDIRS):SUBDIRS += generic diff --git a/src/plugins/bearer/icd/icd.pro b/src/plugins/bearer/icd/icd.pro index 5eaf5af..f411de2 100644 --- a/src/plugins/bearer/icd/icd.pro +++ b/src/plugins/bearer/icd/icd.pro @@ -3,8 +3,8 @@ include(../../qpluginbase.pri) QT += network dbus -CONFIG += link_pkgconfig -PKGCONFIG += glib-2.0 dbus-glib-1 gconf-2.0 osso-ic conninet +QMAKE_CXXFLAGS += $$QT_CFLAGS_ICD +LIBS += $$QT_LIBS_ICD HEADERS += qicdengine.h \ monitor.h \ -- cgit v0.12