changeset 1708:b871f0e7b837

Build the compiler wrapper static if possible, and only copy libraries into the simple-root-filesystem if we need them.
author Rob Landley <rob@landley.net>
date Mon, 24 Nov 2014 14:25:57 -0600
parents 427a9002ab2a
children 60eeade56d1a
files simple-root-filesystem.sh
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/simple-root-filesystem.sh	Wed Nov 19 23:08:31 2014 -0600
+++ b/simple-root-filesystem.sh	Mon Nov 24 14:25:57 2014 -0600
@@ -50,7 +50,7 @@
   tar -c -C "$SIMPLE_ROOT_OVERLAY" . | tar -x -C "$STAGE_DIR" || dienow
 fi
 
-# Build busybox
+# Build toybox
 
 STAGE_DIR="$STAGE_USR" build_section busybox
 cp "$WORK"/config-busybox "$STAGE_USR"/src || dienow
@@ -66,15 +66,19 @@
 then
   "${ARCH}-cc" "${SOURCES}/root-filesystem/src/hello.c" -Os $CFLAGS -static \
     -o "$STAGE_USR/bin/hello-static" || dienow
+  STATIC=--static
+else
+  STATIC=
 fi
 
 # Debug wrapper for use with /usr/src/record-commands.sh
 
-"${ARCH}-cc" "$SOURCES/toys/wrappy.c" -Os $CFLAGS -o "$STAGE_USR/bin/record-commands-wrapper" || dienow
+"${ARCH}-cc" "$SOURCES/toys/wrappy.c" -Os $CFLAGS $STATIC \
+  -o "$STAGE_USR/bin/record-commands-wrapper" || dienow
 
 # Do we need shared libraries?
 
-if [ "$BUILD_STATIC" != all ]
+if ! is_in_list toybox $BUILD_STATIC || ! is_in_list busybox $BUILD_STATIC
 then
   echo Copying compiler libraries...
   mkdir -p "$STAGE_USR/lib" || dienow