summaryrefslogtreecommitdiff
path: root/toolchain/dependencies/dependencies.sh
blob: 48e6778627522f9bdf16c4ab32b9f86b5e2875a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#!/bin/sh

#set -x

echo ""
echo "Checking build system dependencies:"


#############################################################
#
# check build system 'environment'
#
#############################################################
if test -n "$CC" ; then
	echo "CC clean:						FALSE"
	/bin/echo -e "\n\nYou must run 'unset CC' so buildroot can run with";
	/bin/echo -e "a clean enviroment on your build machine\n";
	exit 1;
fi;
echo "CC clean:					Ok"


if test -n "$CXX" ; then
	echo "CXX clean:					FALSE"
	/bin/echo -e "\n\nYou must run 'unset CXX' so buildroot can run with";
	/bin/echo -e "a clean enviroment on your build machine\n";
	exit 1;
fi;
echo "CXX clean:					Ok"


if test -n "$CPP" ; then
	echo "CPP clean:					FALSE"
	/bin/echo -e "\n\nYou must run 'unset CPP' so buildroot can run with";
	/bin/echo -e "a clean enviroment on your build machine\n";
	exit 1;
fi;
echo "CPP clean:					Ok"


if test -n "$CFLAGS" ; then
	echo "CFLAGS clean:					FALSE"
	/bin/echo -e "\n\nYou must run 'unset CFLAGS' so buildroot can run with";
	/bin/echo -e "a clean enviroment on your build machine\n";
	exit 1;
fi;
echo "CFLAGS clean:					Ok"


if test -n "$CXXFLAGS" ; then
	echo "CXXFLAGS clean:					FALSE"
	/bin/echo -e "\n\nYou must run 'unset CXXFLAGS' so buildroot can run with";
	/bin/echo -e "a clean enviroment on your build machine\n";
	exit 1;
fi;
echo "CXXFLAGS clean:					Ok"

#############################################################
#
# 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

#############################################################
#
# check build system 'which'
#
#############################################################
if ! which which > /dev/null ; then
	echo "which installed:		    FALSE"
	/bin/echo -e "\n\nYou must install 'which' on your build machine\n";
	exit 1;
fi;
echo "which installed:				Ok"


#############################################################
#
# check build system 'make'
#
#############################################################
MAKE=$(which make)
if [ -z "$MAKE" ] ; then
	echo "make installed:		    FALSE"
	/bin/echo -e "\n\nYou must install 'make' on your build machine\n";
	exit 1;
fi;
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"
	/bin/echo -e "\n\nYou must install 'make' on your build machine\n";
	exit 1;
fi;
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;
fi;
echo "GNU make version '$MAKE_VERSION':			Ok"



#############################################################
#
# check build system 'gcc'
#
#############################################################
COMPILER=$(which $HOSTCC)
if [ -z "$COMPILER" ] ; then
	COMPILER=$(which cc)
fi;
if [ -z "$COMPILER" ] ; then
	echo "C Compiler installed:		    FALSE"
	/bin/echo -e "\n\nYou must install 'gcc' on your build machine\n";
	exit 1;
fi;

COMPILER_VERSION=$($COMPILER --version 2>&1 | head -n1 | $XSED -e 's/^.*(.CC) \([0-9\.]\)/\1/g' -e "s/[-\ ].*//g")
if [ -z "$COMPILER_VERSION" ] ; then
	echo "gcc installed:		    FALSE"
	/bin/echo -e "\n\nYou must install 'gcc' on your build machine\n";
	exit 1;
fi;
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;
fi;
echo "C compiler '$COMPILER'"
echo "C compiler version '$COMPILER_VERSION':			Ok"



#############################################################
#
# check build system 'bison'
#
#############################################################
if ! which bison > /dev/null ; then
	echo "bison installed:		    FALSE"
	/bin/echo -e "\n\nYou must install 'bison' on your build machine\n";
	exit 1;
fi;
echo "bison installed:				Ok"


#############################################################
#
# check build system 'flex'
#
#############################################################
if ! which flex > /dev/null ; then
	echo "flex installed:		    FALSE"
	/bin/echo -e "\n\nYou must install 'flex' on your build machine\n";
	exit 1;
fi;
echo "flex installed:					Ok"


#############################################################
#
# check build system 'gettext'
#
#############################################################
if ! which msgfmt > /dev/null ; then \
	echo "gettext installed:		    FALSE"
	/bin/echo -e "\n\nYou must install 'gettext' on your build machine\n"; \
	exit 1; \
fi;
echo "gettext installed:				Ok"





#############################################################
#
# All done
#
#############################################################
echo "Build system dependencies:			Ok"
echo ""