cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/m4 ChangeLog _inttypes_h.m4 dirname.m4 dos...


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/m4 ChangeLog _inttypes_h.m4 dirname.m4 dos...
Date: Thu, 06 Jul 2006 02:20:19 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     06/07/06 02:20:19

Modified files:
        m4             : ChangeLog _inttypes_h.m4 dirname.m4 dos.m4 
                         ftruncate.m4 getcwd-path-max.m4 getcwd.m4 
                         gnulib-comp.m4 onceonly_2_57.m4 stdint.m4 
                         sys_stat_h.m4 
Added files:
        m4             : absolute-header.m4 double-slash-root.m4 
                         getcwd-abort-bug.m4 strndup.m4 strnlen.m4 
                         xstrndup.m4 
Removed files:
        m4             : full-header-path.m4 

Log message:
        * absolute-header.m4, double-slash-root.m4, getcwd-abort-bug.m4,
        strndup.m4, strnlen.m4, xstrndup.m4: New files from GNULIB.
        * full-header-path.m4: Remove file.
        * _inttypes_h.m4, dirname.m4, dos.m4, ftruncate.m4, getcwd-path-max.m4,
        getcwd.m4, gnulib-comp.m4, onceonly_2_57.m4, stdint.m4, sys_stat_h.m4:
        Update from GNULIB.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/ChangeLog?cvsroot=cvs&r1=1.180&r2=1.181
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/_inttypes_h.m4?cvsroot=cvs&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/dirname.m4?cvsroot=cvs&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/dos.m4?cvsroot=cvs&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/ftruncate.m4?cvsroot=cvs&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/getcwd-path-max.m4?cvsroot=cvs&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/getcwd.m4?cvsroot=cvs&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/gnulib-comp.m4?cvsroot=cvs&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/onceonly_2_57.m4?cvsroot=cvs&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/stdint.m4?cvsroot=cvs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/sys_stat_h.m4?cvsroot=cvs&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/absolute-header.m4?cvsroot=cvs&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/double-slash-root.m4?cvsroot=cvs&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/getcwd-abort-bug.m4?cvsroot=cvs&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/strndup.m4?cvsroot=cvs&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/strnlen.m4?cvsroot=cvs&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/xstrndup.m4?cvsroot=cvs&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ccvs/m4/full-header-path.m4?cvsroot=cvs&r1=1.4&r2=0

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/ChangeLog,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -b -r1.180 -r1.181
--- ChangeLog   3 Jul 2006 02:12:34 -0000       1.180
+++ ChangeLog   6 Jul 2006 02:20:19 -0000       1.181
@@ -1,3 +1,12 @@
+2006-07-05  Derek Price  <address@hidden>
+
+       * absolute-header.m4, double-slash-root.m4, getcwd-abort-bug.m4,
+       strndup.m4, strnlen.m4, xstrndup.m4: New files from GNULIB.
+       * full-header-path.m4: Remove file.
+       * _inttypes_h.m4, dirname.m4, dos.m4, ftruncate.m4, getcwd-path-max.m4,
+       getcwd.m4, gnulib-comp.m4, onceonly_2_57.m4, stdint.m4, sys_stat_h.m4:
+       Update from GNULIB.
+
 2006-07-02  Derek Price  <address@hidden>
 
        * longlong.m4, stdint.m4, ulonglong.m4, wcwidth.m4: Update from GNULIB.

Index: _inttypes_h.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/_inttypes_h.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- _inttypes_h.m4      13 May 2006 20:47:48 -0000      1.2
+++ _inttypes_h.m4      6 Jul 2006 02:20:19 -0000       1.3
@@ -1,4 +1,4 @@
-# _inttypes_h.m4 serial 2
+# _inttypes_h.m4 serial 3
 dnl Copyright (C) 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,7 +10,7 @@
 [AC_REQUIRE([gl_INCLUDE_NEXT])dnl
 AC_LIBSOURCES([inttypes.h])
 if test $gl_cv_have_include_next = no; then
-  gl_FULL_HEADER_PATH([inttypes.h])
+  gl_ABSOLUTE_HEADER([inttypes.h])
 fi
 AC_CHECK_DECLS_ONCE([strtoimax strtoumax])dnl
 ])

Index: dirname.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/dirname.m4,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- dirname.m4  23 Mar 2005 00:04:29 -0000      1.4
+++ dirname.m4  6 Jul 2006 02:20:19 -0000       1.5
@@ -1,5 +1,5 @@
-# dirname.m4 serial 5
-dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#serial 6   -*- autoconf -*-
+dnl Copyright (C) 2002-2006 Free Software Foundation, 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.
@@ -11,6 +11,7 @@
 
   dnl Prerequisites of lib/dirname.h.
   AC_REQUIRE([gl_AC_DOS])
+  AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
 
   dnl No prerequisites of lib/basename.c, lib/dirname.c, lib/stripslash.c.
 ])

Index: dos.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/dos.m4,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- dos.m4      1 Mar 2005 18:15:07 -0000       1.4
+++ dos.m4      6 Jul 2006 02:20:19 -0000       1.5
@@ -1,9 +1,9 @@
-#serial 9
+#serial 10   -*- autoconf -*-
 
 # Define some macros required for proper operation of code in lib/*.c
 # on MSDOS/Windows systems.
 
-# Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -25,19 +25,27 @@
     if test x"$ac_cv_win_or_dos" = xyes; then
       ac_fs_accepts_drive_letter_prefix=1
       ac_fs_backslash_is_file_name_separator=1
+      AC_CACHE_CHECK([whether drive letter can start relative path],
+                    [ac_cv_drive_letter_can_be_relative],
+       [
+         AC_TRY_COMPILE([],
+         [#if defined __CYGWIN__
+drive letters are always absolute
+#endif],
+         [ac_cv_drive_letter_can_be_relative=yes],
+         [ac_cv_drive_letter_can_be_relative=no])
+       ])
+      if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
+       ac_fs_drive_letter_can_be_relative=1
+      else
+       ac_fs_drive_letter_can_be_relative=0
+      fi
     else
       ac_fs_accepts_drive_letter_prefix=0
       ac_fs_backslash_is_file_name_separator=0
+      ac_fs_drive_letter_can_be_relative=0
     fi
 
-    AH_VERBATIM(FILE_SYSTEM_PREFIX_LEN,
-    [#if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
-# define FILE_SYSTEM_PREFIX_LEN(Filename) \
-  ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
-#else
-# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
-#endif])
-
     AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
       $ac_fs_accepts_drive_letter_prefix,
       [Define on systems for which file names may have a so-called
@@ -55,4 +63,9 @@
       $ac_fs_backslash_is_file_name_separator,
       [Define if the backslash character may also serve as a file name
        component separator.])
+
+    AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE],
+      $ac_fs_drive_letter_can_be_relative,
+      [Define if a drive letter prefix denotes a relative path if it is
+       not followed by a file name component separator.])
   ])

Index: ftruncate.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/ftruncate.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- ftruncate.m4        4 Oct 2005 02:33:12 -0000       1.2
+++ ftruncate.m4        6 Jul 2006 02:20:19 -0000       1.3
@@ -1,17 +1,29 @@
-#serial 8
+#serial 9
 
 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
 
-# Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003-2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# FIXME: remove this macro, along with all uses of HAVE_FTRUNCATE in 2007,
+# if the check below provokes no reports.
+
 AC_DEFUN([gl_FUNC_FTRUNCATE],
 [
   AC_REPLACE_FUNCS(ftruncate)
   if test $ac_cv_func_ftruncate = no; then
     gl_PREREQ_FTRUNCATE
+    # If someone lacks ftruncate, make configure fail, and request
+    # a bug report to inform us about it.
+    if test x"$SKIP_FTRUNCATE_CHECK" != xyes; then
+      AC_MSG_FAILURE([Your system lacks the ftruncate function.
+         Please report this, along with the output of "uname -a", to the
+         address@hidden mailing list.  To continue past this point,
+         rerun configure with SKIP_FTRUNCATE_CHECK=yes set in the environment.
+         E.g., env SKIP_FTRUNCATE_CHECK=yes ./configure])
+    fi
   fi
 ])
 

Index: getcwd-path-max.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/getcwd-path-max.m4,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- getcwd-path-max.m4  25 Apr 2006 14:50:23 -0000      1.5
+++ getcwd-path-max.m4  6 Jul 2006 02:20:19 -0000       1.6
@@ -1,4 +1,4 @@
-#serial 11
+#serial 12
 # Check for several getcwd bugs with long file names.
 # If so, arrange to compile the wrapper function.
 
