Update autoconf scripts

1. Since AX_HARDEN is called always, moved the few items
   set in configure for gcc-hardening to AX_HARDEN.
2. Dropped the macros that AX_DEBUG was setting that we
   haven't been using and aren't using now.
This commit is contained in:
John Safranek 2014-02-14 15:59:59 -08:00
parent 85a47b4596
commit 260c37acec
3 changed files with 3 additions and 14 deletions

View File

@ -95,6 +95,7 @@ AC_TYPE_UINT8_T
AM_PROG_AS
AM_PROG_CC_C_O
LT_LIB_M
AX_HARDEN_CC_COMPILER_FLAGS
OPTIMIZE_CFLAGS="-Os -fomit-frame-pointer"
OPTIMIZE_FAST_CFLAGS="-O2 -fomit-frame-pointer"
@ -1554,17 +1555,6 @@ fi
LIB_SOCKET_NSL
AC_ARG_ENABLE([gcc-hardening],
AS_HELP_STRING(--enable-gcc-hardening, Enable compiler security checks (default: disabled)),
[if test x$enableval = xyes; then
AM_CFLAGS="$AM_CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
AM_CFLAGS="$AM_CFLAGS -fwrapv -fPIE -Wstack-protector"
AM_CFLAGS="$AM_CFLAGS --param ssp-buffer-size=1"
LDFLAGS="$LDFLAGS -pie"
fi])
AX_HARDEN_CC_COMPILER_FLAGS
# link to ws2_32 if on mingw
case $host_os in
*mingw32)

View File

@ -51,9 +51,7 @@ AC_DEFUN([AX_DEBUG],
[AS_HELP_STRING([--enable-debug],
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
[ax_enable_debug=yes
AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])
AX_ADD_AM_MACRO([AM_YFLAGS += --debug])
AX_ADD_AM_MACRO([AM_CPPFLAGS += -D_GLIBCXX_DEBUG])],
AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])],
[ax_enable_debug=no
AC_SUBST([MCHECK])
AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])])

View File

@ -156,6 +156,7 @@
AX_APPEND_COMPILE_FLAGS([-Wunused-variable],,[$ax_append_compile_cflags_extra])
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings],,[$ax_append_compile_cflags_extra])
AX_APPEND_COMPILE_FLAGS([-fwrapv],,[$ax_append_compile_cflags_extra])
AX_APPEND_COMPILE_FLAGS([-fPIE],,[$ax_append_compile_cflags_extra])
AC_LANG_POP
])