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

5.9.2 Generic Type Checks

These macros are used to check for types not covered by the “particular” test macros.

Macro: AC_CHECK_TYPE (type, [action-if-found] [action-if-not-found] @dvar{includes, AC_INCLUDES_DEFAULT})

Check whether type is defined. It may be a compiler builtin type or defined by the includes. includes is a series of include directives, defaulting to AC_INCLUDES_DEFAULT (see section Default Includes), which are used prior to the type under test.

In C, type must be a type-name, so that the expression ‘sizeof (type)’ is valid (but ‘sizeof ((type))’ is not). The same test is applied when compiling for C++, which means that in C++ type should be a type-id and should not be an anonymous ‘struct’ or ‘union’.

This macro caches its result in the ac_cv_type_type variable, with ‘*’ mapped to ‘p’ and other characters not suitable for a variable name mapped to underscores.

Macro: AC_CHECK_TYPES (types, [action-if-found] [action-if-not-found] @dvar{includes, AC_INCLUDES_DEFAULT})

For each type of the types that is defined, define HAVE_type (in all capitals). Each type must follow the rules of AC_CHECK_TYPE. If no includes are specified, the default includes are used (see section Default Includes). If action-if-found is given, it is additional shell code to execute when one of the types is found. If action-if-not-found is given, it is executed when one of the types is not found.

This macro uses M4 lists:

AC_CHECK_TYPES([ptrdiff_t])
AC_CHECK_TYPES([unsigned long long int, uintmax_t])
AC_CHECK_TYPES([float_t], [], [], [[#include <math.h>]])

Autoconf, up to 2.13, used to provide to another version of AC_CHECK_TYPE, broken by design. In order to keep backward compatibility, a simple heuristic, quite safe but not totally, is implemented. In case of doubt, read the documentation of the former AC_CHECK_TYPE, see Obsolete Macros.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 26, 2012 using texi2html 5.0.

© manpagez.com 2000-2017
Individual documents may contain additional copyright information.