summaryrefslogtreecommitdiff
path: root/m4/pathmax.m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-01-31 22:04:34 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-01-31 22:04:34 -0800
commit6df372680c56c386edba7333490588fac1a3aa63 (patch)
treeabb631d2e744630ad6c34a85a4ca4b38897c3678 /m4/pathmax.m4
parent781acb9f3a3a02af4d9abd30af8f2ec379453f9d (diff)
downloademacs-6df372680c56c386edba7333490588fac1a3aa63.tar.gz
Port to older Solaris 10 versions (Bug#10677).
Bug reported by Chong Yidong for SunOS 5.10 Generic_127111-11 sparc. I cannot reproduce it on SunOS 5.10 Generic_141444-09 sparc but possibly this is because Sun fixed the 'stat' bug in my version. * Makefile.in (GNULIB_TOOL_FLAGS): Do not avoid the pathmax module. * lib/pathmax.h, m4/pathmax.m4: New files, from gnulib. * lib/gnulib.mk, m4/gl-comp.m4: Regenerate. These changes are based on gnulib version 4f11d6bebc3098c64ffde27079ab0d0cecfd0cdc dated 2011-10-07 20:59:10, because Emacs is in feature freeze and we do not want to merge any more-recent changes from gnulib.
Diffstat (limited to 'm4/pathmax.m4')
-rw-r--r--m4/pathmax.m442
1 files changed, 42 insertions, 0 deletions
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
new file mode 100644
index 00000000000..4913fa06cb8
--- /dev/null
+++ b/m4/pathmax.m4
@@ -0,0 +1,42 @@
+# pathmax.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PATHMAX],
+[
+ dnl Prerequisites of lib/pathmax.h.
+ AC_CHECK_HEADERS_ONCE([sys/param.h])
+])
+
+# Expands to a piece of C program that defines PATH_MAX in the same way as
+# "pathmax.h" will do.
+AC_DEFUN([gl_PATHMAX_SNIPPET], [[
+/* Arrange to define PATH_MAX, like "pathmax.h" does. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <limits.h>
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+#ifdef __hpux
+# undef PATH_MAX
+# define PATH_MAX 1024
+#endif
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
+]])
+
+# Prerequisites of gl_PATHMAX_SNIPPET.
+AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
+[
+ AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
+])