From: Michael Tremer Date: Wed, 12 Mar 2025 10:36:50 +0000 (+0000) Subject: configure: Fix passing custom LDFLAGS X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7cd3bbc389d717cbdc184a8c012ed7863186f1cc;p=location%2Flibloc.git configure: Fix passing custom LDFLAGS Fixes: #13829 - Overlinking Lua and Python bindings Reported-by: Petr Pisar Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index e5b4fc5..d77cefa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,15 +29,6 @@ AM_CFLAGS = \ AM_LDFLAGS = \ $(OUR_LDFLAGS) -# leaving a space here to work around automake's conditionals - ifeq ($(OS),Darwin) - AM_LDFLAGS += -Wl,-dead_strip - else - AM_LDFLAGS += \ - -Wl,--as-needed \ - -Wl,--gc-sections - endif - LIBLOC_CURRENT=1 LIBLOC_REVISION=3 LIBLOC_AGE=0 diff --git a/configure.ac b/configure.ac index 1e04085..1fae3a3 100644 --- a/configure.ac +++ b/configure.ac @@ -169,6 +169,10 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -fdiagnostics-show-option \ -fno-common \ ]) +CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\ + -Wl,--as-needed \ + -Wl,--gc-sections \ +]) # Enable -fno-semantic-interposition (if available) CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-fno-semantic-interposition])