- (dtucker) [configure.ac] Enable -fno-builtin-memset when using gcc.
diff --git a/configure.ac b/configure.ac
index aea6cb3..eb71a87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.405 2008/06/13 23:14:46 dtucker Exp $
+# $Id: configure.ac,v 1.406 2008/06/15 16:27:48 dtucker Exp $
 #
 # Copyright (c) 1999-2004 Damien Miller
 #
@@ -15,7 +15,7 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
-AC_REVISION($Revision: 1.405 $)
+AC_REVISION($Revision: 1.406 $)
 AC_CONFIG_SRCDIR([ssh.c])
 
 AC_CONFIG_HEADER(config.h)
@@ -112,6 +112,18 @@
 		*) ;;
 	esac
 
+	AC_MSG_CHECKING(if $CC accepts -fno-builtin-memset)
+	saved_CFLAGS="$CFLAGS"
+	CFLAGS="$CFLAGS -fno-builtin-memset"
+	AC_LINK_IFELSE( [AC_LANG_SOURCE([[
+#include <string.h>
+int main(void){char b[10]; memset(b, 0, sizeof(b));}
+		]])],
+		[ AC_MSG_RESULT(yes) ],
+		[ AC_MSG_RESULT(no)
+		  CFLAGS="$saved_CFLAGS" ]
+)
+
 	# -fstack-protector-all doesn't always work for some GCC versions
 	# and/or platforms, so we test if we can.  If it's not supported
 	# on a give platform gcc will emit a warning so we use -Werror.