# HG changeset patch # User Rob Landley # Date 1325415872 21600 # Node ID b381adcd79687b4d0aa0b8bbf38f6ca0f3353be1 # Parent 1e494ad5c7fd1a150051079ca543747bb0d9a134 Add ability to build toybox. diff -r 1e494ad5c7fd -r b381adcd7968 host-tools.sh --- a/host-tools.sh Wed Dec 28 16:01:32 2011 -0600 +++ b/host-tools.sh Sun Jan 01 05:04:32 2012 -0600 @@ -82,6 +82,7 @@ # thing. [ ! -f "$STAGE_DIR/busybox" ] && build_section busybox +[ "$TOYBOX" == toybox ] && [ ! -f "$STAGE_DIR/toybox" ] && build_section toybox # Create symlinks to the host toolchain. We need a usable existing host # toolchain in order to build anything else (even a new host toolchain), diff -r 1e494ad5c7fd -r b381adcd7968 simple-root-filesystem.sh --- a/simple-root-filesystem.sh Wed Dec 28 16:01:32 2011 -0600 +++ b/simple-root-filesystem.sh Sun Jan 01 05:04:32 2012 -0600 @@ -56,6 +56,11 @@ build_section busybox cp "$WORK"/config-busybox "$STAGE_DIR"/src || dienow +if [ "$TOYBOX" == toybox ] +then + build_section toybox +fi + # Build the world's simplest init program: spawns one task with a controlling # TTY, waits (reaping zombies) until it exits, then shuts down the system. diff -r 1e494ad5c7fd -r b381adcd7968 sources/sections/toybox.build --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/sections/toybox.build Sun Jan 01 05:04:32 2012 -0600 @@ -0,0 +1,15 @@ +# Build toybox statically by default, but don't statically link against +# glibc (during host-tools.sh build) because glibc is buggy and can't combine +# --static with --gc-sections. See http://blah for details + +# Build toybox + +make defconfig && +cp .config "$WORK"/config-toybox && +CFLAGS="$CFLAGS $STATIC_FLAGS" make -j $CPUS $DO_CROSS && +PREFIX="$STAGE_DIR" make install$([ -z "$DO_CROSS" ] && echo _flat) || dienow + +if [ ! -z "$SKIP_STRIP" ] +then + cp toybox_unstripped "$INSTDIR/toybox" || dienow +fi