fixing the recurring Mesa build problem

Brian Paul brian.paul at
Sat Nov 4 09:47:24 PST 2006

Dan Nicholson wrote:
> On 10/27/06, Brian Paul <brian.paul at> 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's. What comes out in the's is
> the original "include blah" line near the bottom.
> Attached is a patch that creates a new file, GL/ This
> file is included in the'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:
> 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.

I've been using 'include' in Mesa's Makefiles for years and it seems 
to be OK.  I think all modern versions of make support it.

> 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.

That's perfectly fine.

> The xserver'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.

Looks good to me, but like I said before, I'm not an expert with 
autoconf (who is?).  If someone else can review this too, that'd be great.

I may be off-line all next week so if it's confirmed that this'll 
work, feel free to go ahead with it.



More information about the xorg mailing list