source: mainline/contrib/tools/toolchain_check.sh

Last change on this file was a35b458, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 7 years ago

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

  • Property mode set to 100755
File size: 1.2 KB
Line 
1#!/bin/sh
2
3[ -z "$CROSS_HELENOS_PREFIX" ] && CROSS_HELENOS_PREFIX="/usr/local/cross-helenos"
4
5get_define() {
6 echo "$2" | "$1" -E -P -
7}
8
9print_error() {
10 echo " ERROR:" "$@"
11}
12
13check_define() {
14 def_value=`get_define "$1" "$2"`
15 if [ "$def_value" = "$3" ]; then
16 return 0
17 else
18 print_error "Macro $1 not defined (expected '$3', got '$def_value')."
19 return 1
20 fi
21}
22
23print_version() {
24 if [ -x "$1" ]; then
25 echo " " `$1 --version 2>/dev/null | head -n 1` "@ $1"
26 else
27 print_error "$2";
28 return 1
29 fi
30}
31
32for arch_path in "$CROSS_HELENOS_PREFIX"/*; do
33 arch=`echo "$arch_path" | sed -e 's#/$##' -e 's#.*/\([^/]*\)#\1#'`
34 echo "Checking $arch..."
35
36 gcc_path=`echo "$arch_path"/bin/*-gcc`
37 ld_path=`echo "$arch_path"/bin/*-ld`
38 objcopy_path=`echo "$arch_path"/bin/*-objcopy`
39 gdb_path=`echo "$arch_path"/bin/*-gdb`
40
41 print_version "$ld_path" "Linker not found!" || continue
42
43 print_version "$objcopy_path" "objcopy not found!" || continue
44
45 print_version "$gcc_path" "GCC not found!" || continue
46 check_define "$gcc_path" "__helenos__" 1 || continue
47 check_define "$gcc_path" "helenos_uarch" "$arch" || continue
48
49 print_version "$gdb_path" "GDB not found!" || continue
50done
Note: See TracBrowser for help on using the repository browser.