configure: clean up function definitions

This commit is contained in:
Alexander Barton 2013-11-12 00:25:28 +01:00
parent ae00c100ac
commit 34824abe0d
1 changed files with 16 additions and 13 deletions

View File

@ -75,23 +75,26 @@ AC_C_CONST
AC_C_INLINE AC_C_INLINE
__ng_PROTOTYPES__ __ng_PROTOTYPES__
# -- Hard coded system and compiler dependencies/features/options ... -- # -- Function Definitions --
AC_DEFUN([GCC_STACK_PROTECT_CC],[ AC_DEFUN([GCC_STACK_PROTECT_CC],[
ssp_cc=yes ssp_cc=yes
# we use -fstack-protector-all for the test to enfoce the use of the guard variable # Use -fstack-protector-all for the test to enfoce the use of the
AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector]) # guard variable
ssp_old_cflags="$CFLAGS" AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
CFLAGS="$CFLAGS -fstack-protector-all" ssp_old_cflags="$CFLAGS"
AC_TRY_LINK(,,, ssp_cc=no) CFLAGS="$CFLAGS -fstack-protector-all"
echo $ssp_cc AC_TRY_LINK(,,, ssp_cc=no)
CFLAGS="$ssp_old_cflags" echo $ssp_cc
if test "X$ssp_cc" = "Xyes"; then CFLAGS="$ssp_old_cflags"
CFLAGS="$CFLAGS -fstack-protector" if test "X$ssp_cc" = "Xyes"; then
AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.]) CFLAGS="$CFLAGS -fstack-protector"
fi AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
fi
]) ])
# -- Hard coded system and compiler dependencies/features/options ... --
if test "$GCC" = "yes"; then if test "$GCC" = "yes"; then
# We are using the GNU C compiler. Good! # We are using the GNU C compiler. Good!
CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes" CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes"