2006-05-02 23:35:55 +02:00
|
|
|
#!/bin/sh
|
2007-02-09 13:32:21 +01:00
|
|
|
# vi: set sw=4 ts=4:
|
2006-05-02 23:35:55 +02:00
|
|
|
#set -x
|
|
|
|
|
|
|
|
echo ""
|
2006-07-19 01:54:31 +02:00
|
|
|
echo "Checking build system dependencies:"
|
2007-03-21 19:15:02 +01:00
|
|
|
export LC_ALL=C
|
2006-12-13 08:21:16 +01:00
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'environment'
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-08-20 17:47:42 +02:00
|
|
|
if test -n "$BUILDROOT_DL_DIR" ; then
|
|
|
|
/bin/echo -e "Overriding \$(DL_DIR) in '.config'. Ok"
|
|
|
|
/bin/echo -e "External download directory: Ok ($BUILDROOT_DL_DIR)"
|
|
|
|
else
|
|
|
|
echo "BUILDROOT_DL_DIR clean: Ok"
|
|
|
|
fi
|
|
|
|
|
2006-12-13 08:21:16 +01:00
|
|
|
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
|
|
|
|
2007-02-09 18:28:27 +01:00
|
|
|
if test -n "$INCLUDES" ; then
|
|
|
|
echo "INCLUDES clean: FALSE"
|
|
|
|
/bin/echo -e "WARNING: INCLUDES contains:\n\t'$INCLUDES'"
|
|
|
|
else
|
2007-02-12 11:41:59 +01:00
|
|
|
echo "INCLUDES clean: Ok"
|
2007-02-09 18:28:27 +01:00
|
|
|
fi
|
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"
|
|
|
|
|
2007-06-26 15:26:51 +02:00
|
|
|
if test -n "$GREP_OPTIONS" ; then
|
|
|
|
echo "GREP_OPTIONS clean: FALSE"
|
|
|
|
/bin/echo -e "\n\nYou must run 'unset GREP_OPTIONS' so buildroot can run with";
|
|
|
|
/bin/echo -e "a clean environment on your build machine\n";
|
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
if test -n "$CROSS_COMPILE" ; then
|
|
|
|
echo "CROSS_COMPILE clean: FALSE"
|
|
|
|
/bin/echo -e "\n\nYou must run 'unset CROSS_COMPILE' so buildroot can run with";
|
|
|
|
/bin/echo -e "a clean environment on your build machine\n";
|
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
if test -n "$ARCH" ; then
|
|
|
|
echo "ARCH clean: FALSE"
|
|
|
|
/bin/echo -e "\n\nYou must run 'unset ARCH' so buildroot can run with";
|
|
|
|
/bin/echo -e "a clean environment on your build machine\n";
|
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
|
2007-01-19 18:11:05 +01:00
|
|
|
echo "WORKS" | grep "WORKS" >/dev/null 2>&1
|
|
|
|
if test $? != 0 ; then
|
|
|
|
echo "grep works: FALSE"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# sanity check for CWD in LD_LIBRARY_PATH
|
|
|
|
# try not to rely on egrep..
|
|
|
|
if test -n "$LD_LIBRARY_PATH" ; then
|
|
|
|
/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep ':.:' >/dev/null 2>&1 ||
|
|
|
|
/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep 'TRiGGER_start:' >/dev/null 2>&1 ||
|
|
|
|
/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep ':TRiGGER_end' >/dev/null 2>&1 ||
|
|
|
|
/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep '::' >/dev/null 2>&1
|
|
|
|
if test $? = 0; then
|
|
|
|
echo "LD_LIBRARY_PATH sane: FALSE"
|
|
|
|
echo "You seem to have the current working directory in your"
|
|
|
|
echo "LD_LIBRARY_PATH environment variable. This doesn't work."
|
|
|
|
exit 1;
|
|
|
|
else
|
|
|
|
echo "LD_LIBRARY_PATH sane: Ok"
|
|
|
|
fi
|
|
|
|
fi;
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
2007-03-09 09:33:34 +01:00
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'sed'
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
SED=$(toolchain/dependencies/check-host-sed.sh)
|
|
|
|
|
|
|
|
if [ -z "$SED" ] ; then
|
|
|
|
XSED=$HOST_SED_DIR/bin/sed
|
|
|
|
echo "sed works: No, using buildroot version instead"
|
|
|
|
else
|
|
|
|
XSED=$SED
|
|
|
|
echo "sed works: Ok ($SED)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-05-02 23:35:55 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'make'
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-05-11 14:50:15 +02:00
|
|
|
MAKE=$(which make 2> /dev/null)
|
2006-05-02 23:35:55 +02:00
|
|
|
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;
|
2007-03-21 11:54:24 +01:00
|
|
|
MAKE_VERSION=$($MAKE --version 2>&1 | $XSED -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
|
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")
|
2007-06-05 09:38:07 +02:00
|
|
|
if [ $MAKE_MAJOR -lt 3 ] || [ $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 80 ] ; then
|
2006-05-02 23:35:55 +02:00
|
|
|
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'
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-03-21 19:15:02 +01:00
|
|
|
COMPILER=$(which $HOSTCC 2> /dev/null)
|
2006-05-02 23:35:55 +02:00
|
|
|
if [ -z "$COMPILER" ] ; then
|
2007-05-11 14:50:15 +02:00
|
|
|
COMPILER=$(which cc 2> /dev/null)
|
2006-05-02 23:35:55 +02:00
|
|
|
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;
|
|
|
|
|
2008-09-04 04:30:56 +02:00
|
|
|
COMPILER_VERSION=$($COMPILER -v 2>&1 | $XSED -n '/^gcc version/p' |
|
|
|
|
$XSED -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
|
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
|
|
|
|
|
|
|
|
2007-02-09 13:32:21 +01:00
|
|
|
# check for host CXX
|
2007-03-21 19:15:02 +01:00
|
|
|
CXXCOMPILER=$(which $HOSTCXX 2> /dev/null)
|
2007-02-09 13:32:21 +01:00
|
|
|
if [ -z "$CXXCOMPILER" ] ; then
|
2007-05-11 14:50:15 +02:00
|
|
|
CXXCOMPILER=$(which c++ 2> /dev/null)
|
2007-02-09 13:32:21 +01:00
|
|
|
fi
|
|
|
|
if [ -z "$CXXCOMPILER" ] ; then
|
|
|
|
echo "C++ Compiler installed: FALSE"
|
|
|
|
/bin/echo -e "\nYou may have to install 'g++' on your build machine\n"
|
|
|
|
#exit 1
|
|
|
|
fi
|
|
|
|
if [ ! -z "$CXXCOMPILER" ] ; then
|
2008-09-04 04:30:56 +02:00
|
|
|
CXXCOMPILER_VERSION=$($CXXCOMPILER -v 2>&1 | $XSED -n '/^gcc version/p' |
|
|
|
|
$XSED -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
|
2007-02-09 13:32:21 +01:00
|
|
|
if [ -z "$CXXCOMPILER_VERSION" ] ; then
|
|
|
|
echo "c++ installed: FALSE"
|
|
|
|
/bin/echo -e "\nYou may have to install 'g++' on your build machine\n"
|
|
|
|
#exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
CXXCOMPILER_MAJOR=$(echo $CXXCOMPILER_VERSION | $XSED -e "s/\..*//g")
|
|
|
|
CXXCOMPILER_MINOR=$(echo $CXXCOMPILER_VERSION | $XSED -e "s/^$CXXCOMPILER_MAJOR\.//g" -e "s/\..*//g")
|
|
|
|
if [ $CXXCOMPILER_MAJOR -lt 3 -o $CXXCOMPILER_MAJOR -eq 2 -a $CXXCOMPILER_MINOR -lt 95 ] ; then
|
|
|
|
echo "You have g++ '$CXXCOMPILER_VERSION' installed. g++ >= 2.95 is required"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "C++ compiler '$CXXCOMPILER'"
|
|
|
|
echo "C++ compiler version '$CXXCOMPILER_VERSION': Ok"
|
|
|
|
fi
|
2006-05-02 23:35:55 +02:00
|
|
|
|
2008-06-18 15:11:52 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# check build system 'awk'
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
if ! which awk > /dev/null ; then
|
|
|
|
echo "awk installed: FALSE"
|
|
|
|
/bin/echo -e "\n\nYou must install 'awk' on your build machine\n";
|
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
echo "awk installed: 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
|
|
|
|
|
|
|
|
2007-02-15 15:07:08 +01:00
|
|
|
if ! which makeinfo > /dev/null ; then \
|
|
|
|
echo "makeinfo installed: FALSE"
|
|
|
|
/bin/echo -e "\n\nMost likely some packages will fail to build their documentation"
|
2007-02-16 10:34:11 +01:00
|
|
|
echo "Either install 'makeinfo' on your host or fix the respective packages."
|
|
|
|
echo "Makeinfo can usually be found in the texinfo package for your host."
|
2007-02-15 15:30:56 +01:00
|
|
|
else
|
|
|
|
echo "makeinfo installed: Ok"
|
2007-02-15 15:07:08 +01:00
|
|
|
fi
|
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
|
|
|
|