From 683540ee5a36f8208925a1921ce26639ca129a2c Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 3 Jul 2012 03:00:41 +0530 Subject: linuxfb: Add config.test and configure support The code is exactly the same as what is already done for DirectFB. Change-Id: I3b84e67a3e999f692da4110f3ac9c82d98b0637c Reviewed-by: Oswald Buddenhagen Reviewed-by: Gunnar Sletta Reviewed-by: Girish Ramakrishnan --- config.tests/qpa/linuxfb/linuxfb.cpp | 55 ++++++++++++++++++++++++++++++++++++ config.tests/qpa/linuxfb/linuxfb.pro | 3 ++ configure | 43 ++++++++++++++++++++++++++-- src/plugins/platforms/platforms.pro | 2 ++ 4 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 config.tests/qpa/linuxfb/linuxfb.cpp create mode 100644 config.tests/qpa/linuxfb/linuxfb.pro diff --git a/config.tests/qpa/linuxfb/linuxfb.cpp b/config.tests/qpa/linuxfb/linuxfb.cpp new file mode 100644 index 0000000000..bfc78dce5f --- /dev/null +++ b/config.tests/qpa/linuxfb/linuxfb.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** 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 +#include + +int main(int, char **) +{ + fb_fix_screeninfo finfo; + fb_var_screeninfo vinfo; + + int fd = 3; + ioctl(fd, FBIOGET_FSCREENINFO, &finfo); + ioctl(fd, FBIOGET_VSCREENINFO, &vinfo); + + return 0; +} diff --git a/config.tests/qpa/linuxfb/linuxfb.pro b/config.tests/qpa/linuxfb/linuxfb.pro new file mode 100644 index 0000000000..45db4b78dd --- /dev/null +++ b/config.tests/qpa/linuxfb/linuxfb.pro @@ -0,0 +1,3 @@ +SOURCES = linuxfb.cpp + +CONFIG -= qt diff --git a/configure b/configure index 6054437a5b..5f118ee2cc 100755 --- a/configure +++ b/configure @@ -747,6 +747,7 @@ CFG_XCB=auto CFG_XCB_LIMITED=yes CFG_EGLFS=auto CFG_DIRECTFB=auto +CFG_LINUXFB=auto CFG_LIBUDEV=auto CFG_OBSOLETE_WAYLAND=no CFG_EVDEV=auto @@ -1660,6 +1661,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + linuxfb) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_LINUXFB="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; libudev) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_LIBUDEV="$VAL" @@ -2848,6 +2856,15 @@ if [ "$OPT_HELP" = "yes" ]; then DFBY="*" DFBN=" " fi + + if [ "$CFG_LINUXFB" = "no" ]; then + LFBY=" " + LFBN="*" + else + LFBY="*" + LFBN=" " + fi + if [ "$CFG_XINPUT2" = "no" ]; then X2Y=" " X2N="*" @@ -3140,6 +3157,9 @@ Additional options: $DFBN -no-directfb ....... Do not compile DirectFB support. $DFBY -directfb .......... Compile DirectFB support. + $LFBN -no-linuxfb ........ Do not compile Linux Framebuffer support. + $LFBY -linuxfb ........... Compile Linux Framebuffer support. + -qpa ......... Sets the default QPA platform (e.g xcb, cocoa, windows). -xplatform target ... The target platform when cross-compiling. @@ -4592,6 +4612,7 @@ fi ORIG_CFG_XCB="$CFG_XCB" ORIG_CFG_EGLFS="$CFG_EGLFS" ORIG_CFG_DIRECTFB="$CFG_DIRECTFB" +ORIG_CFG_LINUXFB="$CFG_LINUXFB" if [ "$CFG_LIBUDEV" != "no" ]; then if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then @@ -4717,6 +4738,20 @@ if [ "$CFG_DIRECTFB" != "no" ]; then fi fi +if [ "$CFG_LINUXFB" != "no" ]; then + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/qpa/linuxfb" "LinuxFB" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then + CFG_LINUXFB=yes + elif [ "$CFG_LINUXFB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then + echo " Linux Framebuffer 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_LINUXFB=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`" @@ -4790,6 +4825,9 @@ if [ "$CFG_DIRECTFB" = "yes" ]; then QMakeVar set QMAKE_CFLAGS_DIRECTFB "$QMAKE_CFLAGS_DIRECTFB" QMakeVar set QMAKE_LIBS_DIRECTFB "$QMAKE_LIBS_DIRECTFB" fi +if [ "$CFG_LINUXFB" = "yes" ]; then + QT_CONFIG="$QT_CONFIG linuxfb" +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 @@ -4800,9 +4838,9 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then fi if [ "$BUILD_ON_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ] && [ "$XPLATFORM_QNX" = "no" ]; then - if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ]; then + if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ]; then if [ "$QPA_PLATFORM_GUARD" = "yes" ] && - ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] ); then + ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "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" @@ -6093,6 +6131,7 @@ if [ "$XPLATFORM_MAEMO" = "yes" ] && [ "$CFG_XCB" = "yes" ]; then fi echo "EGLFS support .......... $CFG_EGLFS" echo "DirectFB support ....... $CFG_DIRECTFB" +echo "LinuxFB support ........ $CFG_LINUXFB" echo # complain about not being able to use dynamic plugins if we are using a static build diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index 3d3b647ff0..fe3b9d707a 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -22,3 +22,5 @@ contains(QT_CONFIG, eglfs) { contains(QT_CONFIG, directfb) { SUBDIRS += directfb } + +contains(QT_CONFIG, linuxfb): SUBDIRS += linuxfb -- cgit v1.2.3