Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/vms/make-crtlmap.awk @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 # Generate the VMS crtl map | |
2 # Copyright (C) 2011-2017 Free Software Foundation, Inc. | |
3 | |
4 BEGIN { | |
5 is_first = 1; | |
6 maxlen=1; | |
7 maxlen_name="??" | |
8 prev="" | |
9 ORS="" | |
10 } | |
11 | |
12 # Remove comment and blank lines. | |
13 /^ *#/ || /^ *$/ { | |
14 next; | |
15 } | |
16 | |
17 { | |
18 # Handle comma | |
19 if (!is_first) | |
20 print ",\n" | |
21 else | |
22 is_first = 0; | |
23 | |
24 # Check the map is sorted | |
25 if ($0 <= prev) | |
26 { | |
27 print "Map not sorted!! (with name " $0 ")\n" | |
28 exit 1 | |
29 } | |
30 prev = $0 | |
31 | |
32 # Compute the max of the identifier len. | |
33 l=length($1) | |
34 if (l > maxlen) | |
35 { | |
36 maxlen = l | |
37 maxlen_name = $1 | |
38 } | |
39 | |
40 print "{ \"" $1 "\", " | |
41 if (NF == 1) | |
42 print "0 }" | |
43 else | |
44 { | |
45 printf "VMS_CRTL_" $2 | |
46 for (i = 3; i <= NF; i++) | |
47 printf " | VMS_CRTL_" $i | |
48 printf " }" | |
49 } | |
50 } | |
51 | |
52 END { | |
53 print "\n\n" | |
54 print "#define VMS_CRTL_MAXLEN " maxlen " /*" maxlen_name " */\n" | |
55 } |