Import the "pathmax" gnulib module.
authorPedro Alves <palves@redhat.com>
Mon, 1 Jul 2013 11:25:43 +0000 (11:25 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 1 Jul 2013 11:25:43 +0000 (11:25 +0000)
This imports the "pathmax" gnulib module, making PATH_MAX always
available on systems that have the notion of a constant max path limit
(i.e., practically everywhere except the Hurd), along with fixing a
couple broken systems --- see pathmax.h in the patch.

This means we can normalize on PATH_MAX throughout the tree (instead
of some places using MAXPATHLEN, or defining fallback constants
ourselves).

This is the just the importing step.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add pathmax.
* gnulib/Makefile.in (aclocal_m4_deps): Add import/m4/pathmax.m4.
* gnulib/aclocal.m4: Regenerate.
* gnulib/config.in: Regenerate.
* gnulib/configure: Regenerate.
* gnulib/import/pathmax.h: New file.
* gnulib/import/Makefile.am: Regenerate.
* gnulib/import/Makefile.in: Regenerate.
* gnulib/import/m4/gnulib-cache.m4: Regenerate.
* gnulib/import/m4/gnulib-comp.m4: Regenerate.
* gnulib/import/m4/pathmax.m4: New file.

12 files changed:
gdb/ChangeLog
gdb/gnulib/Makefile.in
gdb/gnulib/aclocal.m4
gdb/gnulib/config.in
gdb/gnulib/configure
gdb/gnulib/import/Makefile.am
gdb/gnulib/import/Makefile.in
gdb/gnulib/import/m4/gnulib-cache.m4
gdb/gnulib/import/m4/gnulib-comp.m4
gdb/gnulib/import/m4/pathmax.m4 [new file with mode: 0644]
gdb/gnulib/import/pathmax.h [new file with mode: 0644]
gdb/gnulib/update-gnulib.sh

index 5a21e6b6dd6e5c7526922652642ac38f6d9f41ee..2c71fdd7607819d20eaf39abf1b1566773260b48 100644 (file)
@@ -1,3 +1,17 @@
+2013-07-01  Pedro Alves  <palves@redhat.com>
+
+       * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add pathmax.
+       * gnulib/Makefile.in (aclocal_m4_deps): Add import/m4/pathmax.m4.
+       * gnulib/aclocal.m4: Regenerate.
+       * gnulib/config.in: Regenerate.
+       * gnulib/configure: Regenerate.
+       * gnulib/import/pathmax.h: New file.
+       * gnulib/import/Makefile.am: Regenerate.
+       * gnulib/import/Makefile.in: Regenerate.
+       * gnulib/import/m4/gnulib-cache.m4: Regenerate.
+       * gnulib/import/m4/gnulib-comp.m4: Regenerate.
+       * gnulib/import/m4/pathmax.m4: New file.
+
 2013-07-01  Pedro Alves  <palves@redhat.com>
 
        * configure.ac (GDBINIT): Define, depending on host.
index 727056c0cab949c0b94cb140fbd8d1d126c2029c..e3a8cbaf52afb60ade41a67494508aec5a6a38f7 100644 (file)
@@ -236,6 +236,7 @@ aclocal_m4_deps = \
        import/m4/mmap-anon.m4 \
        import/m4/multiarch.m4 \
        import/m4/off_t.m4 \
+       import/m4/pathmax.m4 \
        import/m4/ssize_t.m4 \
        import/m4/stdbool.m4 \
        import/m4/stddef_h.m4 \
index d98a4bb9853842b3c8d36ee481e9a6925f763523..40fc4409bb2e45fbf5d390178f1af6da87923dcb 100644 (file)
@@ -1049,6 +1049,7 @@ m4_include([import/m4/memmem.m4])
 m4_include([import/m4/mmap-anon.m4])
 m4_include([import/m4/multiarch.m4])
 m4_include([import/m4/off_t.m4])
+m4_include([import/m4/pathmax.m4])
 m4_include([import/m4/ssize_t.m4])
 m4_include([import/m4/stdbool.m4])
 m4_include([import/m4/stddef_h.m4])
index 9104de192dd87a20d750197abcd3c5198251ee16..66b2e3be55aa48e88383dfe66b7752fe7681683f 100644 (file)
 /* Define to 1 if you have the <sys/mman.h> header file. */
 #undef HAVE_SYS_MMAN_H
 
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
index da0a34809651c040532981f019189adb2253cea5..fc8a0901f2e418529a336763980f9617762a521b 100644 (file)
@@ -3003,6 +3003,7 @@ as_fn_append ac_func_list " mbsinit"
 as_fn_append ac_func_list " mbrtowc"
 as_fn_append ac_header_list " sys/mman.h"
 as_fn_append ac_func_list " mprotect"
+as_fn_append ac_header_list " sys/param.h"
 as_fn_append ac_header_list " features.h"
 as_fn_append ac_func_list " iswcntrl"
 # Check that the precious variables saved in the cache have kept the same
@@ -4735,6 +4736,7 @@ fi
   # Code from module memmem:
   # Code from module memmem-simple:
   # Code from module multiarch:
+  # Code from module pathmax:
   # Code from module snippet/arg-nonnull:
   # Code from module snippet/c++defs:
   # Code from module snippet/warn-on-use:
@@ -8990,6 +8992,8 @@ $as_echo "$gl_cv_func_memmem_works_always" >&6; }
   fi
   :
 
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
 if test "${ac_cv_header_stdbool_h+set}" = set; then :
