Updated change log for 4.5.3
[qt-netbsd.git] / config.tests / unix / fvisibility.test
blobb2bcc075ed46d093ee1276e42e9a0f21ce075ca3
1 #!/bin/sh
3 FVISIBILITY_SUPPORT=no
4 COMPILER=$1
5 VERBOSE=$2
7 RunCompileTest() {
8 cat >>fvisibility.c << EOF
9 __attribute__((visibility("default"))) void blah();
10 #if !defined(__GNUC__)
11 # error "Visiblility support requires GCC"
12 #elif __GNUC__ < 4
13 # error "GCC3 with backported visibility patch is known to miscompile Qt"
14 #endif
15 EOF
17 if [ "$VERBOSE" = "yes" ] ; then
18 "$COMPILER" -c -fvisibility=hidden fvisibility.c && FVISIBILITY_SUPPORT=yes
19 else
20 "$COMPILER" -c -fvisibility=hidden fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes
22 rm -f fvisibility.c fvisibility.o
25 case "$COMPILER" in
26 aCC*)
29 icpc)
30 ICPC_VERSION=`icpc -dumpversion`
31 case "$ICPC_VERSION" in
32 8.*|9.*|10.0)
33 # 8.x, 9.x, and 10.0 don't support symbol visibility
36 # the compile test works for the intel compiler because it mimics gcc's behavior
37 RunCompileTest
39 esac
43 RunCompileTest
45 esac
47 # done
48 if [ "$FVISIBILITY_SUPPORT" != "yes" ]; then
49 [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control disabled."
50 exit 0
51 else
52 [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control enabled."
53 exit 1