[Mesa-dev] [PATCH 3/3] autoconf: do not use the deprecated wayland-scanner "code"

Emil Velikov emil.l.velikov at gmail.com
Thu Jun 28 14:35:46 UTC 2018


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

With version v1.15 the "code" option was deprecated in favour of
"private-code" or "public-code".

Before the interface symbol generated was exported (which is a bad idea
since it's internal implementation detail) and others may misuse it.

That was the case with libva approx. 1 year. Since then libva was fixed,
so we can finally hide it by using "private-code"

Inspired by similar xserver patch by Adam Jackson.

Cc: Dylan Baker <dylan at pnwbakers.com>
Cc: Eric Engestrom <eric at engestrom.ch>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 configure.ac                            | 4 ++++
 src/egl/Makefile.am                     | 2 +-
 src/egl/wayland/wayland-drm/Makefile.am | 2 +-
 src/vulkan/Makefile.am                  | 4 ++--
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 502b1787c62..755c06bf867 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1809,6 +1809,10 @@ for plat in $platforms; do
         PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
                           WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`,
                           WAYLAND_SCANNER='')
+        PKG_CHECK_EXISTS([wayland-scanner >= 1.15],
+                          AC_SUBST(SCANNER_ARG, 'private-code'),
+                          AC_SUBST(SCANNER_ARG, 'code'))
+
         if test "x$WAYLAND_SCANNER" = x; then
             AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
         fi
diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
index be3547d968f..5d7a208825c 100644
--- a/src/egl/Makefile.am
+++ b/src/egl/Makefile.am
@@ -71,7 +71,7 @@ WL_DMABUF_XML = $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-
 
 drivers/dri2/linux-dmabuf-unstable-v1-protocol.c: $(WL_DMABUF_XML)
 	$(MKDIR_GEN)
-	$(AM_V_GEN)$(WAYLAND_SCANNER) code $< $@
+	$(AM_V_GEN)$(WAYLAND_SCANNER) $(SCANNER_ARG) $< $@
 
 drivers/dri2/linux-dmabuf-unstable-v1-client-protocol.h: $(WL_DMABUF_XML)
 	$(MKDIR_GEN)
diff --git a/src/egl/wayland/wayland-drm/Makefile.am b/src/egl/wayland/wayland-drm/Makefile.am
index 0404c79e7fa..40174c6acdd 100644
--- a/src/egl/wayland/wayland-drm/Makefile.am
+++ b/src/egl/wayland/wayland-drm/Makefile.am
@@ -28,7 +28,7 @@ CLEANFILES = \
 	wayland-drm-server-protocol.h
 
 %-protocol.c : %.xml
-	$(AM_V_GEN)$(WAYLAND_SCANNER) code $< $@
+	$(AM_V_GEN)$(WAYLAND_SCANNER) $(SCANNER_ARG) $< $@
 
 %-server-protocol.h : %.xml
 	$(AM_V_GEN)$(WAYLAND_SCANNER) server-header $< $@
diff --git a/src/vulkan/Makefile.am b/src/vulkan/Makefile.am
index ce1a79d0c48..db3831229e9 100644
--- a/src/vulkan/Makefile.am
+++ b/src/vulkan/Makefile.am
@@ -76,7 +76,7 @@ WL_DRM_XML = $(top_srcdir)/src/egl/wayland/wayland-drm/wayland-drm.xml
 
 wsi/wayland-drm-protocol.c : $(WL_DRM_XML)
 	$(MKDIR_GEN)
-	$(AM_V_GEN)$(WAYLAND_SCANNER) code $< $@
+	$(AM_V_GEN)$(WAYLAND_SCANNER) $(SCANNER_ARG) $< $@
 
 wsi/wayland-drm-client-protocol.h : $(WL_DRM_XML)
 	$(MKDIR_GEN)
@@ -86,7 +86,7 @@ WL_DMABUF_XML = $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-
 
 wsi/linux-dmabuf-unstable-v1-protocol.c : $(WL_DMABUF_XML)
 	$(MKDIR_GEN)
-	$(AM_V_GEN)$(WAYLAND_SCANNER) code $< $@
+	$(AM_V_GEN)$(WAYLAND_SCANNER) $(SCANNER_ARG) $< $@
 
 wsi/linux-dmabuf-unstable-v1-client-protocol.h : $(WL_DMABUF_XML)
 	$(MKDIR_GEN)
-- 
2.18.0



More information about the mesa-dev mailing list