From a2d3b7c99165cb5c4be6f0dd83a967e1119cf732 Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Thu, 28 Nov 2013 11:06:29 +0100 Subject: [PATCH] Move the glxfbconfig configtest to qpa and rename it to glx We require glx version 1.3 which is where fbconfig is first defined. Also make use of the configure test and report the glx status. GLX support should always take precedence when compiling the xcb backend Change-Id: Ie46834210bf5cd2ac4006ff08379e0d3434ffa2b Reviewed-by: Laszlo Agocs --- .../glxfbconfig.cpp => qpa/glx/glx.cpp} | 1 + .../glxfbconfig.pro => qpa/glx/glx.pro} | 2 +- configure | 59 +++++++++++-------- src/plugins/platforms/xcb/xcb-plugin.pro | 2 +- 4 files changed, 38 insertions(+), 26 deletions(-) rename config.tests/{x11/glxfbconfig/glxfbconfig.cpp => qpa/glx/glx.cpp} (98%) rename config.tests/{x11/glxfbconfig/glxfbconfig.pro => qpa/glx/glx.pro} (84%) diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.cpp b/config.tests/qpa/glx/glx.cpp similarity index 98% rename from config.tests/x11/glxfbconfig/glxfbconfig.cpp rename to config.tests/qpa/glx/glx.cpp index 77bedb41c89..03af3f61312 100644 --- a/config.tests/x11/glxfbconfig/glxfbconfig.cpp +++ b/config.tests/qpa/glx/glx.cpp @@ -44,6 +44,7 @@ int main(int, char **) { + //We require glxfbconfig, ie. glx 1.3 GLXFBConfig config; config = 0; diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.pro b/config.tests/qpa/glx/glx.pro similarity index 84% rename from config.tests/x11/glxfbconfig/glxfbconfig.pro rename to config.tests/qpa/glx/glx.pro index 65f855a5f2d..da51a6d231b 100644 --- a/config.tests/x11/glxfbconfig/glxfbconfig.pro +++ b/config.tests/qpa/glx/glx.pro @@ -1,4 +1,4 @@ -SOURCES = glxfbconfig.cpp +SOURCES = glx.cpp CONFIG += x11 INCLUDEPATH += $$QMAKE_INCDIR_OPENGL diff --git a/configure b/configure index a20fdaa0bc2..3879f6674cf 100755 --- a/configure +++ b/configure @@ -611,6 +611,7 @@ CFG_OPENVG_LC_INCLUDES=no CFG_OPENVG_SHIVA=auto CFG_OPENVG_ON_OPENGL=auto CFG_EGL=auto +CFG_GLX=auto CFG_SSE=auto CFG_FONTCONFIG=auto CFG_FREETYPE=auto @@ -1480,6 +1481,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + glx) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_GLX="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; pch) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_PRECOMPILE="$VAL" @@ -4902,19 +4910,6 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then fi CFG_OPENGL=no fi - case "$PLATFORM" in - hpux*) - # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct. - if [ "$CFG_OPENGL" = "desktop" ]; then - compileTest x11/glxfbconfig "OpenGL" - if [ $? != "0" ]; then - QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT - fi - fi - ;; - *) - ;; - esac elif [ "$CFG_OPENGL" = "es2" ]; then #OpenGL ES 2.x compileTest unix/opengles2 "OpenGL ES 2.x" @@ -4935,17 +4930,6 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then echo " ${XQMAKESPEC}." exit 1 fi - case "$PLATFORM" in - hpux*) - # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct. - compileTest x11/glxfbconfig "OpenGL" - if [ $? != "0" ]; then - QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT - fi - ;; - *) - ;; - esac fi fi # X11/MINGW OpenGL @@ -5307,6 +5291,24 @@ if [ "$CFG_EGL" != "no" ]; then fi fi +# GLX Support +if [ "$CFG_GLX" != "no" ]; then + if [ "$CFG_GLX" = "yes" ] && [ "$CFG_OPENGL" = "no" ]; then + echo "GLX support was requested but OpenGL support is disabled." + echo "Either disable GLX support or enable OpenGL support." + exit 101 + fi + if compileTest qpa/glx "GLX"; then + CFG_GLX=yes + elif [ "$CFG_GLX" = "yes" ]; then + echo " The GLX functionality test failed; GLX is required by the xcb plugin to manage contexts & surfaces." + exit 1 + else + CFG_GLX=no + fi +fi + + if [ "$CFG_EGLFS" != "no" ]; then if [ "$XPLATFORM_QNX" = "no" ]; then CFG_EGLFS="$CFG_EGL" @@ -5668,6 +5670,13 @@ else QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL" fi +# enable glx +if [ "$CFG_GLX" = "yes" ]; then + QT_CONFIG="$QT_CONFIG glx" +else + QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLX" +fi + # enable eglfs if [ "$CFG_EGLFS" = "yes" ]; then QT_CONFIG="$QT_CONFIG eglfs" @@ -6699,6 +6708,8 @@ else report_support " pkg-config ............. no" fi report_support " PulseAudio ............." "$CFG_PULSEAUDIO" +report_support " EGL ...................." "$CFG_EGL" +report_support " GLX ...................." "$CFG_GLX" report_support " QPA backends:" report_support " DirectFB ............." "$CFG_DIRECTFB" report_support " EGLFS ................" "$CFG_EGLFS" diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index 8968d020c48..49a1c1b320a 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -81,7 +81,7 @@ contains(QT_CONFIG, xcb-sm) { } contains(QT_CONFIG, opengl) { - contains(QT_CONFIG, xcb-xlib):!contains(QT_CONFIG, opengles2) { + contains(QT_CONFIG, xcb-xlib):contains(QT_CONFIG, glx) { DEFINES += XCB_USE_GLX HEADERS += qglxintegration.h SOURCES += qglxintegration.cpp