[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can I check if C++ and Fortran compiler works ?
From: |
Ralf Wildenhues |
Subject: |
Re: How can I check if C++ and Fortran compiler works ? |
Date: |
Mon, 22 Feb 2010 07:43:52 +0100 |
User-agent: |
Mutt/1.5.20 (2009-10-28) |
* Dr. David Kirkby wrote on Sun, Feb 21, 2010 at 11:53:05PM CET:
> There is no actual test that the C++ compiler works. How can I add
> one?
You could simply test whether it can link a trivial program. Call
the macro below after AC_PROG_CXX.
I intend to submit this macro, suitably rewritten and factored, as
Autoconf addition, since it's come up twice within two days now.
Cheers,
Ralf
# rw_PROG_CXX_WORKS
# Check whether the C++ compiler works.
AC_DEFUN([rw_PROG_CXX_WORKS],
[AC_REQUIRE([AC_PROG_CXX])dnl
AC_CACHE_CHECK([whether the C++ compiler works],
[rw_cv_prog_cxx_works],
[AC_LANG_PUSH([C++])
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[rw_cv_prog_cxx_works=yes],
[rw_cv_prog_cxx_works=no])
AC_LANG_POP([C++])])
])