Go to the first, previous, next, last section, table of contents.

Examining Syntax

To check for a syntax feature of the C or C++ compiler, such as whether it recognizes a certain keyword, use AC_TRY_COMPILE to try to compile a small program that uses that feature. You can also use it to check for structures and structure members that are not present on all systems.

Macro: AC_TRY_COMPILE (includes, function-body, [action-if-found [, action-if-not-found]])
Create a test C program to see whether a function whose body consists of function-body can be compiled; includes is any #include statements needed by the code in function-body. If the file compiles successfully, run shell commands action-if-found, otherwise run action-if-not-found. This macro uses CFLAGS or CXXFLAGS, and CPPFLAGS, when compiling. It does not try to link; use AC_TRY_LINK if you need to do that (see section Examining Libraries).


Go to the first, previous, next, last section, table of contents.