fixing the recurring Mesa build problem

Dan Nicholson dbn.lists at gmail.com
Fri Nov 3 21:49:35 PST 2006


On 10/27/06, Brian Paul <brian.paul at tungstengraphics.com> wrote:
> >
> > I'm afraid I've discovered a bootstrap problem with this: The include
> > directive is interpreted by automake, not make. But the symlinks for the
> > sources files generally don't exist yet when automake runs. Any ideas
> > how to solve this would be appreciated.
>
> Can we change the "include sources" line to something like "include
> $(PATH_TO_MESA)/sources"?
>
> I don't know enough about automake to know if that's feasible.

I had an idea about this.

You can make one more level of indirection and fool automake. As in,
make a file that just has says "include blah". Then include that file
in the relevant Makefile.am's. What comes out in the Makefile.in's is
the original "include blah" line near the bottom.

Attached is a patch that creates a new file, GL/mesa-include.mk. This
file is included in the Makefile.am's. It contains the includes for
the Mesa source. It also adds a few dummy targets so that the symlink
script can call it. It's just a start to show a way this could work.
Diff is against xserver HEAD.

I tested the autoreconf bootstrap and ran configure. The includes work
correctly in the Makefile's and the symlinks are made properly from
the files referenced in the Mesa *_SOURCES variables. I tested with
builddir == srcdir and builddir != srcdir. I don't have a recent
enough X development platform to actually try building, though.

There's a couple problems with this direction and the attached patch.

1. Apparently the include directive is not portable. Here's something
that Google dug up from the Automake mailing list:

http://sources.redhat.com/ml/automake/2002-01/msg00156.html

So, that basically means you might need GNU make. I'm on Linux with
all recent GNU tools, but I don't know how that works on the other
platforms.

2. The sources files from Mesa only list the c files, and not the
headers. This is different than the current scheme that links in all
the .c and .h files. The xserver sources currently expect the headers
to be in the build directory. I can see two ways to resolve this
problem.

The Mesa sources files can be appended to list the headers as well,
possibly in MESA_*_HEADERS variables. Then they can be symlinked in as
they are now. That puts the onus on the Mesa developers to keep the
sources files current with the headers, too.

The xserver Makefile.am's can add a -I to the relevant directory in
the Mesa source in the INCLUDES variables. This is possible since the
path to the Mesa source is stored in the MESA_SOURCE variable. This
seems like the right way to go, but it could cause breakage.

Anyway, I hope this helps solve the problem a bit.

--
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mesa-sources-symlink.diff
Type: text/x-patch
Size: 8875 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20061103/d5da0d6a/attachment.bin>


More information about the xorg mailing list