From de8cb9154769a529c184012a5933c41532c2deff Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Wed, 28 Jul 2010 17:41:24 +1000 Subject: Statically link to Qt based dependent librarys. Some of the library dependencies of the ICD Bearer Management plugin use Qt. We include them in src/3rdparty and link against them statically to avoid the circular build dependency. Libraries that do not use Qt are still linked dynamically. The libraries which are statically linked are libconninet and libgq-gconf. Task-number: QTBUG-12354 --- config.tests/unix/icd/icd.cpp | 4 ---- configure | 46 +++++++++--------------------------------- src/plugins/bearer/icd/icd.pro | 7 +++++-- 3 files changed, 14 insertions(+), 43 deletions(-) diff --git a/config.tests/unix/icd/icd.cpp b/config.tests/unix/icd/icd.cpp index 8b74fd6..19c171b 100644 --- a/config.tests/unix/icd/icd.cpp +++ b/config.tests/unix/icd/icd.cpp @@ -40,11 +40,7 @@ ****************************************************************************/ #include -#include -#include -#include #include -#include #include int main(int, char **) diff --git a/configure b/configure index 7fc6aac..c61250b 100755 --- a/configure +++ b/configure @@ -836,9 +836,9 @@ QT_LIBS_GLIB= QT_CFLAGS_GSTREAMER= QT_LIBS_GSTREAMER= -# flags for icd (Maemo Internet Connection Daemon) -QT_CFLAGS_ICD= -QT_LIBS_ICD= +# flags for libconnsettings0 (used for Maemo ICD bearer management plugin) +QT_CFLAGS_CONNSETTINGS= +QT_LIBS_CONNSETTINGS= #------------------------------------------------------------------------------- # check SQL drivers, mouse drivers and decorations available in this package @@ -5425,49 +5425,21 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then # 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 osso-ic conninet 2>/dev/null` - QT_LIBS_ICD=`$PKG_CONFIG --libs 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_QTNETWORK= - QT_LIBS_QTNETWORK= + QT_CFLAGS_CONNSETTINGS=`$PKG_CONFIG --cflags connsettings 2>/dev/null` + QT_LIBS_CONNSETTINGS=`$PKG_CONFIG --libs connsettings 2>/dev/null` 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 + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/icd "ICD" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_CONNSETTINGS $QT_LIBS_CONNSETTINGS; then [ "$CFG_ICD" = "auto" ] && CFG_ICD=yes - # remove system Qt includes and libraries - QT_CFLAGS_ICD_TRIMMED= - for i in $QT_CFLAGS_ICD; do - case $i in - *qt*) - ;; - *) - QT_CFLAGS_ICD_TRIMMED="$QT_CFLAGS_ICD_TRIMMED $i" - ;; - esac - done - QT_LIBS_ICD_TRIMMED= - for i in $QT_LIBS_ICD; do - case $i in - *qt*|-lQt*) - ;; - *) - QT_LIBS_ICD_TRIMMED="$QT_LIBS_ICD_TRIMMED $i" - ;; - esac - done - - QMakeVar set QT_CFLAGS_ICD "$QT_CFLAGS_ICD_TRIMMED" - QMakeVar set QT_LIBS_ICD "$QT_LIBS_ICD_TRIMMED" + QMakeVar set QT_CFLAGS_CONNSETTINGS "$QT_CFLAGS_CONNSETTINGS" + QMakeVar set QT_LIBS_CONNSETTINGS "$QT_LIBS_CONNSETTINGS" 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 osso-ic or conninet was not found." + echo "The ICD Bearer Management plugin cannot be enabled because connsettings 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." diff --git a/src/plugins/bearer/icd/icd.pro b/src/plugins/bearer/icd/icd.pro index c7337f5..b2c58e9 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 -QMAKE_CXXFLAGS += $$QT_CFLAGS_ICD -LIBS += $$QT_LIBS_ICD +QMAKE_CXXFLAGS *= $$QT_CFLAGS_DBUS $$QT_CFLAGS_CONNSETTINGS +LIBS += $$QT_LIBS_CONNSETTINGS HEADERS += qicdengine.h \ qnetworksession_impl.h @@ -15,6 +15,9 @@ SOURCES += main.cpp \ #DEFINES += BEARER_MANAGEMENT_DEBUG +include(../../../3rdparty/libconninet.pri) +include(../../../3rdparty/libgq.pri) + QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/bearer target.path += $$[QT_INSTALL_PLUGINS]/bearer INSTALLS += target -- cgit v0.12