summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2012-06-28 20:22:26 -0400
committerGregory Maxwell <greg@xiph.org>2012-06-28 20:22:26 -0400
commit161623024529233d7aeceb5508b7c4e51cb0abea (patch)
tree2451bf4c85b7a7bdb0046ff7344da9a4915374e8
parent0c9060781cfa8c164406f6161b9d2c70ac60ca7e (diff)
downloadopus-161623024529233d7aeceb5508b7c4e51cb0abea.tar.gz
Add configure option to disable stack protector.
-rw-r--r--configure.ac14
1 files changed, 13 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e7613896..4a2499f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -209,7 +209,18 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
CFLAGS="$saved_CFLAGS $SYMBOL_VISIBILITY"
AC_SUBST(SYMBOL_VISIBILITY)
-if test $ac_cv_c_compiler_gnu = yes ; then
+ac_build_stack_protector=yes
+AC_ARG_ENABLE(stack-protector,
+ AS_HELP_STRING([--disable-stack-protector],[Disable compiler stack hardening]),
+ [
+ if test "x$enableval" = "xno"; then
+ ac_build_stack_protector=$enableval
+ fi
+ ], [
+ ac_build_stack_protector=yes
+ ])
+if test "x$ac_build_stack_protector" = "xyes"; then
+if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector-all"
AC_MSG_CHECKING([if ${CC} supports -fstack-protector-all])
@@ -219,6 +230,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
AC_MSG_RESULT([no]))
CFLAGS="$saved_CFLAGS $STACK_PROTECTOR"
fi
+fi
CFLAGS="$CFLAGS -W"