New upstream version 1.9
[debian/gzip] / m4 / sys_types_h.m4
1 # sys_types_h.m4 serial 9
2 dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 AC_DEFUN_ONCE([gl_SYS_TYPES_H],
8 [
9   dnl Use sane struct stat types in OpenVMS 8.2 and later.
10   AC_DEFINE([_USE_STD_STAT], 1, [For standard stat data types on VMS.])
11
12   AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
13   gl_NEXT_HEADERS([sys/types.h])
14
15   dnl Ensure the type pid_t gets defined.
16   AC_REQUIRE([AC_TYPE_PID_T])
17
18   dnl Ensure the type mode_t gets defined.
19   AC_REQUIRE([AC_TYPE_MODE_T])
20
21   dnl Whether to override the 'off_t' type.
22   AC_REQUIRE([gl_TYPE_OFF_T])
23
24   dnl Whether to override the 'dev_t' and 'ino_t' types.
25   m4_ifdef([gl_WINDOWS_STAT_INODES], [
26     AC_REQUIRE([gl_WINDOWS_STAT_INODES])
27   ], [
28     WINDOWS_STAT_INODES=0
29   ])
30   AC_SUBST([WINDOWS_STAT_INODES])
31 ])
32
33 AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
34 [
35 ])
36
37 # This works around a buggy version in autoconf <= 2.69.
38 # See <https://lists.gnu.org/r/autoconf/2016-08/msg00014.html>
39
40 m4_version_prereq([2.70], [], [
41
42 # This is taken from the following Autoconf patch:
43 # https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=e17a30e987d7ee695fb4294a82d987ec3dc9b974
44
45 m4_undefine([AC_HEADER_MAJOR])
46 AC_DEFUN([AC_HEADER_MAJOR],
47 [AC_CHECK_HEADERS_ONCE([sys/types.h])
48 AC_CHECK_HEADER([sys/mkdev.h],
49   [AC_DEFINE([MAJOR_IN_MKDEV], [1],
50     [Define to 1 if `major', `minor', and `makedev' are declared in
51      <mkdev.h>.])])
52 if test $ac_cv_header_sys_mkdev_h = no; then
53   AC_CHECK_HEADER([sys/sysmacros.h],
54     [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
55       [Define to 1 if `major', `minor', and `makedev' are declared in
56        <sysmacros.h>.])])
57 fi
58 ])
59
60 ])