Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
[qt-netbsd.git] / config.tests / unix / objcopy.test
blobe2051a782342dac1927530bd85809ec0ce2a8084
1 #!/bin/sh
3 TEST_PATH=`dirname "$0"`
4 SEP_DEBUG_SUPPORT=no
5 COMPILER=$1
6 QMAKE_OBJCOPY=$2
7 VERBOSE=$3
9 if [ -n "$QMAKE_OBJCOPY" ]; then
10 echo "int main() { return 0; }" > objcopy_test.cpp
11 if $TEST_PATH/which.test "$QMAKE_OBJCOPY" >/dev/null 2>&1 && $COMPILER -g -o objcopy_test objcopy_test.cpp >/dev/null 2>&1; then
12 "$QMAKE_OBJCOPY" --only-keep-debug objcopy_test objcopy_test.debug >/dev/null 2>&1 \
13 && "$QMAKE_OBJCOPY" --strip-debug objcopy_test >/dev/null 2>&1 \
14 && "$QMAKE_OBJCOPY" --add-gnu-debuglink=objcopy_test.debug objcopy_test >/dev/null 2>&1 \
15 && SEP_DEBUG_SUPPORT=yes
17 rm -f objcopy_test objcopy_test.debug objcopy_test.cpp
18 else
19 [ "$VERBOSE" = "yes" ] && echo "Separate debug info check skipped, QMAKE_OBJCOPY is unset.";
22 # done
23 if [ "$SEP_DEBUG_SUPPORT" != "yes" ]; then
24 [ "$VERBOSE" = "yes" ] && echo "Separate debug info support disabled."
25 exit 0
26 else
27 [ "$VERBOSE" = "yes" ] && echo "Separate debug info support enabled."
28 exit 1