From 3f3770f117043aed476bb1fa3d6b3ba10d1d1d15 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Mon, 2 Sep 2024 15:20:46 +0200 Subject: [PATCH] Compiler vendor detection for autotools --- aclocal.m4 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/aclocal.m4 b/aclocal.m4 index 48285b21..8521b53c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2,6 +2,25 @@ dnl ** Additional Autoconf tests for BIRD configure script dnl ** (c) 1999 Martin Mares dnl ** (c) 2021 Maria Matejka +# simplified adapted macro AX_COMPILER_VENDOR from autotools +AC_DEFUN([BIRD_COMPILER_VENDOR], +[ + AC_CACHE_CHECK( + [which compiler vendor we are dealing with], + [bird_cv_compiler_vendor], + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ int x = __clang__; ], []) + ], + [bird_cv_compiler_vendor=clang], + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ int x = __GNUC__; ], []) + ], + [bird_cv_compiler_vendor=gnu], + [bird_cv_compiler_vendor=unknown] + )) + ) +]) + AC_DEFUN([BIRD_CHECK_POINTER_ALIGNMENT], [ AC_CACHE_CHECK(