[Mesa-dev] [RFC] Convert mesa to automake/libtool
dbn.lists at gmail.com
Sun May 2 09:46:15 PDT 2010
I'm putting forward this request completely understanding your
position why you don't want automake and libtool in your project.
However, I think that mesa has outgrown the static Makefiles approach
for a number of reasons. For a project that's grown to the complexity
of mesa, I believe you need something that is more flexible and robust
than the current system can provide. Eric (and I think Corbin, too)
has a branch adding automake and libtool to the mesa repo.
I haven't looked at it in detail, but I know Eric knows what he's
doing as he's maintained many of the autotooled xorg modules. Here are
some of the pros and cons I see to making this change.
* AM_CONDITIONAL provides a clean way to separate optional parts of
the build. The way that optional components are handled right now is
pretty fragile and basically amounts to having lists of subdirectories
being correct in the config file.
* For all mklib's simplicity, it is inconsistent between platforms,
doesn't handle errors and provides only a scant amount of the features
that libtool does. Libtool provides a robust and well tested means to
generate libraries that handles nearly all the gory details about
generating working binaries on many platforms. I don't think anyone
working on mklib can claim to have the same type of knowledge about
platforms and toolchains as the libtool developers.
* Consistency in build commands for free from automake. Right now we
have the compiling and linking commands repeated throughout the tree
and they're typically out of sync. I've tried to keep them in sync
before and it was a lot of effort. With automake all you really need
to do is tell it the CFLAGS and LIBS to use and it'll take care of the
* Parallel make jobs just work. I've fixed so many of these race
condition bugs, but they'd all just go away using automake. It has all
the goop built in that people usually never think about.
* Well defined distribution for tarballs. The top-level Makefile does
the job, but automake can make this a lot easier and more robust. It
would also be simple to handle the generated files while also
requiring they be included in the tarball.
* Fast source dependencies without external tools. The makedepend
route works, but automake handles this in a faster, more robust and
safer manner. We get a lot of people posting to the mailing list about
build errors were the solution is "make realclean". This would solve a
lot of those issues.
* Mindshare from xorg autotools. Many of the people here have and do
work with the autotools via xorg, so it's not like this is a
completely foreign beast.
* Moves the burden of build tool knowledge onto someone else. I don't
think anyone here wants to become an expert on compilers, linkers and
ABI for multiple platforms. It become a lot easier when you toss
things off to libtool where people are actually spending their time
caring about them.
* Extensive documentation available, unlike the current system which
is pretty much ad hoc.
* The abstracted nature of automake causes build debugging to be
difficult. This requires you to train your brain not to look at the
generated Makefile, but still it can be difficult. Fortunately, many
of the build bugs we see today in Mesa would go away with automake.
* Using libtool means that you can't quickly hack around a fix for
some platform. Fortunately, libtool is a lot more stable these days on
* The maintainer (you) doesn't like it. Not much I can suggest here
besides that it gets a lot easier the more you deal with it. And I'd
be happy to help you out of any jams. For xorg, Peter Hutterer has
asked me to solve a bunch of these problems, and I can't remember the
last time we couldn't get something fixed.
* Loss of the simple "make $target" usage. I understand you guys use
these targets to quickly pop out a build. As a compromise, we could
turn the configs into wrapper scripts that generated the autotools
files and ran configure with appropriate arguments. For example,
"./configs/linux-debug && make". Or, since configure handles the
platform parts, ./configs/debug or ./configs/osmesa.
That's all I can think of. I'm sure we can continue to make the
current system work, but I think integrating these tools would be a
big improvement. Thanks for considering it.
More information about the mesa-dev