[Mesa-maintainers] [PATCH 06/28] configure: rename --with-{egl-, }platforms

Emil Velikov emil.l.velikov at gmail.com
Thu Dec 8 19:21:46 UTC 2016


From: Emil Velikov <emil.velikov at collabora.com>

Since day 1, Vulkan has depended on --with-egl-platforms to select the
platforms build.

With earlier commits, we've attributed for that internally by renaming
the [internal] conditionals in our build. At the same time having the
--enable-egl and --with-egl-platforms dependency for Vulkan makes no
sense.

Since where' on the bridge we want to make the conditional generic, thus
others (such as the gallium VL targets) can honour the respective
platforms.

Cc: mesa-maintainers at lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
Should we keep the old configure and error out when anyone provides a
non-default value ? This way they'll have direct feedback how to move
forward. Otherwise they'll likely miss the warning message.
---
 .travis.yml               |  2 +-
 Makefile.am               |  2 +-
 configure.ac              | 66 +++++++++++++++++++++++------------------------
 docs/egl.html             | 12 ++++-----
 src/egl/main/egldisplay.c |  2 +-
 5 files changed, 41 insertions(+), 43 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 4e4c53a..7a5a318 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -91,7 +91,7 @@ install:
 script:
   - if test "x$BUILD" = xmake; then
       ./autogen.sh --enable-debug
-        --with-egl-platforms=x11,drm
+        --with-platforms=x11,drm
         --with-dri-drivers=i915,i965,radeon,r200,swrast,nouveau
         --with-gallium-drivers=svga,swrast,vc4,virgl,r300,r600
         --disable-llvm-shared-libs
diff --git a/Makefile.am b/Makefile.am
index e6d1969..165f9d2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,7 +41,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
 	--enable-xa \
 	--enable-xvmc \
 	--disable-llvm-shared-libs \
-	--with-egl-platforms=x11,wayland,drm,surfaceless \
+	--with-platforms=x11,wayland,drm,surfaceless \
 	--with-dri-drivers=i915,i965,nouveau,radeon,r200,swrast \
 	--with-gallium-drivers=i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl,swr \
 	--with-vulkan-drivers=intel,radeon
diff --git a/configure.ac b/configure.ac
index 121887a..ed1f96a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2187,22 +2187,18 @@ AC_SUBST([VG_LIB_DEPS])
 AC_SUBST([EGL_CLIENT_APIS])
 
 dnl
-dnl EGL Platforms configuration
-dnl
-AC_ARG_WITH([egl-platforms],
-    [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
-        [comma delimited native platforms libEGL supports, e.g.
-        "x11,drm" @<:@default=auto@:>@])],
-    [with_egl_platforms="$withval"],
-    [if test "x$enable_egl" = xyes; then
-        if test "x$enable_gbm" = xyes; then
-           with_egl_platforms="x11,drm"
-        else
-           with_egl_platforms="x11"
-        fi
-    else
-        with_egl_platforms=""
-    fi])
+dnl EGL/Vulkan/VL Platforms configuration
+dnl
+AC_ARG_WITH([platforms],
+    [AS_HELP_STRING([--with-platforms@<:@=DIRS...@:>@],
+        [comma delimited native platforms libEGL/Vulkan/other supports, e.g.
+        "x11,drm,wayland,surfaceless..." @<:@default=auto@:>@])],
+    [with_platforms="$withval"],
+    [with_platforms="x11"])
+
+if test "x$enable_gbm" = xyes; then
+   with_platforms="$with_platforms,drm"
+fi
 
 PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
         WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`,
@@ -2211,24 +2207,27 @@ if test "x$WAYLAND_SCANNER" = x; then
     AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
 fi
 
-# Do per-EGL platform setups and checks
-egl_platforms=`IFS=', '; echo $with_egl_platforms`
-for plat in $egl_platforms; do
+# Do per platform setups and checks
+platforms=`IFS=', '; echo $with_platforms`
+for plat in $platforms; do
 	case "$plat" in
 	wayland)
-
+		# May not be required in some cases (VL targets), but that's
+		# due to incomplete code.
 		PKG_CHECK_MODULES([WAYLAND], [wayland-client >= $WAYLAND_REQUIRED wayland-server >= $WAYLAND_REQUIRED])
 
 		if test "x$WAYLAND_SCANNER" = x; then
-			AC_MSG_ERROR([wayland-scanner is needed to compile the wayland egl platform])
+			AC_MSG_ERROR([wayland-scanner is needed to compile the wayland platform])
 		fi
 		;;
 
 	x11)
+		# XXX: split and correctly honour DRI2 vs DRI3
 		PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes])
 		;;
 
 	drm)
+		# May not be required for the VL targets.
 		test "x$enable_gbm" = "xno" &&
 			AC_MSG_ERROR([EGL platform drm needs gbm])
 		;;
@@ -2254,25 +2253,25 @@ done
 
 # libEGL wants to default to the first platform specified in
 # ./configure.  parse that here.
-if test "x$egl_platforms" != "x"; then
-    FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr '[[a-z]]' '[[A-Z]]'`
+if test "x$platforms" != "x"; then
+    FIRST_PLATFORM_CAPS=`echo $platforms | sed 's| .*||' | tr '[[a-z]]' '[[A-Z]]'`
     EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
 else
     EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
 fi
 
-AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$egl_platforms" | grep -q 'x11')
-AM_CONDITIONAL(HAVE_PLATFORM_WAYLAND, echo "$egl_platforms" | grep -q 'wayland')
-AM_CONDITIONAL(HAVE_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm')
-AM_CONDITIONAL(HAVE_PLATFORM_SURFACELESS, echo "$egl_platforms" | grep -q 'surfaceless')
-AM_CONDITIONAL(HAVE_PLATFORM_ANDROID, echo "$egl_platforms" | grep -q 'android')
+AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$platforms" | grep -q 'x11')
+AM_CONDITIONAL(HAVE_PLATFORM_WAYLAND, echo "$platforms" | grep -q 'wayland')
+AM_CONDITIONAL(HAVE_PLATFORM_DRM, echo "$platforms" | grep -q 'drm')
+AM_CONDITIONAL(HAVE_PLATFORM_SURFACELESS, echo "$platforms" | grep -q 'surfaceless')
+AM_CONDITIONAL(HAVE_PLATFORM_ANDROID, echo "$platforms" | grep -q 'android')
 
 AC_SUBST([EGL_NATIVE_PLATFORM])
 AC_SUBST([EGL_CFLAGS])
 
 # If we don't have the X11 platform, set this define so we don't try to include
 # the X11 headers.
-if ! echo "$egl_platforms" | grep -q 'x11'; then
+if ! echo "$platforms" | grep -q 'x11'; then
     DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
     GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
 fi
@@ -2357,13 +2356,13 @@ dnl DRM is needed by X, Wayland, and offscreen rendering.
 dnl Surfaceless is an alternative for the last one.
 dnl
 require_basic_egl() {
-    case "$with_egl_platforms" in
+    case "$with_platforms" in
         *drm*|*surfaceless*)
             ;;
         *)
             AC_MSG_ERROR([$1 requires one of these:
-                  1) --with-egl-platforms=drm (X, Wayland, offscreen rendering based on DRM)
-                  2) --with-egl-platforms=surfaceless (offscreen only)
+                  1) --with-platforms=drm (X, Wayland, offscreen rendering based on DRM)
+                  2) --with-platforms=surfaceless (offscreen only)
                   Recommended options: drm,x11])
             ;;
     esac
@@ -2884,7 +2883,6 @@ dnl EGL
 echo ""
 echo "        EGL:             $enable_egl"
 if test "$enable_egl" = yes; then
-    echo "        EGL platforms:   $egl_platforms"
 
     egl_drivers=""
     if test "x$enable_dri" != "xno"; then
@@ -2902,6 +2900,8 @@ else
     echo "        GBM:             no"
 fi
 
+echo "        EGL/Vulkan/VL platforms:   $platforms"
+
 # Vulkan
 echo ""
 if test "x$VULKAN_DRIVERS" != x; then
diff --git a/docs/egl.html b/docs/egl.html
index fb94f8c..a50f859 100644
--- a/docs/egl.html
+++ b/docs/egl.html
@@ -77,15 +77,13 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
 
 </dd>
 
-<dt><code>--with-egl-platforms</code></dt>
+<dt><code>--with-platforms</code></dt>
 <dd>
 
 <p>List the platforms (window systems) to support.  Its argument is a comma
-separated string such as <code>--with-egl-platforms=x11,drm</code>.  It decides
+separated string such as <code>--with-platforms=x11,drm</code>.  It decides
 the platforms a driver may support.  The first listed platform is also used by
-the main library to decide the native platform: the platform the EGL native
-types such as <code>EGLNativeDisplayType</code> or
-<code>EGLNativeWindowType</code> defined for.</p>
+the main library to decide the native platform.</p>
 
 <p>The available platforms are <code>x11</code>, <code>drm</code>,
 <code>wayland</code>, <code>surfaceless</code>, <code>android</code>,
@@ -167,9 +165,9 @@ binaries.</p>
 <dd>
 
 <p>This variable specifies the native platform.  The valid values are the same
-as those for <code>--with-egl-platforms</code>.  When the variable is not set,
+as those for <code>--with-platforms</code>.  When the variable is not set,
 the main library uses the first platform listed in
-<code>--with-egl-platforms</code> as the native platform.</p>
+<code>--with-platforms</code> as the native platform.</p>
 
 <p>Extensions like <code>EGL_MESA_drm_display</code> define new functions to
 create displays for non-native platforms.  These extensions are usually used by
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index 37711bd..1d724b4 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -61,7 +61,7 @@
 
 
 /**
- * Map --with-egl-platforms names to platform types.
+ * Map --with-platforms names to platform types.
  */
 static const struct {
    _EGLPlatformType platform;
-- 
2.10.2



More information about the Mesa-maintainers mailing list