source:
mainline/contrib/tools/toolchain_check.sh
Last change on this file was a35b458, checked in by , 7 years ago | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[98f7830] | 1 | #!/bin/sh |
2 | ||
3 | [ -z "$CROSS_HELENOS_PREFIX" ] && CROSS_HELENOS_PREFIX="/usr/local/cross-helenos" | |
4 | ||
5 | get_define() { | |
6 | echo "$2" | "$1" -E -P - | |
7 | } | |
8 | ||
9 | print_error() { | |
10 | echo " ERROR:" "$@" | |
11 | } | |
12 | ||
13 | check_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 | ||
23 | print_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 | ||
32 | for 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` | |
[a35b458] | 40 | |
[98f7830] | 41 | print_version "$ld_path" "Linker not found!" || continue |
[a35b458] | 42 | |
[98f7830] | 43 | print_version "$objcopy_path" "objcopy not found!" || continue |
[a35b458] | 44 | |
[98f7830] | 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 | |
[a35b458] | 48 | |
[98f7830] | 49 | print_version "$gdb_path" "GDB not found!" || continue |
50 | done |
Note:
See TracBrowser
for help on using the repository browser.