0

The GNU documentation for AC_PROG_CXX states that:

Otherwise, if the macro is invoked without an argument, then search for a C++ compiler under the likely names (first g++ and c++ then other names). If none of those checks succeed, then as a last resort set CXX to g++.

which implies that whether or not a working C++ compiler is found, the CXX variable will be set to something. As a result, it is impossible to use CXX to know whether a C++ compiler is available.

How can I check that a C++ compiler is available at ./configure time?

qdii
  • 12,505
  • 10
  • 59
  • 116

1 Answers1

2

You can add an extra AC_CHECK_PROG check, to make sure the compiler is found.

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
  • Follow-up on my implementation: http://stackoverflow.com/questions/16171949/implement-a-check-for-a-cxx-compilers-presence – qdii Apr 23 '13 at 14:29