2 dnl Copyright (C) 2008 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 dnl From Simon Josefsson
10 # Initializes WARN_CFLAGS variable.
11 AC_DEFUN([gl_WARN_INIT],
13 AC_ARG_VAR(WARN_CFLAGS, [C compiler warning flags])
16 # gl_WARN_ADD([parameter]) adds parameter to WARN_CFLAGS if compiler
17 # supports it. For example, use gl_WARN_ADD([-Werror]).
18 AC_DEFUN([gl_WARN_ADD],
20 pushdef([param],[translit([$1],[ABCDEFGHIJKLMNOPQRSTUVWXYZ./-],
21 [abcdefghijklmnopqrstuvwxyz___])])
23 AC_CACHE_CHECK([whether compiler handles $1], [gl_cv_warn[]param[]], [
26 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
27 gl_cv_warn[]param=yes, gl_cv_warn[]param=no)
31 if test $gl_cv_warn[]param = "yes"; then
32 WARN_CFLAGS="$WARN_CFLAGS $1"