3 # Copyright © 2012 Nick Bowler
5 # Verify that a static library does not export any unprefixed symbols.
7 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
8 # This is free software: you are free to do what the fuck you want to.
9 # There is NO WARRANTY, to the extent permitted by law.
14 eval `$LIBTOOL --config | sed -n \
16 -e '/^build_old_libs=/p'` || exit 1
17 eval `< $ltlib sed -ne '/^old_library=/p'` || exit 1
19 if test x"$build_old_libs" = x"no"; then
20 # Not building static libs.
24 lib=`expr "$ltlib" : '\(.*\)/'`
25 lib="$lib${lib:+/}$objdir/$old_library"
30 for i in `$SHELL exported.sh "$lib"`
32 if expr "$i" : "$sym_prefix" >/dev/null; then
33 # Record that we found at least one exported symbol.
36 printf 'unprefixed global symbol: %s\n' "$i" 1>&2
41 test x"$bad_sym" = x"yes" && exit 1
43 if test x"$found_sym" = x"no"; then
44 printf 'no exported symbols found\n' 1>&2