@@ -157,8 +157,8 @@
   {
     size_t i;
 
-    /* Unlink first, in case the chdir failed.  */
-    unlink (DIR_NAME);
+    /* Try rmdir first, in case the chdir failed.  */
+    rmdir (DIR_NAME);
     for (i = 0; i <= n_chdirs; i++)
       {
        if (chdir ("..") < 0)

Index: getcwd.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/getcwd.m4,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- getcwd.m4   4 Oct 2005 02:33:12 -0000       1.5
+++ getcwd.m4   6 Jul 2006 02:20:19 -0000       1.6
@@ -1,6 +1,6 @@
 # getcwd.m4 - check for working getcwd that is compatible with glibc
 
-# Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -40,12 +40,15 @@
 [
   AC_REQUIRE([gl_FUNC_GETCWD_NULL])
 
+  gl_abort_bug=no
   case $gl_cv_func_getcwd_null in
-  yes) gl_FUNC_GETCWD_PATH_MAX;;
+  yes)
+    gl_FUNC_GETCWD_PATH_MAX
+    gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes]);;
   esac
 
-  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max in
-  yes,yes) ;;
+  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in
+  yes,yes,no) ;;
   *)
     AC_LIBOBJ([getcwd])
     AC_DEFINE([__GETCWD_PREFIX], [[rpl_]],

Index: gnulib-comp.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/gnulib-comp.m4,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- gnulib-comp.m4      30 Jun 2006 02:00:15 -0000      1.18
+++ gnulib-comp.m4      6 Jul 2006 02:20:19 -0000       1.19
@@ -103,6 +103,8 @@
   gl_FUNC_STRDUP
   gl_FUNC_STRERROR
   gl_FUNC_GNU_STRFTIME
+  gl_FUNC_STRNDUP
+  gl_FUNC_STRNLEN
   gl_FUNC_STRSTR
   gl_FUNC_STRTOIMAX
   gl_FUNC_STRTOL
@@ -125,6 +127,7 @@
   gl_XGETCWD
   gl_XREADLINK
   gl_XSIZE
+  gl_XSTRNDUP
   gl_YESNO
 ])
 
@@ -256,6 +259,7 @@
   lib/regexec.c
   lib/rename.c
   lib/rpmatch.c
+  lib/same-inode.h
   lib/save-cwd.c
   lib/save-cwd.h
   lib/setenv.c
@@ -275,6 +279,10 @@
   lib/strftime.h
   lib/stripslash.c
   lib/strncasecmp.c
+  lib/strndup.c
+  lib/strndup.h
+  lib/strnlen.c
+  lib/strnlen.h
   lib/strnlen1.c
   lib/strnlen1.h
   lib/strstr.c
@@ -309,9 +317,12 @@
   lib/xreadlink.c
   lib/xreadlink.h
   lib/xsize.h
+  lib/xstrndup.c
+  lib/xstrndup.h
   lib/yesno.c
   lib/yesno.h
   m4/_inttypes_h.m4
+  m4/absolute-header.m4
   m4/alloca.m4
   m4/allocsa.m4
   m4/atexit.m4
@@ -327,6 +338,7 @@
   m4/d-type.m4
   m4/dirname.m4
   m4/dos.m4
+  m4/double-slash-root.m4
   m4/dup2.m4
   m4/eealloc.m4
   m4/eoverflow.m4
@@ -338,8 +350,8 @@
   m4/fnmatch.m4
   m4/fpending.m4
   m4/ftruncate.m4
-  m4/full-header-path.m4
   m4/getaddrinfo.m4
+  m4/getcwd-abort-bug.m4
   m4/getcwd-path-max.m4
   m4/getcwd.m4
   m4/getdate.m4
@@ -420,6 +432,8 @@
   m4/strerror.m4
   m4/strerror_r.m4
   m4/strftime.m4
+  m4/strndup.m4
+  m4/strnlen.m4
   m4/strstr.m4
   m4/strtoimax.m4
   m4/strtol.m4
@@ -447,5 +461,6 @@
   m4/xgetcwd.m4
   m4/xreadlink.m4
   m4/xsize.m4
+  m4/xstrndup.m4
   m4/yesno.m4
 ])

