+2020-01-18 Bruno Haible <bruno@clisp.org>
+
+ Avoid error "m4_require: circular dependency of AC_LANG_COMPILER(C)".
+ Reported by Mats Erik Andersson <mats.andersson@gisladisker.se> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00109.html>.
+ * m4/00gnulib.m4 (gl_COMPILER_CLANG): Use _AC_COMPILE_IFELSE, not
+ AC_EGREP_CPP.
+
2020-01-18 Bruno Haible <bruno@clisp.org>
Ensure Automake does not drop ~~gnulib.m4.
-# 00gnulib.m4 serial 6
+# 00gnulib.m4 serial 7
dnl Copyright (C) 2009-2020 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 AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([whether the compiler is clang],
[gl_cv_compiler_clang],
- [AC_EGREP_CPP([barfbarf],[
-#ifdef __clang__
-barfbarf
-#endif
- ],
- [gl_cv_compiler_clang=yes],
- [gl_cv_compiler_clang=no])
+ [dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error
+ dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has
+ dnl not yet been invoked.
+ _AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifdef __clang__
+ barfbarf
+ #endif
+ ]],[[]])
+ ],
+ [gl_cv_compiler_clang=no],
+ [gl_cv_compiler_clang=yes])
])
])
AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL],