[PATCH weston 6/6] Create a libweston-0.so
Quentin Glidic
sardemff7+wayland at sardemff7.net
Wed May 25 08:29:49 UTC 2016
On 24/05/2016 18:59, Giulio Camuffo wrote:
> 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>
Almost perfect, a few comments inline.
> ---
> Makefile.am | 44 +++++++++++++++++++++++++++-----------------
> configure.ac | 1 +
> src/libweston.pc.in | 11 +++++++++++
> 3 files changed, 39 insertions(+), 17 deletions(-)
> create mode 100644 src/libweston.pc.in
>
> diff --git a/Makefile.am b/Makefile.am
> index 5542c6d..7344934 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -61,17 +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) \
> - $(DLOPEN_LIBS) -lm $(CLOCK_GETTIME_LIBS) libshared.la
> -
> -weston_SOURCES = \
> +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 libshared.la
> +libweston_la_LDFLAGS = -release ${LIBWESTON_ABI_VERSION}
> +
> +libweston_la_SOURCES = \
> src/git-version.h \
> - src/log.c \
> src/compositor.c \
> src/compositor.h \
> src/compositor-drm.h \
> @@ -85,7 +83,7 @@ weston_SOURCES = \
> src/screenshooter.c \
> src/clipboard.c \
> src/zoom.c \
> - src/text-backend.c \
> + src/log.c \
> src/bindings.c \
> src/animation.c \
> src/noop-renderer.c \
> @@ -94,11 +92,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.h \
> - src/weston-screenshooter.c \
> shared/helpers.h \
> shared/matrix.c \
> shared/matrix.h \
> @@ -123,7 +118,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 \
> @@ -139,7 +134,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)"'
So here is MODULEDIR… you should add it in the correct commit, just in case.
> +weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
> +weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
> + $(DLOPEN_LIBS) -lm libshared.la libweston.la
> +
> +weston_SOURCES = \
> + src/main.c \
> + src/weston.h \
> + 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
> @@ -209,7 +219,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 282b05f..c5e4f6a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -648,6 +648,7 @@ if test "x$enable_systemd_notify" = "xyes"; then
> fi
>
> AC_CONFIG_FILES([Makefile src/version.h src/weston.pc])
> +AC_CONFIG_FILES([src/libweston-]libweston_abi_version[.pc:src/libweston.pc.in])
Maybe worth adding a comment to explain AC_CONFIG_FILES is generating
config.status with m4-time values, so libweston_abi_version has to be
specified that way.
>
> AM_CONDITIONAL([HAVE_GIT_REPO], [test -f $srcdir/.git/logs/HEAD])
>
> diff --git a/src/libweston.pc.in b/src/libweston.pc.in
> new file mode 100644
> index 0000000..1bb0a9e
> --- /dev/null
> +++ b/src/libweston.pc.in
> @@ -0,0 +1,11 @@
> +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@
Still missing Requires.private.
And actually, you can now remove the Requires.private from weston.pc,
since the only weston-specific header has no #include.
> +Cflags: -I${pkgincludedir}
> +Libs: -L${libdir} -lweston- at LIBWESTON_ABI_VERSION@
>
Cheers,
--
Quentin “Sardem FF7” Glidic
More information about the wayland-devel
mailing list