dnl Copyright © 2005 William Pitcock, et al. dnl Rights to this code are as documented in doc/pod/license.pod. dnl dnl This file contains autoconf macros used in configure. dnl dnl $Id: ermyth-c.m4,v 1.2 2007/07/21 01:29:08 pippijn Exp $ dnl Stolen from hyperion. dnl ERMYTH_C_GCC_TRY_FLAGS(,) AC_DEFUN([ERMYTH_C_GCC_TRY_FLAGS],[ AC_MSG_CHECKING([GCC flag(s) $1]) if test "${GCC-no}" = yes then AC_CACHE_VAL($2,[ oldcflags="${CFLAGS-}" CFLAGS="${CFLAGS-} ${CWARNS} $1 -Werror" AC_TRY_COMPILE([ #include #include int main(void); ],[ strcmp("a","b"); fprintf(stdout,"test ok\n"); ], [$2=yes], [$2=no]) CFLAGS="${oldcflags}"]) if test "x$$2" = xyes; then CWARNS="${CWARNS}$1 " AC_MSG_RESULT(ok) else $2='' AC_MSG_RESULT(no) fi else AC_MSG_RESULT(no, not using GCC) fi ])