From 01ec0af301f60fefdd0079647f13ef9abadd2db5 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Sun, 2 Jun 2013 14:31:27 -0700 Subject: [PATCH] - (tim) [aclocal.m4] Enhance OSSH_CHECK_CFLAG_COMPILE to check stderr. feedback and ok dtucker --- ChangeLog | 2 ++ aclocal.m4 | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ccbb790b4..80f0fb4ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,8 @@ need a shell that can handle "[ file1 -nt file2 ]". Rather than keep dealing with shell portability issues in regression tests, we let configure find us a capable shell on those platforms with an old /bin/sh. + - (tim) [aclocal.m4] Enhance OSSH_CHECK_CFLAG_COMPILE to check stderr. + feedback and ok dtucker 20130601 - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to diff --git a/aclocal.m4 b/aclocal.m4 index 9bdea5ec2..1b3bed790 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl $Id: aclocal.m4,v 1.8 2011/05/20 01:45:25 djm Exp $ +dnl $Id: aclocal.m4,v 1.9 2013/06/02 21:31:27 tim Exp $ dnl dnl OpenSSH-specific autoconf macros dnl @@ -14,8 +14,15 @@ AC_DEFUN([OSSH_CHECK_CFLAG_COMPILE], [{ _define_flag="$2" test "x$_define_flag" = "x" && _define_flag="$1" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], - [ AC_MSG_RESULT([yes]) - CFLAGS="$saved_CFLAGS $_define_flag"], + [ +if `grep -i "unrecognized option" conftest.err >/dev/null` +then + AC_MSG_RESULT([no]) + CFLAGS="$saved_CFLAGS" +else + AC_MSG_RESULT([yes]) + CFLAGS="$saved_CFLAGS $_define_flag" +fi], [ AC_MSG_RESULT([no]) CFLAGS="$saved_CFLAGS" ] )