Initialize Tizen 2.3
[external/nettle.git] / testsuite / symbols-test
1 #! /bin/sh
2
3 # Check that all exported symbols use the nettle prefix.
4
5 if [ -z "$srcdir" ] ; then
6   srcdir=`pwd`
7 fi
8
9 # FIXME: Check libhogweed.a too.
10
11 # * nm on aix seems to generate bogus outbut including random binary
12 #   data. Using -g is a workaround to get rid of that. But nm -g
13 #   doesn't work on Solaris-2.4, so try nm -g first, and plain nm if
14 #   -g isn't recognized.
15 #
16 # * gcc on x86 generates functions like __i686.get_pc_thunk.bx in pic
17 #   code.
18
19 ( nm -g ../libnettle.a || nm ../libnettle.a ) \
20     | grep ' [DRT] ' | egrep -v '( |^)\.?_?(_?nettle_|memxor)|get_pc_thunk' \
21     | sort -k3 > test1.out
22
23 if [ -s test1.out ] ; then
24     echo Exported symbols in libnettle.a, lacking the nettle prefix:
25     cat test1.out
26     exit 1
27 fi
28
29 if [ -s ../libhogweed.a ] ; then
30     ( nm -g ../libhogweed.a || nm ../libhogweed.a ) \
31         | grep ' [DRT] ' | egrep -v '( |^)\.?_?_?nettle_|get_pc_thunk' \
32         | sort -k3 > test1.out
33
34     if [ -s test1.out ] ; then
35         echo Exported symbols in libhogweed.a, lacking the nettle prefix:
36         cat test1.out
37         exit 1
38     fi
39 fi
40
41 exit 0
42