4 # abi_checks.sh - check for possible abi changes
6 # Copyright (C) 2009 Michael Adam <obnox@samba.org>
8 # This program is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by the Free
10 # Software Foundation; either version 3 of the License, or (at your option)
13 # This program is distributed in the hope that it will be useful, but WITHOUT
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 # You should have received a copy of the GNU General Public License along with
19 # this program; if not, see <http://www.gnu.org/licenses/>.
23 # USAGE: abi_checks.sh LIBNAME header1 [header2 ...]
25 # This script creates symbol and signature lists from the provided header
26 # files with the aid of the mksyms.sh and mksigs.pl scripts (saved as
27 # $LIBNAME.exports.check and $LIBNAME.sigatures.check). It then compares
28 # the resulting files with the files $LIBNAME.exports and $LIBNME.signatures
29 # which it expects to find in the current directory.
33 LC_ALL
=C
; export LC_ALL
34 LC_COLLATE
=C
; export LC_COLLATE
38 dir_name
=$
(dirname ${script})
40 if test x
"$1" = "x" ; then
41 echo "USAGE: ${script} libname header [header ...]"
48 if test x
"$1" = "x" ; then
49 echo "USAGE: ${script} libname header [header ...]"
55 exports_file
=${libname}.exports
56 exports_file_check
=${exports_file}.check
57 signatures_file
=${libname}.signatures
58 signatures_file_check
=${signatures_file}.check
61 ${dir_name}/mksyms.sh awk ${exports_file_check} ${headers} 2>&1 > /dev
/null
62 cat ${headers} | ${dir_name}/mksigs.pl | sort| uniq > ${signatures_file_check} 2> /dev
/null
64 diff -u ${exports_file} ${exports_file_check}
65 if test "x$?" != "x0" ; then
66 echo "WARNING: possible ABI change detected in exports!"
69 echo "exports check: OK"
72 diff -u ${signatures_file} ${signatures_file_check}
73 if test "x$?" != "x0" ; then
74 echo "WARNING: possible ABI change detected in signatures!"
77 echo "signatures check: OK"