9
0
Fork 0

Buildroot dependency changes from Mike Smith

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4249 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2012-01-01 20:55:42 +00:00
parent 068e88596d
commit 6689dfcd4b
1 changed files with 148 additions and 101 deletions

View File

@ -5,60 +5,73 @@
echo "" echo ""
echo "Checking build system dependencies:" echo "Checking build system dependencies:"
############################################################# #############################################################
# #
# check build system 'environment' # check build system 'environment'
# #
############################################################# #############################################################
if test -n "$CC" ; then if test -n "$CC" ; then
echo "CC clean: FALSE" echo "CC clean: FALSE"
/bin/echo -e "\n\nYou must run 'unset CC' so buildroot can run with"; echo ""
/bin/echo -e "a clean environment on your build machine\n"; echo ""
exit 1; echo "You must run 'unset CC' so buildroot can run with"
fi; echo "a clean environment on your build machine"
echo ""
exit 1
fi
echo "CC clean: Ok" echo "CC clean: Ok"
if test -n "$CXX" ; then if test -n "$CXX" ; then
echo "CXX clean: FALSE" echo "CXX clean: FALSE"
/bin/echo -e "\n\nYou must run 'unset CXX' so buildroot can run with"; echo ""
/bin/echo -e "a clean environment on your build machine\n"; echo ""
exit 1; echo "You must run 'unset CXX' so buildroot can run with"
fi; echo "a clean environment on your build machine"
echo ""
exit 1
fi
echo "CXX clean: Ok" echo "CXX clean: Ok"
if test -n "$CPP" ; then if test -n "$CPP" ; then
echo "CPP clean: FALSE" echo "CPP clean: FALSE"
/bin/echo -e "\n\nYou must run 'unset CPP' so buildroot can run with"; echo ""
/bin/echo -e "a clean environment on your build machine\n"; echo ""
exit 1; echo "You must run 'unset CPP' so buildroot can run with"
fi; echo "a clean environment on your build machine"
echo ""
exit 1
fi
echo "CPP clean: Ok" echo "CPP clean: Ok"
if test -n "$CFLAGS" ; then if test -n "$CFLAGS" ; then
echo "CFLAGS clean: FALSE" echo "CFLAGS clean: FALSE"
/bin/echo -e "\n\nYou must run 'unset CFLAGS' so buildroot can run with"; echo ""
/bin/echo -e "a clean environment on your build machine\n"; echo ""
exit 1; echo "You must run 'unset CFLAGS' so buildroot can run with"
fi; echo "a clean environment on your build machine"
echo ""
exit 1
fi
echo "CFLAGS clean: Ok" echo "CFLAGS clean: Ok"
if test -n "$INCLUDES" ; then if test -n "$INCLUDES" ; then
echo "INCLUDES clean: FALSE" echo "INCLUDES clean: FALSE"
/bin/echo -e "WARNING: INCLUDES contains:\n\t'$INCLUDES'" echo "WARNING: INCLUDES contains:"
echo " '$INCLUDES'"
else else
echo "INCLUDES clean: Ok" echo "INCLUDES clean: Ok"
fi fi
if test -n "$CXXFLAGS" ; then if test -n "$CXXFLAGS" ; then
echo "CXXFLAGS clean: FALSE" echo "CXXFLAGS clean: FALSE"
/bin/echo -e "\n\nYou must run 'unset CXXFLAGS' so buildroot can run with"; echo ""
/bin/echo -e "a clean environment on your build machine\n"; echo ""
exit 1; echo "You must run 'unset CXXFLAGS' so buildroot can run with"
fi; echo "a clean environment on your build machine"
echo ""
exit 1
fi
echo "CXXFLAGS clean: Ok" echo "CXXFLAGS clean: Ok"
echo "WORKS" | grep "WORKS" >/dev/null 2>&1 echo "WORKS" | grep "WORKS" >/dev/null 2>&1
@ -70,10 +83,10 @@ fi
# sanity check for CWD in LD_LIBRARY_PATH # sanity check for CWD in LD_LIBRARY_PATH
# try not to rely on egrep.. # try not to rely on egrep..
if test -n "$LD_LIBRARY_PATH" ; then if test -n "$LD_LIBRARY_PATH" ; then
/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep ':.:' >/dev/null 2>&1 || echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep ':.:' >/dev/null 2>&1 ||
/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep 'TRiGGER_start:' >/dev/null 2>&1 || echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep 'TRiGGER_start:' >/dev/null 2>&1 ||
/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep ':TRiGGER_end' >/dev/null 2>&1 || echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep ':TRiGGER_end' >/dev/null 2>&1 ||
/bin/echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | /bin/grep '::' >/dev/null 2>&1 echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep '::' >/dev/null 2>&1
if test $? = 0; then if test $? = 0; then
echo "LD_LIBRARY_PATH sane: FALSE" echo "LD_LIBRARY_PATH sane: FALSE"
echo "You seem to have the current working directory in your" echo "You seem to have the current working directory in your"
@ -82,15 +95,14 @@ if test -n "$LD_LIBRARY_PATH" ; then
else else
echo "LD_LIBRARY_PATH sane: Ok" echo "LD_LIBRARY_PATH sane: Ok"
fi fi
fi; fi
############################################################# #############################################################
# #
# check build system 'sed' # check build system 'sed'
# #
############################################################# #############################################################
if test -x /usr/bin/sed ; then if test -x /usr/bin/sed ; then
SED="/usr/bin/sed" SED="/usr/bin/sed"
else else
@ -103,106 +115,130 @@ fi
echo "HELLO" > .sedtest echo "HELLO" > .sedtest
$SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1 $SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1
if test $? != 0 ; then if test $? != 0 ; then
echo "sed works: No, using buildroot version instead" echo "sed works: No"
exit 1
else else
echo "sed works: Ok" echo "sed works: Ok"
fi fi
rm -f .sedtest rm -f .sedtest
XSED=$HOST_SED_DIR/bin/sed
############################################################# #############################################################
# #
# check build system 'which' # check build system 'which'
# #
############################################################# #############################################################
if ! which which > /dev/null ; then if ! which which > /dev/null ; then
echo "which installed: FALSE" echo "which installed: FALSE"
/bin/echo -e "\n\nYou must install 'which' on your build machine\n"; echo ""
exit 1; echo ""
fi; echo "You must install 'which' on your build machine"
echo ""
exit 1
fi
echo "which installed: Ok" echo "which installed: Ok"
############################################################# #############################################################
# #
# check build system 'make' # check build system 'make'
# #
############################################################# #############################################################
MAKE=$(which make) MAKE=$(which make)
if [ -z "$MAKE" ] ; then if [ -z "$MAKE" ] ; then
echo "make installed: FALSE" echo "make installed: FALSE"
/bin/echo -e "\n\nYou must install 'make' on your build machine\n"; echo ""
exit 1; echo ""
fi; echo "You must install 'make' on your build machine"
MAKE_VERSION=$($MAKE --version 2>&1 | head -n1 | $XSED -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g') echo ""
exit 1
fi
MAKE_VERSION=$($MAKE --version 2>&1 | head -n1 | $SED -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g')
if [ -z "$MAKE_VERSION" ] ; then if [ -z "$MAKE_VERSION" ] ; then
echo "make installed: FALSE" echo "make installed: FALSE"
/bin/echo -e "\n\nYou must install 'make' on your build machine\n"; echo ""
exit 1; echo ""
fi; echo "You must install 'make' on your build machine"
MAKE_MAJOR=$(echo $MAKE_VERSION | $XSED -e "s/\..*//g") echo ""
MAKE_MINOR=$(echo $MAKE_VERSION | $XSED -e "s/^$MAKE_MAJOR\.//g" -e "s/\..*//g" -e "s/[a-zA-Z].*//g") 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" -e "s/[a-zA-Z].*//g")
if [ $MAKE_MAJOR -lt 3 -o $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 8 ] ; then 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" echo "You have make '$MAKE_VERSION' installed. GNU make >=3.80 is required"
exit 1; exit 1;
fi; fi
echo "GNU make version '$MAKE_VERSION': Ok" echo "GNU make version '$MAKE_VERSION': Ok"
############################################################# #############################################################
# #
# check build system 'gcc' # check build system 'gcc'
# #
############################################################# #############################################################
COMPILER=$(which $HOSTCC) COMPILER=$(which $HOSTCC)
if [ -z "$COMPILER" ] ; then if [ -z "$COMPILER" ] ; then
COMPILER=$(which cc) COMPILER=$(which cc)
fi; fi
if [ -z "$COMPILER" ] ; then if [ -z "$COMPILER" ] ; then
echo "C Compiler installed: FALSE" echo "C Compiler installed: FALSE"
/bin/echo -e "\n\nYou must install 'gcc' on your build machine\n"; echo ""
exit 1; echo ""
fi; echo "You must install 'gcc' on your build machine"
echo ""
exit 1
fi
COMPILER_VERSION=$($COMPILER -v 2>&1 | $XSED -n '/^gcc version/p' | COMPILER_VERSION=$($COMPILER -v 2>&1 | $SED -n '/^gcc version/p' |
$XSED -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q') $SED -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
if [ -z "$COMPILER_VERSION" ] ; then if [ -z "$COMPILER_VERSION" ] ; then
echo "gcc installed: FALSE" echo "gcc installed: FALSE"
/bin/echo -e "\n\nYou must install 'gcc' on your build machine\n"; echo ""
exit 1; echo ""
fi; echo "You must install 'gcc' on your build machine"
COMPILER_MAJOR=$(echo $COMPILER_VERSION | $XSED -e "s/\..*//g") echo ""
COMPILER_MINOR=$(echo $COMPILER_VERSION | $XSED -e "s/^$COMPILER_MAJOR\.//g" -e "s/\..*//g") 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")
if [ $COMPILER_MAJOR -lt 3 -o $COMPILER_MAJOR -eq 2 -a $COMPILER_MINOR -lt 95 ] ; then 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" echo "You have gcc '$COMPILER_VERSION' installed. gcc >= 2.95 is required"
exit 1; exit 1;
fi; fi
echo "C compiler '$COMPILER'" echo "C compiler '$COMPILER'"
echo "C compiler version '$COMPILER_VERSION': Ok" echo "C compiler version '$COMPILER_VERSION': Ok"
# check for host CXX # check for host CXX
CXXCOMPILER=$(which $HOSTCXX 2>/dev/null) CXXCOMPILER=$(which $HOSTCXX 2>/dev/null)
if [ -z "$CXXCOMPILER" ] ; then if [ -z "$CXXCOMPILER" ] ; then
CXXCOMPILER=$(which c++ 2>/dev/null) CXXCOMPILER=$(which c++ 2>/dev/null)
fi fi
if [ -z "$CXXCOMPILER" ] ; then if [ -z "$CXXCOMPILER" ] ; then
echo "C++ Compiler installed: FALSE" echo "C++ Compiler installed: FALSE"
/bin/echo -e "\nYou may have to install 'g++' on your build machine\n" echo ""
echo "You may have to install 'g++' on your build machine"
echo ""
#exit 1 #exit 1
fi fi
if [ ! -z "$CXXCOMPILER" ] ; then if [ ! -z "$CXXCOMPILER" ] ; then
CXXCOMPILER_VERSION=$($CXXCOMPILER -v 2>&1 | $XSED -n '/^gcc version/p' | CXXCOMPILER_VERSION=$($CXXCOMPILER -v 2>&1 | $SED -n '/^gcc version/p' |
$XSED -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q') $SED -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
if [ -z "$CXXCOMPILER_VERSION" ] ; then if [ -z "$CXXCOMPILER_VERSION" ] ; then
echo "c++ installed: FALSE" echo "c++ installed: FALSE"
/bin/echo -e "\nYou may have to install 'g++' on your build machine\n" echo ""
echo "You may have to install 'g++' on your build machine"
echo ""
#exit 1 #exit 1
fi fi
CXXCOMPILER_MAJOR=$(echo $CXXCOMPILER_VERSION | $XSED -e "s/\..*//g") CXXCOMPILER_MAJOR=$(echo $CXXCOMPILER_VERSION | $SED -e "s/\..*//g")
CXXCOMPILER_MINOR=$(echo $CXXCOMPILER_VERSION | $XSED -e "s/^$CXXCOMPILER_MAJOR\.//g" -e "s/\..*//g") CXXCOMPILER_MINOR=$(echo $CXXCOMPILER_VERSION | $SED -e "s/^$CXXCOMPILER_MAJOR\.//g" -e "s/\..*//g")
if [ $CXXCOMPILER_MAJOR -lt 3 -o $CXXCOMPILER_MAJOR -eq 2 -a $CXXCOMPILER_MINOR -lt 95 ] ; then 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" echo "You have g++ '$CXXCOMPILER_VERSION' installed. g++ >= 2.95 is required"
exit 1 exit 1
@ -216,54 +252,65 @@ fi
# check build system 'bison' # check build system 'bison'
# #
############################################################# #############################################################
if ! which bison > /dev/null ; then if ! which bison > /dev/null ; then
echo "bison installed: FALSE" echo "bison installed: FALSE"
/bin/echo -e "\n\nYou must install 'bison' on your build machine\n"; echo ""
exit 1; echo ""
fi; echo "You must install 'bison' on your build machine"
echo ""
exit 1
fi
echo "bison installed: Ok" echo "bison installed: Ok"
############################################################# #############################################################
# #
# check build system 'flex' # check build system 'flex'
# #
############################################################# #############################################################
if ! which flex > /dev/null ; then if ! which flex > /dev/null ; then
echo "flex installed: FALSE" echo "flex installed: FALSE"
/bin/echo -e "\n\nYou must install 'flex' on your build machine\n"; echo ""
exit 1; echo ""
fi; echo "You must install 'flex' on your build machine"
echo ""
exit 1
fi
echo "flex installed: Ok" echo "flex installed: Ok"
############################################################# #############################################################
# #
# check build system 'gettext' # check build system 'gettext'
# #
############################################################# #############################################################
if ! which msgfmt > /dev/null ; then \
if ! which msgfmt > /dev/null ; then
echo "gettext installed: FALSE" echo "gettext installed: FALSE"
/bin/echo -e "\n\nYou must install 'gettext' on your build machine\n"; \ echo ""
exit 1; \ echo ""
fi; echo "You must install 'gettext' on your build machine"
echo ""
exit 1
fi
echo "gettext installed: Ok" echo "gettext installed: Ok"
if ! which makeinfo > /dev/null ; then
if ! which makeinfo > /dev/null ; then \
echo "makeinfo installed: FALSE" echo "makeinfo installed: FALSE"
/bin/echo -e "\n\nMost likely some packages will fail to build their documentation" echo ""
/bin/echo -e "Either install 'makeinfo' on your host or fix the respective packages" echo ""
echo "Most likely some packages will fail to build their documentation"
echo "Either install 'makeinfo' on your host or fix the respective packages"
else else
echo "makeinfo installed: Ok" echo "makeinfo installed: Ok"
fi fi
############################################################# #############################################################
# #
# All done # All done
# #
############################################################# #############################################################
echo "Build system dependencies: Ok" echo "Build system dependencies: Ok"
echo "" echo ""