From 182bb7c3d0afdcc4c49958bb1bef3760680cdc5d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 9 Dec 2014 14:42:50 +0100 Subject: Fix build on Linux when dbus headers cannot be found When CFG_DBUS != "no", we enable the build of linuxaccessibility in src/platformsupport, which requires QT += dbus to work. When no dbus headers are found, CFG_DBUS is set to runtime, which means we'll enable a11y but "dbus" will not end up in qconfig.pri and therefore src/dbus is not built at all (and not before platformsupport). Therefore the build in platformsupport breaks. So even if CFG_DBUS is set to "runtime" we need to make sure that dbus appears in qconfig.pri. Task-number: QTBUG-43205 Change-Id: Ibbe5e66552226cdcc1ce16fb83556406f3bb0e09 Reviewed-by: Thiago Macieira --- configure | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'configure') diff --git a/configure b/configure index acbfb17c64..a461541e36 100755 --- a/configure +++ b/configure @@ -1871,10 +1871,8 @@ while [ "$#" -gt 0 ]; do fi ;; dbus) - if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ]; then + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ] || [ "$VAL" = "runtime" ]; then CFG_DBUS="$VAL" - elif [ "$VAL" = "runtime" ]; then - CFG_DBUS="yes" else UNKNOWN_OPT=yes fi @@ -5780,8 +5778,8 @@ fi [ "$CFG_ICONV" = "sun" ] && QT_CONFIG="$QT_CONFIG sun-libiconv" [ "$CFG_ICONV" = "gnu" ] && QT_CONFIG="$QT_CONFIG gnu-libiconv" [ "$CFG_GLIB" = "yes" ] && QT_CONFIG="$QT_CONFIG glib" -[ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus" -[ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked" +[ "$CFG_DBUS" != "no" ] && QT_CONFIG="$QT_CONFIG dbus" +[ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus-linked" [ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl" [ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked" [ "$CFG_XCB" != "no" ] && QT_CONFIG="$QT_CONFIG xcb" @@ -6559,7 +6557,7 @@ fi # Qt modules echo echo "Qt modules and options:" -report_support " Qt D-Bus ..............." "$CFG_DBUS" yes "loading dbus-1 at runtime" linked "linked to dbus-1" +report_support " Qt D-Bus ..............." "$CFG_DBUS" runtime "loading dbus-1 at runtime" linked "linked to dbus-1" report_support " Qt Concurrent .........." "$CFG_CONCURRENT" report_support " Qt GUI ................." "$CFG_GUI" report_support " Qt Widgets ............." "$CFG_WIDGETS" -- cgit v1.2.3 From 12d32b017d9ff31332933eae28a3f7b46b9d3e49 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 9 Dec 2014 15:03:04 -0800 Subject: Complete the work for the runtime libdbus-1 support Commit a2da88712f1e057747f68a28361b300faac5e605 was incomplete. Though it did enable building of QtDBus without the libdbus-1 headers, but it still kept looking for it. We don't need to do it anymore if CFG_DBUS is the default (runtime), so skip the actual check. This commit does not change behavior. All it does is skip the D-Bus tests if we're about to use dlopen'ed libdbus-1. Change-Id: I3947443c9ef6cc409cb6b154564f8af6fb5de84e Reviewed-by: Simon Hausmann --- configure | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'configure') diff --git a/configure b/configure index a461541e36..31a59fc802 100755 --- a/configure +++ b/configure @@ -658,7 +658,7 @@ CFG_TSLIB=no CFG_NIS=auto CFG_CUPS=auto CFG_ICONV=auto -CFG_DBUS=auto +CFG_DBUS=runtime CFG_GLIB=auto CFG_QGTKSTYLE=auto CFG_LARGEFILE=auto @@ -1871,8 +1871,10 @@ while [ "$#" -gt 0 ]; do fi ;; dbus) - if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ] || [ "$VAL" = "runtime" ]; then + if [ "$VAL" = "no" ] || [ "$VAL" = "linked" ] || [ "$VAL" = "runtime" ]; then CFG_DBUS="$VAL" + elif [ "$VAL" = "yes" ]; then + CFG_DBUS="runtime" else UNKNOWN_OPT=yes fi @@ -4630,7 +4632,7 @@ if [ "$CFG_ICONV" != "no" ]; then fi # auto-detect libdbus-1 support -if [ "$CFG_DBUS" != "no" ]; then +if [ "$CFG_DBUS" = "linked" ]; then if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null` QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null` @@ -4638,7 +4640,6 @@ if [ "$CFG_DBUS" != "no" ]; then QT_LIBS_DBUS="-ldbus-1" fi if compileTest unix/dbus "D-Bus" $QT_CFLAGS_DBUS $QT_LIBS_DBUS; then - [ "$CFG_DBUS" = "auto" ] && CFG_DBUS=yes QMakeVar set QT_LIBS_DBUS "$QT_LIBS_DBUS" QMakeVar set QT_CFLAGS_DBUS "$QT_CFLAGS_DBUS" # Try find correct host configuration for dbus tools when cross-compiling @@ -4648,11 +4649,7 @@ if [ "$CFG_DBUS" != "no" ]; then fi QMakeVar set QT_HOST_CFLAGS_DBUS "$QT_CFLAGS_DBUS" else - if [ "$CFG_DBUS" != "linked" ]; then - CFG_DBUS=runtime - elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then - # CFG_DBUS is "yes" or "linked" here - + if [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then echo "The Qt D-Bus module cannot be enabled because libdbus-1 version $MIN_DBUS_1_VERSION 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" -- cgit v1.2.3 From b077ed746ae91321ff9aa72ebd17a463bec98413 Mon Sep 17 00:00:00 2001 From: Ashish Kulkarni Date: Wed, 7 Jan 2015 23:52:01 +0530 Subject: allow detection of static/shared target in the config tests It was not possible to determine whether Qt is being built as a shared or static library in the config tests, as that information was not added to QMAKE_CONFIG used in the compileTest function. For linking to ICU on Windows, there is logic which depends on it in config.tests/unix/icu/icu.pro, but was broken for the static target, as the expected library name was not found (icuXX -> sicuXX). Change-Id: I22c2d543ea14feebbad36961c9a29e99f66323ff Reviewed-by: Oswald Buddenhagen --- configure | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index 31a59fc802..75fe189bef 100755 --- a/configure +++ b/configure @@ -3954,7 +3954,13 @@ compileTest() path=config.tests/$1 name=$2 shift 2 - "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "$path" "$name" $I_FLAGS $D_FLAGS $L_FLAGS "$@" + # allow config tests which behave differently depending on the type of + # library being built (shared/static) e.g. see config.tests/unix/icu + test_config="$QMAKE_CONFIG shared" + if [ "$CFG_SHARED" = "no" ]; then + test_config="$QMAKE_CONFIG static" + fi + "$unixtests/compile.test" "$XQMAKESPEC" "$test_config" $OPT_VERBOSE "$relpath" "$outpath" "$path" "$name" $I_FLAGS $D_FLAGS $L_FLAGS "$@" } #------------------------------------------------------------------------------- -- cgit v1.2.3 From 8761b2b5d9f36395a52608ec853047fc6052e600 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 29 Oct 2014 13:21:22 -0700 Subject: Print some debugging information for pkg-config detection Commit d44781730ccd4d48af79f480813bf3f9a4000253 disabled use of pkg- config on Mac, which in turn automatically disables all of the tests that depend on pkg-config too, like D-Bus. If you then use the -dbus flag, configure would error out telling you that it couldn't find D-Bus, despite it being there. Now we print some helpful information on error and extra information for finding out why it may have got disabled. Change-Id: Ic4e41c58d62d80eb1a0f3ca1c93529e049aaf231 Reviewed-by: Oswald Buddenhagen --- configure | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 75fe189bef..5ad29bb784 100755 --- a/configure +++ b/configure @@ -3883,13 +3883,16 @@ fi if [ -z "$PKG_CONFIG" ]; then # See if PKG_CONFIG is set in the mkspec: PKG_CONFIG="`"$outpath/bin/qmake" -E -nocache -spec "$XQMAKESPEC" "CONFIG=" $DEV_NULL 2>&1 | sed -n -e 's,^PKG_CONFIG = \(.*\),\1,p'`" + [ -n "$PKG_CONFIG" ] && [ "$OPT_VERBOSE" = "yes" ] && echo "Found pkg-config from mkspec: $PKG_CONFIG" fi if [ -z "$PKG_CONFIG" ]; then PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null` + [ -n "$PKG_CONFIG" ] && [ "$OPT_VERBOSE" = "yes" ] && echo "Found pkg-config from \$PATH: $PKG_CONFIG" fi if [ "$CFG_PKGCONFIG" = "no" ]; then PKG_CONFIG= + [ "$OPT_VERBOSE" = "yes" ] && echo "pkg-config support disabled." elif [ "$CFG_PKGCONFIG" = "force" ]; then echo >&2 "" echo >&2 "You have asked to use pkg-config. Please make sure you have" @@ -4657,6 +4660,7 @@ if [ "$CFG_DBUS" = "linked" ]; then else if [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then echo "The Qt D-Bus module cannot be enabled because libdbus-1 version $MIN_DBUS_1_VERSION was not found." + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" 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." @@ -4678,6 +4682,7 @@ if [ "$CFG_GLIB" != "no" ]; then else if [ "$CFG_GLIB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then echo "Glib support cannot be enabled due to functionality tests!" + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" 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." @@ -4705,6 +4710,7 @@ if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then else if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then echo "GTK theme support cannot be enabled due to functionality tests!" + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" echo " Turn on verbose messaging (-v) to $0 to see the fin al report." echo " If you believe this message is in error you may use the continue" echo " switch (-continue) to $0 to continue." @@ -4749,6 +4755,7 @@ if [ "$CFG_PULSEAUDIO" != "no" ]; then else if [ "$CFG_PULSEAUDIO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then echo "PulseAudio support cannot be enabled due to functionality tests!" + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" 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." @@ -4875,6 +4882,7 @@ elif [ "$CFG_OPENGL" = "es2" ]; then compileTest unix/opengles2 "OpenGL ES 2.0" $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2 if [ $? != "0" ]; then echo "The OpenGL ES 2.0 functionality test failed!" + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in" echo " ${XQMAKESPEC}." @@ -4948,6 +4956,7 @@ if [ "$CFG_LIBUDEV" != "no" ]; then QT_CONFIG="$QT_CONFIG libudev" elif [ "$CFG_LIBUDEV" = "yes" ]; then echo "The libudev functionality test failed!" + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" exit 1 else CFG_LIBUDEV=no @@ -5099,6 +5108,7 @@ if [ "$CFG_XCB" != "no" ]; then else if [ "$CFG_XCB" != "auto" ]; then echo "The test for linking against libxcb failed!" + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" echo " You might need to install dependency packages for libxcb." echo " See src/plugins/platforms/xcb/README." exit 1 @@ -5115,6 +5125,7 @@ if [ "$CFG_DIRECTFB" != "no" ]; then CFG_DIRECTFB=yes elif [ "$CFG_DIRECTFB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then echo " DirectFB support cannot be enabled due to functionality tests!" + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" 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." @@ -5171,6 +5182,7 @@ if [ "$CFG_XCB" != "no" ]; then elif [ "$CFG_XKBCOMMON" = "system" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then echo " xkbcommon support cannot be enabled because either xkbcommon or " echo " xkbcommon-x11 >= $MIN_REQ_XKBCOMMON was not found via pkg-config!" + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" 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." @@ -5231,6 +5243,7 @@ if [ "$CFG_EGL" != "no" ]; then fi elif [ "$CFG_EGL" = "yes" ]; then echo " The EGL functionality test failed; EGL is required by some QPA plugins to manage contexts & surfaces." + [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR_EGL, QMAKE_LIBDIR_EGL and QMAKE_LIBS_EGL in ${XQMAKESPEC}." exit 1 -- cgit v1.2.3