Blame gl/m4/pathmax.m4

Packit a4aae4
# pathmax.m4 serial 10
Packit a4aae4
dnl Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation,
Packit a4aae4
dnl Inc.
Packit a4aae4
dnl This file is free software; the Free Software Foundation
Packit a4aae4
dnl gives unlimited permission to copy and/or distribute it,
Packit a4aae4
dnl with or without modifications, as long as this notice is preserved.
Packit a4aae4
Packit a4aae4
AC_DEFUN([gl_PATHMAX],
Packit a4aae4
[
Packit a4aae4
  dnl Prerequisites of lib/pathmax.h.
Packit a4aae4
  AC_CHECK_HEADERS_ONCE([sys/param.h])
Packit a4aae4
])
Packit a4aae4
Packit a4aae4
# Expands to a piece of C program that defines PATH_MAX in the same way as
Packit a4aae4
# "pathmax.h" will do.
Packit a4aae4
AC_DEFUN([gl_PATHMAX_SNIPPET], [[
Packit a4aae4
/* Arrange to define PATH_MAX, like "pathmax.h" does. */
Packit a4aae4
#if HAVE_UNISTD_H
Packit a4aae4
# include <unistd.h>
Packit a4aae4
#endif
Packit a4aae4
#include <limits.h>
Packit a4aae4
#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
Packit a4aae4
# include <sys/param.h>
Packit a4aae4
#endif
Packit a4aae4
#if !defined PATH_MAX && defined MAXPATHLEN
Packit a4aae4
# define PATH_MAX MAXPATHLEN
Packit a4aae4
#endif
Packit a4aae4
#ifdef __hpux
Packit a4aae4
# undef PATH_MAX
Packit a4aae4
# define PATH_MAX 1024
Packit a4aae4
#endif
Packit a4aae4
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
Packit a4aae4
# undef PATH_MAX
Packit a4aae4
# define PATH_MAX 260
Packit a4aae4
#endif
Packit a4aae4
]])
Packit a4aae4
Packit a4aae4
# Prerequisites of gl_PATHMAX_SNIPPET.
Packit a4aae4
AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
Packit a4aae4
[
Packit a4aae4
  AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
Packit a4aae4
])