summary refs log tree commit diff
path: root/configure.in
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2006-09-09 17:07:39 +0000
committerFlorian Westphal <fw@strlen.de>2006-09-09 17:07:39 +0000
commit035f7fb2fe1761f522ce680a4ff1ac1a2a44611a (patch)
tree7e818f86e8c7edb01017ae24acdb3811f3b078d7 /configure.in
parent1b2c228de55c452d6ecb295256e6f9c5d7dbccbf (diff)
downloadngircd-035f7fb2fe1761f522ce680a4ff1ac1a2a44611a.tar.gz
ngircd-035f7fb2fe1761f522ce680a4ff1ac1a2a44611a.zip
only test for stack smashing protector if we are using gcc;
use -fstack-protector-all for the test to make sure the guard variable is added.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in35
1 files changed, 17 insertions, 18 deletions
diff --git a/configure.in b/configure.in
index 0875735a..ee45da37 100644
--- a/configure.in
+++ b/configure.in
@@ -8,7 +8,7 @@
 # (at your option) any later version.
 # Please read the file COPYING, README and AUTHORS for more information.
 #
-# $Id: configure.in,v 1.120 2006/08/13 18:11:18 fw Exp $
+# $Id: configure.in,v 1.121 2006/09/09 17:07:39 fw Exp $
 #
 
 # -- Initialisation --
@@ -57,29 +57,28 @@ AC_C_INLINE
 
 # -- Hard coded system and compiler dependencies/features/options ... --
 
-if test "$GCC" = "yes"; then
-	# We are using the GNU C compiler. Good!
-	CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes"
-fi
-
-
 AC_DEFUN([GCC_STACK_PROTECT_CC],[
   ssp_cc=yes
-  if test "X$CC" != "X"; then
-    AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
-    ssp_old_cflags="$CFLAGS"
-    CFLAGS="$CFLAGS -fstack-protector"
-    AC_TRY_LINK(,,, ssp_cc=no)
-    echo $ssp_cc
-    if test "X$ssp_cc" = "Xno"; then
-      CFLAGS="$ssp_old_cflags"
-    else
+  # we use -fstack-protector-all for the test to enfoce the use of the guard variable 
+  AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
+  ssp_old_cflags="$CFLAGS"
+  CFLAGS="$CFLAGS -fstack-protector-all"
+  AC_TRY_LINK(,,, ssp_cc=no)
+  echo $ssp_cc
+  CFLAGS="$ssp_old_cflags"
+  if test "X$ssp_cc" = "Xyes"; then
+      CFLAGS="$CFLAGS -fstack-protector"
       AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
-    fi
   fi
 ])
 
-GCC_STACK_PROTECT_CC
+
+if test "$GCC" = "yes"; then
+	# We are using the GNU C compiler. Good!
+	CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes"
+
+	GCC_STACK_PROTECT_CC
+fi
 
 case "$target_os" in
 	hpux*)