summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-10-29 15:43:23 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-10-29 15:43:23 +0000
commit5dd1598b2fa7ccb5445477410102cab554de7bce (patch)
tree5b32a24336fc98193e95d502fb0ca3d47505f754 /configure
parent1c24dffd66fd7673635f81c6228d28ddc675991f (diff)
downloadexecline-5dd1598b2fa7ccb5445477410102cab554de7bce.tar.gz
execline-5dd1598b2fa7ccb5445477410102cab554de7bce.tar.xz
execline-5dd1598b2fa7ccb5445477410102cab554de7bce.zip
Support default pie
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure b/configure
index a5654da..8b10b01 100755
--- a/configure
+++ b/configure
@@ -299,6 +299,16 @@ if [ "x$target" != "x$(cat $sysdeps/target)" ] ; then
   exit 1
 fi
 
+defaultpie=false
+echo "Checking whether we're building PIE..."
+if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST -dM -E - < /dev/null | grep -qF __PIE__ ; then
+  defaultpie=true
+  CFLAGS_AUTO="$CFLAGS_AUTO -fPIC"
+  echo "  ... yes"
+else
+  echo "  ... no"
+fi
+
 spawn_lib=$(cat $sysdeps/spawn.lib)
 socket_lib=$(cat $sysdeps/socket.lib)
 sysclock_lib=$(cat $sysdeps/sysclock.lib)
@@ -411,6 +421,11 @@ if $shared ; then
 else
   echo "DO_SHARED :="
 fi
+if $defaultpie ; then
+  echo "DEFAULT_PIE := 1"
+else
+  echo "DEFAULT_PIE :="
+fi
 
 exec 1>&3 3>&-
 echo "  ... done."