[PATCH weston v3 8/8] Create a libweston-0.so

Giulio Camuffo giuliocamuffo at gmail.com
Thu Jun 2 18:48:15 UTC 2016


This commit also adds a libweston-0.pc file. The -0 is the abi version
introduced in the previous patch.

Signed-off-by: Giulio Camuffo <giuliocamuffo at gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---

v3: - read dropped library dependencies for libweston
    - keep log.c where it is
    - put weston.h in HEADERS only
    - drop -lweston from weston.pc's Cflags

 Makefile.am         | 38 ++++++++++++++++++++++++--------------
 configure.ac        |  4 ++++
 src/libweston.pc.in | 12 ++++++++++++
 src/weston.pc.in    |  4 ++--
 4 files changed, 42 insertions(+), 16 deletions(-)
 create mode 100644 src/libweston.pc.in

diff --git a/Makefile.am b/Makefile.am
index 38c8301..9abea0b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -51,7 +51,6 @@ AM_CPPFLAGS = 					\
 	-I$(top_srcdir)/shared			\
 	-I$(top_builddir)/protocol		\
 	-DDATADIR='"$(datadir)"'		\
-	-DMODULEDIR='"$(moduledir)"'		\
 	-DLIBWESTON_MODULEDIR='"$(libweston_moduledir)"' \
 	-DLIBEXECDIR='"$(libexecdir)"'		\
 	-DBINDIR='"$(bindir)"'
@@ -62,16 +61,15 @@ CLEANFILES = weston.ini				\
 	internal-screenshot-00.png		\
 	$(BUILT_SOURCES)
 
-bin_PROGRAMS += weston
-
-weston_LDFLAGS = -export-dynamic
-weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
-weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
-weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
+lib_LTLIBRARIES = libweston.la
+libweston_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
+libweston_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
+libweston_la_LIBADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
 	$(DLOPEN_LIBS) -lm $(CLOCK_GETTIME_LIBS) \
 	$(LIBINPUT_BACKEND_LIBS) libshared.la
+libweston_la_LDFLAGS = -release ${LIBWESTON_ABI_VERSION}
 
-weston_SOURCES =					\
+libweston_la_SOURCES =					\
 	src/git-version.h				\
 	src/log.c					\
 	src/compositor.c				\
@@ -87,7 +85,6 @@ weston_SOURCES =					\
 	src/screenshooter.c				\
 	src/clipboard.c					\
 	src/zoom.c					\
-	src/text-backend.c				\
 	src/bindings.c					\
 	src/animation.c					\
 	src/noop-renderer.c				\
@@ -96,10 +93,8 @@ weston_SOURCES =					\
 	src/timeline.c					\
 	src/timeline.h					\
 	src/timeline-object.h				\
-	src/main.c					\
 	src/linux-dmabuf.c				\
 	src/linux-dmabuf.h				\
-	src/weston-screenshooter.c			\
 	shared/helpers.h				\
 	shared/matrix.c					\
 	shared/matrix.h					\
@@ -124,7 +119,7 @@ systemd_notify_la_SOURCES =			\
 	src/compositor.h
 endif
 
-nodist_weston_SOURCES =					\
+nodist_libweston_la_SOURCES =					\
 	protocol/weston-screenshooter-protocol.c			\
 	protocol/weston-screenshooter-server-protocol.h			\
 	protocol/text-cursor-position-protocol.c	\
@@ -140,7 +135,22 @@ nodist_weston_SOURCES =					\
 	protocol/linux-dmabuf-unstable-v1-protocol.c	\
 	protocol/linux-dmabuf-unstable-v1-server-protocol.h
 
-BUILT_SOURCES += $(nodist_weston_SOURCES)
+BUILT_SOURCES += $(nodist_libweston_la_SOURCES)
+
+bin_PROGRAMS += weston
+
+weston_LDFLAGS = -export-dynamic
+weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON 		\
+				 -DMODULEDIR='"$(moduledir)"'
+weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
+weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
+	$(DLOPEN_LIBS) $(LIBINPUT_BACKEND_LIBS) \
+	-lm libshared.la libweston.la
+
+weston_SOURCES = 					\
+	src/main.c					\
+	src/weston-screenshooter.c			\
+	src/text-backend.c
 
 # Track this dependency explicitly instead of using BUILT_SOURCES.  We
 # add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h
@@ -210,7 +220,7 @@ endif
 endif # BUILD_WESTON_LAUNCH
 
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = src/weston.pc
+pkgconfig_DATA = src/weston.pc src/libweston-${LIBWESTON_ABI_VERSION}.pc
 
 wayland_sessiondir = $(datadir)/wayland-sessions
 dist_wayland_session_DATA = src/weston.desktop
diff --git a/configure.ac b/configure.ac
index 1ee3265..310efe5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -651,6 +651,10 @@ fi
 
 AC_CONFIG_FILES([Makefile src/version.h src/weston.pc])
 
+# AC_CONFIG_FILES needs the full name when running autoconf, so we need to use
+# libweston_abi_version here, and outside [] because of m4 quoting rules
+AC_CONFIG_FILES([src/libweston-]libweston_abi_version[.pc:src/libweston.pc.in])
+
 AM_CONDITIONAL([HAVE_GIT_REPO], [test -f $srcdir/.git/logs/HEAD])
 
 AC_OUTPUT
diff --git a/src/libweston.pc.in b/src/libweston.pc.in
new file mode 100644
index 0000000..24fe813
--- /dev/null
+++ b/src/libweston.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+pkgincludedir=${includedir}/libweston- at LIBWESTON_ABI_VERSION@
+
+Name: libweston API
+Description: Header files for libweston compositors development
+Version: @WESTON_VERSION@
+Requires.private: wayland-server pixman-1 xkbcommon
+Cflags: -I${pkgincludedir}
+Libs: -L${libdir} -lweston- at LIBWESTON_ABI_VERSION@
diff --git a/src/weston.pc.in b/src/weston.pc.in
index f2ffc9e..09e8580 100644
--- a/src/weston.pc.in
+++ b/src/weston.pc.in
@@ -8,5 +8,5 @@ pkglibexecdir=${libexecdir}/@PACKAGE@
 Name: Weston Plugin API
 Description: Header files for Weston plugin development
 Version: @WESTON_VERSION@
-Requires.private: wayland-server pixman-1 xkbcommon
-Cflags: -I${includedir}/weston -I{includedir}/libweston- at LIBWESTON_ABI_VERSION@
+Requires.private: libweston- at LIBWESTON_ABI_VERSION@
+Cflags: -I${includedir}/weston
-- 
2.8.3



More information about the wayland-devel mailing list