A QPA build on Linux requires xcb or wayland
authorLincoln Ramsay <lincoln.ramsay@nokia.com>
Wed, 5 Oct 2011 03:32:01 +0000 (13:32 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 6 Oct 2011 01:32:06 +0000 (03:32 +0200)
Require the user to pass -no-xcb and -no-wayland in order to produce
a build that has only the minimal plugin available.

This prevents "useless" builds from being accidentally created.

Change-Id: If2f7f516a52b75998f3ae7bf802f89f93f6e8218
Reviewed-on: http://codereview.qt-project.org/6005
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
configure

index a0ef3f9..2bb15c3 100755 (executable)
--- a/configure
+++ b/configure
@@ -6254,6 +6254,10 @@ if [ "$PLATFORM_QPA" = "yes" ]; then
 
     fi
 
+    # Save these for a check later
+    ORIG_CFG_WAYLAND="$CFG_WAYLAND"
+    ORIG_CFG_XCB="$CFG_XCB"
+
     if [ "$CFG_WAYLAND" != "no" ]; then
         if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists wayland-client 2>/dev/null; then
             QMAKE_CFLAGS_WAYLAND=`$PKG_CONFIG --cflags wayland-client 2>/dev/null`
@@ -6341,6 +6345,18 @@ if [ "$PLATFORM_QPA" = "yes" ]; then
         QMakeVar add DEFINES QT_NO_CORESERVICES
     fi
 
+    if [ "$PLATFORM_QPA" = "yes" ] && [ "$BUILD_ON_MAC" = "no" ]; then
+        if [ "$CFG_XCB" = "no" ] && [ "$CFG_WAYLAND" = "no" ]; then
+            if [ "$ORIG_CFG_XCB" = "auto" ] && [ "$ORIG_CFG_WAYLAND" = "auto" ]; then
+                echo "No QPA platform plugin enabled!"
+                echo " If you really want to build without a QPA platform plugin you must pass"
+                echo " -no-xcb and -no-wayland to configure. Doing this will produce a Qt that"
+                echo " cannot run GUI applications."
+                exit 1
+            fi
+        fi
+    fi
+
 fi