diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-01-31 22:04:34 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-01-31 22:04:34 -0800 |
commit | 6df372680c56c386edba7333490588fac1a3aa63 (patch) | |
tree | abb631d2e744630ad6c34a85a4ca4b38897c3678 /m4 | |
parent | 781acb9f3a3a02af4d9abd30af8f2ec379453f9d (diff) | |
download | emacs-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')
-rw-r--r-- | m4/gl-comp.m4 | 15 | ||||
-rw-r--r-- | m4/pathmax.m4 | 42 |
2 files changed, 57 insertions, 0 deletions
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], # Code from module mktime: # Code from module multiarch: # Code from module nocrash: + # Code from module pathmax: # Code from module pthread_sigmask: # Code from module readlink: # Code from module signal-h: @@ -217,6 +218,7 @@ AC_REQUIRE([AC_C_INLINE]) gl_UNISTD_H gl_gnulib_enabled_dosname=false gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false + gl_gnulib_enabled_pathmax=false gl_gnulib_enabled_sigprocmask=false gl_gnulib_enabled_stat=false gl_gnulib_enabled_strtoll=false @@ -236,6 +238,13 @@ AC_SUBST([LTLIBINTL]) gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true fi } + func_gl_gnulib_m4code_pathmax () + { + if ! $gl_gnulib_enabled_pathmax; then +gl_PATHMAX + gl_gnulib_enabled_pathmax=true + fi + } func_gl_gnulib_m4code_sigprocmask () { if ! $gl_gnulib_enabled_sigprocmask; then @@ -262,6 +271,9 @@ gl_SYS_STAT_MODULE_INDICATOR([stat]) func_gl_gnulib_m4code_dosname fi if test $REPLACE_STAT = 1; then + func_gl_gnulib_m4code_pathmax + fi + if test $REPLACE_STAT = 1; then func_gl_gnulib_m4code_verify fi fi @@ -326,6 +338,7 @@ gl_STDLIB_MODULE_INDICATOR([strtoull]) m4_pattern_allow([^gl_GNULIB_ENABLED_]) AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname]) AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_pathmax], [$gl_gnulib_enabled_pathmax]) AM_CONDITIONAL([gl_GNULIB_ENABLED_sigprocmask], [$gl_gnulib_enabled_sigprocmask]) AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat]) AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll]) @@ -502,6 +515,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/md5.h lib/mktime-internal.h lib/mktime.c + lib/pathmax.h lib/pthread_sigmask.c lib/readlink.c lib/sha1.c @@ -552,6 +566,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/mktime.m4 m4/multiarch.m4 m4/nocrash.m4 + m4/pathmax.m4 m4/pthread_sigmask.m4 m4/readlink.m4 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 @@ +# 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]) +]) |