diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2021-05-15 14:25:37 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-05-15 14:25:37 +0200 |
commit | 761ead497feff5fd259c9f6ca76d184bb8755373 (patch) | |
tree | 52091b74397d9fb4e6fceb85154b26093f51e89a /src/auto | |
parent | 847fe7d750001a46a09b97ad57286612d0be8100 (diff) | |
download | vim-git-761ead497feff5fd259c9f6ca76d184bb8755373.tar.gz |
patch 8.2.2852: configure can add --as-needed a second timev8.2.2852
Problem: Configure can add --as-needed a second time.
Solution: Only add --as-needed if not already there. (Natanael Copa,
closes #8189, closes #8181)
Diffstat (limited to 'src/auto')
-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 934b34c24..0b423a657 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 |