6 # Verify that grep works
7 echo "WORKS" | grep "WORKS" >/dev/null 2>&1
10 echo "grep doesn't work"
14 # sanity check for CWD in LD_LIBRARY_PATH
15 # try not to rely on egrep..
16 if test -n "$LD_LIBRARY_PATH" ; then
17 echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep ':\.:' >/dev/null 2>&1 ||
18 echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep 'TRiGGER_start\.:' >/dev/null 2>&1 ||
19 echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep ':\.TRiGGER_end' >/dev/null 2>&1 ||
20 echo TRiGGER_start"$LD_LIBRARY_PATH"TRiGGER_end | grep 'TRiGGER_start\.TRiGGER_end' >/dev/null 2>&1
23 echo "You seem to have the current working directory in your"
24 echo "LD_LIBRARY_PATH environment variable. This doesn't work."
29 # sanity check for CWD in PATH. Having the current working directory
30 # in the PATH makes the toolchain build process break.
31 # try not to rely on egrep..
32 if test -n "$PATH" ; then
33 echo TRiGGER_start"$PATH"TRiGGER_end | grep ':\.:' >/dev/null 2>&1 ||
34 echo TRiGGER_start"$PATH"TRiGGER_end | grep 'TRiGGER_start\.:' >/dev/null 2>&1 ||
35 echo TRiGGER_start"$PATH"TRiGGER_end | grep ':\.TRiGGER_end' >/dev/null 2>&1 ||
36 echo TRiGGER_start"$PATH"TRiGGER_end | grep 'TRiGGER_start\.TRiGGER_end' >/dev/null 2>&1
39 echo "You seem to have the current working directory in your"
40 echo "PATH environment variable. This doesn't work."
45 if test -n "$PERL_MM_OPT" ; then
47 echo "You have PERL_MM_OPT defined because Perl local::lib"
48 echo "is installed on your system. Please unset this variable"
49 echo "before starting Buildroot, otherwise the compilation of"
50 echo "Perl related packages will fail"
54 # Verify that which is installed
55 if ! which which > /dev/null ; then
57 echo "You must install 'which' on your build machine";
61 if ! which sed > /dev/null ; then
63 echo "You must install 'sed' on your build machine"
68 MAKE=$(which make 2> /dev/null)
69 if [ -z "$MAKE" ] ; then
71 echo "You must install 'make' on your build machine";
74 MAKE_VERSION=$($MAKE --version 2>&1 | sed -e 's/^.* \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
75 if [ -z "$MAKE_VERSION" ] ; then
77 echo "You must install 'make' on your build machine";
80 MAKE_MAJOR=$(echo $MAKE_VERSION | sed -e "s/\..*//g")
81 MAKE_MINOR=$(echo $MAKE_VERSION | sed -e "s/^$MAKE_MAJOR\.//g" -e "s/\..*//g" -e "s/[a-zA-Z].*//g")
82 if [ $MAKE_MAJOR -lt 3 ] || [ $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 81 ] ; then
84 echo "You have make '$MAKE_VERSION' installed. GNU make >=3.81 is required"
89 COMPILER=$(which $HOSTCC_NOCCACHE 2> /dev/null)
90 if [ -z "$COMPILER" ] ; then
91 COMPILER=$(which cc 2> /dev/null)
93 if [ -z "$COMPILER" ] ; then
95 echo "You must install 'gcc' on your build machine";
99 COMPILER_VERSION=$($COMPILER -v 2>&1 | sed -n '/^gcc version/p' |
100 sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
101 if [ -z "$COMPILER_VERSION" ] ; then
103 echo "You must install 'gcc' on your build machine";
106 COMPILER_MAJOR=$(echo $COMPILER_VERSION | sed -e "s/\..*//g")
107 COMPILER_MINOR=$(echo $COMPILER_VERSION | sed -e "s/^$COMPILER_MAJOR\.//g" -e "s/\..*//g")
108 if [ $COMPILER_MAJOR -lt 3 -o $COMPILER_MAJOR -eq 2 -a $COMPILER_MINOR -lt 95 ] ; then
110 echo "You have gcc '$COMPILER_VERSION' installed. gcc >= 2.95 is required"
115 CXXCOMPILER=$(which $HOSTCXX_NOCCACHE 2> /dev/null)
116 if [ -z "$CXXCOMPILER" ] ; then
117 CXXCOMPILER=$(which c++ 2> /dev/null)
120 if [ -z "$CXXCOMPILER" ] ; then
122 echo "You may have to install 'g++' on your build machine"
124 if [ ! -z "$CXXCOMPILER" ] ; then
125 CXXCOMPILER_VERSION=$($CXXCOMPILER -v 2>&1 | sed -n '/^gcc version/p' |
126 sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q')
127 if [ -z "$CXXCOMPILER_VERSION" ] ; then
129 echo "You may have to install 'g++' on your build machine"
132 CXXCOMPILER_MAJOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/\..*//g")
133 CXXCOMPILER_MINOR=$(echo $CXXCOMPILER_VERSION | sed -e "s/^$CXXCOMPILER_MAJOR\.//g" -e "s/\..*//g")
134 if [ $CXXCOMPILER_MAJOR -lt 3 -o $CXXCOMPILER_MAJOR -eq 2 -a $CXXCOMPILER_MINOR -lt 95 ] ; then
136 echo "You have g++ '$CXXCOMPILER_VERSION' installed. g++ >= 2.95 is required"
142 if ! $SHELL --version 2>&1 | grep -q '^GNU bash'; then
144 echo "You must install 'bash' on your build machine";
148 # Check that a few mandatory programs are installed
150 for prog in patch perl tar wget cpio python unzip rsync bc ${DL_TOOLS} ; do
151 if ! which $prog > /dev/null ; then
152 echo "You must install '$prog' on your build machine";
154 if test $prog = "svn" ; then
155 echo " svn is usually part of the subversion package in your distribution"
156 elif test $prog = "hg" ; then
157 echo " hg is usually part of the mercurial package in your distribution"
158 elif test $prog = "zcat" ; then
159 echo " zcat is usually part of the gzip package in your distribution"
160 elif test $prog = "bzcat" ; then
161 echo " bzcat is usually part of the bzip2 package in your distribution"
166 if test "${missing_progs}" = "yes" ; then
170 if grep ^BR2_TOOLCHAIN_BUILDROOT=y $BR2_CONFIG > /dev/null && \
171 grep ^BR2_ENABLE_LOCALE=y $BR2_CONFIG > /dev/null ; then
172 if ! which locale > /dev/null ; then
174 echo "You need locale support on your build machine to build a toolchain supporting locales"
177 if ! locale -a | grep -q -i utf8$ ; then
179 echo "You need at least one UTF8 locale to build a toolchain supporting locales"
184 if grep -q ^BR2_PACKAGE_CLASSPATH=y $BR2_CONFIG ; then
185 for prog in javac jar; do
186 if ! which $prog > /dev/null ; then
188 echo "You must install '$prog' on your build machine" >&2
194 if grep -q ^BR2_HOST_NEEDS_JAVA=y $BR2_CONFIG ; then
195 if ! which java > /dev/null ; then
197 echo "You must install 'java' on your build machine" >&2
202 if grep -q ^BR2_HOSTARCH_NEEDS_IA32_LIBS=y $BR2_CONFIG ; then
203 if test ! -f /lib/ld-linux.so.2 ; then
205 echo "Your Buildroot configuration uses pre-built tools for the x86 architecture,"
206 echo "but your build machine uses the x86-64 architecture without the 32 bits compatibility"
208 echo "If you're running a Debian/Ubuntu distribution, install the libc6:i386,"
209 echo "libstdc++6:i386, and zlib1g:i386 packages."
210 echo "For other distributions, refer to the documentation on how to install the 32 bits"
211 echo "compatibility libraries."
216 if grep -q ^BR2_HOSTARCH_NEEDS_IA32_COMPILER=y $BR2_CONFIG ; then
217 if ! echo "int main(void) {}" | gcc -m32 -x c - -o /dev/null ; then
219 echo "Your Buildroot configuration needs a compiler capable of building 32 bits binaries."
220 echo "If you're running a Debian/Ubuntu distribution, install the gcc-multilib package."
221 echo "For other distributions, refer to their documentation."
226 # Check that the Perl installation is complete enough to build
228 if ! perl -e "require Data::Dumper" > /dev/null 2>&1 ; then
229 echo "Your Perl installation is not complete enough, at least Data::Dumper is missing."
230 echo "On Debian/Ubuntu distributions, install the 'perl' package."