]> granicus.if.org Git - pdns/commitdiff
Use -fPIE CXXFLAGS when linking
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 27 Jan 2015 20:01:57 +0000 (20:01 +0000)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 27 Jan 2015 20:01:57 +0000 (20:01 +0000)
m4/pdns_pie.m4

index ce3e692c59d11e0ae45f442a532b01cebf8e57d6..036a968c4803fccdf18518f943303d5707a7760c 100644 (file)
@@ -22,12 +22,14 @@ AC_DEFUN([AC_CC_PIE],[
     AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
     PIE_CFLAGS=
     PIE_LDFLAGS=
+    OLD_CXXFLAGS=$CXXFLAGS
     case "$host" in
       *-*-mingw* | *-*-msvc* | *-*-cygwin* )
          ;; dnl All code is position independent on Win32 target
       *)
       gl_COMPILER_OPTION_IF([-fPIE -DPIE], [
         PIE_CFLAGS="-fPIE -DPIE"
+        CXXFLAGS="$PIE_CFLAGS"
         gl_COMPILER_OPTION_IF([-pie], [
           PIE_LDFLAGS="-pie"
           ], [
@@ -39,6 +41,7 @@ AC_DEFUN([AC_CC_PIE],[
         )]
       )
     esac
+    CXXFLAGS=$OLD_CXXFLAGS
     AC_SUBST([PIE_CFLAGS])
     AC_SUBST([PIE_LDFLAGS])
 ])