bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autoconf-2.57: unclear documentation for AC_CHECK_DECL and AC_CHECK_DECL


From: Nelson H. F. Beebe
Subject: autoconf-2.57: unclear documentation for AC_CHECK_DECL and AC_CHECK_DECLS
Date: Sat, 4 Jan 2003 18:21:46 -0700 (MST)

The autoconf-2.57 manual's documentation for AC_CHECK_DECL and
AC_CHECK_DECLS is unclear.  It reads:

>> ...
>>  - Macro: AC_CHECK_DECL (SYMBOL, [ACTION-IF-FOUND],
>>           [ACTION-IF-NOT-FOUND], [INCLUDES = `default-includes'])
>>      If SYMBOL (a function or a variable) is not declared in INCLUDES
>>      and a declaration is needed, run the shell commands
>>      ACTION-IF-NOT-FOUND, otherwise ACTION-IF-FOUND.  If no INCLUDES
>>      are specified, the default includes are used (*note Default
>>      Includes::).
>> ...

There are no examples in the manual of the specification of INCLUDES,
nor could I spot any in the installed autoconf libraries.  

Does it want a list of header files: [stdio.h stddef.h math.h]?

Or does it want include statements: [
#include <stdio.h>
#include <stddef.h>
#include <math.h>
]?

Or does it want a key=value assignment: INCLUDES=[...]?

By experiment, I found that this works:

        MATH_INCLUDES="
        #include <math.h>
        #if defined(HAVE_SUNMATH_H)
        #include <sunmath.h>
        #endif
        "
        AC_CHECK_DECLS([ilogbf, irintf, nintf],,,[$MATH_INCLUDES])

That is, AC_CHECK_DECLS expects its fourth argument to be a block of C
code that includes files, and possibly does other things as well.
No INCLUDES= keyword expected.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- Center for Scientific Computing       FAX: +1 801 581 4148                  -
- University of Utah                    Internet e-mail: address@hidden  -
- Department of Mathematics, 110 LCB        address@hidden  address@hidden -
- 155 S 1400 E RM 233                       address@hidden                    -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
-------------------------------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]