Index: onceonly_2_57.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/onceonly_2_57.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- onceonly_2_57.m4    12 Aug 2005 20:57:46 -0000      1.2
+++ onceonly_2_57.m4    6 Jul 2006 02:20:19 -0000       1.3
@@ -1,5 +1,5 @@
-# onceonly_2_57.m4 serial 3
-dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
+# onceonly_2_57.m4 serial 4
+dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
@@ -10,7 +10,7 @@
 dnl   AC_CHECK_HEADERS_ONCE         like  AC_CHECK_HEADERS
 dnl   AC_CHECK_FUNCS_ONCE           like  AC_CHECK_FUNCS
 dnl   AC_CHECK_DECLS_ONCE           like  AC_CHECK_DECLS
-dnl   AC_REQUIRE([AC_HEADER_STDC])  like  AC_HEADER_STDC
+dnl   AC_REQUIRE([AC_FUNC_STRCOLL])  like  AC_FUNC_STRCOLL
 dnl The advantage is that the check for each of the headers/functions/decls
 dnl will be put only once into the 'configure' file. It keeps the size of
 dnl the 'configure' file down, and avoids redundant output when 'configure'

Index: stdint.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/stdint.m4,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- stdint.m4   3 Jul 2006 02:12:35 -0000       1.12
+++ stdint.m4   6 Jul 2006 02:20:19 -0000       1.13
@@ -1,4 +1,4 @@
-# stdint.m4 serial 13
+# stdint.m4 serial 14
 dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -49,9 +49,9 @@
 
   dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_stdint_h.
   if test $ac_cv_header_stdint_h = yes; then
-    gl_FULL_HEADER_PATH([stdint.h])
-    FULL_PATH_STDINT_H="<$gl_cv_full_path_stdint_h>"
-    AC_SUBST([FULL_PATH_STDINT_H])
+    gl_ABSOLUTE_HEADER([stdint.h])
+    ABSOLUTE_STDINT_H="<$gl_cv_absolute_stdint_h>"
+    AC_SUBST([ABSOLUTE_STDINT_H])
     HAVE_STDINT_H=1
   else
     HAVE_STDINT_H=0
@@ -59,7 +59,7 @@
   AC_SUBST([HAVE_STDINT_H])
 
   dnl Now see whether we need a substitute <stdint.h>.  Use
-  dnl FULL_PATH_STDINT_H, not <stdint.h>, so that it also works during
+  dnl ABSOLUTE_STDINT_H, not <stdint.h>, so that it also works during
   dnl a "config.status --recheck" if a stdint.h has been
   dnl created in the build directory.
   if test $ac_cv_header_stdint_h = yes; then
