summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-01-12 16:00:37 +1100
committerDamien Miller <djm@mindrot.org>2011-01-12 16:00:37 +1100
commit134d02a494f435458a1147dea9ed719f1274078c (patch)
tree22e45b45fcf6e146dce42d7d5d6fb19b7bda8f27
parent945aa0c744ea99544fdf7f868ff9cce0193c9fdd (diff)
- (djm) [configure.ac] Fix broken test for gcc >= 4.4 with per-compiler
flag tests that don't depend on gcc version at all; suggested by and ok dtucker@
-rw-r--r--ChangeLog3
-rw-r--r--configure.ac32
2 files changed, 28 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index da374f544..f928331c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,9 @@
15 "looks ok" tedu@ feedback guenther@ 15 "looks ok" tedu@ feedback guenther@
16 - (djm) [configure.ac] Turn on -Wno-unused-result for gcc >= 4.4 to avoid 16 - (djm) [configure.ac] Turn on -Wno-unused-result for gcc >= 4.4 to avoid
17 silly warnings on write() calls we don't care succeed or not. 17 silly warnings on write() calls we don't care succeed or not.
18 - (djm) [configure.ac] Fix broken test for gcc >= 4.4 with per-compiler
19 flag tests that don't depend on gcc version at all; suggested by and
20 ok dtucker@
18 21
1920110111 2220110111
20 - (tim) [regress/host-expand.sh] Fix for building outside of read only 23 - (tim) [regress/host-expand.sh] Fix for building outside of read only
diff --git a/configure.ac b/configure.ac
index 020634b56..93dd22174 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.462 2011/01/12 02:34:02 djm Exp $ 1# $Id: configure.ac,v 1.463 2011/01/12 05:00:39 djm Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,9 +15,21 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) 17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
18AC_REVISION($Revision: 1.462 $) 18AC_REVISION($Revision: 1.463 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20 20
21# local macros
22AC_DEFUN([OPENSSH_CHECK_CFLAG_COMPILE], [{
23 AC_MSG_CHECKING([if $CC supports $1])
24 saved_CFLAGS="$CFLAGS"
25 CFLAGS="$CFLAGS $1"
26 AC_COMPILE_IFELSE([void main(void) { return 0; }],
27 [ AC_MSG_RESULT(yes) ],
28 [ AC_MSG_RESULT(no)
29 CFLAGS="$saved_CFLAGS" ]
30 )
31}])
32
21AC_CONFIG_HEADER(config.h) 33AC_CONFIG_HEADER(config.h)
22AC_PROG_CC 34AC_PROG_CC
23AC_CANONICAL_HOST 35AC_CANONICAL_HOST
@@ -113,21 +125,27 @@ AC_ARG_WITH(stackprotect,
113 use_stack_protector=0 125 use_stack_protector=0
114 fi ]) 126 fi ])
115 127
128
116if test "$GCC" = "yes" || test "$GCC" = "egcs"; then 129if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
117 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized" 130 OPENSSH_CHECK_CFLAG_COMPILE([-Wall])
131 OPENSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith])
132 OPENSSH_CHECK_CFLAG_COMPILE([-Wuninitialized])
133 OPENSSH_CHECK_CFLAG_COMPILE([-Wsign-compare])
134 OPENSSH_CHECK_CFLAG_COMPILE([-Wformat-security])
135 OPENSSH_CHECK_CFLAG_COMPILE([-Wno-pointer-sign])
136 OPENSSH_CHECK_CFLAG_COMPILE([-Wno-unused-result])
137 OPENSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing])
138 AC_MSG_CHECKING(gcc version)
118 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` 139 GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
119 case $GCC_VER in 140 case $GCC_VER in
120 1.*) no_attrib_nonnull=1 ;; 141 1.*) no_attrib_nonnull=1 ;;
121 2.8* | 2.9*) 142 2.8* | 2.9*)
122 CFLAGS="$CFLAGS -Wsign-compare"
123 no_attrib_nonnull=1 143 no_attrib_nonnull=1
124 ;; 144 ;;
125 2.*) no_attrib_nonnull=1 ;; 145 2.*) no_attrib_nonnull=1 ;;
126 3.*) CFLAGS="$CFLAGS -Wsign-compare -Wformat-security" ;;
127 4.[0123]|4.[0123].*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign -Wformat-security -fno-strict-aliasing" ;;
128 4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign -Wformat-security -fno-strict-aliasing -Wno-unused-result" ;;
129 *) ;; 146 *) ;;
130 esac 147 esac
148 AC_MSG_RESULT($GCC_VER)
131 149
132 AC_MSG_CHECKING(if $CC accepts -fno-builtin-memset) 150 AC_MSG_CHECKING(if $CC accepts -fno-builtin-memset)
133 saved_CFLAGS="$CFLAGS" 151 saved_CFLAGS="$CFLAGS"