From c0bdcba56e12723440598903fae42b2a60b1b573 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 29 Oct 2017 15:19:58 +0000 Subject: Add pie test, don't double build on pie --- configure | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'configure') diff --git a/configure b/configure index f34dcd0..9d84974 100755 --- a/configure +++ b/configure @@ -377,6 +377,15 @@ if test -z "$target" ; then fi echo " ... $target" +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 -F __PIE__ ; then + defaultpie=true + echo " ... yes" +else + echo " ... no" +fi + tryflag CFLAGS_AUTO -std=c99 tryflag CFLAGS -fomit-frame-pointer tryflag CFLAGS_AUTO -fno-exceptions @@ -586,6 +595,11 @@ if $shared ; then else echo "SHARED_LIBS :=" fi +if $defaultpie ; then + echo "DEFAULT_PIE := true" +else + echo "DEFAULT_PIE :=" +fi exec 1>&3 3>&- echo " ... done." -- cgit v1.2.3