File: abi_checks_gcc.sh

package info (click to toggle)
talloc 2.0.1-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,636 kB
  • ctags: 1,172
  • sloc: ansic: 9,393; sh: 3,078; xml: 812; makefile: 162; perl: 107; awk: 46
file content (34 lines) | stat: -rwxr-xr-x 806 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

make clean

mkdir abi
ABI_CHECKS="-aux-info abi/\$@.X"
make ABI_CHECK="$ABI_CHECKS" CC="/usr/bin/gcc"

for i in abi/*.X; do cat $i | grep 'talloc\.h'; done | sort | uniq | awk -F "extern " '{ print $2 }' | sort > abi/signatures

cat > abi/exports << EOF
{
    global:
EOF
cat abi/signatures | awk -F '(' '{ print $1 }' | awk -F ' ' '{ print "           "$NF";" }' | tr -d '*' | sort >> abi/exports
# need to manually add talloc free for backward ABI compat
echo '           talloc_free;' >> abi/exports
cat >> abi/exports << EOF

    local: *;
};
EOF

rm -fr abi/*.X

diff -u talloc.signatures abi/signatures
if [ "$?" != "0" ]; then
    echo "WARNING: Possible ABI Change!!"
fi

diff -u talloc.exports abi/exports
if [ "$?" != "0" ]; then
    echo "WARNING: Export file may be outdated!!"
fi