--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <stdlib.h>
+extern "C" {
+#include <gbm.h>
+#include <xf86drmMode.h>
+#include <xf86drm.h>
+}
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+
+int main(int, char **)
+{
+ // Check for gbm_surface which is quite a recent addition.
+ gbm_surface *surface = 0;
+ return 0;
+}
CFG_EGLFS=auto
CFG_DIRECTFB=auto
CFG_LINUXFB=auto
+CFG_KMS=auto
CFG_LIBUDEV=auto
CFG_OBSOLETE_WAYLAND=no
CFG_EVDEV=auto
UNKNOWN_OPT=yes
fi
;;
+ kms)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ CFG_KMS="$VAL"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
libudev)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_LIBUDEV="$VAL"
LFBN=" "
fi
+ if [ "$CFG_KMS" = "no" ]; then
+ KMSY=" "
+ KMSN="*"
+ else
+ KMSY="*"
+ KMSN=" "
+ fi
+
if [ "$CFG_XINPUT2" = "no" ]; then
X2Y=" "
X2N="*"
$LFBN -no-linuxfb ........ Do not compile Linux Framebuffer support.
$LFBY -linuxfb ........... Compile Linux Framebuffer support.
+ $KMSN -no-kms ............ Do not compile KMS support.
+ $KMSY -kms ............... Compile KMS support (Requires EGL and OpenGL ES 2 support).
+
-qpa <name> ......... Sets the default QPA platform (e.g xcb, cocoa, windows).
-xplatform target ... The target platform when cross-compiling.
CFG_EGL=yes
fi
+if [ "$CFG_KMS" = "yes" ]; then
+ if [ "$CFG_EGL" = "no" ]; then
+ echo "The KMS plugin requires EGL support and cannot be built"
+ exit 101
+ fi
+ if [ "$CFG_OPENGL" != "es2" ]; then
+ echo "The KMS plugin requires OpenGL ES 2 support and cannot be built"
+ exit 101
+ fi
+fi
+
# auto-detect SQL-modules support
for _SQLDR in $CFG_SQL_AVAILABLE; do
case $_SQLDR in
ORIG_CFG_EGLFS="$CFG_EGLFS"
ORIG_CFG_DIRECTFB="$CFG_DIRECTFB"
ORIG_CFG_LINUXFB="$CFG_LINUXFB"
+ORIG_CFG_KMS="$CFG_KMS"
if [ "$CFG_LIBUDEV" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then
fi
fi
+if [ "$CFG_KMS" != "no" ]; then
+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/qpa/kms" "KMS" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
+ CFG_KMS=yes
+ elif [ "$CFG_KMS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+ echo " KMS support cannot be enabled due to functionality tests!"
+ 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
+ else
+ CFG_KMS=no
+ fi
+fi
+
# Detect libxkbcommon
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists xkbcommon 2>/dev/null; then
QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`"
fi
fi
+if [ "$CFG_KMS" = "yes" ]; then
+ if [ "$CFG_OPENGL" = "es2" ] && [ "$CFG_EGL" = "yes" ]; then
+ CFG_KMS="yes"
+ else
+ CFG_KMS="no"
+ fi
+fi
+
# Determine the default QPA platform
if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then
# check the mkspec
if [ "$CFG_LINUXFB" = "yes" ]; then
QT_CONFIG="$QT_CONFIG linuxfb"
fi
+if [ "$CFG_KMS" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG kms"
+fi
if [ "$BUILD_ON_MAC" = "yes" ]; then
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
fi
if [ "$BUILD_ON_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ] && [ "$XPLATFORM_QNX" = "no" ]; then
- if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ]; then
+ if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ] && [ "$CFG_KMS" = "no" ]; then
if [ "$QPA_PLATFORM_GUARD" = "yes" ] &&
- ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "auto" ] ); then
+ ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "auto" ] || [ "$ORIG_CFG_KMS" = "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-qpa-platform-guard to configure. Doing this will"
echo "EGLFS support .......... $CFG_EGLFS"
echo "DirectFB support ....... $CFG_DIRECTFB"
echo "LinuxFB support ........ $CFG_LINUXFB"
+echo "KMS support ............ $CFG_KMS"
echo
# complain about not being able to use dynamic plugins if we are using a static build