]>
git.saurik.com Git - wxWidgets.git/blob - lib/abicheck.sh
3 # Script originally based on GTK+'s own abicheck.sh; it should be run anytime
4 # there is a change in the stable branch of wxWidgets which could lead to an
5 # ABI breakage and thus result in a binary-incompatible change (see tech docs).
10 expected_abi_file
="expected_abi"
11 actual_abi_file
="actual_abi"
13 if [[ "$1" == "--generate" ]]; then
15 # IMPORTANT: we need a shared build of wxWidgets to proceed
16 if [[ $(echo *.so) == "*.so" ]]; then
17 echo "No shared objects (*.so) were found... aborting"
21 # generated the "expected ABI" for later comparison
22 rm -f $expected_abi_file
23 for library
in *.so
; do
24 # NOTE: don't use -C option as otherwise cut won't work correctly
25 nm
-D -g --defined-only $library | cut
-d ' ' -f 3 | sort >>$expected_abi_file
28 echo "Expected wxWidgets ABI generated in \"$expected_abi_file\"..."
30 elif [[ -z "$1" ]]; then
32 if [[ ! -f "$expected_abi_file" ]]; then
33 echo "The file containing the expected wxWidgets ABI '$expected_abi_file' does not exist!"
34 echo "Please generate it first using the '--generate' option"
38 echo "Comparing actual ABI with the expected ABI (loading it from \"$expected_abi_file\")..."
40 # IMPORTANT: we need a shared build of wxWidgets to do the check
41 if [[ $(echo *.so) == "*.so" ]]; then
42 echo "No shared objects (*.so) were found... aborting"
46 rm -f $actual_abi_file
47 for library
in *.so
; do
48 # NOTE: don't use -C option as otherwise cut won't work correctly
49 nm
-D -g --defined-only $library | cut
-d ' ' -f 3 | sort >>$actual_abi_file
52 result
=`diff -u $expected_abi_file $actual_abi_file`
54 if [[ -z "$result" ]]; then
55 echo "No binary (in)compatible changes were found."
57 echo "========================================================="
58 echo "WARNING: Possible binary-incompatible changes were found:"
59 echo "========================================================="
63 # this doesn't necessarly indicate that binary compatibility was surely
64 # broken; e.g. adding non-virtual methods will generate a new line in the
65 # $actual_abi_file but that's a compatible change.
70 echo "Usage: $0 [--generate]"
71 echo "When running without options, compares the wxWidgets ABI saved in '$expected_abi_file'"
72 echo "with the current ABI of the .so files of the working directory."
73 echo "When --generate is given, saves in '$expected_abi_file' the ABI of the .so files"
74 echo "(for later comparisons)."