diff options
author | Maarten Bosmans <mkbosmans@gmail.com> | 2011-07-02 12:06:32 +0200 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2011-07-02 14:30:09 +0200 |
commit | 4b9c6c64fa1c5a87103e166d4263a150d42d974d (patch) | |
tree | d1ce967b9f9d315c4d1bbbc76bcdd61a55278c6f /m4/ax_compiler_vendor.m4 | |
parent | cfea4ee52f7f2490937976b828a3b82d07b431f2 (diff) | |
download | autoconf-archive-4b9c6c64fa1c5a87103e166d4263a150d42d974d.tar.gz |
AX_COMPILER_VENDOR: Make the list of vendors and corresponding symbols clearer
Also deprecate the macros AX_CHECK_SUNPRO_C and AX_LANG_COMPILER_MS in favor
of the more generic AX_COMPILER_VENDOR.
Diffstat (limited to 'm4/ax_compiler_vendor.m4')
-rw-r--r-- | m4/ax_compiler_vendor.m4 | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4 index 3214706..95b53ec 100644 --- a/m4/ax_compiler_vendor.m4 +++ b/m4/ax_compiler_vendor.m4 @@ -47,17 +47,38 @@ #serial 9 AC_DEFUN([AX_COMPILER_VENDOR], -[ -AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, - [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown - # note: don't check for gcc first since some other compilers define __GNUC__ - for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ clang:__clang__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do - vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" +[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, + [# 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__ + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__TURBOC__ + comeau: __COMO__ + cray: _CRAYC + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + portland: __PGI + 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 -])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) + #if !($vencpp) + thisisanerror; + #endif + ])], [break]) done + ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` ]) ]) |