From 4586bf7acdaa5e13ffb8a7b3e580a316fdb43e93 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 27 Jan 2015 20:48:08 +0000 Subject: [PATCH] Only export CXXFLAGS when the LDFLAGS work --- m4/pdns_pie.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/m4/pdns_pie.m4 b/m4/pdns_pie.m4 index 036a968c4..8fe9c4637 100644 --- a/m4/pdns_pie.m4 +++ b/m4/pdns_pie.m4 @@ -28,13 +28,14 @@ AC_DEFUN([AC_CC_PIE],[ ;; dnl All code is position independent on Win32 target *) gl_COMPILER_OPTION_IF([-fPIE -DPIE], [ - PIE_CFLAGS="-fPIE -DPIE" - CXXFLAGS="$PIE_CFLAGS" + CXXFLAGS="-fPIE -DPIE" gl_COMPILER_OPTION_IF([-pie], [ + PIE_CFLAGS="-fPIE -DPIE" PIE_LDFLAGS="-pie" ], [ dnl some versions of clang require -Wl,-pie instead of -pie gl_COMPILER_OPTION_IF([[-Wl,-pie]], [ + PIE_CFLAGS="-fPIE -DPIE" PIE_LDFLAGS="-Wl,-pie" ]) ] -- 2.40.0