@@ -70,7 +70,7 @@
         AC_LANG_PROGRAM([[
 #include <stddef.h>
 #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#include FULL_PATH_STDINT_H
+#include ABSOLUTE_STDINT_H
 #ifdef INT8_MAX
 int8_t a1 = INT8_MAX;
 #endif

Index: sys_stat_h.m4
===================================================================
RCS file: /cvsroot/cvs/ccvs/m4/sys_stat_h.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- sys_stat_h.m4       1 Jul 2006 12:58:08 -0000       1.2
+++ sys_stat_h.m4       6 Jul 2006 02:20:19 -0000       1.3
@@ -1,4 +1,4 @@
-# sys_stat_h.m4 serial 1   -*- Autoconf -*-
+# sys_stat_h.m4 serial 2   -*- Autoconf -*-
 dnl Copyright (C) 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,11 +19,11 @@
 
   SYS_STAT_H=
   if test $ac_cv_func_lstat:$ac_cv_have_decl_mkdir != yes:yes ; then
-    gl_FULL_HEADER_PATH([sys/stat.h])
-    FULL_PATH_SYS_STAT_H='<'$gl_cv_full_path_sys_stat_h'>'
+    gl_ABSOLUTE_HEADER([sys/stat.h])
+    ABSOLUTE_SYS_STAT_H="<$gl_cv_absolute_sys_stat_h>"
     AC_CHECK_HEADERS([io.h])
     AC_REQUIRE([AC_C_INLINE])
-    AC_SUBST([FULL_PATH_SYS_STAT_H])
+    AC_SUBST([ABSOLUTE_SYS_STAT_H])
     SYS_STAT_H='sys/stat.h'
   fi
   AC_SUBST([SYS_STAT_H])

Index: absolute-header.m4
===================================================================
RCS file: absolute-header.m4
diff -N absolute-header.m4
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ absolute-header.m4  6 Jul 2006 02:20:19 -0000       1.1
@@ -0,0 +1,43 @@
+# absolute-header.m4 serial 4
+dnl Copyright (C) 2006 Free Software Foundation, 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.
+
+dnl From Derek Price.
+
+# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
+# ---------------------------------------
+# Find the absolute name of a header file, assuming the header exists.
+# If the header were sys/inttypes.h, this macro would define
+# ABSOLUTE_SYS_INTTYPES_H to the `<>' quoted absolute name of sys/inttypes.h
+# in config.h
+# (e.g. `#define ABSOLUTE_SYS_INTTYPES_H <///usr/include/sys/inttypes.h>').
+# The three "///" are to pacify Sun C 5.8, which otherwise would say
+# "warning: #include of /usr/include/... may be non-portable".
+AC_DEFUN([gl_ABSOLUTE_HEADER],
+[AC_LANG_PREPROC_REQUIRE()dnl
+AC_FOREACH([gl_HEADER_NAME], [$1],
+  [AS_VAR_PUSHDEF([gl_absolute_header],
+                  [gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+  AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
+    m4_quote(m4_defn([gl_absolute_header])),
+    [AS_VAR_PUSHDEF([ac_header_exists],
+                    [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+    AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+    if test AS_VAR_GET(ac_header_exists) = yes; then
+      AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include 
<]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
+dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+      AS_VAR_SET(gl_absolute_header,
+[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+sed -n 
'\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#;s#^/[^/]#//&#;p;q;}'`])
+    fi
+    AS_VAR_POPDEF([ac_header_exists])dnl
+    ])dnl
+  AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))),
+                     [<AS_VAR_GET(gl_absolute_header)>],
+                     [Define this to an absolute name of 
<]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
+  AS_VAR_POPDEF([gl_absolute_header])dnl
+])dnl
+])# gl_ABSOLUTE_HEADER

Index: double-slash-root.m4
===================================================================
RCS file: double-slash-root.m4
diff -N double-slash-root.m4
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ double-slash-root.m4        6 Jul 2006 02:20:19 -0000       1.1
@@ -0,0 +1,43 @@
+#serial 1   -*- autoconf -*-
+dnl Copyright (C) 2006 Free Software Foundation, 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_DOUBLE_SLASH_ROOT],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([whether // is distinct from /], [ac_cv_double_slash_root],
+    [ if test x"$cross_compiling" = xyes ; then
+       # When cross-compiling, there is no way to tell whether // is special
+       # short of a list of hosts.  However, the only known hosts to date
+       # that have a distinct // are Apollo DomainOS (too old to port to)
+       # and Cygwin.  If anyone knows of another system for which // has
+       # special semantics and is distinct from /, please report it to
+       # <address@hidden>.
+       case $host in
+         *-cygwin)
+           ac_cv_double_slash_root=yes ;;
+         *)
+           # Be optimistic and assume that / and // are the same when we
+           # don't know.
+           ac_cv_double_slash_root='unknown, assuming no' ;;
+       esac
+      else
+       set x `ls -di / //`
+       if test $[2] = $[4]; then
+         ac_cv_double_slash_root=no
+       else
+         ac_cv_double_slash_root=yes
+       fi
+      fi])
+  if test x"$ac_cv_double_slash_root" = xyes; then
+    ac_double_slash_root=1
+  else
+    ac_double_slash_root=0
+  fi
+
+  AC_DEFINE_UNQUOTED([DOUBLE_SLASH_IS_DISTINCT_ROOT],
+   $ac_double_slash_root,
+   [Define to 1 if // is a file system root distinct from /.])
+])

Index: getcwd-abort-bug.m4
===================================================================
RCS file: getcwd-abort-bug.m4
diff -N getcwd-abort-bug.m4
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ getcwd-abort-bug.m4 6 Jul 2006 02:20:19 -0000       1.1
@@ -0,0 +1,106 @@
+#serial 1
+# Determine whether getcwd aborts when the length of the working directory
+# name is unusually large.  Any length between 4k and 16k trigger the bug
+# when using glibc-2.4.90-9 or older.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# From Jim Meyering
+
+# gl_FUNC_GETCWD_ABORT_BUG([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG],
+[
+  AC_CHECK_DECLS_ONCE(getcwd)
+  AC_CHECK_FUNCS(getpagesize)
+  AC_CACHE_CHECK([whether getcwd aborts when 4k < cwd_length < 16k],
+    gl_cv_func_getcwd_abort_bug,
+    [# Remove any remnants of a previous test.
+     rm -rf confdir-14B---
+     # Arrange for deletion of the temporary directory this test creates.
+     ac_clean_files="$ac_clean_files confdir-14B---"
+     AC_RUN_IFELSE(
+       [AC_LANG_SOURCE(
+         [[
+#include <stdlib.h>
+#include <unistd.h>
+#include <limits.h>
+#include <string.h>
+#include <sys/stat.h>
+
+/* Don't get link errors because mkdir is redefined to rpl_mkdir.  */
+#undef mkdir
+
+#ifndef S_IRWXU
+# define S_IRWXU 0700
+#endif
+
+/* FIXME: skip the run-test altogether on systems without getpagesize.  */
+#if ! HAVE_GETPAGESIZE
+# define getpagesize() 0
+#endif
+
+/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
+   the 16kB pagesize on ia64 linux.  Those conditions make the code below
+   trigger a bug in glibc's getcwd implementation before 2.4.90-10.  */
+#define TARGET_LEN (5 * 1024)
+
+int
+main ()
+{
+  char const *dir_name = "confdir-14B---";
+  char *cwd;
+  size_t initial_cwd_len;
+  int fail = 0;
+  size_t desired_depth;
+  size_t d;
+
+  /* The bug is triggered when PATH_MAX < getpagesize (), so skip
+     this relative expensive and invasive test if that's not true.  */
+  if (getpagesize () <= PATH_MAX)
+    return 0;
+
+  cwd = getcwd (NULL, 0);
+  if (cwd == NULL)
+    return 0;
+
+  initial_cwd_len = strlen (cwd);
+  free (cwd);
+  desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
+                  / (1 + strlen (dir_name)));
+  for (d = 0; d < desired_depth; d++)
+    {
+      if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
+       {
+         fail = 3; /* Unable to construct deep hierarchy.  */
+         break;
+       }
+    }
+
+  /* If libc has the bug in question, this invocation of getcwd
+     results in a failed assertion.  */
+  cwd = getcwd (NULL, 0);
+  if (cwd == NULL)
+    fail = 4; /* getcwd failed.  This is ok, and expected.  */
+  free (cwd);
+
+  /* Call rmdir first, in case the above chdir failed.  */
+  rmdir (dir_name);
+  while (0 < d--)
+    {
+      if (chdir ("..") < 0)
+       break;
+      rmdir (dir_name);
+    }
+
+  return 0;
+}
+          ]])],
+    [gl_cv_func_getcwd_abort_bug=no],
+    [gl_cv_func_getcwd_abort_bug=yes],
+    [gl_cv_func_getcwd_abort_bug=yes])
+  ])
+  AS_IF([test $gl_cv_func_getcwd_abort_bug = yes], [$1], [$2])
+])

Index: strndup.m4
===================================================================
RCS file: strndup.m4
diff -N strndup.m4
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ strndup.m4  6 Jul 2006 02:20:19 -0000       1.1
@@ -0,0 +1,51 @@
+# strndup.m4 serial 7
+dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, 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_FUNC_STRNDUP],
+[
+  AC_LIBSOURCES([strndup.c, strndup.h])
+
+  dnl Persuade glibc <string.h> to declare strndup().
+  AC_REQUIRE([AC_GNU_SOURCE])
+
+  AC_CHECK_DECLS_ONCE([strndup])
+
+  # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
+  AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup,
+    [AC_RUN_IFELSE([
+       AC_LANG_PROGRAM([#include <string.h>], [[
+#ifndef HAVE_DECL_STRNDUP
+  extern char *strndup (const char *, size_t);
+#endif
+  char *s;
+  s = strndup ("some longer string", 15);
+  free (s);
+  s = strndup ("shorter string", 13);
+  return s[13] != '\0';]])],
+       [gl_cv_func_strndup=yes],
+       [gl_cv_func_strndup=no],
+       [AC_CHECK_FUNC([strndup],
+          [AC_EGREP_CPP([too risky], [
+#ifdef _AIX
+               too risky
+#endif
+             ],
+             [gl_cv_func_strndup=no],
+             [gl_cv_func_strndup=yes])],
+          [gl_cv_func_strndup=no])])])
+  if test $gl_cv_func_strndup = yes; then
+    AC_DEFINE([HAVE_STRNDUP], 1,
+      [Define if you have the strndup() function and it works.])
+  else
+    AC_LIBOBJ([strndup])
+    AC_DEFINE(strndup, rpl_strndup,
+      [Define to rpl_strndup if the replacement function should be used,])
+    gl_PREREQ_STRNDUP
+  fi
+])
+
+# Prerequisites of lib/strndup.c.
+AC_DEFUN([gl_PREREQ_STRNDUP], [:])

Index: strnlen.m4
===================================================================
RCS file: strnlen.m4
diff -N strnlen.m4
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ strnlen.m4  6 Jul 2006 02:20:19 -0000       1.1
@@ -0,0 +1,29 @@
+# strnlen.m4 serial 5
+dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, 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_FUNC_STRNLEN],
+[
+  AC_LIBSOURCES([strnlen.c, strnlen.h])
+
+  dnl Persuade glibc <string.h> to declare strnlen().
+  AC_REQUIRE([AC_GNU_SOURCE])
+
+  AC_FUNC_STRNLEN
+  if test $ac_cv_func_strnlen_working = no; then
+    # This is necessary because automake-1.6.1 doens't understand
+    # that the above use of AC_FUNC_STRNLEN means we may have to use
+    # lib/strnlen.c.
+    #AC_LIBOBJ(strnlen)
+    AC_DEFINE(strnlen, rpl_strnlen,
+      [Define to rpl_strnlen if the replacement function should be used.])
+    gl_PREREQ_STRNLEN
+  fi
+])
+
+# Prerequisites of lib/strnlen.c.
+AC_DEFUN([gl_PREREQ_STRNLEN], [
+  AC_CHECK_DECLS_ONCE(strnlen)
+])

Index: xstrndup.m4
===================================================================
RCS file: xstrndup.m4
diff -N xstrndup.m4
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ xstrndup.m4 6 Jul 2006 02:20:19 -0000       1.1
@@ -0,0 +1,15 @@
+# xstrndup.m4 serial 2
+dnl Copyright (C) 2003 Free Software Foundation, 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_XSTRNDUP],
+[
+  gl_PREREQ_XSTRNDUP
+])
+
+# Prerequisites of lib/xstrndup.c.
+AC_DEFUN([gl_PREREQ_XSTRNDUP], [
+  :
+])

Index: full-header-path.m4
===================================================================
RCS file: full-header-path.m4
diff -N full-header-path.m4
--- full-header-path.m4 13 May 2006 20:47:48 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,41 +0,0 @@
-# full-header-path.m4 serial 2
-dnl Copyright (C) 2006 Free Software Foundation, 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.
-
-dnl From Derek Price.
-
-# gl_FULL_HEADER_PATH(HEADER1 HEADER2 ...)
-# ----------------------------------------
-# Find the full path to a header file, assuming the header exists.
-# If the header were sys/inttypes.h, this macro would define
-# FULL_PATH_SYS_INTTYPES_H to the `<>' quoted full path to sys/inttypes.h
-# in config.h
-# (e.g. `#define FULL_PATH_SYS_INTTYPES_H </usr/include/sys/inttypes.h>').
-AC_DEFUN([gl_FULL_HEADER_PATH],
-[AC_LANG_PREPROC_REQUIRE()dnl
-AC_FOREACH([gl_HEADER_NAME], [$1],
-  [AS_VAR_PUSHDEF([gl_full_header_path],
-                  [gl_cv_full_path_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
-  AC_CACHE_CHECK([full path to <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
-    m4_quote(m4_defn([gl_full_header_path])),
-    [AS_VAR_PUSHDEF([ac_header_exists],
-                    [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
-    AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
-    if test AS_VAR_GET(ac_header_exists) = yes; then
-      AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include 
<]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
-dnl eval is necessary to expand ac_cpp.
-dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
-      AS_VAR_SET(gl_full_header_path,
-[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
-sed -n 
'\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#;p;q;}'`])
-    fi
-    AS_VAR_POPDEF([ac_header_exists])dnl
-    ])dnl
-  
AC_DEFINE_UNQUOTED(AS_TR_CPP([FULL_PATH_]m4_quote(m4_defn([gl_HEADER_NAME]))),
-                     [<AS_VAR_GET(gl_full_header_path)>],
-                     [Define this to the full path to 
<]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
-  AS_VAR_POPDEF([gl_full_header_path])dnl
-])dnl
-])# gl_FULL_HEADER_PATH




reply via email to

[Prev in Thread] Current Thread [Next in Thread]