Alessandro Bonazzi 8c43d5cf2f Patch level : 12.00
Files correlati     : cg0.exe cg0700a.msk cg0700b.msk cg3.exe cg4.exe

Bug                 :

Commento:
Merge 1.0 libraries
2025-04-06 00:42:21 +02:00

63 lines
1.3 KiB
Bash

#!/bin/sh
DWARF2_SUPPORT=no
DWARF2_SUPPORT_BROKEN=no
COMPILER=$1
VERBOSE=$2
WORKDIR=$3
shift 3
LFLAGS=
CXXFLAGS=
while [ "$#" -gt 0 ]; do
case $1 in
-arch)
CXXFLAGS="$CXXFLAGS -arch $2"
shift
;;
-sdk)
CXXFLAGS="$CXXFLAGS -isysroot $2"
LFLAGS="$LFLAGS -Wl,-syslibroot,$2"
shift
;;
*) ;;
esac
shift
done
touch dwarf2.c
if "$COMPILER" -c dwarf2.c $CXXFLAGS -Werror -gdwarf-2 2>/dev/null 1>&2; then
if "$COMPILER" -c dwarf2.c $CXXFLAGS -Werror -gdwarf-2 2>&1 | grep "unsupported" >/dev/null ; then
true
else
DWARF2_SUPPORT=yes
fi
fi
rm -f dwarf2.c dwarf2.o
# Test for xcode 2.4.0, which has a broken implementation of DWARF
"$COMPILER" $WORKDIR/xcodeversion.cpp $CXXFLAGS $LFLAGS -o xcodeversion -framework Carbon;
./xcodeversion
if [ "$?" == "1" ]; then
DWARF2_SUPPORT_BROKEN=yes
fi
rm xcodeversion
# done
if [ "$DWARF2_SUPPORT" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "DWARF2 debug symbols disabled."
exit 0
else
if [ "$DWARF2_SUPPORT_BROKEN" == "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "DWARF2 debug symbols disabled."
exit 0
else
[ "$VERBOSE" = "yes" ] && echo "DWARF2 debug symbols enabled."
exit 1
fi
fi