Extend test for compiler vendor to include many, many more compilers, and
unify the C / C++ tests, as they are often the same defines to check... This commit was SVN r8450.
Этот коммит содержится в:
родитель
32cecc5798
Коммит
73f4f407c1
@ -67,6 +67,7 @@ m4_include(config/ompi_check_package.m4)
|
||||
m4_include(config/ompi_check_slurm.m4)
|
||||
m4_include(config/ompi_check_tm.m4)
|
||||
m4_include(config/ompi_check_xgrid.m4)
|
||||
m4_include(config/ompi_check_vendor.m4)
|
||||
m4_include(config/ompi_config_subdir.m4)
|
||||
m4_include(config/ompi_config_subdir_args.m4)
|
||||
m4_include(config/ompi_configure_options.m4)
|
||||
|
247
config/ompi_check_vendor.m4
Обычный файл
247
config/ompi_check_vendor.m4
Обычный файл
@ -0,0 +1,247 @@
|
||||
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.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
|
||||
# OMPI_C_COMPILER_VENDOR(VENDOR_VARIABLE)
|
||||
# ---------------------------------------
|
||||
# Set shell variable VENDOR_VARIABLE to the name of the compiler
|
||||
# vendor for the current C compiler.
|
||||
#
|
||||
# See comment for _OMPI_CHECK_COMPILER_VENDOR for a complete
|
||||
# list of currently detected compilers.
|
||||
AC_DEFUN([OMPI_C_COMPILER_VENDOR], [
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
|
||||
AC_CACHE_CHECK([for the C compiler vendor],
|
||||
[ompi_cv_c_compiler_vendor],
|
||||
[AC_LANG_PUSH(C)
|
||||
_OMPI_CHECK_COMPILER_VENDOR([ompi_cv_c_compiler_vendor])
|
||||
AC_LANG_POP(C)])
|
||||
|
||||
$1="$ompi_cv_c_compiler_vendor"
|
||||
])
|
||||
|
||||
|
||||
# OMPI_CXX_COMPILER_VENDOR(VENDOR_VARIABLE)
|
||||
# ---------------------------------------
|
||||
# Set shell variable VENDOR_VARIABLE to the name of the compiler
|
||||
# vendor for the current C++ compiler.
|
||||
#
|
||||
# See comment for _OMPI_CHECK_COMPILER_VENDOR for a complete
|
||||
# list of currently detected compilers.
|
||||
AC_DEFUN([OMPI_CXX_COMPILER_VENDOR], [
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
|
||||
AC_CACHE_CHECK([for the C++ compiler vendor],
|
||||
[ompi_cv_cxx_compiler_vendor],
|
||||
[AC_LANG_PUSH(C++)
|
||||
_OMPI_CHECK_COMPILER_VENDOR([ompi_cv_cxx_compiler_vendor])
|
||||
AC_LANG_POP(C++)])
|
||||
|
||||
$1="$ompi_cv_c_compiler_vendor"
|
||||
])
|
||||
|
||||
|
||||
# OMPI_IFDEF_IFELSE(symbol, [action-if-defined],
|
||||
# [action-if-not-defined])
|
||||
# ----------------------------------------------
|
||||
# Run compiler to determine if preprocessor symbol "symbol" is
|
||||
# defined by the compiler.
|
||||
AC_DEFUN([OMPI_IFDEF_IFELSE], [
|
||||
AC_COMPILE_IFELSE([#ifndef $1
|
||||
#error "symbol $1 not defined"
|
||||
choke me
|
||||
#endif], [$2], [$3])])
|
||||
|
||||
|
||||
# OMPI_IF_IFELSE(symbol, [action-if-defined],
|
||||
# [action-if-not-defined])
|
||||
# ----------------------------------------------
|
||||
# Run compiler to determine if preprocessor symbol "symbol" is
|
||||
# defined by the compiler.
|
||||
AC_DEFUN([OMPI_IF_IFELSE], [
|
||||
AC_COMPILE_IFELSE([#if !( $1 )
|
||||
#error "condition $1 not met"
|
||||
choke me
|
||||
#endif], [$2], [$3])])
|
||||
|
||||
|
||||
# _OMPI_CHECK_COMPILER_VENDOR(VENDOR_VARIABLE)
|
||||
# --------------------------------------------
|
||||
# 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.
|
||||
AC_DEFUN([_OMPI_CHECK_COMPILER_VENDOR], [
|
||||
ompi_check_compiler_vendor_result="unknown"
|
||||
|
||||
# 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
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IF_IFELSE([defined(__INTEL_COMPILER) || defined(__ICC)],
|
||||
[ompi_check_compiler_vendor_result="intel"])])
|
||||
|
||||
# GNU
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__GNUC__],
|
||||
[ompi_check_compiler_vendor_result="gnu"])])
|
||||
|
||||
# Borland Turbo C
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__TURBOC__],
|
||||
[ompi_check_compiler_vendor_result="borland"])])
|
||||
|
||||
# Borland C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__BORLANDC__],
|
||||
[ompi_check_compiler_vendor_result="borland"])])
|
||||
|
||||
# Comeau C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__COMO__],
|
||||
[ompi_check_compiler_vendor_result="comeau"])])
|
||||
|
||||
# Compaq C/C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IF_IFELSE([defined(__DECC) || defined(VAXC) || defined(__VAXC)],
|
||||
[ompi_check_compiler_vendor_result="compaq"],
|
||||
[OMPI_IF_IFELSE([defined(__osf__) && defined(__LANGUAGE_C__)],
|
||||
[ompi_check_compiler_vendor_result="compaq"],
|
||||
[OMPI_IFDEF_IFELSE([__DECCXX],
|
||||
[ompi_check_compiler_vendor_result="compaq"])])])])
|
||||
|
||||
# Cray C/C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([_CRAY_C],
|
||||
[ompi_check_compiler_vendor_result="cray"])])
|
||||
|
||||
# Diab C/C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__DCC__],
|
||||
[ompi_check_compiler_vendor_result="diab"])])
|
||||
|
||||
# Digital Mars
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IF_IFELSE([defined(__DMC__) || defined(__SC__) || defined(__ZTC__)],
|
||||
[ompi_check_compiler_vendor_result="digital mars"])])
|
||||
|
||||
# HP ANSI C / aC++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IF_IFELSE([defined(__HP_cc) || defined(__HP_aCC)],
|
||||
[ompi_check_compiler_vendor_result="hp"])])
|
||||
|
||||
# IBM XL C/C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IF_IFELSE([defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)],
|
||||
[ompi_check_compiler_vendor_result="ibm"],
|
||||
[OMPI_IF_IFELSE([defined(_AIX) && !defined(__GNUC__)],
|
||||
[ompi_check_compiler_vendor_result="ibm"])])])
|
||||
|
||||
# KAI C++ (rest in peace)
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__KCC],
|
||||
[ompi_check_compiler_vendor_result="kai"])])
|
||||
|
||||
# LCC
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__LCC__],
|
||||
[ompi_check_compiler_vendor_result="lcc"])])
|
||||
|
||||
# MetaWare High C/C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__HIGHC__],
|
||||
[ompi_check_compiler_vendor_result="metaware high"])])
|
||||
|
||||
# Metrowerks Codewarrior
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__MWERKS__],
|
||||
[ompi_check_compiler_vendor_result="metrowerks"])])
|
||||
|
||||
# MIPSpro (SGI)
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IF_IFELSE([defined(sgi) || defined(__sgi)],
|
||||
[ompi_check_compiler_vendor_result="sgi"])])
|
||||
|
||||
# MPW C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IF_IFELSE([defined(__MRC__) || defined(MPW_C) || defined(MPW_CPLUS)],
|
||||
[ompi_check_compiler_vendor_result="mpw"])])
|
||||
|
||||
# Microsoft
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[# Always use C compiler when checking for Microsoft, as
|
||||
# Visual C++ doesn't recognize .cc as a C++ file.
|
||||
AC_LANG_PUSH(C)
|
||||
OMPI_IF_IFELSE([defined(_MSC_VER) || defined(__MSC_VER)],
|
||||
[ompi_check_compiler_vendor_result="microsoft"])
|
||||
AC_LANG_POP(C)])
|
||||
|
||||
# Norcroft C
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__CC_NORCROFT],
|
||||
[ompi_check_compiler_vendor_result="norcroft"])])
|
||||
|
||||
# Pelles C
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__POCC__],
|
||||
[ompi_check_compiler_vendor_result="pelles"])])
|
||||
|
||||
# Portland Group
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__PGI],
|
||||
[ompi_check_compiler_vendor_result="portland group"])])
|
||||
|
||||
# SAS/C
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IF_IFELSE([defined(SASC) || defined(__SASC) || defined(__SASC__)],
|
||||
[ompi_check_compiler_vendor_result="sas"])])
|
||||
|
||||
# Sun Workshop C/C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IF_IFELSE([defined(__SUNPRO_C) || defined(__SUNPRO_CC)],
|
||||
[ompi_check_compiler_vendor_result="sun"])])
|
||||
|
||||
# TenDRA C/C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__TenDRA__],
|
||||
[ompi_check_compiler_vendor_result="tendra"])])
|
||||
|
||||
# Tiny C
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__TINYC__],
|
||||
[ompi_check_compiler_vendor_result="tiny"])])
|
||||
|
||||
# USL C
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__USLC__],
|
||||
[ompi_check_compiler_vendor_result="usl"])])
|
||||
|
||||
# Watcom C++
|
||||
AS_IF([test "$ompi_check_compiler_vendor_result" = "unknown"],
|
||||
[OMPI_IFDEF_IFELSE([__WATCOMC__],
|
||||
[ompi_check_compiler_vendor_result="watcom"])])
|
||||
|
||||
$1="$ompi_check_compiler_vendor_result"
|
||||
unset ompi_check_compiler_vendor_result
|
||||
])
|
@ -17,113 +17,24 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([_OMPI_START_SETUP_CC],[
|
||||
ompi_show_subtitle "C compiler and preprocessor"
|
||||
|
||||
# $%@#!@#% AIX!! This has to be called before anything invokes the C
|
||||
# compiler.
|
||||
dnl AC_AIX
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_PROG_CC],[
|
||||
#
|
||||
# Check for the compiler
|
||||
#
|
||||
ompi_cflags_save="$CFLAGS"
|
||||
AC_PROG_CC
|
||||
BASECC="`basename $CC`"
|
||||
CFLAGS="$ompi_cflags_save"
|
||||
AC_DEFINE_UNQUOTED(OMPI_CC, "$CC", [OMPI underlying C compiler])
|
||||
OMPI_CC_ABSOLUTE="`which $CC`"
|
||||
AC_SUBST(OMPI_CC_ABSOLUTE)
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_PROG_CC_IMPERSONATE_GCC],[
|
||||
# Check for compilers that impersonate gcc
|
||||
AC_CACHE_CHECK([if compiler impersonates gcc],
|
||||
[ompi_cv_prog_cc_impersonate_gcc],
|
||||
[ompi_cv_prog_cc_impersonate_gcc="no"
|
||||
if test "$GCC" = "yes" ; then
|
||||
AC_TRY_COMPILE([], [
|
||||
int i = 3;
|
||||
#if __INTEL_COMPILER
|
||||
#error Yes, I am lying about being gcc.
|
||||
#endif
|
||||
], [], [ompi_cv_prog_cc_impersonate_gcc="yes"])
|
||||
fi])
|
||||
|
||||
if test "$GCC" = "yes" -a "$ompi_cv_prog_cc_impersonate_gcc" = "no" ; then
|
||||
TRULY_GCC="yes"
|
||||
else
|
||||
TRULY_GCC="no"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([_OMPI_C_IFDEF],
|
||||
[AC_COMPILE_IFELSE([#ifndef $1
|
||||
# error "Macro $1 is undefined!"
|
||||
/* For some compilers (eg. SGI's CC), #error is not
|
||||
enough... */
|
||||
please, do fail
|
||||
#endif],
|
||||
[$2], [$3])])
|
||||
|
||||
AC_DEFUN([_OMPI_C_COMPILER_VENDOR],
|
||||
#
|
||||
# Arguments:
|
||||
# optional 1 and 2 for the compiler vendor and the compiler nickname
|
||||
#
|
||||
# Depdencies: None
|
||||
#
|
||||
# Check to see if the C++ compiler can handle exceptions
|
||||
#
|
||||
# Sets OMPI_CXX_EXCEPTIONS to 1 if compiler has exceptions, 0 if not
|
||||
#
|
||||
[AC_CACHE_CHECK([the C compiler vendor],
|
||||
[ac_cv_c_compiler_vendor],
|
||||
[_OMPI_C_IFDEF([__GNUC__],
|
||||
[ac_cv_c_compiler_vendor=gnu],
|
||||
[dnl SGI CC
|
||||
_OMPI_C_IFDEF([__sgi],
|
||||
[ac_cv_c_compiler_vendor=sgi],
|
||||
[_OMPI_C_IFDEF([_MSC_VER],
|
||||
[ac_cv_c_compiler_vendor=microsoft],
|
||||
[ac_cv_c_compiler_vendor=unknown]
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
ifelse([$1], , [], [$1="$ac_cv_c_compiler_vendor"])
|
||||
|
||||
dnl The compiler nickname
|
||||
ifelse([$2], , [],
|
||||
[case "$ac_cv_c_compiler_vendor" in
|
||||
gnu) $2=gcc;;
|
||||
microsoft) $2=cl;;
|
||||
*) $2=unknown;;
|
||||
esac])
|
||||
])
|
||||
|
||||
# OMPI_SETUP_CC()
|
||||
# ---------------
|
||||
# Do everything required to setup the C compiler. Safe to AC_REQUIRE
|
||||
# this macro.
|
||||
AC_DEFUN([OMPI_SETUP_CC],[
|
||||
# Modularize this setup so that sub-configure.in scripts can use this
|
||||
# same setup code.
|
||||
# AM_PROG_CC_C_O AC_REQUIREs AC_PROG_CC, so we have to be a little
|
||||
# careful about ordering here, and AC_REQUIRE these things so that
|
||||
# they get stamped out in the right order.
|
||||
|
||||
# Order is important!
|
||||
AC_REQUIRE([_OMPI_START_SETUP_CC])
|
||||
AC_REQUIRE([_OMPI_PROG_CC])
|
||||
AC_REQUIRE([AM_PROG_CC_C_O])
|
||||
AC_REQUIRE([_OMPI_PROG_CC_IMPERSONATE_GCC])
|
||||
AC_REQUIRE([_OMPI_C_COMPILER_VENDOR])
|
||||
|
||||
# Do we want code coverage
|
||||
if test "$WANT_COVERAGE" = "1"; then
|
||||
if test "$TRULY_GCC" = "yes"; then
|
||||
OMPI_C_COMPILER_VENDOR([ompi_c_vendor])
|
||||
|
||||
# Do we want code coverage
|
||||
if test "$WANT_COVERAGE" = "1"; then
|
||||
if test "$ompi_c_vendor" = "gnu" ; then
|
||||
CLEANFILES="*.bb *.bbg *.da *.*.gcov ${CLEANFILES}"
|
||||
AC_MSG_WARN([-fprofile-arcs -ftest-coverage has been added to CFLAGS (--enable-coverage)])
|
||||
WANT_DEBUG=1
|
||||
@ -133,21 +44,19 @@ if test "$WANT_COVERAGE" = "1"; then
|
||||
AC_MSG_WARN([Code coverage functionality is currently available only with GCC])
|
||||
AC_MSG_ERROR([Configure: Cannot continue])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Do we want debugging?
|
||||
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
# Do we want debugging?
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
CFLAGS="$CFLAGS -g"
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
AC_MSG_WARN([-g has been added to CFLAGS (--enable-debug)])
|
||||
fi
|
||||
fi
|
||||
|
||||
# These flags are generally gcc-specific; even the gcc-impersonating
|
||||
# compilers won't accept them.
|
||||
|
||||
OMPI_CFLAGS_BEFORE_PICKY="$CFLAGS"
|
||||
if test "$TRULY_GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||
# These flags are generally gcc-specific; even the
|
||||
# gcc-impersonating compilers won't accept them.
|
||||
OMPI_CFLAGS_BEFORE_PICKY="$CFLAGS"
|
||||
if test "$WANT_PICKY_COMPILER" = 1 -a "$ompi_c_vendor" = "gnu" ; then
|
||||
add="-Wall -Wundef -Wno-long-long -Wsign-compare"
|
||||
add="$add -Wmissing-prototypes -Wstrict-prototypes"
|
||||
add="$add -Wcomment -pedantic"
|
||||
@ -172,11 +81,11 @@ if test "$TRULY_GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
AC_MSG_WARN([$add has been added to CFLAGS (--enable-picky)])
|
||||
unset add
|
||||
fi
|
||||
fi
|
||||
|
||||
# See if this version of gcc allows -finline-functions and/or
|
||||
# -fno-strict-aliasing. Even check the gcc-impersonating compilers.
|
||||
if test "$GCC" = "yes"; then
|
||||
# See if this version of gcc allows -finline-functions and/or
|
||||
# -fno-strict-aliasing. Even check the gcc-impersonating compilers.
|
||||
if test "$GCC" = "yes"; then
|
||||
CFLAGS_orig="$CFLAGS"
|
||||
|
||||
CFLAGS="$CFLAGS_orig -finline-functions"
|
||||
@ -206,28 +115,19 @@ if test "$GCC" = "yes"; then
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
AC_MSG_WARN([$add has been added to CFLAGS])
|
||||
unset add
|
||||
fi
|
||||
fi
|
||||
|
||||
# Try to enable restrict keyword
|
||||
RESTRICT_CFLAGS=
|
||||
case "${host}" in
|
||||
ia64-unknown-linux*)
|
||||
if test "$CC" = "ecc" ; then
|
||||
# Try to enable restrict keyword
|
||||
RESTRICT_CFLAGS=
|
||||
case "$ompi_c_vendor" in
|
||||
intel)
|
||||
RESTRICT_CFLAGS="-restrict"
|
||||
fi
|
||||
;;
|
||||
mips-sgi-irix*)
|
||||
if test "$CC" = "cc" ; then
|
||||
sgi)
|
||||
RESTRICT_CFLAGS="-LANG:restrict=ON"
|
||||
fi
|
||||
;;
|
||||
i?86-pc-linux*)
|
||||
if test "$CC" = "icc" ; then
|
||||
RESTRICT_CFLAGS="-restrict"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test ! -z "$RESTRICT_CFLAGS" ; then
|
||||
esac
|
||||
if test ! -z "$RESTRICT_CFLAGS" ; then
|
||||
CFLAGS_orig="$CFLAGS"
|
||||
CFLAGS="$CFLAGS_orig $RESTRICT_CFLAGS"
|
||||
add=
|
||||
@ -241,33 +141,56 @@ if test ! -z "$RESTRICT_CFLAGS" ; then
|
||||
fi
|
||||
|
||||
CFLAGS="${CFLAGS_orig}${add}"
|
||||
OMPI_UNIQ(CFLAGS)
|
||||
OMPI_UNIQ([CFLAGS])
|
||||
if test "$add" != "" ; then
|
||||
AC_MSG_WARN([$add has been added to CFLAGS])
|
||||
fi
|
||||
unset add
|
||||
fi
|
||||
fi
|
||||
|
||||
# Preload the optflags for the case where the user didn't specify any.
|
||||
# If we're using GNU compilers, use -O3 (since it GNU doesn't require
|
||||
# all compilation units to be compiled with the same level of
|
||||
# optimization -- selecting a high level of optimization is not
|
||||
# prohibitive). If we're using anything else, be conservative and
|
||||
# just use -O.
|
||||
|
||||
# Note: gcc-imperonating compilers accept -O3, so there's no need for
|
||||
# $TRULY_GCC here.
|
||||
|
||||
if test "$GCC" = yes; then
|
||||
# Preload the optflags for the case where the user didn't specify
|
||||
# any. If we're using GNU compilers, use -O3 (since it GNU
|
||||
# doesn't require all compilation units to be compiled with the
|
||||
# same level of optimization -- selecting a high level of
|
||||
# optimization is not prohibitive). If we're using anything else,
|
||||
# be conservative and just use -O.
|
||||
#
|
||||
# Note: gcc-imperonating compilers accept -O3
|
||||
if test "$GCC" = yes; then
|
||||
OPTFLAGS="-O3"
|
||||
else
|
||||
else
|
||||
OPTFLAGS="-O"
|
||||
fi
|
||||
fi
|
||||
|
||||
OMPI_CHECK_OPTFLAGS("$OMPI_CFLAGS_BEFORE_PICKY")
|
||||
OMPI_CFLAGS_BEFORE_PICKY="$co_result"
|
||||
OMPI_CHECK_OPTFLAGS("$OMPI_CFLAGS_BEFORE_PICKY")
|
||||
OMPI_CFLAGS_BEFORE_PICKY="$co_result"
|
||||
|
||||
AC_MSG_CHECKING([for C optimization flags])
|
||||
OMPI_CHECK_OPTFLAGS(["$CFLAGS"])
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CFLAGS="$co_result"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_START_SETUP_CC],[
|
||||
ompi_show_subtitle "C compiler and preprocessor"
|
||||
|
||||
# $%@#!@#% AIX!! This has to be called before anything invokes the C
|
||||
# compiler.
|
||||
dnl AC_AIX
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_PROG_CC],[
|
||||
#
|
||||
# Check for the compiler
|
||||
#
|
||||
ompi_cflags_save="$CFLAGS"
|
||||
AC_PROG_CC
|
||||
BASECC="`basename $CC`"
|
||||
CFLAGS="$ompi_cflags_save"
|
||||
AC_DEFINE_UNQUOTED(OMPI_CC, "$CC", [OMPI underlying C compiler])
|
||||
OMPI_CC_ABSOLUTE="`which $CC`"
|
||||
AC_SUBST(OMPI_CC_ABSOLUTE)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([for C optimization flags])
|
||||
OMPI_CHECK_OPTFLAGS("$CFLAGS")
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CFLAGS="$co_result"])
|
||||
|
@ -17,100 +17,20 @@ dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
# _OMPI_PROG_CXX_IMPERSONATE_GCC()
|
||||
# --------------------------------
|
||||
# Check for compilers that impersonate g++
|
||||
AC_DEFUN([_OMPI_PROG_CXX_IMPERSONATE_GCC],[
|
||||
AC_CACHE_CHECK([if compiler impersonates g++],
|
||||
[ompi_cv_prog_cxx_impersonate_gcc],
|
||||
[ompi_cv_prog_cxx_impersonate_gcc="no"
|
||||
TRULY_GXX=$GXX
|
||||
if test "$GXX" = "yes"; then
|
||||
AC_TRY_COMPILE([], [
|
||||
int i = 3;
|
||||
#if __INTEL_COMPILER
|
||||
#error Yes, I am lying about being g++.
|
||||
#endif
|
||||
], [], [ompi_cv_prog_cxx_impersonate_gcc="yes"])
|
||||
fi])
|
||||
|
||||
if test "$GXX" = "yes" -a "$ompi_cv_prog_cxx_impersonate_gcc" = "no" ; then
|
||||
TRULY_GXX=yes
|
||||
else
|
||||
TRULY_GXX=no
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([_OMPI_CXX_COMPILER_VENDOR],
|
||||
#
|
||||
# Arguments:
|
||||
# Optional 1 and 2 : compiler vendor and compiler nickname.
|
||||
#
|
||||
# Depdencies: _OMPI_C_IFDEF
|
||||
#
|
||||
#
|
||||
[AC_CACHE_CHECK([the C++ compiler vendor],
|
||||
[ac_cv_cxx_compiler_vendor],
|
||||
|
||||
[AC_LANG_PUSH([C++])
|
||||
|
||||
dnl GNU C++
|
||||
_OMPI_C_IFDEF([__GNUG__],
|
||||
[ac_cv_cxx_compiler_vendor=gnu],
|
||||
[_OMPI_C_IFDEF([__DECCXX],
|
||||
[ac_cv_cxx_compiler_vendor=compaq],
|
||||
[dnl HP's aCC
|
||||
_OMPI_C_IFDEF([__HP_aCC],
|
||||
[ac_cv_cxx_compiler_vendor=hp],
|
||||
[dnl SGI CC
|
||||
_OMPI_C_IFDEF([__sgi],
|
||||
[ac_cv_cxx_compiler_vendor=sgi],
|
||||
[dnl Note: We are using the C compiler because VC++ doesn't
|
||||
dnl recognize `.cc'(which is used by `configure') as a C++ file
|
||||
dnl extension and requires `/TP' to be passed.
|
||||
AC_LANG_PUSH([C])
|
||||
_OMPI_C_IFDEF([_MSC_VER],
|
||||
[ac_cv_cxx_compiler_vendor=microsoft],
|
||||
[ac_cv_cxx_compiler_vendor=unknown])
|
||||
AC_LANG_POP()])])])])
|
||||
|
||||
AC_LANG_POP()])
|
||||
ifelse([$1], , [], [$1="$ac_cv_cxx_compiler_vendor"])
|
||||
|
||||
dnl The compiler nickname
|
||||
ifelse([$2], , [],
|
||||
[case "$ac_cv_cxx_compiler_vendor" in
|
||||
gnu) $2=g++;;
|
||||
compaq) $2=cxx;;
|
||||
hp) $2=aCC;;
|
||||
sgi) $2=CC;;
|
||||
microsoft) $2=cl;;
|
||||
*) $2=unknown;;
|
||||
esac])
|
||||
])
|
||||
|
||||
# OMPI_SETUP_CXX()
|
||||
# ----------------
|
||||
# Do everything required to setup the C++ compiler. Safe to AC_REQUIRE
|
||||
# this macro.
|
||||
AC_DEFUN([OMPI_SETUP_CXX],[
|
||||
|
||||
# Modularize this setup so that sub-configure.in scripts can use this
|
||||
# same setup code.
|
||||
AC_REQUIRE([_OMPI_START_SETUP_CXX])
|
||||
AC_REQUIRE([_OMPI_PROG_CXX])
|
||||
|
||||
ompi_show_subtitle "C++ compiler and preprocessor"
|
||||
OMPI_CXX_COMPILER_VENDOR([ompi_cxx_vendor])
|
||||
|
||||
ompi_cxxflags_save="$CXXFLAGS"
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
BASECXX="`basename $CXX`"
|
||||
CXXFLAGS="$ompi_cxxflags_save"
|
||||
AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler])
|
||||
OMPI_CXX_ABSOLUTE="`which $CXX`"
|
||||
AC_SUBST(OMPI_CXX_ABSOLUTE)
|
||||
|
||||
_OMPI_PROG_CXX_IMPERSONATE_GCC
|
||||
_OMPI_CXX_COMPILER_VENDOR
|
||||
|
||||
# Do we want code coverage
|
||||
if test "$WANT_COVERAGE" = "1"; then
|
||||
if test "$TRULY_GXX" = "yes"; then
|
||||
# Do we want code coverage
|
||||
if test "$WANT_COVERAGE" = "1"; then
|
||||
if test "$ompi_cxx_vendor" = "gnu" ; then
|
||||
AC_MSG_WARN([-fprofile-arcs -ftest-coverage has been added to CFLAGS (--enable-coverage)])
|
||||
WANT_DEBUG=1
|
||||
CXXFLAGS="-ftest-coverage -fprofile-arcs ${CXXFLAGS}"
|
||||
@ -119,21 +39,19 @@ if test "$WANT_COVERAGE" = "1"; then
|
||||
AC_MSG_WARN([Code coverage functionality is currently available only with GCC suite])
|
||||
AC_MSG_ERROR([Configure: cannot continue])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Do we want debugging?
|
||||
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
# Do we want debugging?
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
CXXFLAGS="$CXXFLAGS -g"
|
||||
OMPI_UNIQ(CXXFLAGS)
|
||||
AC_MSG_WARN([-g has been added to CXXFLAGS (--enable-debug)])
|
||||
fi
|
||||
fi
|
||||
|
||||
# These flags are generally g++-specific; even the g++-impersonating
|
||||
# compilers won't accept them.
|
||||
|
||||
OMPI_CXXFLAGS_BEFORE_PICKY="$CXXFLAGS"
|
||||
if test "$TRULY_GXX" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||
# These flags are generally g++-specific; even the g++-impersonating
|
||||
# compilers won't accept them.
|
||||
OMPI_CXXFLAGS_BEFORE_PICKY="$CXXFLAGS"
|
||||
if test "$WANT_PICKY_COMPILER" = 1 -a "$ompi_cxx_vendor" = "gnu"; then
|
||||
add="-Wall -Wundef -Wno-long-long"
|
||||
|
||||
# see if -Wno-long-double works...
|
||||
@ -157,11 +75,10 @@ if test "$TRULY_GXX" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then
|
||||
AC_MSG_WARN([$add has been added to CXXFLAGS (--enable-picky)])
|
||||
fi
|
||||
unset add
|
||||
fi
|
||||
fi
|
||||
|
||||
# See if this version of g++ allows -finline-functions
|
||||
|
||||
if test "$GXX" = "yes"; then
|
||||
# See if this version of g++ allows -finline-functions
|
||||
if test "$GXX" = "yes"; then
|
||||
CXXFLAGS_orig="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -finline-functions"
|
||||
add=
|
||||
@ -179,20 +96,19 @@ if test "$GXX" = "yes"; then
|
||||
AC_MSG_WARN([$add has been added to CXXFLAGS])
|
||||
fi
|
||||
unset add
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for special things due to C++ exceptions
|
||||
|
||||
ENABLE_CXX_EXCEPTIONS=no
|
||||
HAVE_CXX_EXCEPTIONS=0
|
||||
AC_ARG_ENABLE(cxx-exceptions,
|
||||
AC_HELP_STRING([--enable-cxx-exceptions],
|
||||
[enable support for C++ exceptions]),
|
||||
# Check for special things due to C++ exceptions
|
||||
ENABLE_CXX_EXCEPTIONS=no
|
||||
HAVE_CXX_EXCEPTIONS=0
|
||||
AC_ARG_ENABLE([cxx-exceptions],
|
||||
[AC_HELP_STRING([--enable-cxx-exceptions],
|
||||
[enable support for C++ exceptions])],
|
||||
[ENABLE_CXX_EXCEPTIONS="$enableval"])
|
||||
|
||||
AC_MSG_CHECKING([if want C++ exception handling])
|
||||
AC_MSG_RESULT([$ENABLE_CXX_EXCEPTIONS])
|
||||
if test "$ENABLE_CXX_EXCEPTIONS" = "yes"; then
|
||||
AC_MSG_CHECKING([if want C++ exception handling])
|
||||
AC_MSG_RESULT([$ENABLE_CXX_EXCEPTIONS])
|
||||
if test "$ENABLE_CXX_EXCEPTIONS" = "yes"; then
|
||||
# config/cxx_have_exceptions.m4
|
||||
OMPI_CXX_HAVE_EXCEPTIONS
|
||||
# config/cxx_find_exception_flags.m4
|
||||
@ -208,20 +124,20 @@ if test "$ENABLE_CXX_EXCEPTIONS" = "yes"; then
|
||||
WRAPPER_EXTRA_FFLAGS="$OMPI_CXX_EXCEPTIONS_FFLAGS ${WRAPPER_EXTRA_FFLAGS}"
|
||||
WRAPPER_EXTRA_CXXFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_CXXFLAGS}"
|
||||
fi
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_CXX_EXCEPTION_SUPPORT, $HAVE_CXX_EXCEPTIONS,
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_CXX_EXCEPTION_SUPPORT, $HAVE_CXX_EXCEPTIONS,
|
||||
[Whether or not we have compiled with C++ exceptions support])
|
||||
|
||||
# Find some more characteristics of the C++ compiler
|
||||
# Find some more characteristics of the C++ compiler
|
||||
|
||||
# config/cxx_find_template_repository.m4
|
||||
OMPI_CXX_FIND_TEMPLATE_REPOSITORY
|
||||
# config/cxx_find_template_parameters.m4
|
||||
OMPI_CXX_FIND_TEMPLATE_PARAMETERS
|
||||
# config/cxx_find_template_repository.m4
|
||||
OMPI_CXX_FIND_TEMPLATE_REPOSITORY
|
||||
# config/cxx_find_template_parameters.m4
|
||||
OMPI_CXX_FIND_TEMPLATE_PARAMETERS
|
||||
|
||||
# If we are on HP-UX, ensure that we're using aCC
|
||||
case "$host" in
|
||||
*hpux*)
|
||||
# If we are on HP-UX, ensure that we're using aCC
|
||||
case "$host" in
|
||||
*hpux*)
|
||||
if test "$BASECXX" = "CC"; then
|
||||
AC_MSG_WARN([*** You will probably have problems compiling the MPI 2])
|
||||
AC_MSG_WARN([*** C++ bindings with the HP-UX CC compiler. You should])
|
||||
@ -229,21 +145,34 @@ case "$host" in
|
||||
AC_MSG_WARN([*** with the environment variable "CXX=aCC".])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
# Same rationale for g++ as with gcc in OMPI_SETUP_CC.
|
||||
|
||||
# Note: gcc-imperonating compilers accept -O3, so there's no need for
|
||||
# $TRULY_GCC here.
|
||||
|
||||
if test "$GXX" = yes; then
|
||||
# Note: gcc-imperonating compilers accept -O3
|
||||
if test "$GXX" = yes; then
|
||||
OPTFLAGS="-O3"
|
||||
else
|
||||
else
|
||||
OPTFLAGS="-O"
|
||||
fi
|
||||
# config/ompi_check_optflags.m4
|
||||
OMPI_CHECK_OPTFLAGS("$CXXFLAGS")
|
||||
AC_MSG_CHECKING([for C++ optimization flags])
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CXXFLAGS="$co_result"
|
||||
fi
|
||||
# config/ompi_check_optflags.m4
|
||||
OMPI_CHECK_OPTFLAGS(["$CXXFLAGS"])
|
||||
AC_MSG_CHECKING([for C++ optimization flags])
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CXXFLAGS="$co_result"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_START_SETUP_CXX],[
|
||||
ompi_show_subtitle "C++ compiler and preprocessor"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_PROG_CXX],[
|
||||
ompi_cxxflags_save="$CXXFLAGS"
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
BASECXX="`basename $CXX`"
|
||||
CXXFLAGS="$ompi_cxxflags_save"
|
||||
AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler])
|
||||
OMPI_CXX_ABSOLUTE="`which $CXX`"
|
||||
AC_SUBST(OMPI_CXX_ABSOLUTE)
|
||||
])
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user