bug-gnu-utils
[Top][All Lists]
Advanced

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

Patch for building sed on windows without cygwin


From: Lionel Fourquaux
Subject: Patch for building sed on windows without cygwin
Date: Wed, 7 Nov 2001 20:29:44 +0100

        Hello!


        I've patched the sed-3.02 distribution to build with
MS Visual C, as a native windows app, without cygwin. Here
is my patch, appended to this message.

        Summary: with this patch, a Windows user with MSVC
can type "nmake -f Makefile.win32" and get sed.

        It adds a win32/ subdirectory containing:
 * a config.h for MSVC
 * Makefiles for the doc/, lib/, sed/ and testsuite/ subdirs
 * a very short readme.
There is a toplevel Makefile in the root directory
(Makefile.win32). This one defines four targets:
 * all    -- build sed and the documentation
 * docs   -- build the documentation
 * checks -- run the testsuite
 * clean  -- cleanup.
All these makefiles are very simple, and use normal windows
commands, plus MSVC, with the following exceptions:
 * docs require MiKTeX (a free windows TeX distribution)
 * the testsuite requires a Bourne-like shell (I was unable
   to remove this requirement).

        The documentation is build in PDF format.

        The sed source has a few additions:
 * text/binary mode (with the --binary switch)
 * memory mapped files for Windows.
This shouldn't affect the normal Unix build, and very few
changes were required.

        This was tested with Windows 2000 SP2, MSVC 6,
MiKTeX 2.1, and my own port of ash 0.2.
The test suite was passed successfully. (Although I
had to patch the check for sed --help).

        Best regards.


                Lionel Fourquaux



===================== PATCH ==========================
diff -Nurd sed-3.02-ori/Makefile.win32 sed-3.02/Makefile.win32
--- sed-3.02-ori/Makefile.win32 Thu Jan  1 00:00:00 1970
+++ sed-3.02/Makefile.win32     Wed Nov  7 18:18:12 2001
@@ -0,0 +1,24 @@
+all: sub_mkf prog docs
+
+sub_mkf:
+       copy /y win32\Makefile.doc doc\Makefile
+       copy /y win32\Makefile.lib lib\Makefile
+       copy /y win32\Makefile.sed sed\Makefile
+
+prog:
+       cd sed & $(MAKE) /nologo
+
+docs:
+       cd doc & $(MAKE) /nologo
+
+check: prog
+       sed -e"s/SED_VERSION_NUMBER/%%CD:*sed-=%%/" <
win32\Makefile.test > testsuite\Makefile
+       cd testsuite & $(MAKE) /nologo
+
+clean:
+       -cd doc & $(MAKE) /nologo clean
+       -cd lib & $(MAKE) /nologo clean
+       -cd sed & $(MAKE) /nologo clean
+       -cd testsuite & $(MAKE) /nologo clean
+       -del doc\Makefile lib\Makefile sed\Makefile testsuite\Makefile
+
diff -Nurd sed-3.02-ori/lib/regex.c sed-3.02/lib/regex.c
--- sed-3.02-ori/lib/regex.c    Fri Jul  3 01:05:58 1998
+++ sed-3.02/lib/regex.c        Tue Nov  6 21:42:13 2001
@@ -115,6 +115,11 @@
 char *realloc ();
 # endif
 
+# ifdef HAVE_MALLOC_H
+/* MS Visual C/C++ needs this for alloca. */
+#  include <malloc.h>
+# endif
+
 /* When used in Emacs's lib-src, we need to get bzero and bcopy
somehow.
    If nothing else has been done, use the method below.  */
 # ifdef INHIBIT_STRING_HEADER
diff -Nurd sed-3.02-ori/sed/basicdefs.h sed-3.02/sed/basicdefs.h
--- sed-3.02-ori/sed/basicdefs.h        Sat Jul  4 14:25:44 1998
+++ sed-3.02/sed/basicdefs.h    Wed Nov  7 13:32:20 2001
@@ -21,7 +21,7 @@
 #define BASICDEFS_H
 
 /* Can the compiler grok function prototypes? */
-#if defined __STDC__ && __STDC__
+#if (defined __STDC__ && __STDC__) || defined _WIN32
 # define P_(s)         s
 #else
 # define P_(s)         ()
@@ -111,5 +111,9 @@
 #define ISUPPER(c) (ISASCII (c) && isupper (c))
 #define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
 
