[PATCH xserver 1/5] hw: use links in git to share source files due to upcoming automake changes

Jon TURNEY jon.turney at dronecode.org.uk
Tue Feb 18 04:35:34 PST 2014


On 17/02/2014 22:33, Gaetan Nadon wrote:
> Automake 1.14 gives us warning about source code specified in *_SOURCES
> that comes from directories other than the current one. It suggests to enable
> the subdir-objects feature which only supports code in sub directories.
> 
> Automake is warning us because 2.0 version will turn on this feature by default
> and cannot be turned off. It assumes the object is to be generated in the
> subdirs and triggers the subdir-objects feature. There are two problems.
> 
> First, the $(top_srcdir) variable is not expanded, dependency tracking
> is broken, and the build stops.
> Second, the object code that is now written where the source file is gets
> overwritten by the next DDX that shares the source file in its Makefile.
> An example would hw/dmx and Xext for the panoramiX object code.
> (It is not a problem today because without subdir-objects being enabled
> the object code is generated where the Makefile is).
> 
> The solution the patch proposes is to use links in git to share the source
> files. So in hw/dmx,
>     miinitext.c -> ../../mi/miinitext.c
> 
> The Makefile will simply lists "miinitext.c" as opposed to
>     $(top_srcdir)/mi/miinitext.c.
> The will not trigger the subdir-objects feature, even in automake 2.0.

I'd say if we are building the same object in different places, this is a sign
that something else is wrong.

I wrote a patch some time ago to build dpmsstubs.c as a convenience library
[1], and this would seem to be the better approach to this problem wherever
possible.

miinitext.c is somewhat a special case as it needs to be built differently for
each DDX, but did you consider moving it's contents to a .h file and then
#include'ing it in each DDX?

[1] http://patchwork.freedesktop.org/patch/7799/



More information about the xorg-devel mailing list