@@ -12896,6 +12900,9 @@ $as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h
 
 
 
+
+
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
 $as_echo_n "checking for ssize_t... " >&6; }
 if test "${gt_cv_ssize_t+set}" = set; then :
index ac38ef6c8c31132274c32e9a3b0d9997579bcf2f..0c2f424d5fadebabbddc2ff27ca2ef87631c1dec 100644 (file)
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files fnmatch-gnu frexpl inttypes memmem unistd update-copyright
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files fnmatch-gnu frexpl inttypes memmem pathmax unistd update-copyright
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -674,6 +674,13 @@ EXTRA_libgnu_a_SOURCES += memmem.c
 
 ## end   gnulib module memmem-simple
 
+## begin gnulib module pathmax
+
+
+EXTRA_DIST += pathmax.h
+
+## end   gnulib module pathmax
+
 ## begin gnulib module snippet/arg-nonnull
 
 # The BUILT_SOURCES created by this Makefile snippet are not used via #include
index 0f377478d30a118e337baeb6ed439f0e94eec8e9..59c1c66d85a8c7cd2fa6e789f177dd6904201c03 100644 (file)
@@ -36,7 +36,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files fnmatch-gnu frexpl inttypes memmem unistd update-copyright
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files fnmatch-gnu frexpl inttypes memmem pathmax unistd update-copyright
 
 
 
@@ -100,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/import/m4/00gnulib.m4 \
        $(top_srcdir)/import/m4/mmap-anon.m4 \
        $(top_srcdir)/import/m4/multiarch.m4 \
        $(top_srcdir)/import/m4/off_t.m4 \
+       $(top_srcdir)/import/m4/pathmax.m4 \
        $(top_srcdir)/import/m4/ssize_t.m4 \
        $(top_srcdir)/import/m4/stdbool.m4 \
        $(top_srcdir)/import/m4/stddef_h.m4 \
@@ -937,7 +938,7 @@ EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h float.c \
        isnanl-nolibm.h isnanl.c config.charset ref-add.sin \
        ref-del.sin math.in.h mbrtowc.c mbsinit.c mbsrtowcs-impl.h \
        mbsrtowcs-state.c mbsrtowcs.c memchr.c memchr.valgrind \
-       memmem.c str-two-way.h \
+       memmem.c str-two-way.h pathmax.h \
        $(top_srcdir)/import/extra/snippet/arg-nonnull.h \
        $(top_srcdir)/import/extra/snippet/c++defs.h \
        $(top_srcdir)/import/extra/snippet/warn-on-use.h stdbool.in.h \
index 9cf71c92761a144233b60ef9797ab155082eb524..511df9cdd2fd894103be68f3ee37d31ad3f5bb0a 100644 (file)
@@ -27,7 +27,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files fnmatch-gnu frexpl inttypes memmem unistd update-copyright
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files fnmatch-gnu frexpl inttypes memmem pathmax unistd update-copyright
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
@@ -36,6 +36,7 @@ gl_MODULES([
   frexpl
   inttypes
   memmem
+  pathmax
   unistd
   update-copyright
 ])
