[PATCH wayland 2/2] build: Add wayland-scanner.pc.
Daiki Ueno
ueno at gnu.org
Tue Jul 2 02:38:15 PDT 2013
To allow user program to include wayland-scanner.m4 in tarball, move
the path variables from it into wayland-scanner.pc.
---
Makefile.am | 2 +-
configure.ac | 3 ++-
src/Makefile.am | 3 +++
src/wayland-scanner-uninstalled.pc.in | 6 ++++++
src/wayland-scanner.pc.in | 9 +++++++++
wayland-scanner.m4 | 11 +++++++++++
wayland-scanner.m4.in | 16 ----------------
7 files changed, 32 insertions(+), 18 deletions(-)
create mode 100644 src/wayland-scanner-uninstalled.pc.in
create mode 100644 src/wayland-scanner.pc.in
create mode 100644 wayland-scanner.m4
delete mode 100644 wayland-scanner.m4.in
diff --git a/Makefile.am b/Makefile.am
index df6d4b3..ddf39d1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,6 +7,6 @@ SUBDIRS = src protocol $(doc_subdir) tests cursor
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
aclocaldir = $(datadir)/aclocal
-aclocal_DATA = wayland-scanner.m4
+dist_aclocal_DATA = wayland-scanner.m4
dist_pkgdata_DATA = wayland-scanner.mk
diff --git a/configure.ac b/configure.ac
index 7ca70da..72ab1f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,7 +127,6 @@ fi
AM_CONDITIONAL([HAVE_PUBLICAN], [test "x$PUBLICAN" != "x"])
AC_CONFIG_FILES([Makefile
- wayland-scanner.m4
cursor/Makefile
cursor/wayland-cursor.pc
cursor/wayland-cursor-uninstalled.pc
@@ -138,8 +137,10 @@ AC_CONFIG_FILES([Makefile
src/Makefile
src/wayland-server-uninstalled.pc
src/wayland-client-uninstalled.pc
+ src/wayland-scanner-uninstalled.pc
src/wayland-server.pc
src/wayland-client.pc
+ src/wayland-scanner.pc
src/wayland-version.h
protocol/Makefile
tests/Makefile])
diff --git a/src/Makefile.am b/src/Makefile.am
index 4fa7425..4226f63 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -57,6 +57,9 @@ wayland_scanner_SOURCES = \
wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
$(BUILT_SOURCES) : wayland-scanner
+
+scannerpkgconfigdir = $(datadir)/pkgconfig
+scannerpkgconfig_DATA = wayland-scanner.pc
endif
BUILT_SOURCES = \
diff --git a/src/wayland-scanner-uninstalled.pc.in b/src/wayland-scanner-uninstalled.pc.in
new file mode 100644
index 0000000..8dcfef3
--- /dev/null
+++ b/src/wayland-scanner-uninstalled.pc.in
@@ -0,0 +1,6 @@
+pkgdatadir=@abs_top_srcdir@
+wayland_scanner=@abs_builddir@/wayland-scanner
+
+Name: Wayland Scanner
+Description: Wayland scanner (not installed)
+Version: @PACKAGE_VERSION@
diff --git a/src/wayland-scanner.pc.in b/src/wayland-scanner.pc.in
new file mode 100644
index 0000000..7b2a4c9
--- /dev/null
+++ b/src/wayland-scanner.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datarootdir=@datarootdir@
+pkgdatadir=@datadir@/@PACKAGE@
+wayland_scanner=@bindir@/wayland-scanner
+
+Name: Wayland Scanner
+Description: Wayland scanner
+Version: @WAYLAND_VERSION@
diff --git a/wayland-scanner.m4 b/wayland-scanner.m4
new file mode 100644
index 0000000..2b87c5f
--- /dev/null
+++ b/wayland-scanner.m4
@@ -0,0 +1,11 @@
+AC_DEFUN([WAYLAND_SCANNER_RULES], [
+ PKG_PROG_PKG_CONFIG
+
+ wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+ AC_SUBST([wayland_scanner])
+
+ wayland_scanner_rules=`$PKG_CONFIG --variable=pkgdatadir wayland-scanner`/wayland-scanner.mk
+ AC_SUBST_FILE([wayland_scanner_rules])
+
+ AC_SUBST([wayland_protocoldir], [$1])
+])
diff --git a/wayland-scanner.m4.in b/wayland-scanner.m4.in
deleted file mode 100644
index 29bc788..0000000
--- a/wayland-scanner.m4.in
+++ /dev/null
@@ -1,16 +0,0 @@
-AC_DEFUN([WAYLAND_SCANNER_RULES], [
- wayland__prefix=${prefix}
- wayland__exec_prefix=${exec_prefix}
-
- prefix=@prefix@
- exec_prefix=@exec_prefix@
-
- AC_PATH_PROG([wayland_scanner], [wayland-scanner], [/bin/false],
- [@bindir@$PATH_SEPARATOR$PATH])
- AC_SUBST_FILE([wayland_scanner_rules])
- AC_SUBST([wayland_protocoldir], [$1])
- wayland_scanner_rules=@datarootdir@/aclocal/wayland-scanner.mk
-
- prefix=${wayland__prefix}
- exec_prefix=${wayland__exec_prefix}
-])
--
1.8.3.1
More information about the wayland-devel
mailing list