]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
configure: Use AC_CHECK_HEADERS to detect stdatomic.h
authorMark Wielaard <mark@klomp.org>
Sun, 6 Apr 2025 16:04:10 +0000 (18:04 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 6 Apr 2025 16:06:24 +0000 (18:06 +0200)
* configure.ac: Use AC_CHECK_HEADERS instead of
AC_COMPILE_IFELSE.

Suggested-by: Dmitry V. Levin <ldv@strace.io>
Signed-off-by: Mark Wielaard <mark@klomp.org>
configure.ac

index 1679a17dd23d71394ef32d1d57c3ddc26c3e3b85..27488e3fe44afdc88fb9c409d9915345a2dbdea6 100644 (file)
@@ -228,11 +228,7 @@ AS_IF([test "x$ac_cv_tls" != xyes],
 
 dnl Although we test for C11 above that doesn't mean we have stdatomic.h
 dnl We need at least gcc 4.9+ for that.
-AC_CACHE_CHECK([whether gcc provides stdatomic.h], ac_cv_has_stdatomic,
-  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdatomic.h>]])],
-                    ac_cv_has_stdatomic=yes, ac_cv_has_stdatomic=no)])
-AS_IF([test "x$ac_cv_has_stdatomic" = "xno"],
-      [AC_MSG_ERROR([stdatomic.h required])])
+AC_CHECK_HEADERS([stdatomic.h], [], [AC_MSG_ERROR([stdatomic.h required])])
 
 dnl This test must come as early as possible after the compiler configuration
 dnl tests, because the choice of the file model can (in principle) affect