+#if defined HAVE_SETMODE || defined HAVE_WIN32API
+/* Flag for text/binary mode */
+extern int binary;
+#endif
 
 #endif /*!BASICDEFS_H*/
diff -Nurd sed-3.02-ori/sed/compile.c sed-3.02/sed/compile.c
--- sed-3.02-ori/sed/compile.c  Sun Jul 26 22:43:06 1998
+++ sed-3.02/sed/compile.c      Wed Nov  7 13:45:14 2001
@@ -71,6 +71,11 @@
      from a string stored at 'prog.cur' instead.  If both 'prog.file'
      and 'prog.cur' are NULL, we're in trouble! */
   FILE *file;
+
+#ifdef HAVE_WIN32API
+  /* The Win32 file mapping handle. */
+  VOID *mapping;
+#endif
 };
 
 /* Information used to give out useful and informative error messages.
*/
@@ -209,7 +214,11 @@
   prog.file = stdin;
   if (cmdfile[0] != '-' || cmdfile[1] != '\0')
     prog.file = ck_fopen(cmdfile, "r");
+#ifdef HAVE_WIN32API
+  if (map_file(prog.file, &prog.base, &prog.mapping, &len))
+#else
   if (map_file(prog.file, &prog.base, &len))
+#endif
     {
       prog.cur = VCAST(const unsigned char *)prog.base;
       prog.end = prog.cur + len;
@@ -222,7 +231,11 @@
   ret = compile_program(cur_program);
   if (prog.base)
     {
+#ifdef HAVE_WIN32API
+      unmap_file(prog.base, prog.mapping);
+#else
       unmap_file(prog.base, len);
+#endif
       prog.base = NULL;
       prog.cur = NULL;
       prog.end = NULL;
@@ -851,7 +864,11 @@
       p->readit_p = readit;
       p->fp = NULL;
       if (!readit)
+#ifdef HAVE_SETMODE
+       p->fp = ck_fopen(p->name, "wb");
+#else
        p->fp = ck_fopen(p->name, "w");
+#endif
       p->link = file_ptrs;
       file_ptrs = p;
     }
@@ -961,6 +978,14 @@
     {
       if (prog.cur < prog.end)
        ch = *prog.cur++;
+#ifdef HAVE_WIN32API
+/* Handle DOS-style line termination, if we are reading a mapped file.
*/
+      if ((ch == '\r')
+         && (prog.cur < prog.end)
+         && (*prog.cur == '\n')
+         && (prog.base != NULL))
+        ch = *prog.cur++;
+#endif
     }
   else if (prog.file)
     {
diff -Nurd sed-3.02-ori/sed/execute.c sed-3.02/sed/execute.c
--- sed-3.02-ori/sed/execute.c  Mon Jul  6 04:01:02 1998
+++ sed-3.02/sed/execute.c      Wed Nov  7 13:37:37 2001
@@ -34,6 +34,9 @@
 # ifdef HAVE_UNISTD_H
 #  include <unistd.h>
 # endif
+# ifdef HAVE_IO_H
+#  include <io.h>
+# endif
 #endif
 
 #ifdef __GNUC__
@@ -42,6 +45,17 @@
 #  define UNUSED       __attribute__((unused))
 # endif
 #endif
+#ifdef _MSC_VER
+  /* silence warnings for MS Visual C/C++
+   *  4100: unused parameter
+   *  4127: constant conditional expression (ISPRINT)
+   *  4131: K&R syntax declaration
+   *  4711: automatic inlining
+   * I'm leaving 4706 (assignment in conditional expression) because
+   * it's useful to track bugs.
+   */
+# pragma warning(disable: 4100 4127 4131 4711)
+#endif
 #ifndef UNUSED
 # define UNUSED
 #endif
@@ -125,6 +139,9 @@
 #ifdef HAVE_ISATTY
   flagT is_tty;                /* only valid if base is NULL */
 #endif
+#ifdef HAVE_WIN32API
+  VOID *mapping;
+#endif
 };
 
 static void resize_line P_((struct line *lb, size_t len));
@@ -242,7 +259,11 @@
       clearerr(stdin); /* clear any stale EOF indication */
       input->fp = stdin;
     }
+#ifdef HAVE_SETMODE
+  else if ( ! (input->fp = fopen(name, "rb")) )
+#else
   else if ( ! (input->fp = fopen(name, "r")) )
