Adapt the MS-DOS build to changes in gnulib.
authorEli Zaretskii <eliz@gnu.org>
Wed, 6 Apr 2011 17:49:21 +0000 (20:49 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 6 Apr 2011 17:49:21 +0000 (20:49 +0300)
 msdos/sedlibmk.inp: Update checklist.
 (am_libgnu_a_OBJECTS): Remove careadlinkat.$(OBJEXT).
 ($(top_builddir)/config.status): Edit away, both as target and in
 prerequisites.
 (@am__fastdepCC_FALSE@): Fix editing.
 (@GL_GENERATE_STDBOOL_H_TRUE@, @GL_GENERATE_STDBOOL_H_FALSE@)
 (@GL_GENERATE_STDDEF_H_TRUE@, @GL_GENERATE_STDDEF_H_FALSE@)
 (@GL_GENERATE_STDINT_H_TRUE@, @GL_GENERATE_STDINT_H_FALSE@): Edit
 to either nothing or "#".
 src/msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.

msdos/ChangeLog
msdos/sedlibmk.inp
src/ChangeLog
src/msdos.c

index 510b3b1..ebac5b2 100644 (file)
@@ -1,3 +1,15 @@
+2011-04-06  Eli Zaretskii  <eliz@gnu.org>
+
+       * sedlibmk.inp: Update checklist.
+       (am_libgnu_a_OBJECTS): Remove careadlinkat.$(OBJEXT).
+       ($(top_builddir)/config.status): Edit away, both as target and in
+       prerequisites.
+       (@am__fastdepCC_FALSE@): Fix editing.
+       (@GL_GENERATE_STDBOOL_H_TRUE@, @GL_GENERATE_STDBOOL_H_FALSE@)
+       (@GL_GENERATE_STDDEF_H_TRUE@, @GL_GENERATE_STDDEF_H_FALSE@)
+       (@GL_GENERATE_STDINT_H_TRUE@, @GL_GENERATE_STDINT_H_FALSE@): Edit
+       to either nothing or "#".
+
 2011-03-25  Eli Zaretskii  <eliz@gnu.org>
 
        * sedlibmk.inp: Adapt to addition of the gnulib stdio module.
index d7af368..df4dd7d 100644 (file)
 #       /^STDINT_H *=/s/@[^@\n]*@/stdint.h/  -- stdint.h is needed
 #       /^STDDEF_H *=/s/@[^@\n]*@//          -- stddef.h is not needed
 #
+#  . Some of the headers are generated conditionally, and the
+#    corresponding recipes are guarder by @GL_GENERATE_xxxx_H_TRUE@
+#    and @GL_GENERATE_xxxx_H_FALSE@.  Depending on whether DJGPP uses
+#    the corresponding header, these should be edited either to
+#    nothing (thus exposing the recipe) or to #, which comments the
+#    recipe away.  Example:
+#
+#       s/^@GL_GENERATE_STDBOOL_H_TRUE@/\#/
+#       s/^@GL_GENERATE_STDBOOL_H_FALSE@//
+#
 #  . Also edit the NEXT_foo and NEXT_AS_FIRST_DIRECTIVE_foo_H variable
 #    as appropriately: to an empty value if the gnulib header is not
 #    used, and to the corresponding DJGPP header name otherwise.
@@ -490,6 +500,7 @@ am__cd = cd
 /^WCHAR_T_SUFFIX *=/s/@WCHAR_T_SUFFIX@/h/
 /^WINT_T_SUFFIX *=/s/@WINT_T_SUFFIX@//
 /^gl_LIBOBJS *=/s/@[^@\n]*@/getopt.o getopt1.o strftime.o time_r.o getloadavg.o md5.o filemode.o/
+/^am_libgnu_a_OBJECTS *=/s/careadlinkat.\$(OBJEXT)//
 /^srcdir *=/s/@[^@\n]*@/./
 /^top_srcdir *=/s/@[^@\n]*@/../
 /^top_builddir *=/s/@[^@\n]*@/../
@@ -500,6 +511,10 @@ s/@PRAGMA_COLUMNS@//
 /^\$(srcdir)\/Makefile\.in:/,/^[       ][      ]*\$(AUTOMAKE)/d
 /^Makefile:/,/^[       ][      ]*esac/d
 /^\$(top_srcdir)\/configure:/,/^\$(ACLOCAL_M4)/d
+/^\$(top_builddir)\/config.status:/,/^$/d
+#
+# Remove the dependencies on $(top_builddir)/config.status
+s/ $(top_builddir)\/config.status//
 #
 # Fix the include-dependency lines
 s/^@AMDEP_TRUE@//
@@ -507,7 +522,7 @@ s/^@AMDEP_FALSE@/\#/
 s/@am__include@/include/
 s/@am__quote@//g
 s/^@am__fastdepCC_TRUE@//
-s/^@am__fastdepCC_FALSE/\#/
+s/^@am__fastdepCC_FALSE@/\#/
 #
 # Fix the *-clean rules, to not use a Unixy `test' command.  Empty
 # lists are replaced with a dummy file, to avoid an error message from
@@ -520,6 +535,12 @@ s/^        -*test -z.*|| rm/        -rm/
 s/@echo /@djecho/
 #
 # Fix the recipes for header files
+s/^@GL_GENERATE_STDBOOL_H_TRUE@/\#/
+s/^@GL_GENERATE_STDBOOL_H_FALSE@//
+s/^@GL_GENERATE_STDDEF_H_TRUE@/\#/
+s/^@GL_GENERATE_STDDEF_H_FALSE@//
+s/^@GL_GENERATE_STDINT_H_TRUE@//
+s/^@GL_GENERATE_STDINT_H_FALSE@/\#/
 /^arg-nonnull\.h:/,/^[         ][      ]*mv /c\
 arg-nonnull.h: $(top_srcdir)/./arg-nonnull.h\
        sed -n -e '/GL_ARG_NONNULL/,$$p' < $(top_srcdir)/./arg-nonnull.h > $@
index 240fd8f..1dff4e4 100644 (file)
@@ -1,5 +1,7 @@
 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
 
+       * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
+
        * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
 
 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
index b0bf5c4..e02e64b 100644 (file)
@@ -81,6 +81,9 @@ extern int spawnve (int, const char *, char *const [], char *const []);
 #include <signal.h>
 #include "syssignal.h"
 
+#include "careadlinkat.h"
+#include "allocator.h"
+
 #ifndef SYSTEM_MALLOC
 
 #ifdef GNU_MALLOC
@@ -3933,6 +3936,41 @@ readlink (const char *name, char *dummy1, size_t dummy2)
 }
 #endif
 
+char *
+careadlinkat (int fd, char const *filename,
+              char *buffer, size_t buffer_size,
+              struct allocator const *alloc,
+              ssize_t (*preadlinkat) (int, char const *, char *, size_t))
+{
+  if (!buffer)
+    {
+      /* We don't support the fancy auto-allocation feature.  */
+      if (!buffer_size)
+       errno = ENOSYS;
+      else
+       errno = EINVAL;
+      buffer = NULL;
+    }
+  else
+    {
+      ssize_t len = preadlinkat (fd, filename, buffer, buffer_size);
+
+      if (len < 0 || len == buffer_size)
+       buffer = NULL;
+      else
+       buffer[len + 1] = '\0';
+    }
+  return buffer;
+}
+
+ssize_t
+careadlinkatcwd (int fd, char const *filename, char *buffer,
+                 size_t buffer_size)
+{
+  (void) fd;
+  return readlink (filename, buffer, buffer_size);
+}
+
 \f
 #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2