[Toybox] Out of tree build support

Rob Landley rob at landley.net
Mon Dec 18 15:41:28 PST 2017


On 12/18/2017 03:57 PM, Patrick Oppenlander wrote:
> Hi Rob,
> 
> are you open to accepting patches for building out of tree?
> 
> I am working on a project where Toybox will be part of an automated
> build system, and this would make life a lot easier.
> 
> Patrick

It's one of my todo list items, but there's backstory:

I've tried to make it so scripts/make.sh can be run separately (not via
the Makefile, that should be an essentially cosmetic wrapper around the
script-based build infrastructure). (In theory this means you can build
it on systems that haven't got a functional "make" yet. I have another
todo item to have a scripts/defconfig that populates generated/*.sh with
absolutely minimal dependencies, working even with apple's broken sed...)

I also have a "configure" file where you can persistently set default
values for overrideable build options. This is in shell syntax rather
than Makefile syntax so only the shell scripts import it, if I import it
from the Makefile it gets confused by the "[ -z "$BLAH" ] && BLAH=" syntax.

The problem is both the Makefile and scripts/make.sh use the generated/
directory, but the configure file isn't in Makefile syntax. I could put
the default value in two places but having the same piece of information
in two places pretty much guarantees they'll get out of sync eventually...

The HOSTCC variable already has this problem. The reason I haven't
implemented this yet is every time I sit down to implment it I get
distracted by trying to come up with a better design for this...

(Probably configure should have VALUE?="blah" and then a shell wrapper
that parses and sets that syntax.)

Rob

(The build has three conflicting use cases, which affect the
environmental dependencies and expected command line user interface. 1)
Conventional "configure/make/install" using gmake. 2) Portable build not
depending on anything toybox doesn't itself provide (building on BSD and
such). And android's doing ninja, which I should have support for but
ninja is a moving target, the one 14.4 installs doesn't work at all for
android...)



More information about the Toybox mailing list