4 # quick'n'dirty script that retrieves the list of exported symbols of a given
5 # library using 'nm', and compares that against the list of symbols-to-export
6 # of our win32/common/libfoo.def files.
9 echo "Usage: $0 library.def library.so"
14 def_name="$(basename $def_path)"
17 lib_result="`mktemp /tmp/defname.XXXXXX`"
22 # On Solaris, add -p to get the correct output format
24 if nm -V 2>&1 |grep Solaris > /dev/null; then
28 # FIXME 0.11: in 0.11, we should change the export filter to only export
29 # _gst_foo, but not __gst_foo (we can't change this now, since we added
30 # __gst_debug_min and __gst_debug_enabled at some point and need to keep
31 # ABI compatibility). So below we special-case some symbols that shouldn't
32 # really be exported, either because we're too lazy to rename them to something
33 # that's not exported (like the _gst_parse_* stuff) or because we had them in
34 # public headers at some point although they shouldn't be and so we need to
35 # keep them exported now (like _gst_debug_init,
36 # __gst_element_factory_add_interface or
37 # __gst_element_factory_add_static_pad_template). We suppress them here to
38 # make sure they're at least not exported in the windows msvc build (they
39 # were never in the .def file, so they never got exported).
40 # _end is special cased because for some reason it is reported as an exported
41 # BSS symbol, unlike on linux where it's a local absolute symbol.
42 nm $NMARGS $lib_path | awk \
44 if ($3 !~ /^_gst_parse_yy/ && \
45 $3 !~ /^_gst_[a-z]*_init/ && \
46 $3 !~ /^_gst_parse_launch/ && \
47 $3 !~ /^__gst_element_details_/ && \
48 $3 !~ /^__gst_element_factory_add_/ && \
49 $3 !~ /^gst_interfaces_marshal/ && \
50 $3 ~ /^[_]*(gst_|Gst|GST_).*/)
57 }' | sort | awk '{ if (NR == 1) print "EXPORTS"; print $0; }' \
60 diffoutput=`diff -u $def_path $lib_result`
64 if test "x$diffoutput" = "x"; then
67 echo -n "$diffoutput" >&2