1 | #!/bin/sh
|
---|
2 |
|
---|
3 | FVISIBILITY_SUPPORT=no
|
---|
4 | COMPILER=$1
|
---|
5 | VERBOSE=$2
|
---|
6 |
|
---|
7 | CMDLINE=
|
---|
8 |
|
---|
9 |
|
---|
10 | RunCompileTest() {
|
---|
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
|
---|
25 | EOF
|
---|
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 |
|
---|
|
---|