summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-06-16 00:49:28 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-06-16 00:49:28 +0000
commit70ee40161f6faa1faa8670ca2fd7b517c4de0598 (patch)
treebae5358184e95d7436b480c9a6dbf15a3299bd05
parenta39a1b4c3e075e80d05caad61646a352693f5455 (diff)
Enable usage of PIE by default
-rw-r--r--acinclude.m412
-rw-r--r--configure.in1
2 files changed, 12 insertions, 1 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index e12fd01a..6242e390 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -45,13 +45,18 @@ AC_DEFUN([AC_INIT_BLUEZ], [
])
AC_DEFUN([AC_ARG_BLUEZ], [
- fortify_enable=yes
debug_enable=no
+ fortify_enable=yes
+ pie_enable=yes
AC_ARG_ENABLE(fortify, AC_HELP_STRING([--disable-fortify], [disable compile time buffer checks]), [
fortify_enable=${enableval}
])
+ AC_ARG_ENABLE(pie, AC_HELP_STRING([--disable-pie], [enable position independent executables flag]), [
+ pie_enable=${enableval}
+ ])
+
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable compiling with debugging information]), [
debug_enable=${enableval}
])
@@ -60,6 +65,11 @@ AC_DEFUN([AC_ARG_BLUEZ], [
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
fi
+ if (test "${pie_enable}" = "yes" && test "${ac_cv_prog_cc_pie}" = "yes"); then
+ CFLAGS="$CFLAGS -fPIC"
+ LDFLAGS="$LDFLAGS -pie"
+ fi
+
if (test "${debug_enable}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then
CFLAGS="$CFLAGS -g -O0"
fi
diff --git a/configure.in b/configure.in
index b086dbdf..2e6c5510 100644
--- a/configure.in
+++ b/configure.in
@@ -11,6 +11,7 @@ AC_INIT_BLUEZ
AC_LANG_C
AC_PROG_CC
+AC_PROG_CC_PIE
AC_PROG_INSTALL
m4_define([_LT_AC_TAGCONFIG], [])