Non-recursive make

Tomas Carnecky tomas.carnecky at gmail.com
Mon May 21 14:01:44 PDT 2012


Many years ago I wrote a small patch to generate protocol bindings from XCB.
Initially only for DPMS, it worked quite well. I've been running my xserver
with that patch since then. A few weeks ago I decided to port another
extension and that where the trouble started. I've run into big problems
because the many small interdependent libraries that are used to link the
server didn't want to correctly link together. I always had some unresolved
symbols.

So that made me thinking about how we build the server, and whether
a non-recursive make wouldn't make everything easier. We could collect all the
source files first and then link the server in one go. Well, at least in
theory.

But even if don't get to that state, there's still a lot of potential. For
example, all servers link with libdix, libos, libXi, libxfixes, libmi,
librandr and librender. Combining all those into a single libXserver will
eliminate a lot of ugly code throughout configure.ac and the makefiles.

You've maybe noticed that I sent a few patches during the last few days. Those
are simple cleanups, stuff that I came across while trying out non-recursive
make. I have successfully converted most of the server to non-recursive make
now, even Xvfb and Xnest are built from the top-level Makefile!

As a proof-of-concept, it's been useful (if somebody wants to see the code,
I can share it on github). However, the code is ugly, and likely breaks tests,
Xwin and XQuartz. And it's a *big* diff, hard to review etc. But I can make
gradual changes over many smaller commits, so we can review at each step, and
see how well it goes:

  1. Cleanup, required to make `subdir-objects` automake option work.

  2. Convert one library after another to build from the top-level makefile.
     This part will include large diffs because all paths have to be made
     relative to the root.

  3. Start consolidating libraries (libdix, libos, libXi etc), cleaning up
     configure.ac, dependencies etc as we go. Eventually building the DDXes
     from the top-level makefile.

What do you think?


More information about the xorg-devel mailing list