aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2012-09-15 16:59:17 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2012-09-15 16:59:17 +0100
commit7281ad13e9dadb1369590617eb06265b084a1726 (patch)
tree09a86f08d1d36f0b984cd8a370eb6a93ff3f4fae /configure
parent68709f5618175d0ecb9b2b160cbb2ce2d4ddc7bc (diff)
Allow building position-independent executables. #981, patch from brainsmoke.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure b/configure
index a1bcda49..c1d64dd1 100755
--- a/configure
+++ b/configure
@@ -41,6 +41,8 @@ events=glib
ldap=0
ssl=auto
+pie=1
+
arch=`uname -s`
cpu=`uname -m`
@@ -79,6 +81,7 @@ Option Description Default
--debug=0/1 Disable/enable debugging $debug
--strip=0/1 Disable/enable binary stripping $strip
+--pie=0/1 Build position independent executable $pie
--gcov=0/1 Disable/enable test coverage reporting $gcov
--plugins=0/1 Disable/enable plugins support $plugins
--otr=0/1/auto/plugin
@@ -90,6 +93,7 @@ Option Description Default
--ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto)
$ssl
+
--target=... Cross compilation target same as host
EOF
exit;
@@ -199,6 +203,11 @@ else
[ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing"
fi
+if [ "$pie" = "1" ]; then
+ echo 'CFLAGS_BITLBEE=-fPIE' >> Makefile.settings
+ echo 'LDFLAGS_BITLBEE=-pie' >> Makefile.settings
+fi
+
echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings
echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings
@@ -747,6 +756,12 @@ else
echo ' Debugging disabled.'
fi
+if [ "$pie" = "1" ]; then
+ echo ' Building PIE executable'
+else
+ echo ' Building non-PIE executable'
+fi
+
if [ "$strip" = "1" ]; then
echo ' Binary stripping enabled.'
else