Autoconf-generated configure scripts check for the C compiler and its features by default. Packages that use other programming languages (maybe more than one, e.g. C and C++) need to test features of the compilers for the respective languages. The following macros determine which programming language is used in the subsequent tests in configure.ac.
function>AC_LANG/function> (language) Do compilation tests using the compiler, preprocessor and file extensions for the specified language.
Supported languages are:
Do compilation tests using CC and CPP and use extension .c for test programs.
Do compilation tests using CXX and CXXCPP and use extension .C for test programs.
Do compilation tests using F77 and use extension .f for test programs.
function>AC_LANG_PUSH/function> (language) Remember the current language (as set by AC_LANG) on a stack, and then select the language. Use this macro and AC_LANG_POP in macros that need to temporarily switch to a particular language.
function>AC_LANG_POP/function> ([language]) Select the language that is saved on the top of the stack, as set by AC_LANG_PUSH, and remove it from the stack.
If given, language specifies the language we just quit. It is a good idea to specify it when it's known (which should be the case…), since Autoconf will detect inconsistencies.
AC_LANG_PUSH(Fortran 77) # Perform some tests on Fortran 77. # ... AC_LANG_POP(Fortran 77)
function>AC_REQUIRE_CPP/function> Ensure that whichever preprocessor would currently be used for tests has been found. Calls AC_REQUIRE (the section called “Prerequisite Macros”) with an argument of either AC_PROG_CPP or AC_PROG_CXXCPP, depending on which language is current.