From 4f044de87e05bee61005c48bb93f3bb9a4b76461 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Thu, 29 Mar 2012 15:29:37 +0200 Subject: [PATCH] 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. --- m4/warnings.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/m4/warnings.m4 b/m4/warnings.m4 index 69d05a670..6ed087b26 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"])]) -- 2.11.0