summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2010-07-28 13:24:07 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-07-28 13:24:07 -0700
commite97249a8bf95cc9e1aa209154dd5210071ffaaf2 (patch)
tree007252334cfdbe1af3b9580799005a82a41df534
parent1ee62399625bedf4fe48151f8ba01e2549981a0a (diff)
Wayland: fix up the build some more
Make Wayland into a more proper platform target: - fix configure to set PLATFORM - move mkspec files to the right location - fix up qmake.conf and qplatformdefs.h for path changes - move stuff into wayland.conf from linux.conf - fix io.pri to include linux files for wayland And fix eglGetDRMDisplayMESA usage in light of recent Mesa commits.
-rwxr-xr-xconfigure1
-rw-r--r--mkspecs/common/linux.conf2
-rw-r--r--mkspecs/common/wayland.conf2
-rw-r--r--mkspecs/wayland/linux-generic-g++/qmake.conf9
-rw-r--r--mkspecs/wayland/linux-generic-g++/qplatformdefs.h1
-rw-r--r--mkspecs/wayland/qmake.conf21
-rw-r--r--mkspecs/wayland/qplatformdefs.h1
-rw-r--r--src/corelib/io/io.pri2
-rw-r--r--src/gui/kernel/qapplication_wayland.cpp10
-rw-r--r--src/gui/kernel/qt_wayland_p.h1
10 files changed, 28 insertions, 22 deletions
diff --git a/configure b/configure
index 6da61e7f9c..10dcadebef 100755
--- a/configure
+++ b/configure
@@ -1315,6 +1315,7 @@ while [ "$#" -gt 0 ]; do
wayland)
# Wayland needs EGL and GLES2
PLATFORM_WAYLAND=yes
+ PLATFORM=wayland
CFG_GRAPHICS_SYSTEM=opengl
CFG_OPENGL=es2
CFG_EGL=yes
diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf
index e4f1067d1f..f7a5bc3a91 100644
--- a/mkspecs/common/linux.conf
+++ b/mkspecs/common/linux.conf
@@ -9,8 +9,6 @@ QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 = /usr/X11R6/include
QMAKE_LIBDIR_X11 = /usr/X11R6/lib
-QMAKE_INCDIR_WAYLAND = /usr/include
-QMAKE_LIBDIR_WAYLAND = /usr/lib
QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
QMAKE_INCDIR_OPENGL = /usr/X11R6/include
diff --git a/mkspecs/common/wayland.conf b/mkspecs/common/wayland.conf
index adb658f6ef..e13be210ff 100644
--- a/mkspecs/common/wayland.conf
+++ b/mkspecs/common/wayland.conf
@@ -4,4 +4,4 @@ TEMPLATE = app
CONFIG += qt warn_on release incremental link_prl opengl
QT += core gui network
QMAKE_INCREMENTAL_STYLE = sublib
-LIBS += -lwayland
+QMAKE_LIBS_WAYLAND = -lwayland
diff --git a/mkspecs/wayland/linux-generic-g++/qmake.conf b/mkspecs/wayland/linux-generic-g++/qmake.conf
deleted file mode 100644
index 0fe09a3a52..0000000000
--- a/mkspecs/wayland/linux-generic-g++/qmake.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# qmake configuration for building with g++
-#
-
-include(../../common/g++.conf)
-include(../../common/linux.conf)
-include(../../common/wayland.conf)
-
-load(qt_config)
diff --git a/mkspecs/wayland/linux-generic-g++/qplatformdefs.h b/mkspecs/wayland/linux-generic-g++/qplatformdefs.h
deleted file mode 100644
index 99e9a27923..0000000000
--- a/mkspecs/wayland/linux-generic-g++/qplatformdefs.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../linux-g++/qplatformdefs.h"
diff --git a/mkspecs/wayland/qmake.conf b/mkspecs/wayland/qmake.conf
new file mode 100644
index 0000000000..8ed5906961
--- /dev/null
+++ b/mkspecs/wayland/qmake.conf
@@ -0,0 +1,21 @@
+#
+# qmake configuration for building with g++
+#
+
+QMAKE_CFLAGS += -DMESA_EGL_NO_X11_HEADERS
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS
+
+include(../common/g++.conf)
+include(../common/linux.conf)
+include(../common/wayland.conf)
+
+QMAKE_INCDIR_WAYLAND = /opt/gfx-test/include
+QMAKE_LIBDIR_WAYLAND = /opt/gfx-test/lib
+QMAKE_INCDIR_OPENGL_ES2=/opt/gfx-test/include
+QMAKE_LIBDIR_OPENGL_ES2=/opt/gfx-test/lib
+QMAKE_LIBS_OPENGL_ES2=-lGLESv2
+QMAKE_INCDIR_OPENGL=/opt/gfx-test/include
+QMAKE_LIBDIR_OPENGL=/opt/gfx-test/lib
+QMAKE_LIBS_OPENGL=-lGLESv2
+
+load(qt_config)
diff --git a/mkspecs/wayland/qplatformdefs.h b/mkspecs/wayland/qplatformdefs.h
new file mode 100644
index 0000000000..5d22fb4101
--- /dev/null
+++ b/mkspecs/wayland/qplatformdefs.h
@@ -0,0 +1 @@
+#include "../linux-g++/qplatformdefs.h"
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index ef448b1d7e..f2671fe516 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -74,7 +74,7 @@ win32 {
SOURCES += io/qsettings_mac.cpp io/qfilesystemwatcher_fsevents.cpp
}
- linux-*:!symbian {
+ wayland|linux-*:!symbian {
SOURCES += \
io/qfilesystemwatcher_inotify.cpp \
io/qfilesystemwatcher_dnotify.cpp
diff --git a/src/gui/kernel/qapplication_wayland.cpp b/src/gui/kernel/qapplication_wayland.cpp
index 5101d27fa9..d18f9af2c2 100644
--- a/src/gui/kernel/qapplication_wayland.cpp
+++ b/src/gui/kernel/qapplication_wayland.cpp
@@ -119,7 +119,6 @@ void QApplicationPrivate::initializeWidgetPaletteHash()
void qt_init(QApplicationPrivate *priv, int type)
{
- PFNEGLGETTYPEDDISPLAYMESA get_typed_display_mesa;
EGLint major, minor, count;
EGLDisplay dpy;
EGLContext ctx;
@@ -146,18 +145,13 @@ void qt_init(QApplicationPrivate *priv, int type)
// FIXME: share compositor connection across threads
- get_typed_display_mesa =
- (PFNEGLGETTYPEDDISPLAYMESA)eglGetProcAddress("eglGetTypedDisplayMESA");
- if (!get_typed_display_mesa)
- qFatal("failed to find MESA_get_typed_display extension\n");
-
fd = open(dri_device, O_RDWR);
if (fd < 0) {
qFatal("failed to open DRI device: %s\n", strerror(errno));
return;
}
- dpy = get_typed_display_mesa(EGL_DRM_DISPLAY_TYPE_MESA, (void *) fd);
+ dpy = eglGetDRMDisplayMESA(fd);
if (!dpy) {
close(fd);
qFatal("failed to get DRM display\n");
@@ -171,7 +165,7 @@ void qt_init(QApplicationPrivate *priv, int type)
if (!eglChooseConfig(dpy, config_attribs, &config, 1, &count) ||
count == 0) {
close(fd);
- qFatal("failed to choose EGL config\n");
+ qFatal("failed to choose EGL config, config count %d\n", count);
}
eglBindAPI(EGL_OPENGL_ES_API);
diff --git a/src/gui/kernel/qt_wayland_p.h b/src/gui/kernel/qt_wayland_p.h
index d1d26692b1..f4e87eb559 100644
--- a/src/gui/kernel/qt_wayland_p.h
+++ b/src/gui/kernel/qt_wayland_p.h
@@ -5,6 +5,7 @@ extern "C" {
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <EGL/egl.h>
+#define EGL_EGLEXT_PROTOTYPES
#include <EGL/eglext.h>
#include <glib.h>
#include <glib-object.h>