manpagez: man pages & more
info autoconf
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4 Running the Compiler

To check for a syntax feature of the current language’s (see section Language Choice) compiler, such as whether it recognizes a certain keyword, or simply to try some library feature, use AC_COMPILE_IFELSE to try to compile a small program that uses that feature.

Macro: AC_COMPILE_IFELSE (input, [action-if-true]@c, [action-if-false]@c)

Run the compiler and compilation flags of the current language (see section Language Choice) on the input, run the shell commands action-if-true on success, action-if-false otherwise. The input can be made by AC_LANG_PROGRAM and friends.

It is customary to report unexpected failures with AC_MSG_FAILURE. This macro does not try to link; use AC_LINK_IFELSE if you need to do that (see section Running the Linker). If needed, action-if-true can further access the just-compiled object file ‘conftest.$OBJEXT’.

This macro uses AC_REQUIRE for the compiler associated with the current language, which means that if the compiler has not yet been determined, the compiler determination will be made prior to the body of the outermust AC_DEFUN macro that triggered this macro to expand (see section Expanded Before Required).

For tests in Erlang, the input must be the source code of a module named conftest. AC_COMPILE_IFELSE generates a ‘conftest.beam’ file that can be interpreted by the Erlang virtual machine (ERL). It is recommended to use AC_LANG_PROGRAM to specify the test program, to ensure that the Erlang module has the right name.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.