| 1 |
# =========================================================================== |
| 2 |
# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html |
| 3 |
# =========================================================================== |
| 4 |
# |
| 5 |
# SYNOPSIS |
| 6 |
# |
| 7 |
# AX_COMPILER_VENDOR |
| 8 |
# |
| 9 |
# DESCRIPTION |
| 10 |
# |
| 11 |
# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, |
| 12 |
# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, |
| 13 |
# watcom, etc. The vendor is returned in the cache variable |
| 14 |
# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. |
| 15 |
# |
| 16 |
# LICENSE |
| 17 |
# |
| 18 |
# Copyright (c) 2008 Steven G. Johnson <[email protected]> |
| 19 |
# Copyright (c) 2008 Matteo Frigo |
| 20 |
# |
| 21 |
# This program is free software: you can redistribute it and/or modify it |
| 22 |
# under the terms of the GNU General Public License as published by the |
| 23 |
# Free Software Foundation, either version 3 of the License, or (at your |
| 24 |
# option) any later version. |
| 25 |
# |
| 26 |
# This program is distributed in the hope that it will be useful, but |
| 27 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 28 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
| 29 |
# Public License for more details. |
| 30 |
# |
| 31 |
# You should have received a copy of the GNU General Public License along |
| 32 |
# with this program. If not, see <https://www.gnu.org/licenses/>. |
| 33 |
# |
| 34 |
# As a special exception, the respective Autoconf Macro's copyright owner |
| 35 |
# gives unlimited permission to copy, distribute and modify the configure |
| 36 |
# scripts that are the output of Autoconf when processing the Macro. You |
| 37 |
# need not follow the terms of the GNU General Public License when using |
| 38 |
# or distributing such scripts, even though portions of the text of the |
| 39 |
# Macro appear in them. The GNU General Public License (GPL) does govern |
| 40 |
# all other use of the material that constitutes the Autoconf Macro. |
| 41 |
# |
| 42 |
# This special exception to the GPL applies to versions of the Autoconf |
| 43 |
# Macro released by the Autoconf Archive. When you make and distribute a |
| 44 |
# modified version of the Autoconf Macro, you may extend this special |
| 45 |
# exception to the GPL to apply to your modified version as well. |
| 46 |
|
| 47 |
#serial 16 |
| 48 |
|
| 49 |
AC_DEFUN([AX_COMPILER_VENDOR], |
| 50 |
[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, |
| 51 |
dnl Please add if possible support to ax_compiler_version.m4 |
| 52 |
[# note: don't check for gcc first since some other compilers define __GNUC__ |
| 53 |
vendors="intel: __ICC,__ECC,__INTEL_COMPILER |
| 54 |
ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ |
| 55 |
pathscale: __PATHCC__,__PATHSCALE__ |
| 56 |
clang: __clang__ |
| 57 |
cray: _CRAYC |
| 58 |
fujitsu: __FUJITSU |
| 59 |
gnu: __GNUC__ |
| 60 |
sun: __SUNPRO_C,__SUNPRO_CC |
| 61 |
hp: __HP_cc,__HP_aCC |
| 62 |
dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER |
| 63 |
borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ |
| 64 |
comeau: __COMO__ |
| 65 |
kai: __KCC |
| 66 |
lcc: __LCC__ |
| 67 |
sgi: __sgi,sgi |
| 68 |
microsoft: _MSC_VER |
| 69 |
metrowerks: __MWERKS__ |
| 70 |
watcom: __WATCOMC__ |
| 71 |
portland: __PGI |
| 72 |
tcc: __TINYC__ |
| 73 |
unknown: UNKNOWN" |
| 74 |
for ventest in $vendors; do |
| 75 |
case $ventest in |
| 76 |
*:) vendor=$ventest; continue ;; |
| 77 |
*) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; |
| 78 |
esac |
| 79 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ |
| 80 |
#if !($vencpp) |
| 81 |
thisisanerror; |
| 82 |
#endif |
| 83 |
])], [break]) |
| 84 |
done |
| 85 |
ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` |
| 86 |
]) |
| 87 |
]) |