summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2012-03-29 15:29:37 +0200
committerEric Blake <eblake@redhat.com>2012-03-29 16:07:48 -0600
commit4f044de87e05bee61005c48bb93f3bb9a4b76461 (patch)
tree71f6649464d11f3d0ca22dfb94265e723e2ecd33 /m4
parent7ce7d6bc711a382eac94fad6209e5e8905745530 (diff)
downloadgnulib-4f044de87e05bee61005c48bb93f3bb9a4b76461.tar.gz
warnings.m4: check the compiler, not the preprocessor
* m4/warnings.m4 (gl_WARN_ADD): Use the compiler, not the preprocessor. Depend on the current AC_LANG for the cache variables.
Diffstat (limited to 'm4')
-rw-r--r--m4/warnings.m412
1 files changed, 6 insertions, 6 deletions
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index 69d05a6700..6ed087b26f 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,4 +1,4 @@
-# warnings.m4 serial 5
+# warnings.m4 serial 6
dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -21,14 +21,14 @@ m4_ifdef([AS_VAR_APPEND],
AC_DEFUN([gl_WARN_ADD],
dnl FIXME: gl_Warn must be used unquoted until we can assume
dnl autoconf 2.64 or newer.
-[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_$1])dnl
-AC_CACHE_CHECK([whether compiler handles $1], m4_defn([gl_Warn]), [
- gl_save_CPPFLAGS="$CPPFLAGS"
+[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
+ gl_save_compiler_FLAGS="$_AC_LANG_PREFIX[]FLAGS"
CPPFLAGS="${CPPFLAGS} $1"
- AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AS_VAR_SET(gl_Warn, [yes])],
[AS_VAR_SET(gl_Warn, [no])])
- CPPFLAGS="$gl_save_CPPFLAGS"
+ _AC_LANG_PREFIX[]FLAGS="$gl_save_compiler_FLAGS"
])
AS_VAR_IF(gl_Warn, [yes],
[gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])])