]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - m4/package_types.m4
xfsprogs: extend fiemap configure check
[thirdparty/xfsprogs-dev.git] / m4 / package_types.m4
CommitLineData
16c44ed2
NS
1#
2# Check if we have a type for the pointer's size integer (__psint_t)
3#
4AC_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#
18AC_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
7413a3b2
TS
29#
30# Check if we have a type for __u32
31#
32AC_DEFUN([AC_TYPE_U32],
33 [ AC_MSG_CHECKING([for __u32 ])
34 AC_TRY_COMPILE([
35#include <asm/types.h>
36#include <stdlib.h>
37#include <stddef.h>
38 ], [
39 __u32 u32;
be609724 40 ], AC_DEFINE(HAVE___U32) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
7413a3b2
TS
41 ])
42
16c44ed2
NS
43#
44# Check type sizes
45#
46AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG],
47 [ if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
48 AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
49 fi
50 AC_CHECK_SIZEOF(long, 4)
51 AC_CHECK_SIZEOF(char *, 4)
a1be3ba1 52 if test $ac_cv_sizeof_long -eq 4 -o $ac_cv_sizeof_long -eq 0; then
16c44ed2
NS
53 AC_DEFINE(HAVE_32BIT_LONG)
54 fi
55 if test $ac_cv_sizeof_long -eq 8; then
56 AC_DEFINE(HAVE_64BIT_LONG)
57 fi
a1be3ba1 58 if test $ac_cv_sizeof_char_p -eq 4 -o $ac_cv_sizeof_char_p -eq 0; then
16c44ed2
NS
59 AC_DEFINE(HAVE_32BIT_PTR)
60 fi
61 if test $ac_cv_sizeof_char_p -eq 8; then
62 AC_DEFINE(HAVE_64BIT_PTR)
63 fi
64 ])