autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stack-like AC_LANG_WERROR


From: Andrey Simonenko
Subject: Re: Stack-like AC_LANG_WERROR
Date: Mon, 7 Apr 2008 12:18:36 +0300
User-agent: Mutt/1.5.17 (2007-11-01)

On Wed, Apr 02, 2008 at 09:13:25AM +0300, Andrey Simonenko wrote:
> 
> 3. Which exit code should be used in ac_lang_werror_pop()?
> 

Updated AC_LANG_WERROR_POP (here AS_ERROR is used):

# AC_LANG_WERROR_POP([VALUE])
# ---------------------------
# If an argument is given, then check that the current werror flag matches
# VALUE (that can be `on' or `off'), and restore the previous werror flag.
AC_DEFUN([AC_LANG_WERROR_POP],
[m4_ifndef([AC_LANG_WERROR_FUNC_INCLUDED],
          [m4_divert_text([DEFAULTS], [AC_LANG_WERROR_FUNC])])dnl
m4_ifndef([AC_LANG_WERROR_POP_FUNC_INCLUDED],
          [m4_divert_text([DEFAULTS],
[m4_define([AC_LANG_WERROR_POP_FUNC_INCLUDED])dnl
ac_lang_werror_pop()
{
  case $[]# in
  1)
    case "`eval echo \\$ac_${ac_ext}_werror_flag`" in
    yes)
      case $[]1 in
      off) AS_ERROR([ac_lang_werror_pop(off): current werror flag is on for 
'${ac_ext}' language]) ;;
      esac ;;
    *)
      case $[]1 in
      on) AS_ERROR([ac_lang_werror_pop(on): current werror flag is off for 
'${ac_ext}' language]) ;;
      esac ;;
    esac ;;
  esac
  case "`eval echo \\${ac_${ac_ext}_werror_flags%% *}`" in
  on)  ac_lang_werror on ;;
  off) ac_lang_werror off ;;
  *) AS_ERROR([ac_lang_werror_pop($[]1): stack is empty for '${ac_ext}' 
language]) ;;
  esac
  eval ac_${ac_ext}_werror_flags=\${ac_${ac_ext}_werror_flags#* }
}])])dnl
m4_if(
    $#, 1, [m4_if(
        [$1], [on], [ac_lang_werror_pop on],
        [$1], [off], [ac_lang_werror_pop off],
        [m4_fatal([$0: wrong argument: `$1'])])],
    $#, 0, [ac_lang_werror_pop],
    [m4_fatal([$0: incorrect number of arguments: $#])])[]dnl
])# AC_LANG_LANG_WERROR_POP




reply via email to

[Prev in Thread] Current Thread [Next in Thread]