Debian Codegraph @

m4/sys_types_h.m4

raw
1 # sys_types_h.m4
2 # serial 15
3 dnl Copyright (C) 2011-2026 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7 dnl This file is offered as-is, without any warranty.
8
9 AC_DEFUN_ONCE([gl_SYS_TYPES_H],
10 [
11 AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
12
13 dnl Use sane struct stat types in OpenVMS 8.2 and later.
14 AC_DEFINE([_USE_STD_STAT], 1, [For standard stat data types on VMS.])
15
16 gl_NEXT_HEADERS([sys/types.h])
17
18 dnl Ensure the type pid_t gets defined.
19 AC_REQUIRE([AC_TYPE_PID_T])
20
21 dnl Ensure the type mode_t gets defined.
22 AC_REQUIRE([AC_TYPE_MODE_T])
23
24 dnl Whether to override the 'off_t' type.
25 AC_REQUIRE([gl_TYPE_OFF_T])
26
27 dnl Whether to define the 'off64_t' type.
28 AC_REQUIRE([gl_TYPE_OFF64_T])
29
30 dnl Whether to override the 'dev_t' and 'ino_t' types.
31 m4_ifdef([gl_WINDOWS_STAT_INODES], [
32 AC_REQUIRE([gl_WINDOWS_STAT_INODES])
33 ], [
34 WINDOWS_STAT_INODES=0
35 ])
36 AC_SUBST([WINDOWS_STAT_INODES])
37
38 dnl Test whether the 'blksize_t' type is defined.
39 AC_CHECK_TYPE([blksize_t], [HAVE_BLKSIZE_T=1], [HAVE_BLKSIZE_T=0])
40 AC_SUBST([HAVE_BLKSIZE_T])
41
42 dnl Test whether the 'blkcnt_t' type is defined.
43 AC_CHECK_TYPE([blkcnt_t], [HAVE_BLKCNT_T=1], [HAVE_BLKCNT_T=0])
44 AC_SUBST([HAVE_BLKCNT_T])
45 ])
46
47 # Initializes the default values for AC_SUBSTed shell variables.
48 # This macro must not be AC_REQUIREd. It must only be invoked, and only
49 # outside of macros or in macros that are not AC_REQUIREd.
50 AC_DEFUN([gl_SYS_TYPES_H_REQUIRE_DEFAULTS],
51 [
52 m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS], [
53 ])
54 m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS])
55 AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
56 ])
57
58 AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
59 [
60 ])
61
62 # This works around a buggy version in autoconf <= 2.69.
63 # See <https://lists.gnu.org/r/autoconf/2016-08/msg00014.html>
64 # The 2.70 version isn't quoted properly, so override it too.
65
66 m4_version_prereq([2.70.1], [], [
67
68 m4_undefine([AC_HEADER_MAJOR])
69 AC_DEFUN([AC_HEADER_MAJOR],
70 [AC_CHECK_HEADERS_ONCE([sys/types.h])
71 AC_CHECK_HEADER([sys/mkdev.h],
72 [AC_DEFINE([MAJOR_IN_MKDEV], [1],
73 [Define to 1 if `major', `minor', and `makedev' are
74 declared in <mkdev.h>.])])
75 if test $ac_cv_header_sys_mkdev_h = no; then
76 AC_CHECK_HEADER([sys/sysmacros.h],
77 [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
78 [Define to 1 if `major', `minor', and `makedev'
79 are declared in <sysmacros.h>.])])
80 fi
81 ])# AC_HEADER_MAJOR
82
83 ])