]>
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).
9 expected_abi_file
="expected_abi"
10 actual_abi_file
="actual_abi"
12 if [[ "$1" == "--generate" ]]; then
14 # IMPORTANT: we need a shared build of wxWidgets to proceed
15 if [[ $(echo *.so) == "*.so" ]]; then
16 echo "No shared objects (*.so) were found... aborting"
20 # generated the "expected ABI" for later comparison
21 rm -f $expected_abi_file
22 for library
in *.so
; do
23 # NOTE: don't use -C option as otherwise cut won't work correctly
24 nm
-D -g --defined-only $library | cut
-d ' ' -f 3 | sort >>$expected_abi_file
27 echo "Expected wxWidgets ABI generated in \"$expected_abi_file\"..."
29 elif [[ -z "$1" ]]; then
31 if [[ ! -f "$expected_abi_file" ]]; then
32 echo "The file containing the expected wxWidgets ABI '$expected_abi_file' does not exist!"
33 echo "Please generate it first using the '--generate' option"
37 echo "Comparing actual ABI with the expected ABI (loading it from \"$expected_abi_file\")..."
39 # IMPORTANT: we need a shared build of wxWidgets to do the check
40 if [[ $(echo *.so) == "*.so" ]]; then
41 echo "No shared objects (*.so) were found... aborting"
45 rm -f $actual_abi_file
46 for library
in *.so
; do
47 # NOTE: don't use -C option as otherwise cut won't work correctly
48 nm
-D -g --defined-only $library | cut
-d ' ' -f 3 | sort >>$actual_abi_file
51 result
=`diff -u $expected_abi_file $actual_abi_file`
53 if [[ -z "$result" ]]; then
54 echo "No binary (in)compatible changes were found."
56 echo "========================================================="
57 echo "WARNING: Possible binary-incompatible changes were found:"
58 echo "========================================================="
62 # this doesn't necessarly indicate that binary compatibility was surely
63 # broken; e.g. adding non-virtual methods will generate a new line in the
64 # $actual_abi_file but that's a compatible change.
69 echo "Usage: $0 [--generate]"
70 echo "When running without options, compares the wxWidgets ABI saved in '$expected_abi_file'"
71 echo "with the current ABI of the .so files of the working directory."
72 echo "When --generate is given, saves in '$expected_abi_file' the ABI of the .so files"
73 echo "(for later comparisons)."