[PATCH] Do not distribute generated headers
Kristian Høgsberg
hoegsberg at gmail.com
Mon May 12 10:46:21 PDT 2014
On Wed, May 07, 2014 at 02:09:35PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding at nvidia.com>
>
> The wayland-server-protocol.h and wayland-client-protocol.h headers are
> currently being shipped in tarballs created using make dist. This causes
> out-of-tree builds to fail since make will detect that the headers exist
> by looking at the source directory (via VPATH) and not regenerate them.
> But as opposed to ${top_builddir}/protocol, ${top_srcdir}/protocol is
> not part of the include path and therefore the shipped files can't be
> found during compilation.
>
> Two solutions exist to this problem: 1) add ${top_srcdir}/protocol to
> the include path to allow shipped files to be used if available or 2)
> don't ship these generated files in release tarballs. The latter seems
> the most appropriate. wayland-scanner is already a prerequisite in order
> to generate wayland-protocol.c, so it is either built as part of the
> package or provided externally. Generating all files from the protocol
> definition at build time also ensures that they don't get out of sync.
>
> Both of the generated headers are already listed in Makefile.am as
> nodist_*_SOURCES, but at the same time they appear in include_HEADERS,
> which will cause them to be added to the list of distributable files
> after all. To prevent that, split them off into nodist_include_HEADERS.
Yes, that how that was supposed to work, and we did this for weston,
but we need it for wayland too. Thanks, patch applied.
> Note that this problem will be hidden if a previous version of wayland
> has been installed, since these files will exist in /usr/include and be
> included from there. So this build error will only show for out-of-tree
> builds on systems that don't have wayland installed yet.
We could move the headers into a pkg include dir, eg
/usr/include/wayland/wayland-server.h
etc, which takes them out of the default include path. The only supported
way to locate the package file is pkg-config anyway, so nothing should
break. Something for the next release.
Kristian
> Signed-off-by: Thierry Reding <treding at nvidia.com>
> ---
> Makefile.am | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index f1584d5bfc12..0ec6f47ab2c7 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -20,13 +20,15 @@ noinst_LTLIBRARIES = libwayland-util.la
>
> include_HEADERS = \
> src/wayland-util.h \
> - protocol/wayland-server-protocol.h \
> src/wayland-server.h \
> - protocol/wayland-client-protocol.h \
> src/wayland-client.h \
> src/wayland-egl.h \
> src/wayland-version.h
>
> +nodist_include_HEADERS = \
> + protocol/wayland-server-protocol.h \
> + protocol/wayland-client-protocol.h
> +
> libwayland_util_la_SOURCES = \
> src/connection.c \
> src/wayland-util.c \
> --
> 1.9.2
>
> _______________________________________________
> 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