Since Autoconf 2.50, internal codes uses
AC_RUN_IFELSE on one hand and
AC_LANG_PROGRAM on the other hand instead of the deprecated
AC_TRY_RUN. The motivations where:
- a more consistent interface:
AC_TRY_COMPILE etc. were double
quoting their arguments;
- the combinatoric explosion is solved by decomposing on the one hand the
generation of sources, and on the other hand executing the program;
- this scheme helps supporting more languages than plain C and C++.
In addition to the change of syntax, the philosophy has changed too:
while emphasis was put on speed at the expense of accuracy, today's
Autoconf promotes accuracy of the testing framework at, ahem..., the
expense of speed.
As a perfect example of what is not to be done, here is how to
find out whether a header file contains a particular declaration, such
as a typedef, a structure, a structure member, or a function. Use
AC_EGREP_HEADER instead of running
grep directly on the
header file; on some systems the symbol might be defined in another
header file that the file you are checking includes.
As a (bad) example, here is how you should not check for C preprocessor
symbols, either defined by header files or predefined by the C
], is_aix=yes, is_aix=no)
The above example, properly written would (i) use
AC_LANG_PROGRAM, and (ii) run the compiler:
[[#if !defined _AIX
error: This isn't AIX!