2 # Usage: gawk -f linkermapfile-check.awk *.map *.xml
3 # Order of *.map *.xml is important, otherwise all symbols are reported to be
5 # Checks if all symbols of all locale data are present in the symbol scoping
6 # linker mapfiles. Any output indicates a missing symbol, ../localedata.cxx is
7 # grep'ed to indicate the library to which mapfile the symbol should be added.
8 # Author: Eike Rathke <er@openoffice.org>
16 sPublic
[nPublics
++] =
"getAllCalendars_"
17 sPublic
[nPublics
++] =
"getAllCurrencies_"
18 sPublic
[nPublics
++] =
"getAllFormats0_"
19 bOptional
[nPublics
] =
1 # getAllFormats1 most times not present
20 sPublic
[nPublics
++] =
"getAllFormats1_"
21 sPublic
[nPublics
++] =
"getBreakIteratorRules_"
22 sPublic
[nPublics
++] =
"getCollationOptions_"
23 sPublic
[nPublics
++] =
"getCollatorImplementation_"
24 sPublic
[nPublics
++] =
"getContinuousNumberingLevels_"
25 sPublic
[nPublics
++] =
"getForbiddenCharacters_"
26 sPublic
[nPublics
++] =
"getLCInfo_"
27 sPublic
[nPublics
++] =
"getLocaleItem_"
28 sPublic
[nPublics
++] =
"getOutlineNumberingLevels_"
29 sPublic
[nPublics
++] =
"getReservedWords_"
30 sPublic
[nPublics
++] =
"getSearchOptions_"
31 sPublic
[nPublics
++] =
"getTransliterations_"
32 sPublic
[nPublics
++] =
"getIndexAlgorithm_"
33 sPublic
[nPublics
++] =
"getUnicodeScripts_"
34 sPublic
[nPublics
++] =
"getFollowPageWords_"
39 if ( file ~
/\.map$
/ )
41 sMapFile
[nMaps
] = file
45 else if ( file ~
/\.xml$
/ )
48 n =
split( file
, arr
, /[:\\\
/.
]/ )
50 for ( i=
0; i
<nPublics
; ++i
)
52 symbol = sPublic
[i
] locale
";"
54 for ( j=
0; j
<nMaps
&& !bFound
; ++j
)
56 if ( sSymbol
[j
,symbol
] )
59 if ( !bFound
&& bOptional
[i
] )
61 print symbol
" not present but optional"
68 search =
"\"" locale
"\""
69 while ( !bOut
&& (getline <"../localedata.cxx") > 0 )
74 print "../localedata.cxx says this should go into: " $
0
77 close( "../localedata.cxx" )
79 print "../localedata.cxx doesn't indicate to which lib this belongs to:"
96 # only reached if .map file encountered, read in symbols
104 print "All good." >>"/dev/stderr"