[PATCH] Install header files and pkg-config file for external modules

Kristian Høgsberg krh at bitplanet.net
Fri Feb 15 17:53:45 PST 2013


This patch installs the three header files that define the compositor
plugin interface as well as a pkg-config file.  This allows
building weston plugins outside the weston tree.  We currently don't make
any guarantees about the plugin API/ABI except that within a stable
branch we won't break it.
---
 configure.ac             | 17 +++++++++++++++--
 src/Makefile.am          | 11 +++++++++++
 src/compositor.c         |  9 +++++++++
 src/compositor.h         |  8 ++++++--
 src/xwayland/Makefile.am |  1 +
 tests/Makefile.am        |  6 +++++-
 6 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 32fbb4b..4f2a9e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,21 @@
+m4_define([weston_major_version], [1])
+m4_define([weston_minor_version], [0])
+m4_define([weston_micro_version], [90])
+m4_define([weston_version],
+          [weston_major_version.weston_minor_version.weston_micro_version])
+
 AC_PREREQ([2.64])
 AC_INIT([weston],
-        [1.0.90],
-        [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.0.90],
+        [weston_version],
+        [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=weston_version],
         [weston],
         [http://wayland.freedesktop.org/])
 
+AC_SUBST([WESTON_VERSION_MAJOR], [weston_major_version])
+AC_SUBST([WESTON_VERSION_MINOR], [weston_minor_version])
+AC_SUBST([WESTON_VERSION_MICRO], [weston_micro_version])
+AC_SUBST([WESTON_VERSION], [weston_version])
+
 AC_CONFIG_HEADERS([config.h])
 
 AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
@@ -294,6 +305,8 @@ AC_CONFIG_FILES([Makefile
 		 shared/Makefile
 		 src/Makefile
 		 src/xwayland/Makefile
+		 src/version.h
+		 src/weston.pc
 		 clients/Makefile
 		 wcap/Makefile
 		 data/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index cfb072e..ce1aad3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,6 +2,7 @@ bin_PROGRAMS = weston				\
 	$(weston_launch)
 
 AM_CPPFLAGS =					\
+	-I$(top_srcdir)/shared			\
 	-DDATADIR='"$(datadir)"'		\
 	-DMODULEDIR='"$(moduledir)"'		\
 	-DLIBEXECDIR='"$(libexecdir)"'		\
@@ -77,6 +78,16 @@ endif
 
 endif # BUILD_WESTON_LAUNCH
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = weston.pc
+
+westonincludedir = @includedir@/weston
+westoninclude_HEADERS =				\
+	version.h				\
+	compositor.h				\
+	../shared/matrix.h			\
+	../shared/config-parser.h
+
 moduledir = @libdir@/weston
 module_LTLIBRARIES =				\
 	$(desktop_shell)			\
diff --git a/src/compositor.c b/src/compositor.c
index 63fe793..d1fd2e5 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -53,6 +53,7 @@
 #include "compositor.h"
 #include "../shared/os-compatibility.h"
 #include "git-version.h"
+#include "version.h"
 
 static struct wl_list child_process_list;
 static struct weston_compositor *segv_compositor;
@@ -3041,6 +3042,14 @@ weston_compositor_shutdown(struct weston_compositor *ec)
 	wl_event_loop_destroy(ec->input_loop);
 }
 
+WL_EXPORT void
+weston_version(int *major, int *minor, int *micro)
+{
+	*major = WESTON_VERSION_MAJOR;
+	*minor = WESTON_VERSION_MINOR;
+	*micro = WESTON_VERSION_MICRO;
+}
+
 static int on_term_signal(int signal_number, void *data)
 {
 	struct wl_display *display = data;
diff --git a/src/compositor.h b/src/compositor.h
index c0694e8..c39abe3 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -28,8 +28,9 @@
 #include <xkbcommon/xkbcommon.h>
 #include <wayland-server.h>
 
-#include "../shared/matrix.h"
-#include "../shared/config-parser.h"
+#include "version.h"
+#include "matrix.h"
+#include "config-parser.h"
 
 #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
 
@@ -496,6 +497,9 @@ enum weston_key_state_update {
 };
 
 void
+weston_version(int *major, int *minor, int *micro);
+
+void
 weston_surface_update_transform(struct weston_surface *surface);
 
 void
diff --git a/src/xwayland/Makefile.am b/src/xwayland/Makefile.am
index 8f3bddd..77124ff 100644
--- a/src/xwayland/Makefile.am
+++ b/src/xwayland/Makefile.am
@@ -1,4 +1,5 @@
 AM_CPPFLAGS =					\
+	-I$(top_srcdir)/shared			\
 	-DDATADIR='"$(datadir)"'		\
 	-DMODULEDIR='"$(moduledir)"'		\
 	-DLIBEXECDIR='"$(libexecdir)"'		\
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 11cd4ec..f2960f1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -32,7 +32,11 @@ check_PROGRAMS =			\
 	$(weston_tests)
 
 AM_CFLAGS = $(GCC_CFLAGS)
-AM_CPPFLAGS = -I$(top_srcdir)/src -DUNIT_TEST $(COMPOSITOR_CFLAGS)
+AM_CPPFLAGS =					\
+	-I$(top_srcdir)/src			\
+	-I$(top_srcdir)/shared			\
+	-DUNIT_TEST				\
+	$(COMPOSITOR_CFLAGS)
 AM_LDFLAGS = -module -avoid-version -rpath $(libdir)
 
 surface_global_test_la_SOURCES = surface-global-test.c
-- 
1.8.1



More information about the wayland-devel mailing list