[Mesa-dev] Build fails without X11 present

Burton, Ross ross.burton at intel.com
Wed Jun 26 09:26:14 PDT 2013


Hi,

I'm routinely building Mesa and Weston in an environment without X11,
and currently both Mesa and Weston are failing to build for the same
reason: eglplatform.h is attempting to include X11/Xlib.h.

There was a patch last year that attempted to solve the Mesa part of this:

http://lists.freedesktop.org/archives/mesa-dev/2012-February/019554.html
(follow-up thread at
http://lists.freedesktop.org/archives/mesa-dev/2012-March/019640.html)

It had outstanding feedback and doesn't apply to master, but something
like this handles the feedback and appears to work:

--- a/configure.ac
+++ b/configure.ac
@@ -1486,6 +1486,10 @@ AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo
"$egl_platforms" | grep 'null' >/dev
 AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
 AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")

+if ! echo "$egl_platforms" | grep -q 'x11'; then
+       DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
+fi
+

--- a/include/EGL/eglplatform.h
+++ b/include/EGL/eglplatform.h
@@ -109,8 +109,8 @@ typedef void                        *EGLNativeDisplayType;
 #ifdef MESA_EGL_NO_X11_HEADERS

 typedef void            *EGLNativeDisplayType;
-typedef khronos_uint32_t EGLNativePixmapType;
-typedef khronos_uint32_t EGLNativeWindowType;
+typedef khronos_uintptr_t EGLNativePixmapType;
+typedef khronos_uintptr_t EGLNativeWindowType;

That is, if we don't have the X11 EGL platform, when compiling Mesa
itself set MESA_EGL_NO_X11_HEADERS.  The generic types are changed
from uint32 to pointers because as Chad pointed out[1] on 64-bit
systems you'll get different pointer sizes.  If this looks right I can
send a proper patch, but I'm no expert on the details of Mesa's insane
configure.ac so this may be missing some details I'm not seeing.

Cheers,
Ross

[1] http://lists.freedesktop.org/archives/mesa-dev/2012-March/019726.html


More information about the mesa-dev mailing list