[Libva] [Libva-intel-driver][PATCH] Don't check WAYLAND_SCANNER if wayland isn't used or found

Xiang, Haihao haihao.xiang at intel.com
Wed May 4 17:48:35 UTC 2016


checking for WAYLAND... no
checking for LIBVA_WAYLAND_DEPS... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for WAYLAND_SCANNER... no
configure: error: Package requirements (wayland-scanner) were not met:

No package 'wayland-scanner' found

Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
---
 configure.ac                      | 19 +++++++++++--------
 src/Makefile.am                   |  7 +++++--
 src/{wayland => }/wayland-drm.xml |  0
 src/wayland/Makefile.am           | 28 ----------------------------
 4 files changed, 16 insertions(+), 38 deletions(-)
 rename src/{wayland => }/wayland-drm.xml (100%)
 delete mode 100644 src/wayland/Makefile.am

diff --git a/configure.ac b/configure.ac
index c32d579..a6ce360 100644
--- a/configure.ac
+++ b/configure.ac
@@ -173,17 +173,21 @@ AM_CONDITIONAL(USE_EGL, test "$USE_EGL" = "yes")
 # Check for Wayland
 USE_WAYLAND="no"
 if test "$enable_wayland" = "yes"; then
-    PKG_CHECK_MODULES([WAYLAND], [wayland-client], [USE_WAYLAND="yes"], [:])
     PKG_CHECK_MODULES([LIBVA_WAYLAND_DEPS], [libva-wayland],
-        [AC_DEFINE([HAVE_VA_WAYLAND], [1], [Defined to 1 if VA/Wayland API is enabled])],
-        [USE_WAYLAND="no"])
+        [USE_WAYLAND="yes"], [:])
+
+    if test "$USE_WAYLAND" = "yes"; then
+
+        WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
+        AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
+                     [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
+
+        AC_DEFINE([HAVE_VA_WAYLAND], [1],
+                  [Defined to 1 if VA/Wayland API is enabled])
+    fi
 fi
 AM_CONDITIONAL(USE_WAYLAND, test "$USE_WAYLAND" = "yes")
 
-m4_ifdef([WAYLAND_SCANNER_RULES],
-    [WAYLAND_SCANNER_RULES(['$(top_builddir)/src/wayland'])],
-    [wayland_scanner_rules=""; AC_SUBST(wayland_scanner_rules)])
-
 AC_OUTPUT([
     Makefile
     debian.upstream/Makefile 
@@ -203,7 +207,6 @@ AC_OUTPUT([
     src/shaders/render/Makefile
     src/shaders/utils/Makefile
     src/shaders/vme/Makefile
-    src/wayland/Makefile
 ])
 
 dnl Print summary
diff --git a/src/Makefile.am b/src/Makefile.am
index ad96102..8d1fc25 100755
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -199,9 +199,12 @@ EXTRA_DIST	+= Android.mk intel_version.h.in $(PKG_VERSION_FILE)
 # Wayland protocol
 protocol_source_h = wayland-drm-client-protocol.h
 i965_output_wayland.c: $(protocol_source_h)
- at wayland_scanner_rules@
+%-client-protocol.h : %.xml
+	$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
 
-DIST_SUBDIRS	+= wayland
+EXTRA_DIST += \
+	wayland-drm.xml         \
+	$(NULL)
 
 # Extra clean files so that maintainer-clean removes *everything*
 MAINTAINERCLEANFILES = Makefile.in config.h.in
diff --git a/src/wayland/wayland-drm.xml b/src/wayland-drm.xml
similarity index 100%
rename from src/wayland/wayland-drm.xml
rename to src/wayland-drm.xml
diff --git a/src/wayland/Makefile.am b/src/wayland/Makefile.am
deleted file mode 100644
index 614d8a4..0000000
--- a/src/wayland/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2012 Intel Corporation. All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sub license, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-# 
-# The above copyright notice and this permission notice (including the
-# next paragraph) shall be included in all copies or substantial portions
-# of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-EXTRA_DIST = \
-	wayland-drm.xml		\
-	$(NULL)
-
-# Extra clean files so that maintainer-clean removes *everything*
-MAINTAINERCLEANFILES = Makefile.in
-- 
1.9.1



More information about the Libva mailing list