21
21
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
22
dnl DEALINGS IN THE SOFTWARE.
24
dnl $Id: bakefile-lang.m4 45826 2007-05-05 14:27:16Z VZ $
26
dnl Compiler detection macros by David Elliott
30
dnl ===========================================================================
31
dnl Macros to detect non-GNU compilers (MetroWerks, XLC)
32
dnl ===========================================================================
34
dnl Based on autoconf _AC_LANG_COMPILER_GNU
35
AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER_MWERKS],
36
[AC_CACHE_CHECK([whether we are using the Metrowerks _AC_LANG compiler],
37
[bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks],
38
[AC_TRY_COMPILE([],[#ifndef __MWERKS__
42
[bakefile_compiler_mwerks=yes],
43
[bakefile_compiler_mwerks=no])
44
bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks=$bakefile_compiler_mwerks
48
dnl Loosely based on autoconf AC_PROG_CC
49
dnl TODO: Maybe this should wrap the call to AC_PROG_CC and be used instead.
50
AC_DEFUN([AC_BAKEFILE_PROG_MWCC],
52
_AC_BAKEFILE_LANG_COMPILER_MWERKS
53
MWCC=`test $bakefile_cv_c_compiler_mwerks = yes && echo yes`
57
dnl Loosely based on autoconf AC_PROG_CXX
58
dnl TODO: Maybe this should wrap the call to AC_PROG_CXX and be used instead.
59
AC_DEFUN([AC_BAKEFILE_PROG_MWCXX],
61
_AC_BAKEFILE_LANG_COMPILER_MWERKS
62
MWCXX=`test $bakefile_cv_cxx_compiler_mwerks = yes && echo yes`
66
dnl Based on autoconf _AC_LANG_COMPILER_GNU
67
AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER_XLC],
68
[AC_CACHE_CHECK([whether we are using the IBM xlC _AC_LANG compiler],
69
[bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_xlc],
70
[AC_TRY_COMPILE([],[#ifndef __xlC__
74
[bakefile_compiler_xlc=yes],
75
[bakefile_compiler_xlc=no])
76
bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_xlc=$bakefile_compiler_xlc
80
dnl Loosely based on autoconf AC_PROG_CC
81
AC_DEFUN([AC_BAKEFILE_PROG_XLCC],
83
_AC_BAKEFILE_LANG_COMPILER_XLC
84
XLCC=`test $bakefile_cv_c_compiler_xlc = yes && echo yes`
88
dnl Loosely based on autoconf AC_PROG_CXX
89
AC_DEFUN([AC_BAKEFILE_PROG_XLCXX],
91
_AC_BAKEFILE_LANG_COMPILER_XLC
92
XLCXX=`test $bakefile_cv_cxx_compiler_xlc = yes && echo yes`
24
dnl $Id: bakefile-lang.m4 53750 2008-05-26 09:21:56Z VS $
26
dnl Compiler detection macros by David Elliott and Vadim Zeitlin
30
dnl ===========================================================================
31
dnl Macros to detect different C/C++ compilers
32
dnl ===========================================================================
96
34
dnl Based on autoconf _AC_LANG_COMPILER_GNU
97
35
dnl _AC_BAKEFILE_LANG_COMPILER(NAME, LANG, SYMBOL, IF-YES, IF-NO)
117
54
if test "x$bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_[]$3" = "xyes"; then
62
dnl CodeWarrior Metrowerks compiler defines __MWERKS__ for both C and C++
63
AC_DEFUN([AC_BAKEFILE_PROG_MWCC],
65
_AC_BAKEFILE_LANG_COMPILER(Metrowerks, C, __MWERKS__, MWCC=yes)
68
AC_DEFUN([AC_BAKEFILE_PROG_MWCXX],
70
_AC_BAKEFILE_LANG_COMPILER(Metrowerks, C++, __MWERKS__, MWCXX=yes)
73
dnl IBM xlC compiler defines __xlC__ for both C and C++
74
AC_DEFUN([AC_BAKEFILE_PROG_XLCC],
76
_AC_BAKEFILE_LANG_COMPILER([IBM xlC], C, __xlC__, XLCC=yes)
79
AC_DEFUN([AC_BAKEFILE_PROG_XLCXX],
81
_AC_BAKEFILE_LANG_COMPILER([IBM xlC], C++, __xlC__, XLCXX=yes)
124
84
dnl recent versions of SGI mipsPro compiler define _SGI_COMPILER_VERSION