diff options
Diffstat (limited to 'src/auto/configure')
-rwxr-xr-x | src/auto/configure | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/auto/configure b/src/auto/configure index 934b34c24e..0b423a6577 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -14937,7 +14937,9 @@ $as_echo_n "checking linker --as-needed support... " >&6; } LINK_AS_NEEDED= # Check if linker supports --as-needed and --no-as-needed options if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then - LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'` + if ! echo "$LDFLAGS" | grep -q -- '-Wl,[^[:space:]]*--as-needed'; then + LDFLAGS="$LDFLAGS -Wl,--as-needed" + fi LINK_AS_NEEDED=yes fi if test "$LINK_AS_NEEDED" = yes; then |