summaryrefslogtreecommitdiff
path: root/lib/tevent/abi_checks.sh
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-06-07 14:10:15 -0400
committerSimo Sorce <idra@samba.org>2009-06-15 16:31:13 -0400
commitefccef09aec93180a06955b5e03f1ceb99dc39e8 (patch)
treeb9ab8101b66e240c3f222cc1e94df09524894b60 /lib/tevent/abi_checks.sh
parente83f4b868b208724a732b45a0aa4f6ee8a08b115 (diff)
downloadsamba-efccef09aec93180a06955b5e03f1ceb99dc39e8.tar.gz
samba-efccef09aec93180a06955b5e03f1ceb99dc39e8.tar.bz2
samba-efccef09aec93180a06955b5e03f1ceb99dc39e8.zip
Add exports file and abi checker for tevent
This is a first attempt at exporting symbols only for public functions We also provide a rudimentary ABI checker that tries to check that function signatures are not changed by mistake. Given our use of macros this is not an API checker. It's all based on tevent.h contents and the gcc -aux-info option
Diffstat (limited to 'lib/tevent/abi_checks.sh')
-rwxr-xr-xlib/tevent/abi_checks.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/tevent/abi_checks.sh b/lib/tevent/abi_checks.sh
new file mode 100755
index 0000000000..83082ad401
--- /dev/null
+++ b/lib/tevent/abi_checks.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+make clean
+
+mkdir abi
+ABI_CHECKS="-aux-info abi/\$@.X"
+make ABI_CHECK="$ABI_CHECKS"
+
+for i in abi/*.X; do cat $i | grep 'tevent\.h'; done | sort | uniq | awk -F "extern " '{ print $2 }' > abi/signatures
+
+cat > abi/exports << EOF
+{
+ global:
+EOF
+cat abi/signatures | awk -F '(' '{ print $1 }' | awk -F ' ' '{ print " "$NF";" }' | tr -d '*' | sort >> abi/exports
+cat >> abi/exports << EOF
+
+ local: *;
+};
+EOF
+
+rm -fr abi/*.X
+
+diff -u tevent.signatures abi/signatures
+if [ "$?" != "0" ]; then
+ echo "WARNING: Possible ABI Change!!"
+fi
+
+diff -u tevent.exports abi/exports
+if [ "$?" != "0" ]; then
+ echo "WARNING: Export file may be outdated!!"
+fi