+#endif
     {
       const char *ptr = strerror(errno);
       fprintf(stderr, "%s: can't read %s: %s\n", myname, name, ptr);
@@ -252,7 +273,11 @@
     }
 
   input->read_fn = read_file_line;
+#ifdef HAVE_WIN32API
+  if (map_file(input->fp, &input->base, &input->mapping,
&input->length))
+#else
   if (map_file(input->fp, &input->base, &input->length))
+#endif
     {
       input->cur = VCAST(char *)input->base;
       input->left = input->length;
@@ -273,7 +298,11 @@
   if (!input->fp)
     return;
   if (input->base)
+#ifdef HAVE_WIN32API
+    unmap_file(input->base, input->mapping);
+#else
     unmap_file(input->base, input->length);
+#endif
   if (input->fp != stdin) /* stdin can be reused on tty and tape
devices */
     ck_fclose(input->fp);
   input->fp = NULL;
@@ -297,6 +326,11 @@
 
   if ( (e = memchr(input->cur, '\n', input->left)) )
     {
+#ifdef HAVE_WIN32API
+      /* Handle DOS-style line termination. */
+      if (!binary && (e != input->cur) && (e[-1] == '\r'))
+       e--;
+#endif
       /* common case */
       l = e++ - input->cur;
       line.chomped = 1;
@@ -575,7 +609,7 @@
       } else {
          *o++ = '\\';
          switch (*p) {
-#if defined __STDC__ && __STDC__
+#if (defined __STDC__ && __STDC__) || defined _WIN32
            case '\a': *o++ = 'a'; break;
 #else
            /* If not STDC we'll just assume ASCII */
@@ -1142,7 +1176,11 @@
          size_t cnt;
          FILE *fp;
 
+#ifdef HAVE_SETMODE
+         fp = fopen(p->rfile, "rb");
+#else
          fp = fopen(p->rfile, "r");
+#endif
          /* Not ck_fopen() because: "If _rfile_ does not exist or
cannot be
             read, it shall be treated as if it were an empty file,
causing
             no error condition."  IEEE Std 1003.2-1992 */
diff -Nurd sed-3.02-ori/sed/sed.c sed-3.02/sed/sed.c
--- sed-3.02-ori/sed/sed.c      Fri Jul  3 01:06:26 1998
+++ sed-3.02/sed/sed.c  Wed Nov  7 13:58:02 2001
@@ -48,6 +48,20 @@
 # endif
 #endif /* HAVE_MMAP */
 
+#ifdef HAVE_WIN32API
+# define STRICT
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
+#ifdef HAVE_IO_H
+# include <io.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
 #ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
@@ -78,6 +92,10 @@
 /* Do we need to be pedantically POSIX compliant? */
 flagT POSIXLY_CORRECT;
 
+#if defined HAVE_SETMODE || defined HAVE_WIN32API
+int binary = 0;
+#endif
+
 static void
 usage(status)
   int status;
@@ -94,8 +112,12 @@
   -f script-file, --file=script-file\n\
                  add the contents of script-file to the commands to be
executed\n\
       --help     display this help and exit\n\
-  -V, --version  output version information and exit\n\
-\n\
+  -V, --version  output version information and exit\n"
+#ifdef HAVE_SETMODE
+"\
+  --binary       use binary file I/O\n"
+#endif
+"\n\
 If no -e, --expression, -f, or --file option is given, then the
first\n\
 non-option argument is taken as the sed script to interpret.  All\n\
 remaining arguments are names of input files; if no input files are\n\
@@ -120,6 +142,9 @@
     {"silent", 0, NULL, 'n'},
     {"version", 0, NULL, 'V'},
     {"help", 0, NULL, 'h'},
+#ifdef HAVE_SETMODE
+    {"binary", 0, NULL, 'b'},
+#endif
     {NULL, 0, NULL, 0}
   };
 
@@ -167,11 +192,24 @@
          exit(0);
        case 'h':
          usage(0);
+#ifdef HAVE_SETMODE
+       case 'b':
+         binary = 1;
+         break;
+#endif
        default:
          usage(4);
        }
     }
 
+#ifdef HAVE_SETMODE
+  if (binary)
+  {
+    setmode(0, O_BINARY);
+    setmode(1, O_BINARY);
+  }
+#endif
+
   if (!the_program)
     {
       if (optind < argc)
@@ -193,11 +231,16 @@
 

 /* Attempt to mmap() a file.  On failure, just return a zero,
    otherwise set *base and *len and return non-zero.  */
+/* For Win32, use mapped files too, and keep the mapping handle. */
+#ifdef HAVE_WIN32API
+flagT map_file(FILE *fp, VOID **base, HANDLE *map_object, size_t *len)
+#else
 flagT
 map_file(fp, base, len)
   FILE *fp;
   VOID **base;
   size_t *len;
+#endif
 {
 #ifdef HAVE_MMAP
   struct stat s;
@@ -217,19 +260,56 @@
          return 1;
        }
     }
+#elif defined HAVE_WIN32API
+  HANDLE h, m;
+  PVOID nbase;
+  LARGE_INTEGER size;
+  h = (HANDLE) _get_osfhandle(fileno(fp));
+  if ((GetFileType(h) == FILE_TYPE_DISK)
+      && GetFileSizeEx(h, &size)
+      && (size.HighPart == 0)
+      && (size.LowPart != 0))
+    {
+      m = CreateFileMapping(h, NULL, PAGE_READONLY, 0, 0, NULL);
+      if (m != NULL)
+        {
+         nbase = MapViewOfFile(m, FILE_MAP_READ, 0, 0, size.LowPart);
+         if (nbase != NULL)
+           {
+             *base = nbase;
+             *map_object = m;
+             *len = size.LowPart;
+             return 1;
+           }
+         else
+           {
+             (void) CloseHandle(m);
+           }
+       }
+    }
 #endif /* HAVE_MMAP */
 
   return 0;
 }
 
 /* Attempt to munmap() a memory region. */
+#ifdef HAVE_WIN32API
+void unmap_file(VOID *base, HANDLE map_object)
+#else
 void
 unmap_file(base, len)
   VOID *base;
   size_t len;
+#endif
 {
 #ifdef HAVE_MMAP
   if (base)
     munmap(VCAST(caddr_t)base, len);
+#elif defined HAVE_WIN32API
+  if (base != NULL)
+  {
+    (void) UnmapViewOfFile(base);
+    (void) CloseHandle(map_object);
+  }
 #endif
 }
diff -Nurd sed-3.02-ori/sed/sed.h sed-3.02/sed/sed.h
--- sed-3.02-ori/sed/sed.h      Fri Jun 12 20:20:26 1998
+++ sed-3.02/sed/sed.h  Tue Nov  6 22:30:24 2001
@@ -156,8 +156,13 @@
 countT process_files P_((struct vector *, char **argv));
 
 int main P_((int, char **));
+#ifdef HAVE_WIN32API
+flagT map_file P_((FILE *fp, VOID **base, VOID **map_object, size_t
*len));
+void unmap_file P_((VOID *base, VOID *map_object));
+#else
 flagT map_file P_((FILE *fp, VOID **base, size_t *len));
 void unmap_file P_((VOID *base, size_t len));
+#endif
 
 extern flagT use_extended_syntax_p;
 extern flagT rx_testing;
diff -Nurd sed-3.02-ori/sed/utils.c sed-3.02/sed/utils.c
--- sed-3.02-ori/sed/utils.c    Mon Jul  6 04:00:56 1998
+++ sed-3.02/sed/utils.c        Tue Nov  6 21:54:12 2001
@@ -58,7 +58,7 @@
 
 
 /* Print an error message and exit */
-#if !defined __STDC__ || !__STDC__
+#if (!defined __STDC__ || !__STDC__) && !defined _WIN32
 # include <varargs.h>
 # define VSTART(l,a)   va_start(l)
 void
