pathmax.m4 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # pathmax.m4 serial 11
  2. dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation,
  3. dnl 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. AC_DEFUN([gl_PATHMAX],
  8. [
  9. dnl Prerequisites of lib/pathmax.h.
  10. AC_CHECK_HEADERS_ONCE([sys/param.h])
  11. ])
  12. # Expands to a piece of C program that defines PATH_MAX in the same way as
  13. # "pathmax.h" will do.
  14. AC_DEFUN([gl_PATHMAX_SNIPPET], [[
  15. /* Arrange to define PATH_MAX, like "pathmax.h" does. */
  16. #if HAVE_UNISTD_H
  17. # include <unistd.h>
  18. #endif
  19. #include <limits.h>
  20. #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
  21. # include <sys/param.h>
  22. #endif
  23. #if !defined PATH_MAX && defined MAXPATHLEN
  24. # define PATH_MAX MAXPATHLEN
  25. #endif
  26. #ifdef __hpux
  27. # undef PATH_MAX
  28. # define PATH_MAX 1024
  29. #endif
  30. #if defined _WIN32 && ! defined __CYGWIN__
  31. # undef PATH_MAX
  32. # define PATH_MAX 260
  33. #endif
  34. ]])
  35. # Prerequisites of gl_PATHMAX_SNIPPET.
  36. AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
  37. [
  38. AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
  39. ])