[Toybox] FreeBSD support.
Ed Maste
emaste at freebsd.org
Tue Jan 8 17:25:47 PST 2019
On Tue, 8 Jan 2019 at 20:07, Rob Landley <rob at landley.net> wrote:
>
> The 5th is expecting /usr/bin/env to be at an absolute
> path but not /bin/bash, which... how is one more trustworthy than the other?
Yep, I don't have a very convincing answer for why /usr/bin/env is
better than /bin/bash, other than in practice it seems all relevant
systems have /usr/bin/env, and not all have /bin/bash.
I'm not sure of a great way to handle this, other than renaming files
to .sh.in and having a build step that replaces some sort of @BASH@
sentinel with #!/bin/bash or #!/usr/local/bin/bash as appropriate.
> Other than that, Ed says:
>
> > With this change I can build these posix toys:
> > ...
>
> Which sounds a bit like where MacOS left off. I think I need some sort of "make
> macos_defconfig" and "make freebsd_defconfig" targets pulling in relevant
> default configurations. (Which should be separate files rather than trying to
> annotate every command with which targets can build it; that way lies madness,
> as gentoo discovered)...
Yeah, that sounds good to me - I'm happy to put together a default
config file for FreeBSD (.config.FreeBSD?), and then update it along
with other future changes that improve FreeBSD support.
In addition to the #!/bin/bash workaround I have another local change
now, in order to get tests to start running: in scripts/single.sh and
scripts/test.sh I changed 'make' to 'gmake' and 'sed' to 'gsed' to get
the GNU versions.
> but I've _almost_ got working BSD versions on more than one occasion. (With help
> from Randi Harper and Kirk McKusick over the years, and it still didn't _quite_
> work, but I can try again...)
I'm happy to help get your VM set up as well - and the FreeBSD project
makes prebuilt VM images available if you like.
More information about the Toybox
mailing list