sys_types_h.m4 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # sys_types_h.m4 serial 6
  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. AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
  9. gl_NEXT_HEADERS([sys/types.h])
  10. dnl Ensure the type pid_t gets defined.
  11. AC_REQUIRE([AC_TYPE_PID_T])
  12. dnl Ensure the type mode_t gets defined.
  13. AC_REQUIRE([AC_TYPE_MODE_T])
  14. dnl Whether to override the 'off_t' type.
  15. AC_REQUIRE([gl_TYPE_OFF_T])
  16. ])
  17. AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
  18. [
  19. ])
  20. # This works around a buggy version in autoconf <= 2.69.
  21. # See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html>
  22. m4_version_prereq([2.70], [], [
  23. # This is taken from the following Autoconf patch:
  24. # http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98
  25. m4_undefine([AC_HEADER_MAJOR])
  26. AC_DEFUN([AC_HEADER_MAJOR],
  27. [AC_CHECK_HEADERS_ONCE([sys/types.h])
  28. AC_CHECK_HEADER([sys/mkdev.h],
  29. [AC_DEFINE([MAJOR_IN_MKDEV], [1],
  30. [Define to 1 if `major', `minor', and `makedev' are declared in
  31. <mkdev.h>.])])
  32. if test $ac_cv_header_sys_mkdev_h = no; then
  33. AC_CHECK_HEADER([sys/sysmacros.h],
  34. [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
  35. [Define to 1 if `major', `minor', and `makedev' are declared in
  36. <sysmacros.h>.])])
  37. fi
  38. ])
  39. ])