Install header files and pkg-config file for external modules
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.
diff --git a/src/Makefile.am b/src/Makefile.am
index a5e7dcf..b9d21b8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,6 +2,7 @@
$(weston_launch)
AM_CPPFLAGS = \
+ -I$(top_srcdir)/shared \
-DDATADIR='"$(datadir)"' \
-DMODULEDIR='"$(moduledir)"' \
-DLIBEXECDIR='"$(libexecdir)"' \
@@ -78,6 +79,16 @@
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 5c19d92..3b16220 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -58,6 +58,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;
@@ -3046,6 +3047,14 @@
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 @@
};
void
+weston_version(int *major, int *minor, int *micro);
+
+void
weston_surface_update_transform(struct weston_surface *surface);
void
diff --git a/src/version.h.in b/src/version.h.in
new file mode 100644
index 0000000..f573328
--- /dev/null
+++ b/src/version.h.in
@@ -0,0 +1,31 @@
+/*
+ * Copyright © 2013 Intel Corporation
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef WESTON_VERSION_H
+#define WESTON_VERSION_H
+
+#define WESTON_VERSION_MAJOR @WESTON_VERSION_MAJOR@
+#define WESTON_VERSION_MINOR @WESTON_VERSION_MINOR@
+#define WESTON_VERSION_MICRO @WESTON_VERSION_MICRO@
+#define WESTON_VERSION "@WESTON_VERSION@"
+
+#endif
diff --git a/src/weston.pc.in b/src/weston.pc.in
new file mode 100644
index 0000000..537cc89
--- /dev/null
+++ b/src/weston.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Weston Plugin API
+Description: Header files for Weston plugin development
+Version: @WESTON_VERSION@
+Cflags: -I${includedir}
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)"' \