From ab2d8cd098c3294d666a8e32fea9e14f31322361 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 25 May 2010 10:09:49 -0500 Subject: [PATCH] Test for static linking capability on the host, and complain if we need it but it isn't there. --- host-tools.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/host-tools.sh b/host-tools.sh index 5109797..95b54ac 100755 --- a/host-tools.sh +++ b/host-tools.sh @@ -62,6 +62,23 @@ mkdir -p "$STAGE_DIR" || dienow PATH="$STAGE_DIR:$PATH" +# Sanity test for the host supporting static linking. + +if [ "$BUILD_STATIC" != none ] +then + $CC "$SOURCES/toys/hello.c" --static -o "$WORK/hello" && + rm "$WORK/hello" + + if [ $? -ne 0 ] + then + echo "Your host toolchain does not support static linking." >&2 + echo "Either install support, or export BUILD_STATIC=none" >&2 + + dienow + fi +fi + + # Start by building busybox. We have no idea what strange things our host # system has (or lacks, such as "which"), so throw busybox at it first # thing.