config.tests/unix/objcopy.test
changeset 0 1918ee327afb
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 #!/bin/sh
       
     2 
       
     3 TEST_PATH=`dirname "$0"`
       
     4 SEP_DEBUG_SUPPORT=no
       
     5 COMPILER=$1
       
     6 QMAKE_OBJCOPY=$2
       
     7 VERBOSE=$3
       
     8 
       
     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 
       
    16     fi
       
    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.";
       
    20 fi
       
    21 
       
    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
       
    29 fi