Cactus's configure test "checking whether we are using GNU C++" uses .C for C++ files

Create issue
Issue #2564 new
Roland Haas created an issue

Steve found, when trying of use nvcc for CXX, that the autoconf version used by Cactus uses a file conftest.C to see check if $CXX is the GNU compiler.

The autoconf code is:

AC_DEFUN(AC_PROG_CXX_GNU,
[AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if AC_TRY_COMMAND(${CXX-g++} -E conftest.C) | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi])])

which hard-codes the extension.

To better support file systems that do not consider case significant (it will still work) and nvcc we may wan to define our own CCTK_PROG_CXX_GNU. Something like:

AC_DEFUN(AC_PROG_CXX_GNU,
[AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
AC_LANG_SAVE
AC_LANG_CXX
AC_TRY_COMPILE([], [#ifndef __GNU__
#error "Not GNU compiler"
#endif
return 0;], eval "ac_cv_prog_gxx=yes",
  eval "ac_cv_prog_gxx=no")])dnl
AC_MSG_RESULT($ac_cv_prog_gxx)
AC_LONG_RESTORE
])])

(untested).

Comments (0)

  1. Log in to comment