Fix a bit of the brokenness of AC_CHECK_TYPE.
* acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): New macro, inspired from
the former AC_CHECK_TYPE. This macro is exactly the one that
ought to be named AC_CHECK_TYPE: it just checks, and executes user
actions. In the future, this macro ought to be renamed
AC_CHECK_TYPE.
There is a big difference with the former AC_CHECK_TYPE: instead
of grepping in the headers, it tries to compile a variable
declaration. This is both safer, slower, and better, since now we
can check for compiler types (e.g., unsigned long long).
(AC_CHECK_TYPES): The looping and AC_DEFINEing version of the
previous macro. Uses m4 loops.
(AC_CHECK_TYPE): Reimplemented on top of AC_CHECK_TYPE_INTERNAL.
* autoheader.m4 (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros,
hooked.
* autoconf.texi (@ovar): New macro, for optional variables.
(Generic Typedefs): Document AC_CHECK_TYPES.
* autoheader.texi: (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros.
(Epilogue): Hooks them.
+1999-11-01 Akim Demaille <akim@epita.fr>
+
+ Fix a bit of the brokenness of AC_CHECK_TYPE.
+
+ * acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): New macro, inspired from
+ the former AC_CHECK_TYPE. This macro is exactly the one that
+ ought to be named AC_CHECK_TYPE: it just checks, and executes user
+ actions. In the future, this macro ought to be renamed
+ AC_CHECK_TYPE.
+ There is a big difference with the former AC_CHECK_TYPE: instead
+ of grepping in the headers, it tries to compile a variable
+ declaration. This is both safer, slower, and better, since now we
+ can check for compiler types (e.g., unsigned long long).
+ (AC_CHECK_TYPES): The looping and AC_DEFINEing version of the
+ previous macro. Uses m4 loops.
+ (AC_CHECK_TYPE): Reimplemented on top of AC_CHECK_TYPE_INTERNAL.
+ * autoheader.m4 (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros,
+ hooked.
+ * autoconf.texi (@ovar): New macro, for optional variables.
+ (Generic Typedefs): Document AC_CHECK_TYPES.
+ * autoheader.texi: (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros.
+ (Epilogue): Hooks them.
+
1999-11-01 Akim Demaille <akim@epita.fr>
Update autoupdate.
are also suggestions we should either satisfy right now (they're
easy), or remove (obsoleted since then).
+** automake
+The section for old macros is not completely up to date. For
+instance, there is still AM_PROG_LIBTOOL. Anyawy, since autoupdate
+takes care of them, it is no longer the role of Automake to handle
+this. Most should be removed.
+
** tests/
Write the sketch of a new series of tests, written in Autotest,
cf. recode 3.5 by François Pinard. It has to be shell scripts so that
])dnl
])
+
dnl AC_DEFUN(NAME, [REPLACED-FUNCTION, ARGUMENT, ]EXPANSION)
dnl --------------------------------------------------------
dnl Define a macro which automatically provides itself. Add machinery
dnl ### Generic structure checks
-dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER
-dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl [, INCLUDES ]]])
+dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
+dnl [INCLUDES])
dnl ---------------------------------------------------------
dnl AGGREGATE.MEMBER is for instance `struct passwd.pw_gecos', shell
dnl variables are not a valid argument.
])dnl AC_CHECK_MEMBER
-dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER...
-dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl [, INCLUDES ]]])
-dnl ---------------------------------------------------------
+dnl AC_CHECK_MEMBER((AGGREGATE.MEMBER, ...),
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]
+dnl [INCLUDES])
+dnl --------------------------------------------------------
+dnl The first argument is an m4 list. First because we want to
+dnl promote m4 list, and second because anyway there can be spaces
+dnl in some types (struct etc.).
AC_DEFUN(AC_CHECK_MEMBERS,
[m4_foreach([AC_Member], [$1],
[AC_SPECIALIZE([AC_CHECK_MEMBER], AC_Member,
dnl ### Checking for programs
-dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR
-dnl [, VALUE-IF-FOUND [, VALUE-IF-NOT-FOUND]
-dnl [, PATH [, REJECT]]])
-dnl ------------------------------------------------------
+dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR,
+dnl [VALUE-IF-FOUND], [VALUE-IF-NOT-FOUND],
+dnl [PATH], [REJECT])
+dnl -----------------------------------------------------
AC_DEFUN(AC_CHECK_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_VAR_POPDEF([ac_Header])dnl
])dnl AC_CHECK_HEADER
+
dnl AC_CHECK_HEADERS(HEADER-FILE...
dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl -------------------------------------------------------------
dnl Check if SYMBOL (a variable or a function) is declared.
AC_DEFUN([AC_CHECK_DECL],
[AC_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl
-AC_CACHE_CHECK([whether `$1' is declared], ac_Symbol,
+AC_CACHE_CHECK([whether $1 is declared], ac_Symbol,
[AC_TRY_COMPILE(m4_default([$4], [#include <stdio.h>
#ifdef HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
dnl ### Checking for typedefs
-dnl AC_CHECK_TYPE(TYPE, DEFAULT[, INCLUDES])
-dnl ----------------------------------------
-dnl FIXME: This is an extremely badly chosen name, since this
-dnl macro actually performs an AC_REPLACE_TYPE. Some day we
-dnl have to clean this up.
-AC_DEFUN(AC_CHECK_TYPE,
+dnl AC_CHECK_TYPE_INTERNAL(TYPE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
+dnl [INCLUDES])
+dnl ----------------------------------------------------------------------
+dnl Check whether the type TYPE is supported by the system, maybe via the
+dnl the provided includes. This macro implements the former task of
+dnl AC_CHECK_TYPE, with one big difference though: AC_CHECK_TYPE was
+dnl grepping in the headers, what led to many problems, BTW, until
+dnl the egrep expression was correct and did not given false positives.
+dnl Now, we try to compile a variable declaration. It is probably slower,
+dnl but it is *much* safer, and in addition, allows to check for types
+dnl defined by the compiler (e.g., unsigned long long), not only for
+dnl typedefs.
+dnl FIXME: This is *the* macro which ought to be named AC_CHECK_TYPE.
+AC_DEFUN(AC_CHECK_TYPE_INTERNAL,
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl
AC_CACHE_CHECK([for $1], ac_Type,
-[AC_EGREP_CPP(
-changequote(<<,>>)dnl
-<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
-changequote([,]),
-m4_default([$3], [#include <stdio.h>
+[AC_TRY_COMPILE(m4_default([$4
+], [#include <stdio.h>
#include <sys/types.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif
-]), AC_VAR_SET(ac_Type, yes), AC_VAR_SET(ac_Type, no))])
-AC_SHELL_IFELSE(test AC_VAR_GET(ac_Type) = yes,,
- [AC_DEFINE_UNQUOTED($1, $2,
- [Define to `$2' if <sys/types.h>
- does not define.])])dnl
+]),
+ [$1 foo;],
+ AC_VAR_SET(ac_Type, yes), AC_VAR_SET(ac_Type, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Type) = yes,
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Type])dnl
+])dnl AC_CHECK_TYPE_INTERNAL
+
+
+dnl AC_CHECK_TYPES(TYPES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [INCLUDES])
+dnl ---------------------------------------------------------------------------
+dnl TYPES is an m4 list.
+AC_DEFUN(AC_CHECK_TYPES,
+[m4_foreach([AC_Type], [$1],
+ [AC_SPECIALIZE([AC_CHECK_TYPE_INTERNAL], AC_Type,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Type))
+$2]
+ [$3],
+ [$4])])])
+
+
+dnl AC_CHECK_TYPE(TYPE, DEFAULT, [INCLUDES])
+dnl ----------------------------------------
+dnl FIXME: This is an extremely badly chosen name, since this
+dnl macro actually performs an AC_REPLACE_TYPE. Some day we
+dnl have to clean this up. The macro AC_TYPE_PTRDIFF_T shows the
+dnl need for a checking only macro.
+AC_DEFUN(AC_CHECK_TYPE,
+[AC_CHECK_TYPE_INTERNAL([$1],,
+ [AC_DEFINE_UNQUOTED($1, $2)],
+ [$3])dnl
])dnl AC_CHECK_TYPE
@finalout
@end iftex
+@c A simple macro for optional variables.
+@macro ovar{varname}
+@r{[}@var{\varname\}@r{]}
+@end macro
+
@dircategory GNU admin
@direntry
* Autoconf: (autoconf). Create source code configuration scripts
@node Generic Typedefs, , Particular Typedefs, Typedefs
@subsection Generic Typedef Checks
-This macro is used to check for typedefs not covered by the particular
-test macros. This macro does not fit well with the rest of Autoconf,
-and its design will probably change in the future.
+These macros are used to check for typedefs not covered by the
+particular test macros.
+
+@defmac AC_CHECK_TYPES ((@var{type}, @dots{}), @ovar{action-if-found}, @ovar{action-if-not-found}, @ovar{includes})
+@maindex CHECK_TYPES
+For each given @var{type} that is defined by the @var{includes} (by
+default, @file{sys/types.h}, @file{stdlib.h}, and @file{stddef.h}),
+define @code{HAVE_@var{type}} (in all capitals). If
+@var{action-if-found} is given, it is additional shell code to execute
+when one of the header files is found. You can give it a value of
+@samp{break} to break out of the loop on the first match. If
+@var{action-if-not-found} is given, it is executed when one of the
+header files is not found.
+
+This macro uses m4 lists:
+@example
+AC_CHECK_TYPES((ptrdiff_t))
+AC_CHECK_TYPES((unsigned long long, uintmax_t))
+@end example
+
+@end defmac
-One of its main flaws is that missing types are not typedef'd, they are
-defined, which can lead to incompatible code in the case of pointer types.
-@defmac AC_CHECK_TYPE (@var{type}, @var{default} @r{[}, @var{includes}@r{]})
+The following macro does not fit well with the rest of Autoconf, and its
+design will probably change in the future. One of its main flaws is
+that missing types are not typedef'd, they are defined, which can lead
+to incompatible code in the case of pointer types.
+
+@defmac AC_CHECK_TYPE (@var{type}, @var{default}, @ovar{includes})
@maindex CHECK_TYPE
If the type @var{type} is not defined in @file{sys/types.h}, or
-@file{stdlib.h} or @file{stddef.h} if they exist, define it to be the
-C (or C++) builtin type @var{default}; e.g., @samp{short} or
-@samp{unsigned}. The default header files to search can be replaced
-by supplying the optional argument @var{includes}.
+@file{stdlib.h} or @file{stddef.h} if they exist, define it to be the C
+(or C++) builtin type @var{default}; e.g., @samp{short} or
+@samp{unsigned}. The default header files to search can be replaced by
+supplying the optional argument @var{includes}.
+
+This macro has a broken design. First, although it is a member of the
+@code{CHECK} clan, singular subfamily, it does more than just checking.
+Second, the replacement it performs is done via @samp{#define @var{type}
+@var{default}}, although a @samp{typedef} is expected. Therefore, in
+the future, this macro shall be removed or replaced. User are adviced
+to use @code{AC_CHECK_TYPES} preferably.
@end defmac
+
@node C Compiler Characteristics, Fortran 77 Compiler Characteristics, Typedefs, Existing Tests
@section C Compiler Characteristics
@c FIXME: What the heck is this macro doing here? Move it out of
@c the way, in its proper section!!!
-@defmac AC_CHECK_SIZEOF (@var{type} @r{[}, @var{cross-size}@r{[}, @var{includes}@r{]]})
+@defmac AC_CHECK_SIZEOF (@var{type}, @ovar{cross-size}, @ovar{includes})
@maindex CHECK_SIZEOF
Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or
C++) builtin type @var{type}, e.g. @samp{int} or @samp{char *}. If
$3])
])
+dnl AH_CHECK_TYPES((TYPES, ...))
+dnl ----------------------------
+define([AH_CHECK_TYPES],
+[m4_foreach([AC_Type], [$1],
+ [AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Type),
+ [Define if the system has the type `]AC_Type['.])
+ # Success
+ $2
+ # Failure
+ $3])
+])
+
+
+dnl AC_CHECK_TYPE(TYPE, SUBTITUTE)
+dnl ------------------------------
+define([AH_CHECK_TYPE],
+[AH_TEMPLATE([$1], [Define to `$2' if <sys/types.h> does not define.])])
define([AH_FUNC_ALLOCA],
[AH_VERBATIM([STACK_DIRECTION],
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
-#endif])])
+#endif[]dnl
+])])
define([AH_F77_WRAPPERS],
AH_HOOK([AC_CHECK_HEADERS], [AH_CHECK_HEADERS])
AH_HOOK([AC_CHECK_HEADERS_DIRENT], [AH_CHECK_HEADERS])
AH_HOOK([AC_CHECK_MEMBERS], [AH_CHECK_MEMBERS])
+AH_HOOK([AC_CHECK_TYPE], [AH_CHECK_TYPE])
+AH_HOOK([AC_CHECK_TYPES], [AH_CHECK_TYPES])
AH_HOOK([AC_CHECK_LIB], [AH_CHECK_LIB])
AH_HOOK([AC_PROG_LEX], [AH_PROG_LEX])
AH_HOOK([AC_FUNC_ALLOCA], [AH_FUNC_ALLOCA])
@finalout
@end iftex
+@c A simple macro for optional variables.
+@macro ovar{varname}
+@r{[}@var{\varname\}@r{]}
+@end macro
+
@dircategory GNU admin
@direntry
* Autoconf: (autoconf). Create source code configuration scripts
@node Generic Typedefs, , Particular Typedefs, Typedefs
@subsection Generic Typedef Checks
-This macro is used to check for typedefs not covered by the particular
-test macros. This macro does not fit well with the rest of Autoconf,
-and its design will probably change in the future.
+These macros are used to check for typedefs not covered by the
+particular test macros.
+
+@defmac AC_CHECK_TYPES ((@var{type}, @dots{}), @ovar{action-if-found}, @ovar{action-if-not-found}, @ovar{includes})
+@maindex CHECK_TYPES
+For each given @var{type} that is defined by the @var{includes} (by
+default, @file{sys/types.h}, @file{stdlib.h}, and @file{stddef.h}),
+define @code{HAVE_@var{type}} (in all capitals). If
+@var{action-if-found} is given, it is additional shell code to execute
+when one of the header files is found. You can give it a value of
+@samp{break} to break out of the loop on the first match. If
+@var{action-if-not-found} is given, it is executed when one of the
+header files is not found.
+
+This macro uses m4 lists:
+@example
+AC_CHECK_TYPES((ptrdiff_t))
+AC_CHECK_TYPES((unsigned long long, uintmax_t))
+@end example
+
+@end defmac
-One of its main flaws is that missing types are not typedef'd, they are
-defined, which can lead to incompatible code in the case of pointer types.
-@defmac AC_CHECK_TYPE (@var{type}, @var{default} @r{[}, @var{includes}@r{]})
+The following macro does not fit well with the rest of Autoconf, and its
+design will probably change in the future. One of its main flaws is
+that missing types are not typedef'd, they are defined, which can lead
+to incompatible code in the case of pointer types.
+
+@defmac AC_CHECK_TYPE (@var{type}, @var{default}, @ovar{includes})
@maindex CHECK_TYPE
If the type @var{type} is not defined in @file{sys/types.h}, or
-@file{stdlib.h} or @file{stddef.h} if they exist, define it to be the
-C (or C++) builtin type @var{default}; e.g., @samp{short} or
-@samp{unsigned}. The default header files to search can be replaced
-by supplying the optional argument @var{includes}.
+@file{stdlib.h} or @file{stddef.h} if they exist, define it to be the C
+(or C++) builtin type @var{default}; e.g., @samp{short} or
+@samp{unsigned}. The default header files to search can be replaced by
+supplying the optional argument @var{includes}.
+
+This macro has a broken design. First, although it is a member of the
+@code{CHECK} clan, singular subfamily, it does more than just checking.
+Second, the replacement it performs is done via @samp{#define @var{type}
+@var{default}}, although a @samp{typedef} is expected. Therefore, in
+the future, this macro shall be removed or replaced. User are adviced
+to use @code{AC_CHECK_TYPES} preferably.
@end defmac
+
@node C Compiler Characteristics, Fortran 77 Compiler Characteristics, Typedefs, Existing Tests
@section C Compiler Characteristics
@c FIXME: What the heck is this macro doing here? Move it out of
@c the way, in its proper section!!!
-@defmac AC_CHECK_SIZEOF (@var{type} @r{[}, @var{cross-size}@r{[}, @var{includes}@r{]]})
+@defmac AC_CHECK_SIZEOF (@var{type}, @ovar{cross-size}, @ovar{includes})
@maindex CHECK_SIZEOF
Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or
C++) builtin type @var{type}, e.g. @samp{int} or @samp{char *}. If
])dnl
])
+
dnl AC_DEFUN(NAME, [REPLACED-FUNCTION, ARGUMENT, ]EXPANSION)
dnl --------------------------------------------------------
dnl Define a macro which automatically provides itself. Add machinery
dnl ### Generic structure checks
-dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER
-dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl [, INCLUDES ]]])
+dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
+dnl [INCLUDES])
dnl ---------------------------------------------------------
dnl AGGREGATE.MEMBER is for instance `struct passwd.pw_gecos', shell
dnl variables are not a valid argument.
])dnl AC_CHECK_MEMBER
-dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER...
-dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl [, INCLUDES ]]])
-dnl ---------------------------------------------------------
+dnl AC_CHECK_MEMBER((AGGREGATE.MEMBER, ...),
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]
+dnl [INCLUDES])
+dnl --------------------------------------------------------
+dnl The first argument is an m4 list. First because we want to
+dnl promote m4 list, and second because anyway there can be spaces
+dnl in some types (struct etc.).
AC_DEFUN(AC_CHECK_MEMBERS,
[m4_foreach([AC_Member], [$1],
[AC_SPECIALIZE([AC_CHECK_MEMBER], AC_Member,
dnl ### Checking for programs
-dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR
-dnl [, VALUE-IF-FOUND [, VALUE-IF-NOT-FOUND]
-dnl [, PATH [, REJECT]]])
-dnl ------------------------------------------------------
+dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR,
+dnl [VALUE-IF-FOUND], [VALUE-IF-NOT-FOUND],
+dnl [PATH], [REJECT])
+dnl -----------------------------------------------------
AC_DEFUN(AC_CHECK_PROG,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_VAR_POPDEF([ac_Header])dnl
])dnl AC_CHECK_HEADER
+
dnl AC_CHECK_HEADERS(HEADER-FILE...
dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl -------------------------------------------------------------
dnl Check if SYMBOL (a variable or a function) is declared.
AC_DEFUN([AC_CHECK_DECL],
[AC_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl
-AC_CACHE_CHECK([whether `$1' is declared], ac_Symbol,
+AC_CACHE_CHECK([whether $1 is declared], ac_Symbol,
[AC_TRY_COMPILE(m4_default([$4], [#include <stdio.h>
#ifdef HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
dnl ### Checking for typedefs
-dnl AC_CHECK_TYPE(TYPE, DEFAULT[, INCLUDES])
-dnl ----------------------------------------
-dnl FIXME: This is an extremely badly chosen name, since this
-dnl macro actually performs an AC_REPLACE_TYPE. Some day we
-dnl have to clean this up.
-AC_DEFUN(AC_CHECK_TYPE,
+dnl AC_CHECK_TYPE_INTERNAL(TYPE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
+dnl [INCLUDES])
+dnl ----------------------------------------------------------------------
+dnl Check whether the type TYPE is supported by the system, maybe via the
+dnl the provided includes. This macro implements the former task of
+dnl AC_CHECK_TYPE, with one big difference though: AC_CHECK_TYPE was
+dnl grepping in the headers, what led to many problems, BTW, until
+dnl the egrep expression was correct and did not given false positives.
+dnl Now, we try to compile a variable declaration. It is probably slower,
+dnl but it is *much* safer, and in addition, allows to check for types
+dnl defined by the compiler (e.g., unsigned long long), not only for
+dnl typedefs.
+dnl FIXME: This is *the* macro which ought to be named AC_CHECK_TYPE.
+AC_DEFUN(AC_CHECK_TYPE_INTERNAL,
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl
AC_CACHE_CHECK([for $1], ac_Type,
-[AC_EGREP_CPP(
-changequote(<<,>>)dnl
-<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
-changequote([,]),
-m4_default([$3], [#include <stdio.h>
+[AC_TRY_COMPILE(m4_default([$4
+], [#include <stdio.h>
#include <sys/types.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif
-]), AC_VAR_SET(ac_Type, yes), AC_VAR_SET(ac_Type, no))])
-AC_SHELL_IFELSE(test AC_VAR_GET(ac_Type) = yes,,
- [AC_DEFINE_UNQUOTED($1, $2,
- [Define to `$2' if <sys/types.h>
- does not define.])])dnl
+]),
+ [$1 foo;],
+ AC_VAR_SET(ac_Type, yes), AC_VAR_SET(ac_Type, no))])
+AC_SHELL_IFELSE(test AC_VAR_GET(ac_Type) = yes,
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Type])dnl
+])dnl AC_CHECK_TYPE_INTERNAL
+
+
+dnl AC_CHECK_TYPES(TYPES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [INCLUDES])
+dnl ---------------------------------------------------------------------------
+dnl TYPES is an m4 list.
+AC_DEFUN(AC_CHECK_TYPES,
+[m4_foreach([AC_Type], [$1],
+ [AC_SPECIALIZE([AC_CHECK_TYPE_INTERNAL], AC_Type,
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Type))
+$2]
+ [$3],
+ [$4])])])
+
+
+dnl AC_CHECK_TYPE(TYPE, DEFAULT, [INCLUDES])
+dnl ----------------------------------------
+dnl FIXME: This is an extremely badly chosen name, since this
+dnl macro actually performs an AC_REPLACE_TYPE. Some day we
+dnl have to clean this up. The macro AC_TYPE_PTRDIFF_T shows the
+dnl need for a checking only macro.
+AC_DEFUN(AC_CHECK_TYPE,
+[AC_CHECK_TYPE_INTERNAL([$1],,
+ [AC_DEFINE_UNQUOTED($1, $2)],
+ [$3])dnl
])dnl AC_CHECK_TYPE