aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-01-31 22:04:34 -0800
committerPaul Eggert2012-01-31 22:04:34 -0800
commit6df372680c56c386edba7333490588fac1a3aa63 (patch)
treeabb631d2e744630ad6c34a85a4ca4b38897c3678
parent781acb9f3a3a02af4d9abd30af8f2ec379453f9d (diff)
downloademacs-6df372680c56c386edba7333490588fac1a3aa63.tar.gz
emacs-6df372680c56c386edba7333490588fac1a3aa63.zip
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.
-rw-r--r--ChangeLog14
-rw-r--r--Makefile.in2
-rw-r--r--lib/gnulib.mk11
-rw-r--r--lib/pathmax.h84
-rw-r--r--m4/gl-comp.m415
-rw-r--r--m4/pathmax.m442
6 files changed, 166 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index bc5b3fcd77e..731bd80d549 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
12012-02-01 Paul Eggert <eggert@cs.ucla.edu>
2
3 Port to older Solaris 10 versions (Bug#10677).
4 Bug reported by Chong Yidong for SunOS 5.10 Generic_127111-11 sparc.
5 I cannot reproduce it on SunOS 5.10 Generic_141444-09 sparc but
6 possibly this is because Sun fixed the 'stat' bug in my version.
7 * Makefile.in (GNULIB_TOOL_FLAGS): Do not avoid the pathmax module.
8 * lib/pathmax.h, m4/pathmax.m4: New files, from gnulib.
9 * lib/gnulib.mk, m4/gl-comp.m4: Regenerate.
10 These changes are based on gnulib version
11 4f11d6bebc3098c64ffde27079ab0d0cecfd0cdc dated 2011-10-07 20:59:10,
12 because Emacs is in feature freeze and we do not want to merge any
13 more-recent changes from gnulib.
14
12012-01-31 Glenn Morris <rgm@gnu.org> 152012-01-31 Glenn Morris <rgm@gnu.org>
2 16
3 * configure.in: Throw an explicit error if Motif toolkit was 17 * configure.in: Throw an explicit error if Motif toolkit was
diff --git a/Makefile.in b/Makefile.in
index f178a3aeb16..6c1f34bade4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -341,7 +341,7 @@ GNULIB_MODULES = \
341 mktime pthread_sigmask readlink \ 341 mktime pthread_sigmask readlink \
342 socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat 342 socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat
343GNULIB_TOOL_FLAGS = \ 343GNULIB_TOOL_FLAGS = \
344 --avoid=msvc-inval --avoid=msvc-nothrow --avoid=pathmax \ 344 --avoid=msvc-inval --avoid=msvc-nothrow \
345 --avoid=raise --avoid=threadlib \ 345 --avoid=raise --avoid=threadlib \
346 --conditional-dependencies --import --no-changelog --no-vc-files \ 346 --conditional-dependencies --import --no-changelog --no-vc-files \
347 --makefile-name=gnulib.mk 347 --makefile-name=gnulib.mk
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index 14010feb04b..154ae9882da 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -21,7 +21,7 @@
21# the same distribution terms as the rest of that program. 21# the same distribution terms as the rest of that program.
22# 22#
23# Generated by gnulib-tool. 23# Generated by gnulib-tool.
24# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=msvc-inval --avoid=msvc-nothrow --avoid=pathmax --avoid=raise --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat 24# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=msvc-inval --avoid=msvc-nothrow --avoid=raise --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat
25 25
26 26
27MOSTLYCLEANFILES += core *.stackdump 27MOSTLYCLEANFILES += core *.stackdump
@@ -258,6 +258,15 @@ EXTRA_libgnu_a_SOURCES += mktime.c
258 258
259## end gnulib module mktime 259## end gnulib module mktime
260 260
261## begin gnulib module pathmax
262
263if gl_GNULIB_ENABLED_pathmax
264
265endif
266EXTRA_DIST += pathmax.h
267
268## end gnulib module pathmax
269
261## begin gnulib module pthread_sigmask 270## begin gnulib module pthread_sigmask
262 271
263 272
diff --git a/lib/pathmax.h b/lib/pathmax.h
new file mode 100644
index 00000000000..c47618a1b6a
--- /dev/null
+++ b/lib/pathmax.h
@@ -0,0 +1,84 @@
1/* Define PATH_MAX somehow. Requires sys/types.h.
2 Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2011 Free Software
3 Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18
19#ifndef _PATHMAX_H
20# define _PATHMAX_H
21
22/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename,
23 including the terminating NUL byte.
24 <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>
25 PATH_MAX is not defined on systems which have no limit on filename length,
26 such as GNU/Hurd.
27
28 This file does *not* define PATH_MAX always. Programs that use this file
29 can handle the GNU/Hurd case in several ways:
30 - Either with a package-wide handling, or with a per-file handling,
31 - Either through a
32 #ifdef PATH_MAX
33 or through a fallback like
34 #ifndef PATH_MAX
35 # define PATH_MAX 8192
36 #endif
37 or through a fallback like
38 #ifndef PATH_MAX
39 # define PATH_MAX pathconf ("/", _PC_PATH_MAX)
40 #endif
41 */
42
43# include <unistd.h>
44
45# include <limits.h>
46
47# ifndef _POSIX_PATH_MAX
48# define _POSIX_PATH_MAX 256
49# endif
50
51/* Don't include sys/param.h if it already has been. */
52# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
53# include <sys/param.h>
54# endif
55
56# if !defined PATH_MAX && defined MAXPATHLEN
57# define PATH_MAX MAXPATHLEN
58# endif
59
60# ifdef __hpux
61/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename,
62 *not* including the terminating NUL byte, and is set to 1023.
63 Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is
64 not defined at all any more. */
65# undef PATH_MAX
66# define PATH_MAX 1024
67# endif
68
69# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
70/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com,
71 section "Maximum Path Length Limitation",
72 <http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx#maxpath>
73 explains that the maximum size of a filename, including the terminating
74 NUL byte, is 260 = 3 + 256 + 1.
75 This is the same value as
76 - FILENAME_MAX in <stdio.h>,
77 - _MAX_PATH in <stdlib.h>,
78 - MAX_PATH in <windef.h>.
79 Undefine the original value, because mingw's <limits.h> gets it wrong. */
80# undef PATH_MAX
81# define PATH_MAX 260
82# endif
83
84#endif /* _PATHMAX_H */
diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4
index 03cedf70af8..4894f840303 100644
--- a/m4/gl-comp.m4
+++ b/m4/gl-comp.m4
@@ -65,6 +65,7 @@ AC_DEFUN([gl_EARLY],
65 # Code from module mktime: 65 # Code from module mktime:
66 # Code from module multiarch: 66 # Code from module multiarch:
67 # Code from module nocrash: 67 # Code from module nocrash:
68 # Code from module pathmax:
68 # Code from module pthread_sigmask: 69 # Code from module pthread_sigmask:
69 # Code from module readlink: 70 # Code from module readlink:
70 # Code from module signal-h: 71 # Code from module signal-h:
@@ -217,6 +218,7 @@ AC_REQUIRE([AC_C_INLINE])
217gl_UNISTD_H 218gl_UNISTD_H
218 gl_gnulib_enabled_dosname=false 219 gl_gnulib_enabled_dosname=false
219 gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false 220 gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
221 gl_gnulib_enabled_pathmax=false
220 gl_gnulib_enabled_sigprocmask=false 222 gl_gnulib_enabled_sigprocmask=false
221 gl_gnulib_enabled_stat=false 223 gl_gnulib_enabled_stat=false
222 gl_gnulib_enabled_strtoll=false 224 gl_gnulib_enabled_strtoll=false
@@ -236,6 +238,13 @@ AC_SUBST([LTLIBINTL])
236 gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true 238 gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
237 fi 239 fi
238 } 240 }
241 func_gl_gnulib_m4code_pathmax ()
242 {
243 if ! $gl_gnulib_enabled_pathmax; then
244gl_PATHMAX
245 gl_gnulib_enabled_pathmax=true
246 fi
247 }
239 func_gl_gnulib_m4code_sigprocmask () 248 func_gl_gnulib_m4code_sigprocmask ()
240 { 249 {
241 if ! $gl_gnulib_enabled_sigprocmask; then 250 if ! $gl_gnulib_enabled_sigprocmask; then
@@ -262,6 +271,9 @@ gl_SYS_STAT_MODULE_INDICATOR([stat])
262 func_gl_gnulib_m4code_dosname 271 func_gl_gnulib_m4code_dosname
263 fi 272 fi
264 if test $REPLACE_STAT = 1; then 273 if test $REPLACE_STAT = 1; then
274 func_gl_gnulib_m4code_pathmax
275 fi
276 if test $REPLACE_STAT = 1; then
265 func_gl_gnulib_m4code_verify 277 func_gl_gnulib_m4code_verify
266 fi 278 fi
267 fi 279 fi
@@ -326,6 +338,7 @@ gl_STDLIB_MODULE_INDICATOR([strtoull])
326 m4_pattern_allow([^gl_GNULIB_ENABLED_]) 338 m4_pattern_allow([^gl_GNULIB_ENABLED_])
327 AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname]) 339 AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname])
328 AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) 340 AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
341 AM_CONDITIONAL([gl_GNULIB_ENABLED_pathmax], [$gl_gnulib_enabled_pathmax])
329 AM_CONDITIONAL([gl_GNULIB_ENABLED_sigprocmask], [$gl_gnulib_enabled_sigprocmask]) 342 AM_CONDITIONAL([gl_GNULIB_ENABLED_sigprocmask], [$gl_gnulib_enabled_sigprocmask])
330 AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat]) 343 AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat])
331 AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll]) 344 AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
@@ -502,6 +515,7 @@ AC_DEFUN([gl_FILE_LIST], [
502 lib/md5.h 515 lib/md5.h
503 lib/mktime-internal.h 516 lib/mktime-internal.h
504 lib/mktime.c 517 lib/mktime.c
518 lib/pathmax.h
505 lib/pthread_sigmask.c 519 lib/pthread_sigmask.c
506 lib/readlink.c 520 lib/readlink.c
507 lib/sha1.c 521 lib/sha1.c
@@ -552,6 +566,7 @@ AC_DEFUN([gl_FILE_LIST], [
552 m4/mktime.m4 566 m4/mktime.m4
553 m4/multiarch.m4 567 m4/multiarch.m4
554 m4/nocrash.m4 568 m4/nocrash.m4
569 m4/pathmax.m4
555 m4/pthread_sigmask.m4 570 m4/pthread_sigmask.m4
556 m4/readlink.m4 571 m4/readlink.m4
557 m4/sha1.m4 572 m4/sha1.m4
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 @@
1# pathmax.m4 serial 10
2dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
3dnl Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN([gl_PATHMAX],
9[
10 dnl Prerequisites of lib/pathmax.h.
11 AC_CHECK_HEADERS_ONCE([sys/param.h])
12])
13
14# Expands to a piece of C program that defines PATH_MAX in the same way as
15# "pathmax.h" will do.
16AC_DEFUN([gl_PATHMAX_SNIPPET], [[
17/* Arrange to define PATH_MAX, like "pathmax.h" does. */
18#if HAVE_UNISTD_H
19# include <unistd.h>
20#endif
21#include <limits.h>
22#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
23# include <sys/param.h>
24#endif
25#if !defined PATH_MAX && defined MAXPATHLEN
26# define PATH_MAX MAXPATHLEN
27#endif
28#ifdef __hpux
29# undef PATH_MAX
30# define PATH_MAX 1024
31#endif
32#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
33# undef PATH_MAX
34# define PATH_MAX 260
35#endif
36]])
37
38# Prerequisites of gl_PATHMAX_SNIPPET.
39AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
40[
41 AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
42])