]>
git.ipfire.org Git - ipfire-3.x.git/blob - tools/make-check
f92566389ac88fcb6d09386661c5c83b943fbe86
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
34 TMPFILE
=/tmp
/ipfire-check-
$RANDOM
36 echo -ne "${BOLD}Checking for $NAME${NORMAL}"
38 [ -n "$RVER" ] && echo -n " (Requires at least $RVER)"
40 bash
-c "$COMMAND" >$TMPFILE 2>&1
42 if ! grep -q "command not found" < $TMPFILE; then
45 rm -f $TMPFILE 2>/dev
/null
46 exiterror
"$NAME not found!"
49 [ -n "$EXTRA" ] && echo -n "$EXTRA"
52 rm -f $TMPFILE 2>/dev
/null
57 check_common
"GNU autoconf" "2.63" "autoconf --version | head -n1"
58 check_common
"GNU Bash" "2.05a" "bash --version | head -n1 | cut -d\" \" -f2-4"
59 check_common
"/bin/sh links bash?" "if ! which sh; then echo \"command not found\"; fi"
60 check_common
"GNU Binutils" "2.12" "ld --version | head -n1 | cut -d\" \" -f3-" "Binutils: "
61 check_common
"GNU Bison" "1.875" "bison --version | head -n1"
62 #check_common "/usr/bin/yacc links bison?" "if ! which yacc; then echo \"command not found\"; fi"
63 check_common
"Bzip2" "1.0.2" "bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d\" \" -f1,6-"
64 check_common
"Coreutils" "5.0" "chown --version | head -n1 | cut -d\")\" -f2" "Coreutils:"
65 check_common
"Diffutils" "2.8" "diff --version | head -n1"
66 check_common
"Findutils" "4.1.20" "find --version | head -n1"
67 check_common
"GNU awk" "3.0" "gawk --version | head -n1"
68 check_common
"/bin/awk links gawk?" "if ! which awk; then echo \"command not found\"; fi"
69 check_common
"GNU CC" "3.0.1" "gcc --version | head -n1"
70 check_common
"GNU C++" "3.0.1" "g++ --version | head -n1"
71 check_common
"GNU libc" "2.2.5" "/lib/libc.so.6 | head -n1 | cut -d\" \" -f1-7"
72 check_common
"GNU Grep" "2.5" "grep --version | head -n1"
73 check_common
"GNU zip" "1.2.4" "gzip --version | head -n1"
74 check_common
"Linux 2.6" "2.6.x" "uname -r" "Linux: "
75 check_common
"GNU make" "3.79.1" "make --version | head -n1"
76 check_common
"Patch" "2.5.4" "patch --version | head -n1"
77 check_common
"GNU sed" "3.0.2" "sed --version | head -n1"
78 check_common
"GNU tar" "1.14" "tar --version | head -n1"
79 check_common
"GNU Texinfo" "4.8" "makeinfo --version | head -n1"
80 check_common
"GNU m4" "1.4.8" "m4 --version | head -n1"
81 check_common
"GNU libtool" "libtool --version | head -n1"
85 check_common
"Python" "python -V"
86 check_common
"GNU make" "3.79.1" "make --version | head -n1"
87 check_common
"Git" "git --version"
88 check_common
"GNU which" "which --version | head -n1"
95 echo -n " Running code checks"
105 exiterror
"This is not a valid option: $ACTION"
109 echo -n "..." # End the line
111 python
$BASEDIR/tools
/code-beautify
$ARGS $BASEDIR/{config
,doc
,lfs
,src
,tools
}
112 if [ "$?" -eq "0" ]; then
113 beautify message DONE
115 beautify message FAIL
122 echo "Checking sanity of working directory..."
130 if [ -z $IPFIRE_USER ]; then
131 echo -n "You have to setup IPFIRE_USER first. See .config for details."
132 beautify message FAIL
138 for i
in $
(seq 0 7); do
139 if [ -e /dev
/loop
/$i ] ||
[ -e /dev
/loop
$i ]; then
146 CPU_FLAGS
=$
(grep ^flags
/proc
/cpuinfo
)
149 grep -q $FLAG <<< $CPU_FLAGS
153 check_supported_target
() {
155 if [ "$1" = "via-c7" ]; then
157 elif [ "$1" = "via-c3" ]; then
159 elif [ "$1" = "atom" ]; then
160 FLAGS
="mmx sse sse2 pni ssse3"
161 elif [ "$1" = "core2duo" ]; then
165 if ! check_cpu
$j; then
166 echo "Your system doesn't support needed cpu feature \"$j\" to build target $1." >&2
173 check_supported_targets
() {
174 for i
in ${1-$POSSIBLE_TARGETS}; do
175 check_supported_target
$i 2>/dev
/null
176 [ "$?" -eq "0" ] && echo -n "$i "