Mercurial > hg > toybox
changeset 512:9bcc288a1c54 0.2.1
Fix from Georgi Chorbadzhiyski to make cross compiling more robust.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 03 Mar 2012 10:56:11 -0600 |
parents | 15bad33d5ded |
children | 8dc4aced2ffc |
files | configure scripts/genconfig.sh scripts/make.sh |
diffstat | 3 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/configure Fri Mar 02 20:18:17 2012 -0600 +++ b/configure Sat Mar 03 10:56:11 2012 -0600 @@ -8,7 +8,6 @@ [ -z "$CFLAGS" ] && CFLAGS="-Wall -Wundef -Wno-char-subscripts" CFLAGS="$CFLAGS -funsigned-char" [ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -Wl,--gc-sections" -[ -z "$CC" ] && CC="cc" -CC="${CROSS_COMPILE}${CC}" -[ -z "$STRIP" ] && STRIP="${CROSS_COMPILE}strip" +[ -z "$CC" ] && CC=cc +[ -z "$STRIP" ] && STRIP=strip [ -z "$HOSTCC" ] && HOSTCC=gcc
--- a/scripts/genconfig.sh Fri Mar 02 20:18:17 2012 -0600 +++ b/scripts/genconfig.sh Sat Mar 03 10:56:11 2012 -0600 @@ -13,7 +13,7 @@ # Probe for container support on target echo -e "# container support\nconfig TOYBOX_CONTAINER\n\tbool" || return 1 - $CC -c -xc -o /dev/null - << EOF + ${CROSS_COMPILE}${CC} -c -xc -o /dev/null - 2>/dev/null << EOF #include <sched.h> int x=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET; EOF
--- a/scripts/make.sh Fri Mar 02 20:18:17 2012 -0600 +++ b/scripts/make.sh Sat Mar 03 10:56:11 2012 -0600 @@ -102,9 +102,9 @@ "$@" } -do_loudly $CC $CFLAGS -I . -o toybox_unstripped $OPTIMIZE main.c lib/*.c \ - $TOYFILES -Wl,--as-needed,-lutil,--no-as-needed || exit 1 -do_loudly $STRIP toybox_unstripped -o toybox || exit 1 +do_loudly ${CROSS_COMPILE}${CC} $CFLAGS -I . -o toybox_unstripped $OPTIMIZE \ + main.c lib/*.c $TOYFILES -Wl,--as-needed,-lutil,--no-as-needed || exit 1 +do_loudly ${CROSS_COMPILE}${STRIP} toybox_unstripped -o toybox || exit 1 # gcc 4.4's strip command is buggy, and doesn't set the executable bit on # its output the way SUSv4 suggests it do so. do_loudly chmod +x toybox || exit 1