manpagez: man pages & more
info autoconf
Home | html | info | man

File: autoconf.info,  Node: C++ Compiler,  Next: Objective C Compiler,  Prev: C Compiler,  Up: Compilers and Preprocessors

5.10.4 C++ Compiler Characteristics
-----------------------------------

 — Macro: AC_PROG_CXX([COMPILER-SEARCH-LIST])
     Determine a C++ compiler to use.

     If either the environment variable ‘CXX’ or the environment
     variable ‘CCC’ is set, its value will be taken as the name of a C++
     compiler.  If both are set, ‘CXX’ is preferred.  If neither are
     set, search for a C++ compiler under a series of likely names,
     trying ‘g++’ and ‘c++’ first.  Regardless, the output variable
     ‘CXX’ is set to the chosen compiler.

     If the optional first argument to the macro is used, it must be a
     whitespace-separated list of potential names for a C++ compiler,
     which overrides the built-in list.

     If no C++ compiler can be found, as a last resort ‘CXX’ is set to
     ‘g++’ (and subsequent tests will probably fail).

     If the selected C++ compiler is found to be GNU C++ (regardless of
     its name), the shell variable ‘GXX’ will be set to ‘yes’.  If the
     shell variable ‘CXXFLAGS’ was not already set, it is set to ‘-g
     -O2’ for the GNU C++ compiler (‘-O2’ on systems where G++ does not
     accept ‘-g’), or ‘-g’ for other compilers.  ‘CXXFLAGS’ is then made
     an output variable.  You can override the default for ‘CXXFLAGS’ by
     inserting a shell default assignment between ‘AC_INIT’ and
     ‘AC_PROG_CXX’:

          : ${CXXFLAGS="OPTIONS"}

     where OPTIONS are the appropriate set of options to use by default.
     (It is important to use this construct rather than a normal
     assignment, so that ‘CXXFLAGS’ can still be overridden by the
     person building the package.  *Note Preset Output Variables::.)

 — Macro: AC_PROG_CXXCPP
     Set output variable ‘CXXCPP’ to a command that runs the C++
     preprocessor.  If ‘$CXX -E’ doesn’t work, tries ‘cpp’ and
     ‘/lib/cpp’, in that order.  Because of this fallback, ‘CXXCPP’ may
     or may not set C++-specific predefined macros (such as
     ‘__cplusplus’).

     It is portable to run ‘CXXCPP’ only on files with a ‘.c’, ‘.C’,
     ‘.cc’, or ‘.cpp’ extension.

     Some preprocessors don’t indicate missing include files by the
     error status.  For such preprocessors an internal variable is set
     that causes other macros to check the standard error from the
     preprocessor and consider the test failed if any warnings have been
     reported.  However, it is not known whether such broken
     preprocessors exist for C++.

 — Macro: AC_PROG_CXX_C_O
     Test whether the C++ compiler accepts the options ‘-c’ and ‘-o’
     simultaneously, and define ‘CXX_NO_MINUS_C_MINUS_O’, if it does
     not.

© manpagez.com 2000-2026
Individual documents may contain additional copyright information.