3 ###############################################################################
5 # Check liblzma.map for certain types of errors
9 # This file has been put into the public domain.
10 # You can do whatever you want with this file.
12 ###############################################################################
21 # Get the list of symbols that aren't defined in liblzma.map.
22 SYMS
=$
(sed -n 's/^extern LZMA_API([^)]*) \([a-z0-9_]*\)(.*$/\1;/p' \
25 |
grep -Fve "$(sed '/[{}:*]/d;/^$/d;s/^ //' liblzma.map)")
27 # Check that there are no old alpha or beta versions listed.
28 VER
=$
(cd ..
/..
&& sh build-aux
/version.sh
)
32 NAMES
=$
(sed -n 's/^.*XZ_\([^ ]*\)\(alpha\|beta\) .*$/\1\2/p' \
33 liblzma.map |
grep -Fv "$VER")
37 # Check for duplicate lines. It can catch missing dependencies.
38 DUPS
=$
(sort liblzma.map |
sed '/^$/d;/^global:$/d' |
uniq -d)
40 # Print error messages if needed.
41 if test -n "$SYMS$NAMES$DUPS"; then
43 echo 'validate_map.sh found problems from liblzma.map:'
46 if test -n "$SYMS"; then
47 echo 'liblzma.map lacks the following symbols:'
52 if test -n "$NAMES"; then
53 echo 'Obsolete alpha or beta version names:'
58 if test -n "$DUPS"; then
59 echo 'Duplicate lines:'
67 # Exit status is 1 if problems were found, 0 otherwise.