summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-11-10 21:06:57 +0100
committerSimon Josefsson <simon@josefsson.org>2008-11-10 21:06:57 +0100
commit46644dcc71708b65d9f3c2bd93126a3d76cf0af4 (patch)
treecb1e7e871a7c4aacdc3e02d007d778c6fb7e5628 /gl
parent62fac578a9f3327e0fbc650b39a0b5fd4074c9bd (diff)
downloadlibtasn1-46644dcc71708b65d9f3c2bd93126a3d76cf0af4.tar.gz
libtasn1-46644dcc71708b65d9f3c2bd93126a3d76cf0af4.tar.bz2
libtasn1-46644dcc71708b65d9f3c2bd93126a3d76cf0af4.zip
Update gnulib files.
Diffstat (limited to 'gl')
-rw-r--r--gl/m4/warnings.m434
1 files changed, 34 insertions, 0 deletions
diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4
new file mode 100644
index 0000000..594ff97
--- /dev/null
+++ b/gl/m4/warnings.m4
@@ -0,0 +1,34 @@
+# warnings.m4 serial 1
+dnl Copyright (C) 2008 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# gl_WARN_INIT
+# Initializes WARN_CFLAGS variable.
+AC_DEFUN([gl_WARN_INIT],
+[
+ AC_ARG_VAR(WARN_CFLAGS, [C compiler warning flags])
+])
+
+# gl_WARN_ADD([parameter]) adds parameter to WARN_CFLAGS if compiler
+# supports it. For example, use gl_WARN_ADD([-Werror]).
+AC_DEFUN([gl_WARN_ADD],
+[
+ pushdef([param],[translit([$1],[ABCDEFGHIJKLMNOPQRSTUVWXYZ./-],
+ [abcdefghijklmnopqrstuvwxyz___])])
+
+ AC_CACHE_CHECK([whether compiler handles $1], [gl_cv_warn[]param[]], [
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="${CFLAGS} $1"
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
+ gl_cv_warn[]param=yes, gl_cv_warn[]param=no)
+ CFLAGS="$save_CFLAGS"
+ ])
+
+ if test $gl_cv_warn[]param = "yes"; then
+ WARN_CFLAGS="$WARN_CFLAGS $1"
+ fi
+])