xfstests: Automatic build dependency calculations
[xfstests-dev.git] / m4 / package_types.m4
1
2 # Check if we have a type for the pointer's size integer (__psint_t)
3
4 AC_DEFUN([AC_TYPE_PSINT],
5   [ AC_MSG_CHECKING([for __psint_t ])
6     AC_TRY_COMPILE([
7 #include <sys/types.h>
8 #include <stdlib.h>
9 #include <stddef.h>
10     ], [
11          __psint_t  psint;
12     ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
13   ])
14
15
16 # Check if we have a type for the pointer's size unsigned (__psunsigned_t)
17
18 AC_DEFUN([AC_TYPE_PSUNSIGNED],
19   [ AC_MSG_CHECKING([for __psunsigned_t ])
20     AC_TRY_COMPILE([
21 #include <sys/types.h>
22 #include <stdlib.h>
23 #include <stddef.h>
24     ], [
25         __psunsigned_t  psuint;
26     ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
27   ])
28
29
30 # Check type sizes
31
32 AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG],
33   [ if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
34       AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
35     fi
36     AC_CHECK_SIZEOF(long, 4)
37     AC_CHECK_SIZEOF(char *, 4)
38     if test $ac_cv_sizeof_long -eq 4 -o $ac_cv_sizeof_long -eq 0; then
39       AC_DEFINE(HAVE_32BIT_LONG)
40     fi
41     if test $ac_cv_sizeof_long -eq 8; then
42       AC_DEFINE(HAVE_64BIT_LONG)
43     fi
44     if test $ac_cv_sizeof_char_p -eq 4 -o $ac_cv_sizeof_char_p -eq 0; then
45       AC_DEFINE(HAVE_32BIT_PTR)
46     fi
47     if test $ac_cv_sizeof_char_p -eq 8; then
48       AC_DEFINE(HAVE_64BIT_PTR)
49     fi
50   ])