qt5base-lts/config.tests/unix/objcopy.test
Simon Hausmann 19f4b47b45 Improve sysroot handling with regards to configure tests.
Some configure tests try to link programs, which when compiling against
a sysroot _does_ require the --sysroot= argument in order to find crt0.o.

This patch uses the existing pattern of using the export SYSROOT_FLAG
in the missing linking tests.

Change-Id: I063849c814f393d5f88de1b486ce9035b9f7bf65
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-03 18:59:09 +01:00

30 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
TEST_PATH=`dirname "$0"`
SEP_DEBUG_SUPPORT=no
COMPILER=$1
QMAKE_OBJCOPY=$2
VERBOSE=$3
if [ -n "$QMAKE_OBJCOPY" ]; then
echo "int main() { return 0; }" > objcopy_test.cpp
if $TEST_PATH/which.test "$QMAKE_OBJCOPY" >/dev/null 2>&1 && $COMPILER $SYSROOT_FLAG -g -o objcopy_test objcopy_test.cpp >/dev/null 2>&1; then
"$QMAKE_OBJCOPY" --only-keep-debug objcopy_test objcopy_test.debug >/dev/null 2>&1 \
&& "$QMAKE_OBJCOPY" --strip-debug objcopy_test >/dev/null 2>&1 \
&& "$QMAKE_OBJCOPY" --add-gnu-debuglink=objcopy_test.debug objcopy_test >/dev/null 2>&1 \
&& SEP_DEBUG_SUPPORT=yes
fi
rm -f objcopy_test objcopy_test.debug objcopy_test.cpp
else
[ "$VERBOSE" = "yes" ] && echo "Separate debug info check skipped, QMAKE_OBJCOPY is unset.";
fi
# done
if [ "$SEP_DEBUG_SUPPORT" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "Separate debug info support disabled."
exit 0
else
[ "$VERBOSE" = "yes" ] && echo "Separate debug info support enabled."
exit 1
fi