2006-05-02 23:35:55 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#set -x
|
|
|
|
|
|
|
|
echo ""
|
2006-07-19 01:54:31 +02:00
|
|
|
echo "Checking build system dependencies:"
|
2006-05-02 23:35:55 +02:00
|
|
|
|
2006-12-13 08:21:16 +01:00
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'environment'
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
if test -n "$CC" ; then
|
2006-12-13 08:25:22 +01:00
|
|
|
echo "CC clean: FALSE"
|
2006-12-13 08:21:16 +01:00
|
|
|
/bin/echo -e "\n\nYou must run 'unset CC' so buildroot can run with";
|
2006-12-13 10:17:12 +01:00
|
|
|
/bin/echo -e "a clean environment on your build machine\n";
|
2006-12-13 08:21:16 +01:00
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
echo "CC clean: Ok"
|
|
|
|
|
|
|
|
|
|
|
|
if test -n "$CXX" ; then
|
2006-12-13 08:25:22 +01:00
|
|
|
echo "CXX clean: FALSE"
|
2006-12-13 08:21:16 +01:00
|
|
|
/bin/echo -e "\n\nYou must run 'unset CXX' so buildroot can run with";
|
2006-12-13 10:17:12 +01:00
|
|
|
/bin/echo -e "a clean environment on your build machine\n";
|
2006-12-13 08:21:16 +01:00
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
echo "CXX clean: Ok"
|
|
|
|
|
|
|
|
|
|
|
|
if test -n "$CPP" ; then
|
2006-12-13 08:25:22 +01:00
|
|
|
echo "CPP clean: FALSE"
|
2006-12-13 08:21:16 +01:00
|
|
|
/bin/echo -e "\n\nYou must run 'unset CPP' so buildroot can run with";
|
2006-12-13 10:17:12 +01:00
|
|
|
/bin/echo -e "a clean environment on your build machine\n";
|
2006-12-13 08:21:16 +01:00
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
echo "CPP clean: Ok"
|
|
|
|
|
|
|
|
|
2006-12-13 08:25:22 +01:00
|
|
|
if test -n "$CFLAGS" ; then
|
|
|
|
echo "CFLAGS clean: FALSE"
|
|
|
|
/bin/echo -e "\n\nYou must run 'unset CFLAGS' so buildroot can run with";
|
2006-12-13 10:17:12 +01:00
|
|
|
/bin/echo -e "a clean environment on your build machine\n";
|
2006-12-13 08:21:16 +01:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2006-12-13 08:25:22 +01:00
|
|
|
echo "CFLAGS clean: Ok"
|
2006-12-13 08:21:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
if test -n "$CXXFLAGS" ; then
|
2006-12-13 08:25:22 +01:00
|
|
|
echo "CXXFLAGS clean: FALSE"
|
2006-12-13 08:21:16 +01:00
|
|
|
/bin/echo -e "\n\nYou must run 'unset CXXFLAGS' so buildroot can run with";
|
2006-12-13 10:17:12 +01:00
|
|
|
/bin/echo -e "a clean environment on your build machine\n";
|
2006-12-13 08:21:16 +01:00
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
echo "CXXFLAGS clean: Ok"
|
|
|
|
|
2006-07-19 01:39:39 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# 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
|
2006-12-13 08:21:16 +01:00
|
|
|
echo "sed works: No, using buildroot version instead"
|
2006-07-19 01:39:39 +02:00
|
|
|
else
|
2006-12-13 08:21:16 +01:00
|
|
|
echo "sed works: Ok"
|
2006-07-19 01:39:39 +02:00
|
|
|
fi
|
|
|
|
XSED=$HOST_SED_DIR/bin/sed
|
2006-05-02 23:35:55 +02:00
|
|
|
|
2006-11-29 11:39:30 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'which'
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
if ! which which > /dev/null ; then
|
|
|
|
echo "which installed: FALSE"
|
2006-12-08 06:24:59 +01:00
|
|
|
/bin/echo -e "\n\nYou must install 'which' on your build machine\n";
|
2006-11-29 11:39:30 +01:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2006-12-13 08:21:16 +01:00
|
|
|
echo "which installed: Ok"
|
2006-11-29 11:39:30 +01:00
|
|
|
|
|
|
|
|
2006-05-02 23:35:55 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'make'
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
MAKE=$(which make)
|
|
|
|
if [ -z "$MAKE" ] ; then
|
|
|
|
echo "make installed: FALSE"
|
2006-12-08 06:24:59 +01:00
|
|
|
/bin/echo -e "\n\nYou must install 'make' on your build machine\n";
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2006-07-19 01:39:39 +02:00
|
|
|
MAKE_VERSION=$($MAKE --version 2>&1 | head -n1 | $XSED -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g')
|
2006-05-02 23:35:55 +02:00
|
|
|
if [ -z "$MAKE_VERSION" ] ; then
|
|
|
|
echo "make installed: FALSE"
|
2006-12-08 06:24:59 +01:00
|
|
|
/bin/echo -e "\n\nYou must install 'make' on your build machine\n";
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2006-07-19 01:39:39 +02:00
|
|
|
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")
|
2006-05-02 23:35:55 +02:00
|
|
|
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;
|
|
|
|
fi;
|
2006-12-13 08:21:16 +01:00
|
|
|
echo "GNU make version '$MAKE_VERSION': Ok"
|
2006-05-02 23:35:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'gcc'
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-11-28 11:06:48 +01:00
|
|
|
COMPILER=$(which $HOSTCC)
|
2006-05-02 23:35:55 +02:00
|
|
|
if [ -z "$COMPILER" ] ; then
|
|
|
|
COMPILER=$(which cc)
|
|
|
|
fi;
|
2006-11-29 11:39:30 +01:00
|
|
|
if [ -z "$COMPILER" ] ; then
|
|
|
|
echo "C Compiler installed: FALSE"
|
2006-12-08 06:24:59 +01:00
|
|
|
/bin/echo -e "\n\nYou must install 'gcc' on your build machine\n";
|
2006-11-29 11:39:30 +01:00
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
|
2006-11-28 11:06:48 +01:00
|
|
|
COMPILER_VERSION=$($COMPILER --version 2>&1 | head -n1 | $XSED -e 's/^.*(.CC) \([0-9\.]\)/\1/g' -e "s/[-\ ].*//g")
|
2006-05-02 23:35:55 +02:00
|
|
|
if [ -z "$COMPILER_VERSION" ] ; then
|
|
|
|
echo "gcc installed: FALSE"
|
2006-12-08 06:24:59 +01:00
|
|
|
/bin/echo -e "\n\nYou must install 'gcc' on your build machine\n";
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2006-07-19 01:39:39 +02:00
|
|
|
COMPILER_MAJOR=$(echo $COMPILER_VERSION | $XSED -e "s/\..*//g")
|
|
|
|
COMPILER_MINOR=$(echo $COMPILER_VERSION | $XSED -e "s/^$COMPILER_MAJOR\.//g" -e "s/\..*//g")
|
2006-05-02 23:35:55 +02:00
|
|
|
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;
|
|
|
|
fi;
|
2006-11-29 11:39:30 +01:00
|
|
|
echo "C compiler '$COMPILER'"
|
2006-12-13 08:21:16 +01:00
|
|
|
echo "C compiler version '$COMPILER_VERSION': Ok"
|
2006-05-02 23:35:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'bison'
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
if ! which bison > /dev/null ; then
|
|
|
|
echo "bison installed: FALSE"
|
2006-12-08 06:24:59 +01:00
|
|
|
/bin/echo -e "\n\nYou must install 'bison' on your build machine\n";
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2006-12-13 08:21:16 +01:00
|
|
|
echo "bison installed: Ok"
|
2006-05-02 23:35:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'flex'
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
if ! which flex > /dev/null ; then
|
|
|
|
echo "flex installed: FALSE"
|
2006-12-08 06:24:59 +01:00
|
|
|
/bin/echo -e "\n\nYou must install 'flex' on your build machine\n";
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1;
|
|
|
|
fi;
|
2006-12-13 08:21:16 +01:00
|
|
|
echo "flex installed: Ok"
|
2006-05-02 23:35:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'gettext'
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
if ! which msgfmt > /dev/null ; then \
|
|
|
|
echo "gettext installed: FALSE"
|
2006-12-08 06:24:59 +01:00
|
|
|
/bin/echo -e "\n\nYou must install 'gettext' on your build machine\n"; \
|
2006-05-02 23:35:55 +02:00
|
|
|
exit 1; \
|
|
|
|
fi;
|
2006-12-13 08:21:16 +01:00
|
|
|
echo "gettext installed: Ok"
|
2006-05-02 23:35:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# All done
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-12-13 08:21:16 +01:00
|
|
|
echo "Build system dependencies: Ok"
|
2006-07-19 01:42:03 +02:00
|
|
|
echo ""
|
2006-05-02 23:35:55 +02:00
|
|
|
|