From fa8dc5ccc69b2d62ee23e17e365506bce9b798b1 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Mon, 16 Nov 2015 17:58:04 +0900 Subject: [PATCH] allow to disable ssp --- configure | 17 ++++++++++++++++- configure.ac | 12 +++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 11783206..c3934645 100755 --- a/configure +++ b/configure @@ -794,6 +794,7 @@ with_mbedtls with_mbedtls_include with_mbedtls_lib enable_applecc +enable_ssp enable_assert ' ac_precious_vars='build_alias @@ -1439,6 +1440,7 @@ Optional Features: build against shared libraries when possible --disable-zlib disable zlib compression support --enable-applecc enable Apple CommonCrypto API support + --disable-ssp Do not compile with -fstack-protector --disable-assert turn off assertions Optional Packages: @@ -13782,7 +13784,20 @@ $as_echo "$as_me: -fstack-protector disabled on Solaris" >&6;} has_stack_protector=no ;; esac -if test x$has_stack_protector = xyes; then + +# Check whether --enable-ssp was given. +if test "${enable_ssp+set}" = set; then : + enableval=$enable_ssp; + enable_ssp="no" + +else + + enable_ssp="yes" + +fi + + +if test x$has_stack_protector = xyes && test x$enable_ssp = xyes; then CFLAGS="$CFLAGS -fstack-protector" { $as_echo "$as_me:${as_lineno-$LINENO}: -fstack-protector enabled in CFLAGS" >&5 $as_echo "$as_me: -fstack-protector enabled in CFLAGS" >&6;} diff --git a/configure.ac b/configure.ac index d18165fd..ba4baf81 100755 --- a/configure.ac +++ b/configure.ac @@ -142,7 +142,17 @@ case "$host_os" in has_stack_protector=no ;; esac -if test x$has_stack_protector = xyes; then + +AC_ARG_ENABLE(ssp, +[AS_HELP_STRING(--disable-ssp,Do not compile with -fstack-protector)], +[ + enable_ssp="no" +], +[ + enable_ssp="yes" +]) + +if test x$has_stack_protector = xyes && test x$enable_ssp = xyes; then CFLAGS="$CFLAGS -fstack-protector" AC_MSG_NOTICE([-fstack-protector enabled in CFLAGS]) fi