aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-03-03 10:56:11 -0600
committerRob Landley <rob@landley.net>2012-03-03 10:56:11 -0600
commit344c267e9fe5c6a39efdbf0305bd873d5bef65f3 (patch)
tree94de0771123873b6f3fa8cb0e468f3b595555b1b
parentad065e2d1b96dd2f387296086ef808cd28bf3a47 (diff)
downloadtoybox-0.2.1.tar.gz
Fix from Georgi Chorbadzhiyski to make cross compiling more robust.0.2.1
-rw-r--r--configure5
-rwxr-xr-xscripts/genconfig.sh2
-rwxr-xr-xscripts/make.sh6
3 files changed, 6 insertions, 7 deletions
diff --git a/configure b/configure
index 9b7bb365..4e05af7e 100644
--- a/configure
+++ b/configure
@@ -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
diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh
index 4ecff254..449ee1ea 100755
--- a/scripts/genconfig.sh
+++ b/scripts/genconfig.sh
@@ -13,7 +13,7 @@ probeconfig()
# 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
diff --git a/scripts/make.sh b/scripts/make.sh
index e2236eac..e0f6d4b3 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -102,9 +102,9 @@ do_loudly()
"$@"
}
-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