summaryrefslogtreecommitdiff
path: root/m4/ax_compiler_vendor.m4
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2022-06-25 21:14:30 -0400
committerAnthony Green <green@moxielogic.com>2022-06-25 21:14:30 -0400
commit4a46f35ba5a4bbb3ea396e1fa836535d338f8930 (patch)
treeacfc3ae70be5ce679af1e2ae46fa3604a7a2e225 /m4/ax_compiler_vendor.m4
parentfc8c8c1e2c31321b38dc079e549bc7748da4159d (diff)
downloadlibffi-4a46f35ba5a4bbb3ea396e1fa836535d338f8930.tar.gz
Update configury
Diffstat (limited to 'm4/ax_compiler_vendor.m4')
-rw-r--r--m4/ax_compiler_vendor.m4121
1 files changed, 76 insertions, 45 deletions
diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4
index 73efdb0..039f99d 100644
--- a/m4/ax_compiler_vendor.m4
+++ b/m4/ax_compiler_vendor.m4
@@ -8,15 +8,30 @@
#
# DESCRIPTION
#
-# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun,
-# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft,
-# watcom, etc. The vendor is returned in the cache variable
-# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++.
+# Determine the vendor of the C, C++ or Fortran compiler. The vendor is
+# returned in the cache variable $ax_cv_c_compiler_vendor for C,
+# $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for
+# (modern) Fortran. The value is one of "intel", "ibm", "pathscale",
+# "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "nvhpc" (NVIDIA HPC
+# Compiler), "portland" (PGI), "gnu" (GCC), "sun" (Oracle Developer
+# Studio), "hp", "dec", "borland", "comeau", "kai", "lcc", "sgi",
+# "microsoft", "metrowerks", "watcom", "tcc" (Tiny CC) or "unknown" (if
+# the compiler cannot be determined).
+#
+# To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT
+# with an appropriate preprocessor-enabled extension. For example:
+#
+# AC_LANG_PUSH([Fortran])
+# AC_PROG_FC
+# AC_FC_PP_SRCEXT([F])
+# AX_COMPILER_VENDOR
+# AC_LANG_POP([Fortran])
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2008 Matteo Frigo
+# Copyright (c) 2018-19 John Zaitseff <J.Zaitseff@zap.org.au>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -44,45 +59,61 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 17
+#serial 32
+
+AC_DEFUN([AX_COMPILER_VENDOR], [dnl
+ AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl
+ dnl If you modify this list of vendors, please add similar support
+ dnl to ax_compiler_version.m4 if at all possible.
+ dnl
+ dnl Note: Do NOT check for GCC first since some other compilers
+ dnl define __GNUC__ to remain compatible with it. Compilers that
+ dnl are very slow to start (such as Intel) are listed first.
+
+ vendors="
+ intel: __ICC,__ECC,__INTEL_COMPILER
+ ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__
+ pathscale: __PATHCC__,__PATHSCALE__
+ clang: __clang__
+ cray: _CRAYC
+ fujitsu: __FUJITSU
+ sdcc: SDCC,__SDCC
+ sx: _SX
+ nvhpc: __NVCOMPILER
+ portland: __PGI
+ gnu: __GNUC__
+ sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95
+ hp: __HP_cc,__HP_aCC
+ dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
+ borland: __BORLANDC__,__CODEGEARC__,__TURBOC__
+ comeau: __COMO__
+ kai: __KCC
+ lcc: __LCC__
+ sgi: __sgi,sgi
+ microsoft: _MSC_VER
+ metrowerks: __MWERKS__
+ watcom: __WATCOMC__
+ tcc: __TINYC__
+ unknown: UNKNOWN
+ "
+ for ventest in $vendors; do
+ case $ventest in
+ *:)
+ vendor=$ventest
+ continue
+ ;;
+ *)
+ vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")"
+ ;;
+ esac
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
+#if !($vencpp)
+ thisisanerror;
+#endif
+ ]])], [break])
+ done
-AC_DEFUN([AX_COMPILER_VENDOR],
-[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
- dnl Please add if possible support to ax_compiler_version.m4
- [# note: don't check for gcc first since some other compilers define __GNUC__
- vendors="intel: __ICC,__ECC,__INTEL_COMPILER
- ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__
- pathscale: __PATHCC__,__PATHSCALE__
- clang: __clang__
- cray: _CRAYC
- fujitsu: __FUJITSU
- sdcc: SDCC, __SDCC
- gnu: __GNUC__
- sun: __SUNPRO_C,__SUNPRO_CC
- hp: __HP_cc,__HP_aCC
- dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
- borland: __BORLANDC__,__CODEGEARC__,__TURBOC__
- comeau: __COMO__
- kai: __KCC
- lcc: __LCC__
- sgi: __sgi,sgi
- microsoft: _MSC_VER
- metrowerks: __MWERKS__
- watcom: __WATCOMC__
- portland: __PGI
- tcc: __TINYC__
- unknown: UNKNOWN"
- for ventest in $vendors; do
- case $ventest in
- *:) vendor=$ventest; continue ;;
- *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;;
- esac
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
- #if !($vencpp)
- thisisanerror;
- #endif
- ])], [break])
- done
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1`
- ])
-])
+ ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1`
+ ])
+])dnl