diff options
author | djm <djm> | 2011-05-20 01:45:25 +0000 |
---|---|---|
committer | djm <djm> | 2011-05-20 01:45:25 +0000 |
commit | b01119b4e29ecf1f004c8786aee5dd9d6fc317c5 (patch) | |
tree | 9108fc01399b6a54146d32b973319b79fb19381c /aclocal.m4 | |
parent | a98bceaabfd0977be0b232e39a3f009444985db7 (diff) | |
download | openssh-b01119b4e29ecf1f004c8786aee5dd9d6fc317c5.tar.gz |
- (djm) [aclocal.m4 configure.ac] since gcc-4.x ignores all -Wno-options
options, we should corresponding -W-option when trying to determine
whether it is accepted. Also includes a warning fix on the program
fragment uses (bad main() return type).
bz#1900 and bz#1901 reported by g.esp AT free.fr; ok dtucker@
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -1,8 +1,26 @@ -dnl $Id: aclocal.m4,v 1.7 2011/05/05 03:48:37 djm Exp $ +dnl $Id: aclocal.m4,v 1.8 2011/05/20 01:45:25 djm Exp $ dnl dnl OpenSSH-specific autoconf macros dnl +dnl OSSH_CHECK_CFLAG_COMPILE(check_flag[, define_flag]) +dnl Check that $CC accepts a flag 'check_flag'. If it is supported append +dnl 'define_flag' to $CFLAGS. If 'define_flag' is not specified, then append +dnl 'check_flag'. +AC_DEFUN([OSSH_CHECK_CFLAG_COMPILE], [{ + AC_MSG_CHECKING([if $CC supports $1]) + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + _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"], + [ AC_MSG_RESULT([no]) + CFLAGS="$saved_CFLAGS" ] + ) +}]) + dnl OSSH_CHECK_HEADER_FOR_FIELD(field, header, symbol) dnl Does AC_EGREP_HEADER on 'header' for the string 'field' |