From 8db4a55a572528cc03fc0deb5516bda6b93863c2 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Sun, 20 Aug 2006 13:53:27 +0000 Subject: [PATCH] Reorder the C++ compiler discovery stages. Check first the compiler vendor before checking if we are able to compile the test program. This is required for windows as the C++ conftest.c file generated by configure cannot be compiled with the Microsoft cl.exe compiler (because of the exit function prototype). So if we detect a vendor equal to microsoft we will assume that the compiler is correctly installed (which is true on Windows most of the time anyway). This commit was SVN r11268. --- config/ompi_setup_cxx.m4 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/ompi_setup_cxx.m4 b/config/ompi_setup_cxx.m4 index d44062154a..f105baa4ed 100644 --- a/config/ompi_setup_cxx.m4 +++ b/config/ompi_setup_cxx.m4 @@ -3,7 +3,7 @@ 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 Copyright (c) 2004-2006 The University of Tennessee and The University dnl of Tennessee Research Foundation. All rights dnl reserved. dnl Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -26,8 +26,6 @@ AC_DEFUN([OMPI_SETUP_CXX],[ AC_REQUIRE([_OMPI_START_SETUP_CXX]) AC_REQUIRE([_OMPI_PROG_CXX]) - OMPI_CXX_COMPILER_VENDOR([ompi_cxx_vendor]) - # Do we want code coverage if test "$WANT_COVERAGE" = "1"; then if test "$ompi_cxx_vendor" = "gnu" ; then @@ -239,6 +237,8 @@ AC_DEFUN([_OMPI_PROG_CXX],[ OMPI_CXX_ABSOLUTE="`which $CXX`" AC_SUBST(OMPI_CXX_ABSOLUTE) + OMPI_CXX_COMPILER_VENDOR([ompi_cxx_vendor]) + # Make sure that the C++ compiler both works and is actually a C++ # compiler (if not cross-compiling). Don't just use the AC macro # so that we can have a pretty message. Do something here that @@ -252,7 +252,9 @@ AC_DEFUN([_OMPI_PROG_CXX],[ # we want to cover the entire spectrum (compiling, linking, # running). - OMPI_CHECK_COMPILER_WORKS([C++], [#include ], - [std::string foo = "Hello, world"; return 0], [], - [AC_MSG_ERROR([Could not run a simple C++ program. Aborting.])]) + if[ test "$ompi_cv_cxx_compiler_vendor" != "microsoft" ]; then + OMPI_CHECK_COMPILER_WORKS([C++], [#include ], + [std::string foo = "Hello, world"], [], + [AC_MSG_ERROR([Could not run a simple C++ program. Aborting.])]) + fi ])