From a977849dd917bcb606d353abe30aa4b5e8f96974 Mon Sep 17 00:00:00 2001
From: Rob Landley How do I install toybox?
How do I make individual/standalone toybox command binaries?
How do I build toybox on a system with a broken $PATH?
How do I cross compile toybox?
What architectures does toybox support?
What part of Linux/Android does toybox provide?
Toybox can provide its own build prerequisites (I.E +perform a "hermetic" build) using the script scripts/prereq/build.sh +which is a canned minimal toybox build that basically does "cc *.c" against +saved headers to build the commands needed by the rest of the build.
+ +At the moment, building toybox on mac requires homebrew to get a .config +file, ala:
+ ++ ++$ homebrew +$ make macos_defconfig +$ make clean +$ exit +
But the rest of the hermetic build works without it:
+ ++ ++$ scripts/prereq/build.sh #ignoring SO many warnings +$ mkdir prereq; mv toybox-prereq prereq/ +$ for i in $(prereq/toybox-prereq); do ln -s toybox-prereq prereq/$i; done +$ PATH=$PWD/prereq:$PATH scripts/make.sh +$ ./toybox +
If you already have an appropriate .config file you can copy in you +don't need homebrew at all (and can skip the first section above). +Editing one up by hand for qnx and similar is currently left as an exercise +for the reader (but it's a fairly simple text file format).
+ +The files in the scripts/prereq directory were created by +scripts/recreate-prereq.sh which records the commands used by +a toybox build, harvests stripped down headers, and writes a build.sh +to compile the appropriate source files. It's a couple dozen lines of +bash if you're interested.
+ +At the moment toybox's full scripts/make.sh still requires bash +(until toysh is finished and promoted out of pending). Freebsd users +can invoke "/opt/usr/local/bin/bash scripts/make.sh" or similar +to work around their distro's policy insisting that /bin/env can be +trusted to live at a specific path but /bin/bash can't. (On Android both +env and sh live in /system/bin, which is at least internally consistent.)
+ +Toybox does not yet provide "make" either. You can call scripts/make.sh +directly (and scripts/test.sh and scripts/single.sh) if you've got a .config, +but until kconfig/ is replaced defconfig/menuconfig still need gmake.
+A: You need a compiler "toolchain" capable of producing binaries that -- 2.39.5