Commit 0f6facba authored by Dafydd Harries's avatar Dafydd Harries

add scripts for generating/checking symbol lists

darcs-hash:20070131123026-c9803-98cea90c5235f7c67b1c98ee94c4b83f518b1178.gz
parent 00905c00
#!/bin/sh
usage()
{
echo "usage: $0 library symbol-file"
exit 1
}
test -n "$1" || usage
lib="$1"
test -n "$2" || usage
symbol_file="$2"
make_symbol_list=`dirname $0`/make-symbol-list.sh
test -f "$make_symbol_list" || exit 1
# stop if there are no differences
sh $make_symbol_list "$lib" | cmp -s "$symbol_file" - && exit 0
echo "symbols for $lib changed"
diff=`sh $make_symbol_list "$lib" | \
diff -u "$symbol_file" - | tail -n +3`
if echo "$diff" | grep -q '^-'; then
echo " missing:"
echo "$diff" | grep '^-' | cut -b 2- | \
xargs -i echo " " "{}"
fi
if echo "$diff" | grep -q '^+'; then
echo " extra:"
echo "$diff" | grep '^+' | cut -b 2- | \
xargs -i echo " " "{}"
fi
exit 1
#!/bin/sh
test -n "$1" || exit 1
nm --print-file-name --defined-only --extern-only "$1" | \
cut -d ' ' -f 2,3 | \
grep -v '^[rA]' | \
sort
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment