summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-10-29 23:21:19 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-10-29 23:21:19 +0000
commit8330521d9b370bad4b804d7fb6dfeb9ed8aafc2c (patch)
tree40384032ce79ce82c6254ff8830c7e58310274b8 /configure
parentd00ae5af737aa553cb4e6d903eda0537086776bb (diff)
downloads6-networking-8330521d9b370bad4b804d7fb6dfeb9ed8aafc2c.tar.xz
Support default pie
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure b/configure
index c1d807f..d4f484b 100755
--- a/configure
+++ b/configure
@@ -301,6 +301,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)
@@ -414,6 +424,11 @@ if $shared ; then
else
echo "DO_SHARED :="
fi
+if $defaultpie ; then
+ echo "DEFAULT_PIE := 1"
+else
+ echo "DEFAULT_PIE :="
+fi
if test -n $ssl ; then
echo "SSL_IMPL := $ssl"
else