summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/dependencies/dependencies.mk2
-rwxr-xr-xtoolchain/dependencies/dependencies.sh34
-rw-r--r--toolchain/uClibc/uclibc.mk2
3 files changed, 30 insertions, 8 deletions
diff --git a/toolchain/dependencies/dependencies.mk b/toolchain/dependencies/dependencies.mk
index 1b25a1573..0bcb840d3 100644
--- a/toolchain/dependencies/dependencies.mk
+++ b/toolchain/dependencies/dependencies.mk
@@ -5,7 +5,7 @@
#
######################################################################
-dependencies:
+dependencies: host-sed
$(TOPDIR)/toolchain/dependencies/dependencies.sh
dependencies-source:
diff --git a/toolchain/dependencies/dependencies.sh b/toolchain/dependencies/dependencies.sh
index c0a23ae1c..b14b941d7 100755
--- a/toolchain/dependencies/dependencies.sh
+++ b/toolchain/dependencies/dependencies.sh
@@ -6,6 +6,28 @@ set -e
echo "Checking build system dependencies:"
echo ""
+#############################################################
+#
+# check build system 'sed'
+#
+#############################################################
+if test -x /usr/bin/sed ; then
+ SED="/usr/bin/sed"
+else
+ if test -x /bin/sed ; then
+ SED="/bin/sed"
+ else
+ SED="sed"
+ fi
+fi
+echo "HELLO" > .sedtest
+$SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1
+if test $? != 0 ; then
+ echo "sed works: No, using buildroot version instead"
+else
+ echo "sed works: Ok"
+fi
+XSED=$HOST_SED_DIR/bin/sed
#############################################################
#
@@ -18,14 +40,14 @@ if [ -z "$MAKE" ] ; then
echo -e "\n\nYou must install 'make' on your build machine\n";
exit 1;
fi;
-MAKE_VERSION=$($MAKE --version 2>&1 | head -n1 | sed -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g')
+MAKE_VERSION=$($MAKE --version 2>&1 | head -n1 | $XSED -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g')
if [ -z "$MAKE_VERSION" ] ; then
echo "make installed: FALSE"
echo -e "\n\nYou must install 'make' on your build machine\n";
exit 1;
fi;
-MAKE_MAJOR=$(echo $MAKE_VERSION | sed -e "s/\..*//g")
-MAKE_MINOR=$(echo $MAKE_VERSION | sed -e "s/^$MAKE_MAJOR\.//g" -e "s/\..*//g")
+MAKE_MAJOR=$(echo $MAKE_VERSION | $XSED -e "s/\..*//g")
+MAKE_MINOR=$(echo $MAKE_VERSION | $XSED -e "s/^$MAKE_MAJOR\.//g" -e "s/\..*//g" -e "s/[a-zA-Z].*//g")
if [ $MAKE_MAJOR -lt 3 -o $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 8 ] ; then
echo "You have make '$MAKE_VERSION' installed. GNU make >=3.80 is required"
exit 1;
@@ -48,14 +70,14 @@ if [ -z "$COMPILER" ] ; then
exit 1;
fi;
fi;
-COMPILER_VERSION=$($COMPILER --version 2>&1 | head -n1 | sed -e 's/^.* \([0-9\.]\)/\1/g' -e "s/[-\ ].*//g")
+COMPILER_VERSION=$($COMPILER --version 2>&1 | head -n1 | $XSED -e 's/^.* \([0-9\.]\)/\1/g' -e "s/[-\ ].*//g")
if [ -z "$COMPILER_VERSION" ] ; then
echo "gcc installed: FALSE"
echo -e "\n\nYou must install 'gcc' on your build machine\n";
exit 1;
fi;
-COMPILER_MAJOR=$(echo $COMPILER_VERSION | sed -e "s/\..*//g")
-COMPILER_MINOR=$(echo $COMPILER_VERSION | sed -e "s/^$COMPILER_MAJOR\.//g" -e "s/\..*//g")
+COMPILER_MAJOR=$(echo $COMPILER_VERSION | $XSED -e "s/\..*//g")
+COMPILER_MINOR=$(echo $COMPILER_VERSION | $XSED -e "s/^$COMPILER_MAJOR\.//g" -e "s/\..*//g")
if [ $COMPILER_MAJOR -lt 3 -o $COMPILER_MAJOR -eq 2 -a $COMPILER_MINOR -lt 95 ] ; then
echo "You have gcc '$COMPILER_VERSION' installed. gcc >= 2.95 is required"
exit 1;
diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk
index 08a1ce776..2caceebb4 100644
--- a/toolchain/uClibc/uclibc.mk
+++ b/toolchain/uClibc/uclibc.mk
@@ -68,7 +68,7 @@ $(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
touch $(UCLIBC_DIR)/.unpacked
uclibc-configured: $(UCLIBC_DIR)/.configured
-$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked
+$(UCLIBC_DIR)/.configured: dependencies $(UCLIBC_DIR)/.unpacked
cp $(UCLIBC_CONFIG_FILE) $(UCLIBC_DIR)/.config
$(SED) 's,^CROSS_COMPILER_PREFIX=.*,CROSS_COMPILER_PREFIX="$(TARGET_CROSS)",g' \
-e 's,# TARGET_$(UCLIBC_TARGET_ARCH) is not set,TARGET_$(UCLIBC_TARGET_ARCH)=y,g' \