diff -Nurd sed-3.02-ori/testsuite/help-bin.good
sed-3.02/testsuite/help-bin.good
--- sed-3.02-ori/testsuite/help-bin.good        Thu Jan  1 00:00:00 1970
+++ sed-3.02/testsuite/help-bin.good    Wed Nov  7 17:59:35 2001
@@ -0,0 +1,19 @@
+Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...
+
+  -n, --quiet, --silent
+                 suppress automatic printing of pattern space
+  -e script, --expression=script
+                 add the script to the commands to be executed
+  -f script-file, --file=script-file
+                 add the contents of script-file to the commands to be
executed
+      --help     display this help and exit
+  -V, --version  output version information and exit
+  --binary       use binary file I/O
+
+If no -e, --expression, -f, or --file option is given, then the first
+non-option argument is taken as the sed script to interpret.  All
+remaining arguments are names of input files; if no input files are
+specified, then the standard input is read.
+
+E-mail bug reports to: address@hidden .
+Be sure to include the word ``sed'' somewhere in the ``Subject:''
field.
diff -Nurd sed-3.02-ori/win32/Makefile.doc sed-3.02/win32/Makefile.doc
--- sed-3.02-ori/win32/Makefile.doc     Thu Jan  1 00:00:00 1970
+++ sed-3.02/win32/Makefile.doc Wed Nov  7 14:20:18 2001
@@ -0,0 +1,8 @@
+all: sed.pdf
+
+sed.pdf:
+       texify -c --pdf sed.texi
+
+clean:
+       -del sed.pdf
+
diff -Nurd sed-3.02-ori/win32/Makefile.inc sed-3.02/win32/Makefile.inc
--- sed-3.02-ori/win32/Makefile.inc     Thu Jan  1 00:00:00 1970
+++ sed-3.02/win32/Makefile.inc Wed Nov  7 14:21:42 2001
@@ -0,0 +1,8 @@
+CC = cl
+LD = link
+CC_OPTS = /nologo /GAFy6 /Oxb2 /vmb /MD /W3 /I..\win32 /I..\lib
/DHAVE_CONFIG_H
+LD_OPTS = /nologo /release /opt:ref /subsystem:console
+
+.c.obj:
+       $(CC) /c $(CC_OPTS) $<
+
diff -Nurd sed-3.02-ori/win32/Makefile.lib sed-3.02/win32/Makefile.lib
--- sed-3.02-ori/win32/Makefile.lib     Thu Jan  1 00:00:00 1970
+++ sed-3.02/win32/Makefile.lib Wed Nov  7 14:09:08 2001
@@ -0,0 +1,9 @@
+!include ..\win32\Makefile.inc
+
+OBJS = getopt.obj getopt1.obj regex.obj
+
+all: $(OBJS)
+
+clean:
+       -del $(OBJS)
+
diff -Nurd sed-3.02-ori/win32/Makefile.sed sed-3.02/win32/Makefile.sed
--- sed-3.02-ori/win32/Makefile.sed     Thu Jan  1 00:00:00 1970
+++ sed-3.02/win32/Makefile.sed Wed Nov  7 14:13:20 2001
@@ -0,0 +1,17 @@
+!include ..\win32\Makefile.inc
+
+OBJS = compile.obj execute.obj sed.obj utils.obj
+LIB_OBJS = ..\lib\getopt.obj ..\lib\getopt1.obj ..\lib\regex.obj
+LIBS = setargv.obj kernel32.lib msvcrt.lib
+
+all: lib sed.exe
+
+lib:
+       cd ..\lib & $(MAKE) /nologo
+
+sed.exe: $(OBJS)
+       $(LD) $(LD_OPTS) /out:$@ $(OBJS) $(LIB_OBJS) $(LIBS)
+
+clean:
+       -del $(OBJS) sed.exe
+
diff -Nurd sed-3.02-ori/win32/Makefile.test sed-3.02/win32/Makefile.test
--- sed-3.02-ori/win32/Makefile.test    Thu Jan  1 00:00:00 1970
+++ sed-3.02/win32/Makefile.test        Wed Nov  7 18:12:38 2001
@@ -0,0 +1,122 @@
+SED = ..\sed\sed.exe
+#TIME = ntimer
+TIME =
+CMP = fc
+RM = del
+
+all: check
+
+check: basics othersedcmds cmdlines
+
+CORE_BASICS = \
+       enable sep inclib 8bit newjis xabcx dollar noeol \
+       numsub head madding mac-mf empty
+
+basics: $(CORE_BASICS) manis allsub 8to7 cv-vars middle
+othersedcmds: subwrite khadafy linecnt distrib writeout readin dc
+cmdlines: help version file quiet
+
+$(CORE_BASICS) linecnt::
+       $(TIME) $(SED) -f address@hidden < address@hidden > tmp.$@
+       $(CMP) address@hidden tmp.$@
+       @$(RM) tmp.$@
+
+manis khadafy::
+       $(TIME) $(SED) -f address@hidden < address@hidden > tmp.$@
+       $(CMP) address@hidden tmp.$@
+       @$(RM) tmp.$@
+
+allsub::
+       $(TIME) $(SED) -f address@hidden < numsub.inp > tmp.$@
+       $(CMP) address@hidden tmp.$@
+       @$(RM) tmp.$@
+
+8to7::
+       $(TIME) $(SED) -f address@hidden < 8bit.inp > tmp.$@
+       $(CMP) address@hidden tmp.$@
+       @$(RM) tmp.$@
+
+cv-vars::
+       $(TIME) $(SED) -n -f address@hidden < address@hidden > tmp.$@
+       $(CMP) address@hidden tmp.$@
+       @$(RM) tmp.$@
+
+middle::
+       $(TIME) $(SED) -n -f address@hidden < head.inp > tmp.$@
+       $(CMP) address@hidden tmp.$@
+       @$(RM) tmp.$@
+
+subwrite::
+       $(TIME) $(SED) -f address@hidden < address@hidden > tmp.1$@
+       $(CMP) subwrt1.good tmp.1$@
+       $(CMP) subwrt2.good tmp.subwrite-w
+       @$(RM) tmp.1$@ tmp.subwrite-w
+
+spencer::
+       sh address@hidden $(SED) <  address@hidden > tmp.$@
+       $(TIME) sh tmp.$@
+       @$(RM) tmp.$@
+
+distrib::
+       $(TIME) sh address@hidden $(SED) < address@hidden > tmp.$@
+       $(CMP) address@hidden tmp.$@
+       @$(RM) tmp.$@
+
+writeout::
+       $(TIME) $(SED) -f address@hidden < address@hidden >tmp.1$@
+       $(CMP) wrtout1.good tmp.1$@
+       $(CMP) wrtout2.good tmp.writeout-w
+       @$(RM) tmp.1$@ tmp.writeout-w
+
+readin::
+       $(TIME) $(SED) -f address@hidden < address@hidden >tmp.$@
+       $(CMP) address@hidden tmp.$@
+       @$(RM) tmp.$@
+
+dc::
+       @echo Patience, the dc.sed test is expected to take a while...
+       $(TIME) $(SED) -n -f ../dc.sed < address@hidden >tmp.$@
+       $(CMP) address@hidden tmp.$@
+       @$(RM) tmp.$@
+
+#
+# cmdlines targets
+#
+
+help::
+       $(SED) --help | $(SED) "1s/ [^ ]* / sed /" > tmp.1$@
+       $(SED) -h | $(SED) "1s/ [^ ]* / sed /" > tmp.2$@
+       -$(SED) 2>&1 | $(SED) "1s/ [^ ]* / sed /" > tmp.3$@
+       $(CMP) address@hidden tmp.1$@
+       $(CMP) tmp.1$@ tmp.2$@
+       $(CMP) tmp.2$@ tmp.3$@
+       @$(RM) tmp.1$@ tmp.2$@ tmp.3$@
+
+version:: version.good
+       $(SED) --version  > tmp.1$@ 2>&1
+       $(SED) -V > tmp.2$@ 2>&1
+       $(CMP) address@hidden tmp.1$@
+       $(CMP) address@hidden tmp.2$@
+       @$(RM) tmp.1$@ tmp.2$@
+
+file::
+       $(TIME) $(SED) --file=newjis.sed < newjis.inp > tmp.$@
+       $(CMP) newjis.good tmp.$@
+       @$(RM) tmp.$@
+
+quiet::
+       $(TIME) $(SED) --quiet -f cv-vars.sed \
+               < cv-vars.inp > tmp.$@
+       $(CMP) cv-vars.good tmp.$@
+       @$(RM) tmp.$@
+
+
+# automake won't cooperate with me and let me AC_OUTPUT() this,
+# so I need to special-case this:
+version.good: version.gin Makefile
+       $(SED) "address@hidden@^SED_VERSION_NUMBER^" version.gin > tmp-$@
+       move /y tmp-$@ $@
+
+clean:
+       -del tmp* core *.core version.good
+
diff -Nurd sed-3.02-ori/win32/README sed-3.02/win32/README
--- sed-3.02-ori/win32/README   Thu Jan  1 00:00:00 1970
+++ sed-3.02/win32/README       Wed Nov  7 19:00:41 2001
@@ -0,0 +1,12 @@
+Compiling sed with Microsoft Visual C/C++:
+
+The makefile "Makefile.win32" defines the following targets:
+ * all    -- build sed and the documentation
+ * docs   -- build the documentation (requires MiKTeX
http://www.miktex.org)
+ * checks -- test sed (requires sh)
+ * clean  -- cleanup.
+
+This was tested with MSVC 6 and sed 3.02.
+
+Lionel Fourquaux       address@hidden
+
diff -Nurd sed-3.02-ori/win32/config.h sed-3.02/win32/config.h
--- sed-3.02-ori/win32/config.h Thu Jan  1 00:00:00 1970
+++ sed-3.02/win32/config.h     Wed Nov  7 18:25:46 2001
@@ -0,0 +1,147 @@
+/* config.h.  Generated automatically by configure.  */
+/* config_h.in.  Generated automatically from configure.in by
autoheader.  */
+
+/* Define if on AIX 3.
+   System headers sometimes define this.
+   We just want to avoid a redefinition error message.  */
+#ifndef _ALL_SOURCE
+/* #undef _ALL_SOURCE */
+#endif
+
+/* Define if using alloca.c.  */
+/* #undef C_ALLOCA */
+
+/* Define to empty if the keyword does not work.  */
+/* #undef const */
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP
systems.
+   This function is required for alloca.c support on those systems.  */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define if you have alloca, as a function or macro.  */
+#define HAVE_ALLOCA 1
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix).
*/
+/* #undef HAVE_ALLOCA_H */
+
+/* Define if you don't have vprintf but do have _doprnt.  */
+/* #undef HAVE_DOPRNT */
+
+/* Define if you have a working `mmap' system call.  */
+/* #undef HAVE_MMAP */
+
+/* Define if you have the vprintf function.  */
+#define HAVE_VPRINTF 1
+
+/* Define if on MINIX.  */
+/* #undef _MINIX */
+
+/* Define if the system does not provide POSIX.1 features except
+   with this defined.  */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define if you need to in order for stat and other things to work.
*/
+/* #undef _POSIX_SOURCE */
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+/* #undef size_t */
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+/* #undef STACK_DIRECTION */
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+/* PACKAGE name */
+#define PACKAGE "sed"
+
+/* Package VERSION number */
+#define VERSION "3.02"
+
+/* Use lib/regex-gnu.h header (in preference to system's <regex.h>) */
+#define USE_REGEX_GNU_H 1
+
+/* Define if you have the bcopy function.  */
+/* #undef HAVE_BCOPY */
+
+/* Define if you have the bzero function.  */
+/* #undef HAVE_BZERO */
+
+/* Define if you have the getpagesize function.  */
+/* #undef HAVE_GETPAGESIZE */
+
+/* Define if you have the isascii function.  */
+#define HAVE_ISASCII 1
+
+/* Define if you have the isatty function.  */
+#define HAVE_ISATTY 1
+
+/* Define if you have the memchr function.  */
+#define HAVE_MEMCHR 1
+
+/* Define if you have the memcmp function.  */
+#define HAVE_MEMCMP 1
+
+/* Define if you have the memcpy function.  */
+#define HAVE_MEMCPY 1
+
+/* Define if you have the memmove function.  */
+#define HAVE_MEMMOVE 1
+
+/* Define if you have the regexec function.  */
+#define HAVE_REGEXEC 1
+
+/* Define if you have the regnexec function.  */
+#define HAVE_REGNEXEC 1
+
+/* Define if you have the strerror function.  */
+#define HAVE_STRERROR 1
+
+/* Define if you have the <limits.h> header file.  */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <memory.h> header file.  */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <regex.h> header file.  */
+/* #undef HAVE_REGEX_H */
+
+/* Define if you have the <stdlib.h> header file.  */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <string.h> header file.  */
+#define HAVE_STRING_H 1
+
+/* Define if you have the <sys/types.h> header file.  */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define if you have the <unistd.h> header file.  */
+/* #undef HAVE_UNISTD_H */
+
+/* Define if you have the cposix library (-lcposix).  */
+/* #undef HAVE_LIBCPOSIX */
+
+
+/* These lines were added manually */
+
+/* Define if you have io.h */
+#define HAVE_IO_H 1
+
+/* Define if you have malloc.h and it is required for alloca */
+#define HAVE_MALLOC_H 1
+
+/* Define if you don't have mmap but do have the Win32 API */
+#define HAVE_WIN32API 1
+
+/* Define if you have setmode and text/binary I/O */
+#define HAVE_SETMODE 1
+
+/* Define if you have fcntl.h */
+#define HAVE_FCNTL_H 1
+
======================================================







reply via email to

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