1 dnl AC_CHECK_SIZEOF_SYSTYPE is as the standard AC_CHECK_SIZEOF macro
2 dnl but also capable of checking the size of system defined types, not
3 dnl only compiler defined types.
5 dnl AC_CHECK_SYSTYPE is the same thing but replacing AC_CHECK_TYPE
6 dnl However AC_CHECK_TYPE is not by far as limited as AC_CHECK_SIZEOF
7 dnl (it at least makes use of <sys/types.h>, <stddef.h> and <stdlib.h>)
9 dnl AC_CHECK_SIZEOF_SYSTYPE(TYPE [, CROSS-SIZE])
10 AC_DEFUN(AC_CHECK_SIZEOF_SYSTYPE,
11 [changequote(<<, >>)dnl
12 dnl The name to #define.
13 define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
14 dnl The cache variable name.
15 define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
17 AC_MSG_CHECKING(size of $1)
18 AC_CACHE_VAL(AC_CV_NAME,
29 #include <sys/types.h>
31 #if HAVE_SYS_BITYPES_H
32 #include <sys/bitypes.h>
36 FILE *f=fopen("conftestval", "w");
38 fprintf(f, "%d\n", sizeof($1));
41 ], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
42 AC_MSG_RESULT($AC_CV_NAME)
43 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
44 undefine([AC_TYPE_NAME])dnl
45 undefine([AC_CV_NAME])dnl
48 dnl AC_CHECK_SYSTYPE(TYPE, DEFAULT)
49 AC_DEFUN(AC_CHECK_SYSTYPE,
50 [AC_REQUIRE([AC_HEADER_STDC])dnl
51 AC_MSG_CHECKING(for $1)
52 AC_CACHE_VAL(ac_cv_type_$1,
55 <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
57 /* What a mess.. many systems have added the (now standard) bit types
58 * in their own ways, so we need to scan a wide variety of headers to
61 #include <sys/types.h>
70 #include <sys/types.h>
72 #if HAVE_SYS_BITYPES_H
73 #include <sys/bitypes.h>
75 ], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
76 AC_MSG_RESULT($ac_cv_type_$1)
77 if test $ac_cv_type_$1 = no; then