[Aboriginal] Use ${CC_PREFIX} in root-filesystem.sh and PS1 change
Geoff Salmon
gsalmon at se-instruments.com
Wed Nov 18 09:30:56 PST 2015
Hi Rob
There are some uses of ${ARCH}-cc and ${ARCH}-strip remaining in
root-filesystem.sh. Below is a patch to replace them with ${CC_PREFIX}.
Also I'll first sneak in a small patch to change PS1 in init.sh to
expand the HOST and CPUS vars.
- Geoff
diff --git a/sources/root-filesystem/sbin/init.sh
b/sources/root-filesystem/sbin/init.sh
--- a/sources/root-filesystem/sbin/init.sh
+++ b/sources/root-filesystem/sbin/init.sh
@@ -20,7 +20,7 @@
export CPUS=$(echo /sys/devices/system/cpu/cpu[0-9]* | wc -w)
[ "$CPUS" -lt 1 ] && CPUS=1
fi
-export PS1='($HOST:$CPUS) \w \$ '
+export PS1="($HOST:$CPUS) \w \$ "
# When running under qemu, do some more setup
if [ $$ -eq 1 ]
diff --git a/root-filesystem.sh b/root-filesystem.sh
--- a/root-filesystem.sh
+++ b/root-filesystem.sh
@@ -54,12 +54,12 @@
# Put statically and dynamically linked hello world programs on there for
# test purposes.
-"${ARCH}-cc" "${SOURCES}/root-filesystem/src/hello.c" -Os $CFLAGS \
+"${CC_PREFIX}cc" "${SOURCES}/root-filesystem/src/hello.c" -Os $CFLAGS \
-o "$STAGE_USR/bin/hello-dynamic" || dienow
if [ "$BUILD_STATIC" != none ]
then
- "${ARCH}-cc" "${SOURCES}/root-filesystem/src/hello.c" -Os $CFLAGS
-static \
+ "${CC_PREFIX}cc" "${SOURCES}/root-filesystem/src/hello.c" -Os $CFLAGS
-static \
-o "$STAGE_USR/bin/hello-static" || dienow
STATIC=--static
else
@@ -68,7 +68,7 @@
# Debug wrapper for use with /usr/src/record-commands.sh
-"${ARCH}-cc" "$SOURCES/toys/wrappy.c" -Os $CFLAGS $STATIC \
+"${CC_PREFIX}cc" "$SOURCES/toys/wrappy.c" -Os $CFLAGS $STATIC \
-o "$STAGE_USR/bin/record-commands-wrapper" || dienow
# Do we need shared libraries?
@@ -78,18 +78,18 @@
echo Copying compiler libraries...
mkdir -p "$STAGE_USR/lib" || dienow
(path_search \
- "$("$ARCH-cc" --print-search-dirs | sed -n 's/^libraries: =*//p')" \
+ "$("${CC_PREFIX}cc" --print-search-dirs | sed -n 's/^libraries:
=*//p')" \
"*.so*" 'cp -H "$DIR/$FILE" "$STAGE_USR/lib/$FILE"' \
|| dienow) | dotprogress
[ -z "$SKIP_STRIP" ] &&
- "${ARCH}-strip" --strip-unneeded "$STAGE_USR"/lib/*.so
+ "${CC_PREFIX}strip" --strip-unneeded "$STAGE_USR"/lib/*.so
fi
# Clean up and package the result
[ -z "$SKIP_STRIP" ] &&
- "${ARCH}-strip" "$STAGE_USR"/{bin/*,sbin/*}
+ "${CC_PREFIX}strip" "$STAGE_USR"/{bin/*,sbin/*}
create_stage_tarball
More information about the Aboriginal
mailing list