view configure @ 1470:4f25d3a3eda9 draft

Create a generated/build.sh with a single compiler command line to rebuild the toybox_unstripped binary using the existing generated/*.h files. This way we can snapshot the generated/*.{h,sh} from a defconfig build into a "shipped" directory or something, and then people can maybe build on crazy crippled environments like pcbsd that haven't got gmake and put bash under /usr/local so none of the #!/scripts can find it. This solves at least part of the "toybox can build with itself but you need to build toybox first to have the tools to run the build scripts" problem. Next up: work out the minimal config to provide the build tools needed to run an actual build. (This should, eventually, include a "make" command if freebsd's kernel is going to refuse to build with netbsd's "make" and we don't just write off the whole thing as crazy. But it probably shouldn't include commands that #include <linux/*.h> if we are trying to make that work.)
author Rob Landley <rob@landley.net>
date Thu, 11 Sep 2014 20:50:10 -0500
parents 5f9fbf75ad34
children 2d5e3e345c14
line wrap: on
line source

# Toybox configuration file.

# This sets environment variables used by scripts/make.sh

# A synonym.
[ -z "$CROSS_COMPILE" ] && CROSS_COMPILE="$CROSS"
[ -z "$CFLAGS" ] && CFLAGS="-Wall -Wundef -Wno-char-subscripts"
# Required for our expected ABI. we're 8-bit clean thus "char" must be unsigned.
CFLAGS="$CFLAGS -funsigned-char"

[ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables"
[ -z "$LDOPTIMIZE" ] && LDOPTIMIZE="-Wl,--gc-sections"
[ -z "$CC" ] && CC=cc
[ -z "$STRIP" ] && STRIP=strip

# If HOSTCC needs CFLAGS, add them to the variable ala HOSTCC="blah-cc --static"
[ -z "$HOSTCC" ] && HOSTCC=gcc