sys_types_h.m4 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # sys_types_h.m4 serial 8
  2. dnl Copyright (C) 2011-2017 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. AC_DEFUN_ONCE([gl_SYS_TYPES_H],
  7. [
  8. dnl Use sane struct stat types in OpenVMS 8.2 and later.
  9. AC_DEFINE([_USE_STD_STAT], 1, [For standard stat data types on VMS.])
  10. AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
  11. gl_NEXT_HEADERS([sys/types.h])
  12. dnl Ensure the type pid_t gets defined.
  13. AC_REQUIRE([AC_TYPE_PID_T])
  14. dnl Ensure the type mode_t gets defined.
  15. AC_REQUIRE([AC_TYPE_MODE_T])
  16. dnl Whether to override the 'off_t' type.
  17. AC_REQUIRE([gl_TYPE_OFF_T])
  18. dnl Whether to override the 'dev_t' and 'ino_t' types.
  19. m4_ifdef([gl_WINDOWS_STAT_INODES], [
  20. AC_REQUIRE([gl_WINDOWS_STAT_INODES])
  21. ], [
  22. WINDOWS_STAT_INODES=0
  23. ])
  24. AC_SUBST([WINDOWS_STAT_INODES])
  25. ])
  26. AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
  27. [
  28. ])
  29. # This works around a buggy version in autoconf <= 2.69.
  30. # See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html>
  31. m4_version_prereq([2.70], [], [
  32. # This is taken from the following Autoconf patch:
  33. # http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98
  34. m4_undefine([AC_HEADER_MAJOR])
  35. AC_DEFUN([AC_HEADER_MAJOR],
  36. [AC_CHECK_HEADERS_ONCE([sys/types.h])
  37. AC_CHECK_HEADER([sys/mkdev.h],
  38. [AC_DEFINE([MAJOR_IN_MKDEV], [1],
  39. [Define to 1 if `major', `minor', and `makedev' are declared in
  40. <mkdev.h>.])])
  41. if test $ac_cv_header_sys_mkdev_h = no; then
  42. AC_CHECK_HEADER([sys/sysmacros.h],
  43. [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
  44. [Define to 1 if `major', `minor', and `makedev' are declared in
  45. <sysmacros.h>.])])
  46. fi
  47. ])
  48. ])