[GNC-dev] Wiki Build-Tools

Geert Janssens geert.gnucash at kobaltwit.be
Sat Sep 22 05:14:33 EDT 2018


Op zaterdag 22 september 2018 06:00:40 CEST schreef David Cousens:
> Hi
> I made so comments in the Talk page on Build Tools repeated here for perhaps
> broader comment:
> 
> I dont think the description here really represents the situation. Both
> Autotools and Cmake are build configuration utilities not tool chains as
> such.
> 
> Would it not be better to describe the toolchains as:
> Autotools->make; #must be used for the documentation builds- used for
> program builds <v 2.6;
> Cmake->make; # now used for program and API documentation (V3.2 forward);
> Cmake->ninja; # alternative program build (API documentation??) (V3.2
> forward);
> 
That would be v3 (or v3.x) forward compared to v2.6 (or v2.6.x and before. 
v3.2 is the third release in the 3.x series but cmake was already mandatory 
starting from v3.0. We don't recommend building these earlier versions of 
course, but it reads a bit strange if there's a hole in the numbering.

Other than that, yes, this summarizes the "tool chain", but it still doesn't 
make it clear that the first tool in the chain is to configure a build system 
and the second is the actual build orchestrator. In principle the first 
command is run only once or when you want to reconfigure the build system with 
different options, the second each time a source file changes, and for many 
purposes: build, test, install, api-doc.

I'm calling make or ninja "orchestrators" because they primarily drive other 
tools. As you hinted at below they drive compilers and linkers. But I'm not 
sure a casual builder really needs to know all this in detail. It can be 
shortly documented on a breakout page with extra background if you really 
want. It may be helpful in that case to also write something about guile and 
swig on the background page.

> or even better if we consider the installation as a separate step from the
> build itself
> 
Of course it's a separate step, but it is also performed by the same tool, 
either make or ninja.

> Autotools->make->make; #must be used for the documentation builds- used for
> program builds <v 2.6;
> Cmake->make->make; # now used for program and API documentation (V3.2
> forward);
> Cmake->ninja->Make; # alternative program build (API documentation??) (V3.2
> forward);
> 
I don't understand this. There is no make->make versus ninja->Make.

ninja (or on some platforms ninja-build to keep things "simple") is a drop-in 
replacement for make.

So depending on which tool you told cmake to configure the build system for, 
you can run either
make all, make install, make check, ...
or
ninja all, ninja install, ninja check, ...

After running cmake for a specific build system, both commands accept the 
exact same targets. So to answer your question mark: ninja can also be used to 
build the API documentation.

I also presume the above is very succinct to get your point across and you 
will elaborate a bit more in the actual documentation. If no more info is 
given than the above I would be puzzled on which choice to make: make or ninja 
?

> The other parts of the tool chain here is the compiler system called by the
> above to compile and libtool to construct the libraries and possibly the
> linker. Should they not be also mentioned?

Perhaps. Though a casual builder will never manipulate them directly. More 
details on those tools are mostly useful for aspiring contributors.

Geert




More information about the gnucash-devel mailing list