[PATCH] shared: Fix build to ensure weston_matrix_ is still exported

Kristian Høgsberg hoegsberg at gmail.com
Fri Dec 7 11:02:41 PST 2012


On Fri, Dec 07, 2012 at 05:36:13PM +0000, Rob Bradford wrote:
> From: Rob Bradford <rob at linux.intel.com>
> 
> We need to ensure that weston_matrix_ functions are available so include
> wayland-util.h to provide the WL_EXPORT macro. To ensure that that header file
> can be found we must search the appropriate path. Adding $(COMPOSITOR_CFLAGS)
> to the CFLAGS is sufficient.

This fixes the build, but the idea was also we take matrix.c out of
libshared and add it back to weston_SOURCES and calibrator_SOURCES.
We don't want the compositor modules to link to matrix.c through
libshared, those symbols should be provided by weston.  When compiling
matrix.c as part of weston, we already have the right CPPFLAGS, so we
really just need to fix the compile in calibrator.

I ended up just doing

	#ifdef IN_WESTON
	#include <wayland-server.h>
	#else
	#define WL_EXPORT
	#endif

in matrix.c and then adding -DIN_WESTON to AM_CPPFLAGS in
src/Makefile.am.  Compiling the same file multiple times with
different #defines is the first step towards cfb8line.c [1], but if it
gets too ugly, we can copy the matrix code into calibrator or maybe
look for a library that calibrator can use.

Kristian

[1] Follow link at your own risk: http://cgit.freedesktop.org/xorg/xserver/tree/cfb/cfb8line.c?h=server-1_0-branch

> ---
>  shared/Makefile.am | 2 +-
>  shared/matrix.c    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/shared/Makefile.am b/shared/Makefile.am
> index faf073d..c3f5208 100644
> --- a/shared/Makefile.am
> +++ b/shared/Makefile.am
> @@ -1,6 +1,6 @@
>  noinst_LTLIBRARIES = libshared.la libshared-cairo.la
>  
> -libshared_la_CFLAGS = $(GCC_CFLAGS)
> +libshared_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
>  
>  libshared_la_SOURCES =				\
>  	config-parser.c				\
> diff --git a/shared/matrix.c b/shared/matrix.c
> index 91acdd3..8c35bfb 100644
> --- a/shared/matrix.c
> +++ b/shared/matrix.c
> @@ -24,7 +24,7 @@
>  #include <string.h>
>  #include <stdlib.h>
>  #include <math.h>
> -#include <wayland-server.h>
> +#include <wayland-util.h>
>  
>  #include "matrix.h"
>  
> -- 
> 1.7.11.7
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list