qt5base-lts/config.tests/unix/bsymbolic_functions.test
Thiago Macieira 69bf30596c Fix the bsymbolic_functions test and improve the error reporting
The bsymbolic_functions test was missing $SYSROOT_FLAG, so the linking
was always failing and the test falsely negative.

Also make the error reporting better: if the flag was requested, error
out if the check fails and report more information in -v mode.

Change-Id: Ie2615f8083e7e58d63d9ee9c23be937dc864b30d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-22 18:59:45 +01:00

28 lines
848 B
Bash
Executable File

#!/bin/sh
BSYMBOLIC_FUNCTIONS_SUPPORT=no
COMPILER=$1
VERBOSE=$2
cat >>bsymbolic_functions.c << EOF
int main() { return 0; }
EOF
if [ "$VERBOSE" = "yes" ] ; then
echo $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
$COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
else
$COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
fi
rm -f bsymbolic_functions.c libtest.so
# done
if [ "$BSYMBOLIC_FUNCTIONS_SUPPORT" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "Symbolic function binding disabled."
exit 0
else
[ "$VERBOSE" = "yes" ] && echo "Symbolic function binding enabled."
exit 1
fi