From a4ba0ead6c82b3efe409c04d17de7ca06054356a Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 3 Oct 2018 15:11:52 +0000 Subject: [PATCH] build-sys: Inherit LDFLAGS So that we can respect e.g. the Fedora hardening flags. --- Makefile | 2 +- configure | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8d9b7d2..badecdc 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ O := files-pwd.o \ files-have_o_cloexec.o CFLAGS += $(EXTRA_CFLAGS) -pthread -fpic -LDFLAGS += $(CFLAGS) -Wl,-soname,$T -Wl,-as-needed -nostdlib -lpthread +LDFLAGS += $(CFLAGS) $(EXTRA_LDFLAGS) -Wl,-soname,$T -Wl,-as-needed -nostdlib -lpthread CPPFLAGS += -D_GNU_SOURCE ifneq ($(strip $(DATADIR)),) diff --git a/configure b/configure index 3336c3d..8d0bf6d 100755 --- a/configure +++ b/configure @@ -34,13 +34,14 @@ done # test -n "${CXXFLAGS}" && EXTRA_CXXFLAGS=${CXXFLAGS} test -n "${CFLAGS}" && EXTRA_CFLAGS=${CFLAGS} +test -n "${LDFLAGS}" && EXTRA_LDFLAGS=${LDFLAGS} # Inspect arguments and generate config.mk # echo "# autogenerated by: $0 $*" > config.mk for var in "$@" ; do case ${var} in - CFLAGS=* | CXXFLAGS=*) + CFLAGS=* | CXXFLAGS=* | LDFLAGS=* ) echo "Setting EXTRA_${var}" echo "EXTRA_${var}" >> config.mk ;; -- 2.17.1