PROPOSAL: Use Cmake as the build system for Samba

Kai Blin kai at samba.org
Thu Feb 18 14:10:36 MST 2010


On Thursday 18 February 2010 20:56:21 Andreas Schneider wrote:

> > CMake uses timestamps to see if files that depend on changed files need
> > to be rebuilt. This severely reduces the usefulness of automatic
> > dependencies when generated header files are being used. For example,
> > changing a core C file in Samba (even if no signatures are changed) will
> > trigger a rebuild of the prototype header file for that C file, and that
> > header being touched will cause a recompilation of all files that
> > include it, etc.
>
> that's true, but I think people would complain if this is not done and you
> changed something important.
>
> If you're using the the Unix Makefile generator, 'make ${target}/fast' will
> build the target without any dependency checks. This is *only* for
> developers, who *know* what they are doing!

I don't think that's actually the point. Jelmer was referring to the following 
scenario in the current build system:

source.c:
/* This is an example source file */

void do_something_cool(struct cool_struct *data)
{
	data->foo = 42;
}

#############

source_proto.h (autogenerated):
void do_something_cool(struct cool_struct *data);

#############

Now you change source.c to be
/* This is an example source file */

void do_something_cool(struct cool_struct *data)
{
	/* data could be NULL */
	if (data != NULL)
		data->foo = 42;
}

##############

Our current build system checks the timestamp of source.c, notices that it was 
last changed more recently than source_proto.h, so it regenerates the proto 
header, even though the function signature didn't change. This in turn 
triggers a rebuild of all files that have a dependency on source_proto.h.

If the build system used checksums, it'd notice that the checksum of 
source_proto.h didn't change and not trigger the rebuild of files that depend 
on source_proto.h.

>
> > Does it support multi-architecture compilations? When cross-compiling we
> > need to build some of the compilers (asn1c, compile_et) for the build
> > platform and target platform and most other things just for the target
> > platform.
>
> Yes, cross compilation support has been added in CMake 2.6. All you have to
> do is to write a toolchain file which defines the compilers and paths.
>
> I've cross-compiled Windows binaries for libssh on Linux with MinGW.

Would this work for.. say ARM or PPC cross-compilation as well? I know that's 
currently a bit tricky with the build system we have.

Cheers,
Kai

-- 
Kai Blin
WorldForge developer  http://www.worldforge.org/
Wine developer        http://wiki.winehq.org/KaiBlin
Samba team member     http://www.samba.org/samba/team/
--
Will code for cotton.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100218/35e2c6b4/attachment.pgp>


More information about the samba-technical mailing list