Mercurial > hg > CbC > CbC_gcc
comparison contrib/warn_summary @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | a06113de4d67 |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 # | 2 # |
3 # This script parses the output of a gcc bootstrap when using warning | 3 # This script parses the output of a gcc bootstrap when using warning |
4 # flags and determines various statistics. | 4 # flags and determines various statistics. |
5 # | 5 # |
6 # usage: warn_summary [-llf] [-s stage] [-nosub|-ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc] | 6 # usage: warn_summary [-llf] [-s stage] [-nosub|-ch|-cp|-f|-fortran|-ada|-intl|-fixinc] |
7 # [-pass|-wpass] [file(s)] | 7 # [-pass|-wpass] [file(s)] |
8 # | 8 # |
9 # -llf | 9 # -llf |
10 # Filter out long lines from the bootstrap output before any other | 10 # Filter out long lines from the bootstrap output before any other |
11 # action. This is useful for systems with broken awks/greps which choke | 11 # action. This is useful for systems with broken awks/greps which choke |
17 # before and after the gcc bootstrap directory. E.g. libraries, etc. | 17 # before and after the gcc bootstrap directory. E.g. libraries, etc. |
18 # This presupposes using "gcc -W*" for the stage1 compiler. | 18 # This presupposes using "gcc -W*" for the stage1 compiler. |
19 # | 19 # |
20 # -nosub | 20 # -nosub |
21 # Only show warnings from the gcc top level directory. | 21 # Only show warnings from the gcc top level directory. |
22 # -ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc | 22 # -ch|-cp|-f|-fortran|-ada|-intl|-fixinc |
23 # Only show warnings from the specified gcc subdirectory. | 23 # Only show warnings from the specified gcc subdirectory. |
24 # These override each other so only the last one passed takes effect. | 24 # These override each other so only the last one passed takes effect. |
25 # | 25 # |
26 # -pass | 26 # -pass |
27 # Pass through the bootstrap output after filtering stage and subdir | 27 # Pass through the bootstrap output after filtering stage and subdir |
55 # Pass through all lines. | 55 # Pass through all lines. |
56 cat | 56 cat |
57 else | 57 else |
58 if test "$filter" = nosub ; then | 58 if test "$filter" = nosub ; then |
59 # Omit all subdirectories. | 59 # Omit all subdirectories. |
60 egrep -v '/gcc/(ch|cp|f|fortran|java|ada|intl|fixinc)/' | 60 egrep -v '/gcc/(ch|cp|f|fortran|ada|intl|fixinc)/' |
61 else | 61 else |
62 # Pass through only subdir $filter. | 62 # Pass through only subdir $filter. |
63 grep "/gcc/$filter/" | 63 grep "/gcc/$filter/" |
64 fi | 64 fi |
65 fi ) | 65 fi ) |
134 s%^[^ ]*/\(lib[a-z23+-]*/\)%\1%;' | 134 s%^[^ ]*/\(lib[a-z23+-]*/\)%\1%;' |
135 } | 135 } |
136 | 136 |
137 # Start the main section. | 137 # Start the main section. |
138 | 138 |
139 usage="usage: `basename $0` [-llf] [-s stage] [-nosub|-ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc] [-pass|-wpass] [file(s)]" | 139 usage="usage: `basename $0` [-llf] [-s stage] [-nosub|-ch|-cp|-f|-fortran|-ada|-intl|-fixinc] [-pass|-wpass] [file(s)]" |
140 stageN=3 | 140 stageN=3 |
141 tmpfile=/tmp/tmp-warn.$$ | 141 tmpfile=/tmp/tmp-warn.$$ |
142 | 142 |
143 # Remove $tmpfile on exit and various signals. | 143 # Remove $tmpfile on exit and various signals. |
144 trap "rm -f $tmpfile" 0 | 144 trap "rm -f $tmpfile" 0 |
160 case "$1" in | 160 case "$1" in |
161 -llf) llf=1 ; shift ;; | 161 -llf) llf=1 ; shift ;; |
162 -s) if test -z "$2"; then echo $usage 1>&2; exit 1; fi | 162 -s) if test -z "$2"; then echo $usage 1>&2; exit 1; fi |
163 stageN="$2"; shift 2 ;; | 163 stageN="$2"; shift 2 ;; |
164 -s*) stageN="`expr $1 : '-s\(.*\)'`" ; shift ;; | 164 -s*) stageN="`expr $1 : '-s\(.*\)'`" ; shift ;; |
165 -nosub|-ch|-cp|-f|-fortran|-java|-ada|-intl|-fixinc) filter="`expr $1 : '-\(.*\)'`" ; shift ;; | 165 -nosub|-ch|-cp|-f|-fortran|-ada|-intl|-fixinc) filter="`expr $1 : '-\(.*\)'`" ; shift ;; |
166 -pass) pass=1 ; shift ;; | 166 -pass) pass=1 ; shift ;; |
167 -wpass) pass=w ; shift ;; | 167 -wpass) pass=w ; shift ;; |
168 -*) echo $usage 1>&2 ; exit 1 ;; | 168 -*) echo $usage 1>&2 ; exit 1 ;; |
169 *) break ;; | 169 *) break ;; |
170 esac | 170 esac |