]> granicus.if.org Git - pdns/commitdiff
Simplify check
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 27 Jan 2015 21:48:12 +0000 (21:48 +0000)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 27 Jan 2015 21:48:12 +0000 (21:48 +0000)
If we can link with -pie or -Wl,pie, -fPIE works too

m4/pdns_pie.m4

index 1f1f71d0eb2641b09afe4fa28f3122ce6fa0b106..98d392374228e28a56b4595ebd649d3bcb5badd4 100644 (file)
@@ -27,7 +27,6 @@ AC_DEFUN([AC_CC_PIE],[
       *-*-mingw* | *-*-msvc* | *-*-cygwin* )
          ;; dnl All code is position independent on Win32 target
       *)
-      gl_COMPILER_OPTION_IF([-fPIE -DPIE], [
         CXXFLAGS="-fPIE -DPIE"
         gl_COMPILER_OPTION_IF([-pie], [
           PIE_CFLAGS="-fPIE -DPIE"
@@ -48,13 +47,7 @@ __thread unsigned int t_id;
 #include <pthread.h>
 __thread unsigned int t_id;
             ]], [[t_id = 1;]])]
-        )],
-        [],
-        [AC_LANG_PROGRAM([[
-#include <pthread.h>
-__thread unsigned int t_id;
-          ]], [[t_id = 1;]])]
-      )
+        )
     esac
     CXXFLAGS=$OLD_CXXFLAGS
     AC_SUBST([PIE_CFLAGS])