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

Pekka Paalanen ppaalanen at gmail.com
Thu Jun 2 13:34:54 UTC 2016


On Wed,  1 Jun 2016 21:43:30 +0300
Giulio Camuffo <giuliocamuffo at gmail.com> 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>
> ---
>  Makefile.am         | 45 +++++++++++++++++++++++++++------------------
>  configure.ac        |  4 ++++
>  src/libweston.pc.in | 12 ++++++++++++
>  src/weston.pc.in    |  2 +-
>  4 files changed, 44 insertions(+), 19 deletions(-)
>  create mode 100644 src/libweston.pc.in
> 
> diff --git a/Makefile.am b/Makefile.am
> index e90b3ba..7cc52cd 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,18 +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) \
> -	$(LIBINPUT_BACKEND_LIBS) libshared.la
> +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

compositor.c uses clock_gettime(), but you dropped CLOCK_GETTIME_LIBS.
The same for libinput.

> +libweston_la_LDFLAGS = -release ${LIBWESTON_ABI_VERSION}
>  
> -weston_SOURCES =					\
> +libweston_la_SOURCES =					\
>  	src/git-version.h				\
> -	src/log.c					\
>  	src/compositor.c				\
>  	src/compositor.h				\
>  	src/compositor-drm.h				\
> @@ -87,7 +83,7 @@ weston_SOURCES =					\
>  	src/screenshooter.c				\
>  	src/clipboard.c					\
>  	src/zoom.c					\
> -	src/text-backend.c				\
> +	src/log.c					\

Moving log.c around?

>  	src/bindings.c					\
>  	src/animation.c					\
>  	src/noop-renderer.c				\
> @@ -96,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					\
> @@ -125,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	\
> @@ -141,7 +134,23 @@ 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.h					\
> +	src/weston-screenshooter.c			\
> +	src/text-backend.c

Quentin says headers in _HEADERS should not be in _SOURCES, so I think
weston.h does not belong here.

>  
>  # Track this dependency explicitly instead of using BUILT_SOURCES.  We
>  # add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h
> @@ -211,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

Hmm, xkbcommon is optional. Can be fixed as a follow-up, or maybe just
left out for now.

> +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..4c5e965 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
> +Requires.private: libweston- at LIBWESTON_ABI_VERSION@
>  Cflags: -I${includedir}/weston -I{includedir}/libweston- at LIBWESTON_ABI_VERSION@

Quentin's comment about Cflags seems right. It's also missing a '$'.

The installation looks good to me, so the very least:
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160602/f61800d1/attachment-0001.sig>


More information about the wayland-devel mailing list