From: Bruno Haible Date: Sat, 18 Jan 2020 18:02:19 +0000 (+0100) Subject: Avoid error "m4_require: circular dependency of AC_LANG_COMPILER(C)". X-Git-Tag: v1.0~4339 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=cee130f4dcfcd73385581e00c746eb1084cf9008;p=gnulib.git Avoid error "m4_require: circular dependency of AC_LANG_COMPILER(C)". Reported by Mats Erik Andersson in . * m4/00gnulib.m4 (gl_COMPILER_CLANG): Use _AC_COMPILE_IFELSE, not AC_EGREP_CPP. --- diff --git a/ChangeLog b/ChangeLog index 020dfb9df8..fcf7105b7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2020-01-18 Bruno Haible + + Avoid error "m4_require: circular dependency of AC_LANG_COMPILER(C)". + Reported by Mats Erik Andersson in + . + * m4/00gnulib.m4 (gl_COMPILER_CLANG): Use _AC_COMPILE_IFELSE, not + AC_EGREP_CPP. + 2020-01-18 Bruno Haible Ensure Automake does not drop ~~gnulib.m4. diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4 index 36304b933d..90e7e04169 100644 --- a/m4/00gnulib.m4 +++ b/m4/00gnulib.m4 @@ -1,4 +1,4 @@ -# 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, @@ -58,13 +58,18 @@ AC_DEFUN([gl_COMPILER_CLANG], 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],