aboutsummaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-10-09 22:45:56 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-10-09 22:45:56 +0000
commitcce6e7719f417d41f1be706bffd135899f83087b (patch)
tree701037348ce4afca2604b343f8175e427fdf6fa6 /acinclude.m4
parent3b2261da8c56c1ec8153f87f9f0b25dda0eae820 (diff)
downloadhcidump-cce6e7719f417d41f1be706bffd135899f83087b.tar.gz
Add compile time buffer checks (FORTIFY SOURCE)
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m49
1 files changed, 9 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 694412f..94ee696 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -86,9 +86,14 @@ AC_DEFUN([AC_PATH_BLUEZ], [
])
AC_DEFUN([AC_ARG_BLUEZ], [
+ fortify_enable=yes
debug_enable=no
pie_enable=no
+ AC_ARG_ENABLE(fortify, AC_HELP_STRING([--disable-fortify], [disable compile time buffer checks]), [
+ fortify_enable=${enableval}
+ ])
+
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable compiling with debugging information]), [
debug_enable=${enableval}
])
@@ -97,6 +102,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
pie_enable=${enableval}
])
+ if (test "${fortify_enable}" = "yes"); then
+ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
+ fi
+
if (test "${debug_enable}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then
CFLAGS="$CFLAGS -g"
fi