autoconf: AC_ACT_IFELSE vs AC_TRY_ACT

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