summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-10-09 22:45:07 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-10-09 22:45:07 +0000
commit0fccefa9c8f3299917f72f9afc37f8fc64c08f00 (patch)
treecf2f2c0a6cb44dc9cdb862d186e47530a4d54e92
parent0f5a5a9580084a3c4e0644ef5cd75689aeb5ff40 (diff)
Add compile time buffer checks (FORTIFY SOURCE)
-rw-r--r--acinclude.m49
1 files changed, 9 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 2f1077ea..92cde650 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -49,12 +49,21 @@ AC_DEFUN([AC_INIT_BLUEZ], [
])
AC_DEFUN([AC_ARG_BLUEZ], [
+ fortify_enable=yes
debug_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}
])
+ 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