Install header files and pkg-config file for external modules
authorKristian Høgsberg <krh@bitplanet.net>
Sat, 16 Feb 2013 01:53:20 +0000 (20:53 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 22 Feb 2013 17:18:27 +0000 (12:18 -0500)
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.

Conflicts:
configure.ac
src/compositor.h

configure.ac
src/Makefile.am
src/compositor.c
src/compositor.h
src/version.h.in [new file with mode: 0644]
src/weston.pc.in [new file with mode: 0644]
src/xwayland/Makefile.am
tests/Makefile.am

index 7bc5c83..e8f02b1 100644 (file)
@@ -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.5],
-        [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.0.5],
+        [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])
@@ -253,6 +264,8 @@ AC_CONFIG_FILES([Makefile
                 shared/Makefile
                 src/Makefile
                 src/xwayland/Makefile
+                src/version.h
+                src/weston.pc
                 clients/Makefile
                 wcap/Makefile
                 data/Makefile
index 447b911..94c6931 100644 (file)
@@ -2,6 +2,7 @@ bin_PROGRAMS = weston                           \
        $(weston_launch)
 
 AM_CPPFLAGS =                                  \
+       -I$(top_srcdir)/shared                  \
        -DDATADIR='"$(datadir)"'                \
        -DMODULEDIR='"$(moduledir)"'            \
        -DLIBEXECDIR='"$(libexecdir)"'
@@ -69,6 +70,16 @@ endif
 
 endif # BUILD_WESTON_LAUNCH
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = weston.pc
+
+westonincludedir = $(includedir)/weston
+westoninclude_HEADERS =                                \
+       version.h                               \
+       compositor.h                            \
+       matrix.h                                \
+       ../shared/config-parser.h
+
 moduledir = @libdir@/weston
 module_LTLIBRARIES =                           \
        $(desktop_shell)                        \
index 6d7b2c7..f384c9c 100644 (file)
@@ -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;
@@ -2908,6 +2909,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;
index c7c583e..4b77abd 100644 (file)
@@ -33,8 +33,9 @@
 #include <EGL/egl.h>
 #include <EGL/eglext.h>
 
+#include "version.h"
 #include "matrix.h"
-#include "../shared/config-parser.h"
+#include "config-parser.h"
 #include "weston-egl-ext.h"
 
 #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
@@ -509,6 +510,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/version.h.in b/src/version.h.in
new file mode 100644 (file)
index 0000000..f573328
--- /dev/null
@@ -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 (file)
index 0000000..537cc89
--- /dev/null
@@ -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}
index 8f3bddd..77124ff 100644 (file)
@@ -1,4 +1,5 @@
 AM_CPPFLAGS =                                  \
+       -I$(top_srcdir)/shared                  \
        -DDATADIR='"$(datadir)"'                \
        -DMODULEDIR='"$(moduledir)"'            \
        -DLIBEXECDIR='"$(libexecdir)"'          \
index c93d100..8bdcfde 100644 (file)
@@ -31,7 +31,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