source: trunk/config.tests/unix/fvisibility.test@ 561

Last change on this file since 561 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/sh
2
3FVISIBILITY_SUPPORT=no
4COMPILER=$1
5VERBOSE=$2
6
7RunCompileTest() {
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
15EOF
16
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
21 fi
22 rm -f fvisibility.c fvisibility.o
23}
24
25case "$COMPILER" in
26aCC*)
27 ;;
28
29icpc)
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
34 ;;
35 *)
36 # the compile test works for the intel compiler because it mimics gcc's behavior
37 RunCompileTest
38 ;;
39 esac
40 ;;
41
42 *)
43 RunCompileTest
44 ;;
45esac
46
47# done
48if [ "$FVISIBILITY_SUPPORT" != "yes" ]; then
49 [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control disabled."
50 exit 0
51else
52 [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control enabled."
53 exit 1
54fi
Note: See TracBrowser for help on using the repository browser.