Buy the book!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
Since Autoconf 2.50, internal codes uses
AC_RUN_IFELSE on the other one hand and
AC_LANG_PROGRAM on the other hand instead of the deprecated
AC_TRY_RUN. The motivations where:
AC_TRY_COMPILEetc. were double quoting their arguments;
In addition to the change of syntax, the philosphy 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 `#include's.
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
AC_EGREP_CPP(yes, [#ifdef _AIX yes #endif ], is_aix=yes, is_aix=no)
The above example, properly written would (i) use
AC_LANG_PROGRAM, and (ii) run the compiler:
AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[#if !defined _AIX # error _AIX not defined #endif ]])], [is_aix=yes], [is_aix=no])
|webmaster||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|