configure: check for --no-as-needed before using (#217)

This commit is contained in:
Josh de Kock 2016-11-04 06:49:48 +00:00 committed by Juan RP
parent c3068808a2
commit 21492ca1bf

8
configure vendored
View File

@ -222,8 +222,6 @@ esac
# Add CPPFLAGS/CFLAGS/LDFLAGS to CC for testing features
XCC="$CC $CFLAGS $CPPFLAGS $LDFLAGS"
# Make sure to disable --as-needed for CC tests.
XCC="$XCC -Wl,--no-as-needed"
check_compiler_flag()
{
@ -259,6 +257,12 @@ EOF
return $rv
}
# If supported, make sure to disable --as-needed for CC tests.
check_compiler_flag "l,--no-as-needed" W LDFLAGS
if [ $? -eq 0 ]; then
XCC="$XCC -Wl,--no-as-needed"
fi
#
# Check for some compiler warning flags.
#