index 8f151cbef38e0492c26e935a8c8ea0f3de674013..77c1b249e09db4bbc04d3d98ae42530eee5bb09b 100644 (file)
@@ -66,6 +66,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module memmem:
   # Code from module memmem-simple:
   # Code from module multiarch:
+  # Code from module pathmax:
   # Code from module snippet/arg-nonnull:
   # Code from module snippet/c++defs:
   # Code from module snippet/warn-on-use:
@@ -181,6 +182,7 @@ AC_DEFUN([gl_INIT],
   fi
   gl_STRING_MODULE_INDICATOR([memmem])
   gl_MULTIARCH
+  gl_PATHMAX
   gt_TYPE_SSIZE_T
   AM_STDBOOL_H
   gl_STDDEF_H
@@ -366,6 +368,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/memchr.c
   lib/memchr.valgrind
   lib/memmem.c
+  lib/pathmax.h
   lib/ref-add.sin
   lib/ref-del.sin
   lib/stdbool.in.h
@@ -419,6 +422,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/mmap-anon.m4
   m4/multiarch.m4
   m4/off_t.m4
+  m4/pathmax.m4
   m4/ssize_t.m4
   m4/stdbool.m4
   m4/stddef_h.m4
diff --git a/gdb/gnulib/import/m4/pathmax.m4 b/gdb/gnulib/import/m4/pathmax.m4
new file mode 100644 (file)
index 0000000..0117861
--- /dev/null
@@ -0,0 +1,42 @@
+# pathmax.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2012 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])
+])
diff --git a/gdb/gnulib/import/pathmax.h b/gdb/gnulib/import/pathmax.h
new file mode 100644 (file)
index 0000000..03db7cb
--- /dev/null
@@ -0,0 +1,83 @@
+/* Define PATH_MAX somehow.  Requires sys/types.h.
+   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2012 Free Software
+   Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _PATHMAX_H
+# define _PATHMAX_H
+
+/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename,
+   including the terminating NUL byte.
+   <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>
+   PATH_MAX is not defined on systems which have no limit on filename length,
+   such as GNU/Hurd.
+
+   This file does *not* define PATH_MAX always.  Programs that use this file
+   can handle the GNU/Hurd case in several ways:
+     - Either with a package-wide handling, or with a per-file handling,
+     - Either through a
+         #ifdef PATH_MAX
+       or through a fallback like
+         #ifndef PATH_MAX
+         # define PATH_MAX 8192
+         #endif
+       or through a fallback like
+         #ifndef PATH_MAX
+         # define PATH_MAX pathconf ("/", _PC_PATH_MAX)
+         #endif
+ */
+
+# include <unistd.h>
+
+# include <limits.h>
+
+# ifndef _POSIX_PATH_MAX
+#  define _POSIX_PATH_MAX 256
+# endif
+
+/* Don't include sys/param.h if it already has been.  */
+# 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
+/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename,
+   *not* including the terminating NUL byte, and is set to 1023.
+   Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is
+   not defined at all any more.  */
+#  undef PATH_MAX
+#  define PATH_MAX 1024
+# endif
+
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com,
+   section "Maximum Path Length Limitation",
+   <http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx#maxpath>
+   explains that the maximum size of a filename, including the terminating
+   NUL byte, is 260 = 3 + 256 + 1.
+   This is the same value as
+     - FILENAME_MAX in <stdio.h>,
+     - _MAX_PATH in <stdlib.h>,
+     - MAX_PATH in <windef.h>.
+   Undefine the original value, because mingw's <limits.h> gets it wrong.  */
+#  undef PATH_MAX
+#  define PATH_MAX 260
+# endif
+
+#endif /* _PATHMAX_H */
index 1653ad91046bbdef5d1ce06e61430a7f71223e1c..0b292ba2c076e14238efb07f49c7bc2b286df69a 100644 (file)
@@ -29,7 +29,7 @@
 #     regenerate the various scripts and Makefiles are on the PATH.
 
 # The list of gnulib modules we are importing in GDB.
-IMPORTED_GNULIB_MODULES="fnmatch-gnu frexpl inttypes memmem update-copyright unistd"
+IMPORTED_GNULIB_MODULES="fnmatch-gnu frexpl inttypes memmem update-copyright unistd pathmax"
 
 # The gnulib commit ID to use for the update.
 GNULIB_COMMIT_SHA1="8d5bd1402003bd0153984b138735adf537d960b0"
This page took 0.063468 seconds and 4 git commands to generate.