Samba 4 buildsystem; patch in progress
jpeach at samba.org
Sun Jan 6 07:11:39 GMT 2008
On 05/01/2008, at 5:32 PM, Jelmer Vernooij wrote:
> After discussing this with various people over the last week, I
> to try and see how hard it would be to get Samba 4 to use a simple
> Makefile again.
> I've now got something partially working, heavily based on the
Is "include" portable? According to <http://www.freebsd.org/cgi/man.cgi?query=make&sektion=1
>, BSD make uses ".include".
> and double-colon features in make (portable across all makes we build
> on, afaik).
This is a weird one. <http://www.freebsd.org/cgi/man.cgi?query=make&sektion=1
> describes :: in a way that conflicts with your use of it to
accumulate target dependencies and rules. However, <http://www.opengroup.org/onlinepubs/009695399/utilities/make.html
> claims that the accumulation behaviour is a BSD make-ism.
> So far I've managed to avoid most beartraps; it should work portably
> across all platforms, doesn't use recursive make, doesn't use libtool
> and variables and rules don't use a lot of magic.
I have to say that I don't think a truly portable Makefile is a good
First, I'm not convinced that the portable subset of make has the
features we would want to use in the build.
Second, even if we narrow the scope to 3 or 4 make implementations, I
think there will be a continual support cost from folks building on
platforms without these implementation, as well as the likelihood of
GNU make-isms constantly leaking in from the 99% of Samba developers
who use GNU make exclusively.
Finally, I think that using the full vocabulary of a single make
implementation (particularly GNU make), is too useful to ignore, eg.
> A nice advantage of this system is that you never have to run
> config.status if you include one of the files included by the
> Only when config.status changes do you have to update anything.
> Another advantage is that we can include the config.mk for tdb, talloc
> and ldb within the Samba build and the standalone builds (and
> potentially the Samba 3 makefile). So, only one place where the rules
> are and thus harder to break.
With the above caveats, I rather like the approach. It's simple and
obvious and easy for people to dig into.
You could include a GNU make download/bootstrap script with installs a
temporary copy of GNU make automatically if configure doesn't find it.
Then you could use GNU make features like per-target variables. Would
this make a GNU make dependency more acceptable?
James Peach | jpeach at samba.org
More information about the samba-technical