changeset 389:becb1084a427

Add USE_TOYBOX option (enabled by default), to use toybox commands where available.
author Rob Landley <rob@landley.net>
date Fri, 15 Aug 2008 14:29:14 -0500
parents 3eeb77934265
children a9a9eee9e620
files host-tools.sh include.sh mini-native.sh
diffstat 3 files changed, 31 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/host-tools.sh	Tue Aug 12 18:53:09 2008 -0500
+++ b/host-tools.sh	Fri Aug 15 14:29:14 2008 -0500
@@ -2,8 +2,8 @@
 
 # Get lots of predefined environment variables and shell functions.
 
-# Tell bash not to memorize the path to anything, so toybox utilities get
-# used immediately even if a different executable was found last $PATH lookup.
+# Tell bash not to cache the $PATH to anything, so busybox/toybox utilities
+# get used immediately even if a different executable was found last lookup.
 set +h
 
 echo -e "\e[0m"
@@ -12,6 +12,8 @@
 NO_ARCH=1
 source include.sh
 
+export LC_ALL=C
+
 mkdir -p "${HOSTTOOLS}" || dienow
 
 # If we want to record the host command lines, so we know exactly what commands
@@ -19,7 +21,7 @@
 
 if [ ! -z "$RECORD_COMMANDS" ] && [ ! -f "$BUILD/wrapdir/wrappy" ]
 then
-  # package-mini-native.sh needs oneit.
+  # package-mini-native.sh needs oneit.  Until UML goes away, anyway.
 
   if [ ! -f "${HOSTTOOLS}/toybox" ]
   then
@@ -93,12 +95,17 @@
   then
     setupfor toybox &&
     make defconfig &&
-    # make install_flat PREFIX="${HOSTTOOLS}" &&
     make &&
-    cp toybox $HOSTTOOLS &&
-    ln -s toybox $HOSTTOOLS/oneit &&
-    ln -s toybox $HOSTTOOLS/patch &&
-    cd ..
+    if [ -z "$USE_TOYBOX" ]
+    then
+      cp toybox "$HOSTTOOLS" &&
+      ln -s toybox "$HOSTTOOLS/oneit" &&
+      ln -s toybox "$HOSTTOOLS/patch" &&
+      cd ..
+    else
+      make install_flat PREFIX="${HOSTTOOLS}" &&
+      cd ..
+    fi
 
     cleanup toybox
   fi
--- a/include.sh	Tue Aug 12 18:53:09 2008 -0500
+++ b/include.sh	Fri Aug 15 14:29:14 2008 -0500
@@ -21,6 +21,10 @@
 
 # export PREFERRED_MIRROR=http://landley.net/code/firmware/mirror
 
+# If this is set, the toybox utilities will take precedence over busybox ones.
+
+export USE_TOYBOX=1
+
 # What host compiler should we use?
 
 [ -z "$CC" ] && CC=gcc
--- a/mini-native.sh	Tue Aug 12 18:53:09 2008 -0500
+++ b/mini-native.sh	Fri Aug 15 14:29:14 2008 -0500
@@ -53,15 +53,19 @@
 # Build and install toybox
 
 setupfor toybox
-
 make defconfig &&
-#make install_flat PREFIX="${TOOLS}"/bin CROSS="${ARCH}-" &&
-#rm "${TOOLS}"/bin/sh &&  # Bash won't install if this exists.
-make CROSS="${ARCH}-" &&
-cp toybox "$TOOLS/bin" &&
-ln -s toybox "$TOOLS/bin/patch" &&
-ln -s toybox "$TOOLS/bin/oneit" &&
-cd ..
+if [ -z "$USE_TOYBOX" ]
+then
+  make CROSS="${ARCH}-" &&
+  cp toybox "$TOOLS/bin" &&
+  ln -s toybox "$TOOLS/bin/patch" &&
+  ln -s toybox "$TOOLS/bin/oneit" &&
+  cd ..
+else
+  make install_flat PREFIX="${TOOLS}"/bin CROSS="${ARCH}-" &&
+  rm "${TOOLS}"/bin/sh &&  # Bash won't install if this exists.
+  cd ..
+fi
 
 cleanup toybox