Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
[qt-netbsd.git] / config.tests / mac / dwarf2.test
bloba640b113de5d17815e22f2b44a054d032a0cdc1e
1 #!/bin/sh
3 DWARF2_SUPPORT=no
4 DWARF2_SUPPORT_BROKEN=no
5 COMPILER=$1
6 VERBOSE=$2
7 WORKDIR=$3
9 touch dwarf2.c
11 if "$COMPILER" -c dwarf2.c -Werror -gdwarf-2 2>/dev/null 1>&2; then
12 if "$COMPILER" -c dwarf2.c -Werror -gdwarf-2 2>&1 | grep "unsupported" >/dev/null ; then
13 true
14 else
15 DWARF2_SUPPORT=yes
18 rm -f dwarf2.c dwarf2.o
20 # Test for xcode 2.4.0, which has a broken implementation of DWARF
21 "$COMPILER" $WORKDIR/xcodeversion.cpp -o xcodeversion -framework Carbon;
22 ./xcodeversion
24 if [ "$?" == "1" ]; then
25 DWARF2_SUPPORT_BROKEN=yes
28 rm xcodeversion
30 # done
31 if [ "$DWARF2_SUPPORT" != "yes" ]; then
32 [ "$VERBOSE" = "yes" ] && echo "DWARF2 debug symbols disabled."
33 exit 0
34 else
35 if [ "$DWARF2_SUPPORT_BROKEN" == "yes" ]; then
36 [ "$VERBOSE" = "yes" ] && echo "DWARF2 debug symbols disabled."
37 exit 0
38 else
39 [ "$VERBOSE" = "yes" ] && echo "DWARF2 debug symbols enabled."
40 exit 1