Debian Codegraph @

test/exported

raw
1 #! /bin/sh
2 # gtk-engines - a collection of drawing engines for GTK+
3 # Copyright (C) 2007 Benjamin Berg <[email protected]>
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #
19 # Project contact: <[email protected]>
20 #
21
22
23 ALLOWED_SYMBOLS="\(g_module_check_init\|theme_create_rc_style\|theme_exit\|theme_init\)"
24
25 # exit with status 77 if nm does not exist
26 which nm >/dev/null || exit 77
27
28 ENGINE="`basename $0 | cut -d '_' -f 2`"
29 ENGINE_FILE="engines/lib$ENGINE.so"
30
31 nm -gD --defined-only $ENGINE_FILE | cut -d ' ' -f 2,3 | cut -d ' ' -f 2 | grep -v '^_' | grep -v "$ALLOWED_SYMBOLS" >symbols/$ENGINE
32
33 if [ -s symbols/$ENGINE ]; then
34 exit 1;
35 else
36 if [ -f symbols/$ENGINE ]; then
37 # No point in keeping an empty file around
38 rm symbols/$ENGINE
39 else
40 # Something wen't wrong, there is no file?!?
41 # This should never happen ...
42 exit 1
43 fi
44 fi
45