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

Last change on this file since 1030 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/sh
2
3FVISIBILITY_SUPPORT=no
4COMPILER=$1
5VERBOSE=$2
6
7CMDLINE=
8
9
10RunCompileTest() {
11 cat >>fvisibility.c << EOF
12#if defined(__GNUC__)
13# if (__GNUC__ < 4)
14# error "GCC3 with backported visibility patch is known to miscompile Qt"
15# endif
16__attribute((visibility("default"))) void blah();
17#elif defined(__SUNPRO_CC)
18# if (__SUNPRO_CC < 0x0550)
19# error "SunStudio 8 or later is required for ELF visibility"
20# endif
21__global void blah();
22#else
23# error "GCC4+ or SunStudio 8+ are required to support ELF visibility"
24#endif
25EOF
26
27 if [ "$VERBOSE" = "yes" ] ; then
28 "$COMPILER" -c $CMDLINE fvisibility.c && FVISIBILITY_SUPPORT=yes
29 else
30 "$COMPILER" -c $CMDLINE fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes
31 fi
32 rm -f fvisibility.c fvisibility.o
33}
34