build: Make abicheck.sh backend-aware

It should be possible to adapt the abicheck.sh script so that it
actually tests the ABI of libclutter-1.0.so taking into account
the backends that were compiled into Clutter, and avoid expected
failures if Clutter was not built with a specific backend.

https://bugzilla.gnome.org/show_bug.cgi?id=670680
This commit is contained in:
Emmanuele Bassi 2012-02-23 14:34:26 +00:00
parent 78b237b535
commit f27e575ad4
2 changed files with 20 additions and 7 deletions

View File

@ -983,7 +983,7 @@ clutter_all_c_sources = \
$(cally_sources_c) \ $(cally_sources_c) \
$(built_source_c) $(built_source_c)
TESTS_ENVIRONMENT = srcdir="$(srcdir)" clutter_all_c_sources="$(clutter_all_c_sources)" TESTS_ENVIRONMENT = srcdir="$(srcdir)" CLUTTER_BACKENDS="$(CLUTTER_BACKENDS)"
if OS_LINUX if OS_LINUX
TESTS = abicheck.sh TESTS = abicheck.sh
endif endif

View File

@ -1,11 +1,24 @@
#! /bin/sh #! /bin/sh
cpp -P \ has_x11_backend=no
-DG_OS_UNIX \ has_gdk_backend=no
-DCLUTTER_WINDOWING_X11 \ for backend in ${CLUTTER_BACKENDS}; do
-DCLUTTER_WINDOWING_GLX \ case "$backend" in
-DCLUTTER_WINDOWING_GDK \ x11) has_x11_backend=yes ;;
${srcdir:-.}/clutter.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE//' -e 's/ DATA//' | sort > expected-abi gdk) has_gdk_backend=yes ;;
esac
done
cppargs="-DG_OS_UNIX"
if [ $has_x11_backend = "yes" ]; then
cppargs="$cppargs -DCLUTTER_WINDOWING_X11 -DCLUTTER_WINDOWING_GLX"
fi
if [ $has_gdk_backend = "yes" ]; then
cppargs="$cppargs -DCLUTTER_WINDOWING_GDK"
fi
cpp -P ${cppargs} ${srcdir:-.}/clutter.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE//' -e 's/ DATA//' | sort > expected-abi
nm -D -g --defined-only .libs/libclutter-1.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi nm -D -g --defined-only .libs/libclutter-1.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi
diff -u expected-abi actual-abi && rm -f expected-abi actual-abi diff -u expected-abi actual-abi && rm -f expected-abi actual-abi