2008-10-28 20:22:29 +03:00
|
|
|
dnl -*- shell-script -*-
|
|
|
|
dnl
|
|
|
|
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
dnl University Research and Technology
|
|
|
|
dnl Corporation. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
dnl of Tennessee Research Foundation. All rights
|
|
|
|
dnl reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
dnl University of Stuttgart. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
dnl All rights reserved.
|
2012-02-10 23:25:23 +04:00
|
|
|
dnl Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
|
2014-05-07 00:13:37 +04:00
|
|
|
dnl Copyright (c) 2014 Intel, Inc. All rights reserved
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl $COPYRIGHT$
|
|
|
|
dnl
|
|
|
|
dnl Additional copyrights may follow
|
|
|
|
dnl
|
|
|
|
dnl $HEADER$
|
|
|
|
dnl
|
|
|
|
|
|
|
|
|
2014-05-07 00:13:37 +04:00
|
|
|
# OPAL_C_COMPILER_VENDOR(VENDOR_VARIABLE)
|
2008-10-28 20:22:29 +03:00
|
|
|
# ---------------------------------------
|
|
|
|
# Set shell variable VENDOR_VARIABLE to the name of the compiler
|
|
|
|
# vendor for the current C compiler.
|
|
|
|
#
|
2014-05-07 00:13:37 +04:00
|
|
|
# See comment for _OPAL_CHECK_COMPILER_VENDOR for a complete
|
2008-10-28 20:22:29 +03:00
|
|
|
# list of currently detected compilers.
|
2014-05-07 00:13:37 +04:00
|
|
|
AC_DEFUN([OPAL_C_COMPILER_VENDOR], [
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_REQUIRE([AC_PROG_CC])
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([for the C compiler vendor],
|
2014-05-06 19:01:34 +04:00
|
|
|
[opal_cv_c_compiler_vendor],
|
2008-10-28 20:22:29 +03:00
|
|
|
[AC_LANG_PUSH(C)
|
2014-05-07 00:13:37 +04:00
|
|
|
_OPAL_CHECK_COMPILER_VENDOR([opal_cv_c_compiler_vendor])
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C)])
|
|
|
|
|
2014-05-06 19:01:34 +04:00
|
|
|
$1="$opal_cv_c_compiler_vendor"
|
2008-10-28 20:22:29 +03:00
|
|
|
])
|
|
|
|
|
|
|
|
|
2014-05-07 00:13:37 +04:00
|
|
|
# OPAL_CXX_COMPILER_VENDOR(VENDOR_VARIABLE)
|
2008-10-28 20:22:29 +03:00
|
|
|
# ---------------------------------------
|
|
|
|
# Set shell variable VENDOR_VARIABLE to the name of the compiler
|
|
|
|
# vendor for the current C++ compiler.
|
|
|
|
#
|
2014-05-07 00:13:37 +04:00
|
|
|
# See comment for _OPAL_CHECK_COMPILER_VENDOR for a complete
|
2008-10-28 20:22:29 +03:00
|
|
|
# list of currently detected compilers.
|
2014-05-07 00:13:37 +04:00
|
|
|
AC_DEFUN([OPAL_CXX_COMPILER_VENDOR], [
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_REQUIRE([AC_PROG_CXX])
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([for the C++ compiler vendor],
|
2014-05-07 00:13:37 +04:00
|
|
|
[opal_cv_cxx_compiler_vendor],
|
2008-10-28 20:22:29 +03:00
|
|
|
[AC_LANG_PUSH(C++)
|
2014-05-07 00:13:37 +04:00
|
|
|
_OPAL_CHECK_COMPILER_VENDOR([opal_cv_cxx_compiler_vendor])
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C++)])
|
|
|
|
|
2014-05-06 19:01:34 +04:00
|
|
|
$1="$opal_cv_c_compiler_vendor"
|
2008-10-28 20:22:29 +03:00
|
|
|
])
|
|
|
|
|
2010-09-24 02:37:52 +04:00
|
|
|
# workaround to avoid syntax error with Autoconf < 2.68:
|
|
|
|
m4_ifndef([AC_LANG_DEFINES_PROVIDED],
|
|
|
|
[m4_define([AC_LANG_DEFINES_PROVIDED])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2014-05-07 00:13:37 +04:00
|
|
|
# OPAL_IFDEF_IFELSE(symbol, [action-if-defined],
|
2008-10-28 20:22:29 +03:00
|
|
|
# [action-if-not-defined])
|
|
|
|
# ----------------------------------------------
|
|
|
|
# Run compiler to determine if preprocessor symbol "symbol" is
|
|
|
|
# defined by the compiler.
|
2014-05-07 00:13:37 +04:00
|
|
|
AC_DEFUN([OPAL_IFDEF_IFELSE], [
|
2010-09-24 02:37:52 +04:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED
|
|
|
|
#ifndef $1
|
2008-10-28 20:22:29 +03:00
|
|
|
#error "symbol $1 not defined"
|
|
|
|
choke me
|
|
|
|
#endif], [$2], [$3])])
|
|
|
|
|
|
|
|
|
2014-05-07 00:13:37 +04:00
|
|
|
# OPAL_IF_IFELSE(symbol, [action-if-defined],
|
2008-10-28 20:22:29 +03:00
|
|
|
# [action-if-not-defined])
|
|
|
|
# ----------------------------------------------
|
|
|
|
# Run compiler to determine if preprocessor symbol "symbol" is
|
|
|
|
# defined by the compiler.
|
2014-05-07 00:13:37 +04:00
|
|
|
AC_DEFUN([OPAL_IF_IFELSE], [
|
2010-09-24 02:37:52 +04:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED
|
|
|
|
#if !( $1 )
|
2008-10-28 20:22:29 +03:00
|
|
|
#error "condition $1 not met"
|
|
|
|
choke me
|
|
|
|
#endif], [$2], [$3])])
|
|
|
|
|
|
|
|
|
2014-05-07 00:13:37 +04:00
|
|
|
# _OPAL_CHECK_COMPILER_VENDOR(VENDOR_VARIABLE)
|
2008-10-28 20:22:29 +03:00
|
|
|
# --------------------------------------------
|
|
|
|
# Set shell variable VENDOR_VARIABLE to the name of the compiler
|
|
|
|
# vendor for the compiler for the current language. Language must be
|
|
|
|
# one of C, OBJC, or C++.
|
|
|
|
#
|
|
|
|
# thanks to http://predef.sourceforge.net/precomp.html for the list
|
|
|
|
# of defines to check.
|
2014-05-07 00:13:37 +04:00
|
|
|
AC_DEFUN([_OPAL_CHECK_COMPILER_VENDOR], [
|
|
|
|
opal_check_compiler_vendor_result="unknown"
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# GNU is probably the most common, so check that one as soon as
|
|
|
|
# possible. Intel pretends to be GNU, so need to check Intel
|
|
|
|
# before checking for GNU.
|
|
|
|
|
|
|
|
# Intel
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IF_IFELSE([defined(__INTEL_COMPILER) || defined(__ICC)],
|
|
|
|
[opal_check_compiler_vendor_result="intel"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# GNU
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__GNUC__],
|
|
|
|
[opal_check_compiler_vendor_result="gnu"
|
2012-02-10 23:25:23 +04:00
|
|
|
|
|
|
|
# We do not support gccfss as a compiler so die if
|
|
|
|
# someone tries to use said compiler. gccfss (gcc
|
|
|
|
# for SPARC Systems) is a compiler that is no longer
|
|
|
|
# supported by Oracle and it has some major flaws
|
|
|
|
# that prevents it from actually compiling OMPI code.
|
|
|
|
# So if we detect it we automatically bail.
|
|
|
|
|
|
|
|
if ($CC --version | grep gccfss) >/dev/null 2>&1; then
|
|
|
|
AC_MSG_RESULT([gccfss])
|
|
|
|
AC_MSG_WARN([Detected gccfss being used to compile Open MPI.])
|
|
|
|
AC_MSG_WARN([Because of several issues Open MPI does not support])
|
|
|
|
AC_MSG_WARN([the gccfss compiler. Please use a different compiler.])
|
|
|
|
AC_MSG_WARN([If you didn't think you used gccfss you may want to])
|
|
|
|
AC_MSG_WARN([check to see if the compiler you think you used is])
|
|
|
|
AC_MSG_WARN([actually a link to gccfss.])
|
|
|
|
AC_MSG_ERROR([Cannot continue])
|
|
|
|
fi])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Borland Turbo C
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__TURBOC__],
|
|
|
|
[opal_check_compiler_vendor_result="borland"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Borland C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__BORLANDC__],
|
|
|
|
[opal_check_compiler_vendor_result="borland"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Comeau C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__COMO__],
|
|
|
|
[opal_check_compiler_vendor_result="comeau"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Compaq C/C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IF_IFELSE([defined(__DECC) || defined(VAXC) || defined(__VAXC)],
|
|
|
|
[opal_check_compiler_vendor_result="compaq"],
|
|
|
|
[OPAL_IF_IFELSE([defined(__osf__) && defined(__LANGUAGE_C__)],
|
|
|
|
[opal_check_compiler_vendor_result="compaq"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__DECCXX],
|
|
|
|
[opal_check_compiler_vendor_result="compaq"])])])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Cray C/C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([_CRAYC],
|
|
|
|
[opal_check_compiler_vendor_result="cray"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Diab C/C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__DCC__],
|
|
|
|
[opal_check_compiler_vendor_result="diab"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Digital Mars
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IF_IFELSE([defined(__DMC__) || defined(__SC__) || defined(__ZTC__)],
|
|
|
|
[opal_check_compiler_vendor_result="digital mars"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# HP ANSI C / aC++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IF_IFELSE([defined(__HP_cc) || defined(__HP_aCC)],
|
|
|
|
[opal_check_compiler_vendor_result="hp"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# IBM XL C/C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IF_IFELSE([defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)],
|
|
|
|
[opal_check_compiler_vendor_result="ibm"],
|
|
|
|
[OPAL_IF_IFELSE([defined(_AIX) && !defined(__GNUC__)],
|
|
|
|
[opal_check_compiler_vendor_result="ibm"])])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# KAI C++ (rest in peace)
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__KCC],
|
|
|
|
[opal_check_compiler_vendor_result="kai"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# LCC
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__LCC__],
|
|
|
|
[opal_check_compiler_vendor_result="lcc"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# MetaWare High C/C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__HIGHC__],
|
|
|
|
[opal_check_compiler_vendor_result="metaware high"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Metrowerks Codewarrior
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__MWERKS__],
|
|
|
|
[opal_check_compiler_vendor_result="metrowerks"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# MIPSpro (SGI)
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IF_IFELSE([defined(sgi) || defined(__sgi)],
|
|
|
|
[opal_check_compiler_vendor_result="sgi"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# MPW C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IF_IFELSE([defined(__MRC__) || defined(MPW_C) || defined(MPW_CPLUS)],
|
|
|
|
[opal_check_compiler_vendor_result="mpw"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Microsoft
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
2008-10-28 20:22:29 +03:00
|
|
|
[# Always use C compiler when checking for Microsoft, as
|
|
|
|
# Visual C++ doesn't recognize .cc as a C++ file.
|
|
|
|
AC_LANG_PUSH(C)
|
2014-05-07 00:13:37 +04:00
|
|
|
OPAL_IF_IFELSE([defined(_MSC_VER) || defined(__MSC_VER)],
|
|
|
|
[opal_check_compiler_vendor_result="microsoft"])
|
2008-10-28 20:22:29 +03:00
|
|
|
AC_LANG_POP(C)])
|
|
|
|
|
|
|
|
# Norcroft C
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__CC_NORCROFT],
|
|
|
|
[opal_check_compiler_vendor_result="norcroft"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Pelles C
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__POCC__],
|
|
|
|
[opal_check_compiler_vendor_result="pelles"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Portland Group
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__PGI],
|
|
|
|
[opal_check_compiler_vendor_result="portland group"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# SAS/C
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IF_IFELSE([defined(SASC) || defined(__SASC) || defined(__SASC__)],
|
|
|
|
[opal_check_compiler_vendor_result="sas"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Sun Workshop C/C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IF_IFELSE([defined(__SUNPRO_C) || defined(__SUNPRO_CC)],
|
|
|
|
[opal_check_compiler_vendor_result="sun"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# TenDRA C/C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__TenDRA__],
|
|
|
|
[opal_check_compiler_vendor_result="tendra"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Tiny C
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__TINYC__],
|
|
|
|
[opal_check_compiler_vendor_result="tiny"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# USL C
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__USLC__],
|
|
|
|
[opal_check_compiler_vendor_result="usl"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
# Watcom C++
|
2014-05-07 00:13:37 +04:00
|
|
|
AS_IF([test "$opal_check_compiler_vendor_result" = "unknown"],
|
|
|
|
[OPAL_IFDEF_IFELSE([__WATCOMC__],
|
|
|
|
[opal_check_compiler_vendor_result="watcom"])])
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2014-05-07 00:13:37 +04:00
|
|
|
$1="$opal_check_compiler_vendor_result"
|
|
|
|
unset opal_check_compiler_vendor_result
|
2008-10-28 20:22:29 +03:00
|
|
|
])
|