From 21bd66e1ea06e466754ab06ee2c5f8b737bb4bd7 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 29 Oct 2012 12:59:09 +0100 Subject: Add configure option to minimize xcb runtime dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some of the xcb- libraries we depend upon are not (yet) common across distributions. This is problematic for binaries that should be working on different distributions. The patch mitigates this by: Adding the files from libxcb-proto (version 0.1.6), compiled with libxcb-1.5 xcb-util (version 0.3.9) xcb-util-image (version 0.3.9) xcb-util-keysyms (version 0.3.9) xcb-util-renderutil (version 0.3.8) xcb-util-wm (version 0.3.9) from xcb.freedesktop.org/dist to src/3rdparty/xcb. Adding a configure option '-qt-xcb' to use the sources instead of linking to the respective runtime libraries. Task-number: QTBUG-27803 Change-Id: I6ea87daa382871b2b9072a601511523fa0b9f44b Reviewed-by: Samuel Rødal --- config.tests/qpa/xcb-syslibs/xcb-syslibs.pro | 5 +++ config.tests/qpa/xcb-syslibs/xcb.cpp | 66 ++++++++++++++++++++++++++++ config.tests/qpa/xcb/xcb.cpp | 19 +------- config.tests/qpa/xcb/xcb.pro | 2 +- 4 files changed, 73 insertions(+), 19 deletions(-) create mode 100644 config.tests/qpa/xcb-syslibs/xcb-syslibs.pro create mode 100644 config.tests/qpa/xcb-syslibs/xcb.cpp (limited to 'config.tests/qpa') diff --git a/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro b/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro new file mode 100644 index 0000000000..23eedb03a7 --- /dev/null +++ b/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro @@ -0,0 +1,5 @@ +SOURCES = xcb.cpp +CONFIG -= qt + +LIBS += -lxcb -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-randr + diff --git a/config.tests/qpa/xcb-syslibs/xcb.cpp b/config.tests/qpa/xcb-syslibs/xcb.cpp new file mode 100644 index 0000000000..0a59ba708f --- /dev/null +++ b/config.tests/qpa/xcb-syslibs/xcb.cpp @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia 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. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +// FIXME This workaround can be removed for xcb-icccm > 3.8 +#define class class_name +#include +#undef class + +#include +#include +#include +#include +#include +#include + +int main(int, char **) +{ + int primaryScreen = 0; + + xcb_connection_t *connection = xcb_connect("", &primaryScreen); + + // This won't compile unless libxcb >= 1.5 which defines XCB_ATOM_PRIMARY. + int xcbAtomPrimary = XCB_ATOM_PRIMARY; + + return 0; +} diff --git a/config.tests/qpa/xcb/xcb.cpp b/config.tests/qpa/xcb/xcb.cpp index 0a59ba708f..8f46e4c5d0 100644 --- a/config.tests/qpa/xcb/xcb.cpp +++ b/config.tests/qpa/xcb/xcb.cpp @@ -41,26 +41,9 @@ #include -// FIXME This workaround can be removed for xcb-icccm > 3.8 -#define class class_name -#include -#undef class - -#include -#include -#include -#include -#include -#include - int main(int, char **) { int primaryScreen = 0; - - xcb_connection_t *connection = xcb_connect("", &primaryScreen); - - // This won't compile unless libxcb >= 1.5 which defines XCB_ATOM_PRIMARY. - int xcbAtomPrimary = XCB_ATOM_PRIMARY; - + xcb_connection_t *t = xcb_connect("", &primaryScreen); return 0; } diff --git a/config.tests/qpa/xcb/xcb.pro b/config.tests/qpa/xcb/xcb.pro index 23eedb03a7..a48fdbd15f 100644 --- a/config.tests/qpa/xcb/xcb.pro +++ b/config.tests/qpa/xcb/xcb.pro @@ -1,5 +1,5 @@ SOURCES = xcb.cpp CONFIG -= qt -LIBS += -lxcb -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-randr +LIBS += -lxcb -- cgit v1.2.3