*** doc/textutil.t~0	Wed Jan  1 23:51:14 1997
--- doc/textutil.texi	Sat Feb  8 15:49:34 1997
***************
*** 228,238 ****
  @opindex --show-all
  Equivalent to @samp{-vET}.
  
  @item -b
  @itemx --number-nonblank
  @opindex -b
  @opindex --number-nonblank
! Number all nonblank output lines, starting with 1.
  
  @item -e
  @opindex -e
--- 228,258 ----
  @opindex --show-all
  Equivalent to @samp{-vET}.
  
+ @item -B
+ @itemx --binary
+ @opindex -B
+ @opindex --binary
+ @cindex binary and text I/O in cat
+ On MS-DOS only, causes @code{cat} read and write the files in DOS binary
+ mode.  By default, @code{cat} on MS-DOS uses binary mode only when
+ standard output is redirected to a file or a pipe; this option overrides
+ that.  Binary file I/O is used so that the files retain their format
+ (Unix text as opposed to DOS text and binary), because @code{cat} is
+ frequently used as file copying program.  Some options (see below) cause
+ @code{cat} read and write files in text mode because then the original
+ file contents aren't important (e.g., when lines are numbered by
+ @code{cat}, or when line endings should be marked).  This is so these
+ options work as MS-DOS users would expect; for example, DOS text files
+ have their lines end with @key{CR-LF} pair of characters which won't be
+ processed as an empty line by @samp{-b} unless the file is read in text
+ mode.
+ 
  @item -b
  @itemx --number-nonblank
  @opindex -b
  @opindex --number-nonblank
! Number all nonblank output lines, starting with 1.  On MS-DOS, this
! option causes @code{cat} to read and write files in DOS text mode.
  
  @item -e
  @opindex -e
***************
*** 242,261 ****
  @itemx --show-ends
  @opindex -E
  @opindex --show-ends
! Display a @samp{$} after the end of each line.
  
  @item -n
  @itemx --number
  @opindex -n
  @opindex --number
! Number all output lines, starting with 1.
  
  @item -s
  @itemx --squeeze-blank
  @opindex -s
  @opindex --squeeze-blank
  @cindex squeezing blank lines
! Replace multiple adjacent blank lines with a single blank line.
  
  @item -t
  @opindex -t
--- 262,285 ----
  @itemx --show-ends
  @opindex -E
  @opindex --show-ends
! Display a @samp{$} after the end of each line.  On MS-DOS, this option
! causes @code{cat} to read and write files in DOS text mode.
  
  @item -n
  @itemx --number
  @opindex -n
  @opindex --number
! Number all output lines, starting with 1.  On MS-DOS, this option causes
! @code{cat} to read and write files in DOS text mode.
  
  @item -s
  @itemx --squeeze-blank
  @opindex -s
  @opindex --squeeze-blank
  @cindex squeezing blank lines
! Replace multiple adjacent blank lines with a single blank line.  On
! MS-DOS, this option causes @code{cat} to read and write files in DOS
! text mode.
  
  @item -t
  @opindex -t
***************
*** 277,283 ****
  @opindex --show-nonprinting
  Display control characters except for @key{LFD} and @key{TAB} using
  @samp{^} notation and precede characters that have the high bit set
! with @samp{M-}.
  
  @end table
  
--- 301,309 ----
  @opindex --show-nonprinting
  Display control characters except for @key{LFD} and @key{TAB} using
  @samp{^} notation and precede characters that have the high bit set
! with @samp{M-}.  On MS-DOS, this option causes @code{cat} to read files
! and standard input in DOS binary mode, so the @key{CR} characters at the
! end of each line are also visible.
  
  @end table
  
***************
*** 1653,1659 ****
  Treat all input files as binary.  This option has no effect on Unix
  systems, since they don't distinguish between binary and text files.
  This option is useful on systems that have different internal and
! external character representations.
  
  @item -c
  @itemx --check
--- 1679,1685 ----
  Treat all input files as binary.  This option has no effect on Unix
  systems, since they don't distinguish between binary and text files.
  This option is useful on systems that have different internal and
! external character representations.  On MS-DOS, this is the default.
  
  @item -c
  @itemx --check
*** src/cat.c~0	Sat Nov 23 22:00:50 1996
--- src/cat.c	Sat Feb  8 15:01:04 1997
*************** Concatenate FILE(s), or standard input, 
*** 104,109 ****
--- 104,115 ----
  \n\
  With no FILE, or when FILE is -, read standard input.\n\
  "));
+ #ifdef __DJGPP__
+       printf (_("\
+ \n\
+   -B, --binary             use binary writes to the console device.\n\n\
+ "));
+ #endif
        puts (_("\nReport bugs to textutils-bugs@gnu.ai.mit.edu"));
      }
    exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
*************** cat (
*** 440,445 ****
--- 446,468 ----
      }
  }
  
+ #ifdef __DJGPP__
+ static int orig_stdin_mode = -1;
+ static int orig_stdout_mode = -1;
+ 
+ /* Switch the standard streams to the mode we found them in.
+    Called at program exit, mainly to avoid leaving the console
+    device in the raw (as opposed to cooked) mode.  */
+ void
+ msdos_back_to_original_mode (void)
+ {
+   if (isatty (fileno (stdin)) && orig_stdin_mode != -1)
+     setmode (fileno (stdin), orig_stdin_mode);
+   if (isatty (fileno (stdout)) && orig_stdout_mode != -1)
+     setmode (fileno (stdout), orig_stdout_mode);
+ }
+ #endif
+ 
  int
  main (int argc, char **argv)
  {
*************** main (int argc, char **argv)
*** 481,486 ****
--- 504,513 ----
    int mark_line_ends = 0;
    int quote = 0;
    int output_tabs = 1;
+ #ifdef __DJGPP__
+   int binary_files  = 0;
+   int binary_output = 0;
+ #endif
  
  /* If nonzero, call cat, otherwise call simple_cat to do the actual work. */
    int options = 0;
*************** main (int argc, char **argv)
*** 500,505 ****
--- 527,535 ----
      {"show-ends", no_argument, NULL, 'E'},
      {"show-tabs", no_argument, NULL, 'T'},
      {"show-all", no_argument, NULL, 'A'},
+ #ifdef __DJGPP__
+     {"binary", no_argument, NULL, 'B'},
+ #endif
      {"help", no_argument, &show_help, 1},
      {"version", no_argument, &show_version, 1},
      {NULL, 0, NULL, 0}
*************** main (int argc, char **argv)
*** 512,518 ****
  
    /* Parse command line options.  */
  
!   while ((c = getopt_long (argc, argv, "benstuvAET", long_options, (int *) 0))
  	 != EOF)
      {
        switch (c)
--- 542,554 ----
  
    /* Parse command line options.  */
  
!   while ((c = getopt_long (argc, argv,
! #ifdef __DJGPP__
! 			   "benstuvABET"
! #else
! 			   "benstuvAET"
! #endif
! 			   , long_options, (int *) 0))
  	 != EOF)
      {
        switch (c)
*************** main (int argc, char **argv)
*** 564,569 ****
--- 600,612 ----
  	  output_tabs = 0;
  	  break;
  
+ #ifdef __DJGPP__
+ 	case 'B':
+ 	  ++options;
+ 	  binary_files = 1;
+ 	  break;
+ #endif
+ 
  	case 'E':
  	  ++options;
  	  mark_line_ends = 1;
*************** main (int argc, char **argv)
*** 616,621 ****
--- 659,703 ----
  #endif
      }
  
+ #ifdef __DJGPP__
+   /* We always read and write in BINARY mode, since this is the
+      best way to copy the files verbatim.  Exceptions are when
+      they request line numbering, squeezing of empty lines or
+      marking lines' ends: then we use text I/O, because otherwise
+      -b, -s and -E would surprise users on MSDOS where a line with
+      only CR-LF is an empty line.  (Besides, if they ask for one of
+      these options, they don't care much about the original file
+      contents anyway).  */
+   if ((!isatty (output_desc)
+        && !(numbers || squeeze_empty_lines || mark_line_ends))
+       || binary_files)
+     {
+       /* Force all files to be open in BINARY mode.  */
+       _fmode = O_BINARY;
+       /* Switch stdout to BINARY mode.  */
+       binary_output = 1;
+       orig_stdout_mode = setmode (output_desc, O_BINARY);
+       /* Arrange to switch standard streams to original
+ 	 mode when we exit.  */
+       atexit (msdos_back_to_original_mode);
+     }
+   else if (quote)
+     {
+       /* If they want to see the non-printables, let's show them
+ 	 those CR characters as well, so make the input binary.
+ 	 But keep console output in text mode, so that LF causes
+ 	 both CR and LF on output, and the output is readable.  */
+       _fmode = O_BINARY;
+       orig_stdin_mode = setmode (0, O_BINARY);
+ 
+       /* Setting stdin to binary switches the console device to
+ 	 raw I/O, which also affects stdout to console.  Undo that.  */
+       if (isatty (output_desc))
+ 	orig_stdout_mode = setmode (output_desc, O_TEXT);
+       atexit (msdos_back_to_original_mode);
+     }
+ #endif
+ 
    /* Check if any of the input files are the same as the output file.  */
  
    /* Main loop.  */
*************** main (int argc, char **argv)
*** 632,637 ****
--- 714,746 ----
  	{
  	  have_read_stdin = 1;
  	  input_desc = 0;
+ 
+ #ifdef __DJGPP__
+ 	  /* Switch stdin to BINARY mode if needed.  */
+ 	  if (binary_output)
+ 	    {
+ 	      int prev_mode = -1;
+ 	      int tty_in = isatty (input_desc);
+ 
+ 	      /* If stdin is a terminal device, and it is the ONLY
+ 		 input file (i.e. we didn't write anything to the
+ 		 output yet), switch the output back to TEXT mode.
+ 		 This is so "cat > xyzzy" creates a DOS-style text
+ 		 file, like people expect.  */
+ 	      if (tty_in && optind <= argc)
+ 		setmode (output_desc, O_TEXT);
+ 	      else
+ 		{
+ 		  prev_mode = setmode (input_desc, O_BINARY);
+ 		  /* Let the terminal reads be interruptible.  */
+ 		  if (tty_in)
+ 		    __djgpp_set_ctrl_c (1);
+ 		}
+ 
+ 	      if (orig_stdin_mode == -1)
+ 		orig_stdin_mode = prev_mode;
+ 	    }
+ #endif
  	}
        else
  	{
*** src/cksum.c~0	Sat Nov  2 23:42:24 1996
--- src/cksum.c	Fri Jan 31 19:36:12 1997
***************
*** 21,27 ****
    Usage: cksum [file...]
  
    The code segment between "#ifdef CRCTAB" and "#else" is the code
!   which calculates the "crctab". It is included for those who want
    verify the correctness of the "crctab". To recreate the "crctab",
    do following:
  
--- 21,27 ----
    Usage: cksum [file...]
  
    The code segment between "#ifdef CRCTAB" and "#else" is the code
!   which calculates the "crctab". It is included for those who want to
    verify the correctness of the "crctab". To recreate the "crctab",
    do following:
  
*************** cksum (char *file, int print_name)
*** 206,211 ****
--- 206,216 ----
      {
        fp = stdin;
        have_read_stdin = 1;
+ #ifdef __DJGPP__
+       /* Read stdin in BINARY mode, unless it is a console device.  */
+       if (!isatty (fileno (fp)))
+ 	setmode (fileno (fp), O_BINARY);
+ #endif
      }
    else
      {
*************** main (int argc, char **argv)
*** 313,318 ****
--- 318,328 ----
  
    if (show_help)
      usage (0);
+ 
+ #ifdef __DJGPP__
+   /* Read files in BINARY mode.  */
+   _fmode = O_BINARY;
+ #endif
  
    if (optind >= argc)
      {
*** src/head.c~0	Sat Jan 25 06:09:48 1997
--- src/head.c	Fri Jan 31 19:40:12 1997
*************** head_bytes (const char *filename, int fd
*** 163,168 ****
--- 163,179 ----
    char buffer[BUFSIZE];
    int bytes_read;
  
+ #ifdef __DJGPP__
+   /* Need BINARY I/O for the byte counts to be accurate.  */
+   int orig_stdout_mode = -1;
+ 
+   if (!isatty (fd))
+     {
+       setmode (fd, O_BINARY);
+       orig_stdout_mode = setmode (fileno (stdout), O_BINARY);
+     }
+ #endif
+ 
    while (bytes_to_write)
      {
        bytes_read = safe_read (fd, buffer, BUFSIZE);
*************** head_bytes (const char *filename, int fd
*** 179,184 ****
--- 190,202 ----
  	error (EXIT_FAILURE, errno, _("write error"));
        bytes_to_write -= bytes_read;
      }
+ 
+ #ifdef __DJGPP__
+   /* Switch stdout back to original mode.  */
+   if (orig_stdout_mode != -1)
+     setmode (fileno (stdout), orig_stdout_mode);
+ #endif
+ 
    return 0;
  }
  
*** src/md5sum.c~0	Mon Dec 23 23:57:30 1996
--- src/md5sum.c	Fri Jan 31 19:54:36 1997
***************
*** 32,55 ****
  #include "system.h"
  #include "error.h"
  
! /* Most systems do not distinguish between external and internal
!    text representations.  */
! #if UNIX || __UNIX__ || unix || __unix__ || _POSIX_VERSION
! # define OPENOPTS(BINARY) "r"
  #else
! # ifdef MSDOS
! #  define TEXT1TO1 "rb"
! #  define TEXTCNVT "r"
  # else
! #  if defined VMS
! #   define TEXT1TO1 "rb", "ctx=stm"
! #   define TEXTCNVT "r", "ctx=stm"
  #  else
      /* The following line is intended to evoke an error.
         Using #error is not portable enough.  */
      "Cannot determine system type."
  #  endif
  # endif
  # define OPENOPTS(BINARY) ((BINARY) != 0 ? TEXT1TO1 : TEXTCNVT)
  #endif
  
--- 32,58 ----
  #include "system.h"
  #include "error.h"
  
! /* DJGPP defines `unix', so must test MSDOS up front.  */
! #ifdef MSDOS
! # define TEXT1TO1 "rb"
! # define TEXTCNVT "r"
  #else
! # if defined VMS
! #  define TEXT1TO1 "rb", "ctx=stm"
! #  define TEXTCNVT "r", "ctx=stm"
  # else
! /* Most systems do not distinguish between external and internal
!    text representations.  */
! #  if UNIX || __UNIX__ || unix || __unix__ || _POSIX_VERSION
! #   define OPENOPTS(BINARY) "r"
  #  else
      /* The following line is intended to evoke an error.
         Using #error is not portable enough.  */
      "Cannot determine system type."
  #  endif
  # endif
+ #endif
+ #ifndef OPENOPTS
  # define OPENOPTS(BINARY) ((BINARY) != 0 ? TEXT1TO1 : TEXTCNVT)
  #endif
  
*************** Usage: %s [OPTION] [FILE]...\n\
*** 107,115 ****
  Print or check MD5 checksums.\n\
  With no FILE, or when FILE is -, read standard input.\n\
  \n\
!   -b, --binary            read files in binary mode\n\
    -c, --check             check MD5 sums against given list\n\
!   -t, --text              read files in text mode (default)\n\
  \n\
  The following two options are useful only when verifying checksums:\n\
        --status            don't output anything, status code shows success\n\
--- 110,118 ----
  Print or check MD5 checksums.\n\
  With no FILE, or when FILE is -, read standard input.\n\
  \n\
!   -b, --binary            read files in binary mode (default on MS-DOS)\n\
    -c, --check             check MD5 sums against given list\n\
!   -t, --text              read files in text mode (default on Unix)\n\
  \n\
  The following two options are useful only when verifying checksums:\n\
        --status            don't output anything, status code shows success\n\
*************** md5_file (const char *filename, int bina
*** 245,250 ****
--- 248,259 ----
      {
        have_read_stdin = 1;
        fp = stdin;
+ #ifdef __DJGPP__
+       /* If we need binary reads from a pipe or redirected stdin, we need
+ 	 to switch it to BINARY mode here, since stdin is already open.  */
+       if (binary && !isatty (fileno (stdin)))
+ 	setmode (fileno (stdin), O_BINARY);
+ #endif
      }
    else
      {
*************** main (int argc, char **argv)
*** 452,459 ****
--- 461,474 ----
    size_t err = 0;
    int file_type_specified = 0;
  
+ #ifdef MSDOS
+   /* Binary is default on MSDOS, so the actual file contents
+      are used in computation.  */
+   int binary = 1;
+ #else
    /* Text is default of the Plumb/Lankester format.  */
    int binary = 0;
+ #endif
  
    /* Setting values of global variables.  */
    program_name = argv[0];
*** src/od.c~0	Sat Jan 25 06:01:40 1997
--- src/od.c	Sat Feb  1 11:14:12 1997
*************** typedef double LONG_DOUBLE;
*** 107,113 ****
        }									\
      while (0)
  #else
! # define WINDOWS_SETFILEMODE_BINARY(IN_STREAM, FILENAME) /* empty */
  #endif
  
  /* The default number of input bytes per output line.  */
--- 107,129 ----
        }									\
      while (0)
  #else
! # ifdef __DJGPP__
! #  define WINDOWS_SETFILEMODE_BINARY(IN_STREAM, FILENAME)		 \
!      do									 \
!        { /* Switch stdin to binary mode, but only if it isn't		 \
! 	    a terminal device.  */					 \
! 	 if (!isatty (fileno (IN_STREAM))			         \
! 		      && setmode (fileno((IN_STREAM)), O_BINARY) == -1)	 \
!            {								 \
! 	     error (0, errno, "%s", (FILENAME));			 \
! 	     err = 1;							 \
! 	     continue;							 \
! 	   }								 \
!        }								 \
!      while (0)
! # else
! #  define WINDOWS_SETFILEMODE_BINARY(IN_STREAM, FILENAME) /* empty */
! # endif
  #endif
  
  /* The default number of input bytes per output line.  */
*** src/pr.c~0	Sat Jan 25 06:06:48 1997
--- src/pr.c	Sat Feb  1 11:15:56 1997
*************** static int page_number;
*** 486,492 ****
  
     When printing files across (-a flag), ...
     1    foo     2       moo     3       goo
!    4    hoo     3       too     6       zoo
  
     Otherwise, line numbering is as follows:
     1    foo     3       goo     5       too
--- 486,492 ----
  
     When printing files across (-a flag), ...
     1    foo     2       moo     3       goo
!    4    hoo     5       too     6       zoo
  
     Otherwise, line numbering is as follows:
     1    foo     3       goo     5       too
*** src/sort.c~0	Sun Jan 19 03:41:54 1997
--- src/sort.c	Sat Feb  8 17:41:22 1997
*************** char *realloc ();
*** 49,54 ****
--- 49,64 ----
  void free ();
  #endif
  
+ /* Are long filenames supported by this OS?  */
+ #ifdef MSDOS
+ # ifndef _USE_LFN
+ #  define _USE_LFN 0
+ # endif
+ # define SHORT_FNAMES (!_USE_LFN)
+ #else  /* not MSDOS */
+ # define SHORT_FNAMES 0
+ #endif /* not MSDOS */
+ 
  /* Undefine, to avoid warning about redefinition on some systems.  */
  #undef min
  #define min(a, b) ((a) < (b) ? (a) : (b))
*************** tempname (void)
*** 407,417 ****
    struct tempnode *node;
  
    node = (struct tempnode *) xmalloc (sizeof (struct tempnode));
!   sprintf (name,
! 	   "%s%ssort%5.5d%5.5d",
! 	   temp_file_prefix,
! 	   (len && temp_file_prefix[len - 1] != '/') ? "/" : "",
! 	   (unsigned int) getpid () & 0xffff, seq);
  
    /* Make sure that SEQ's value fits in 5 digits.  */
    ++seq;
--- 417,436 ----
    struct tempnode *node;
  
    node = (struct tempnode *) xmalloc (sizeof (struct tempnode));
! 
!   /* If long filenames aren't supported, we cannot afford filenames
!      longer than 8+3.  */
!   if (SHORT_FNAMES)
!     sprintf (name, "%s%ss%5.5d%2.2d.%3.3d",
! 	     temp_file_prefix,
! 	     (len && temp_file_prefix[len - 1] != '/') ? "/" : "",
! 	     (unsigned int) getpid () & 0xffff, seq / 1000, seq % 1000);
!   else
!     sprintf (name,
! 	     "%s%ssort%5.5d%5.5d",
! 	     temp_file_prefix,
! 	     (len && temp_file_prefix[len - 1] != '/') ? "/" : "",
! 	     (unsigned int) getpid () & 0xffff, seq);
  
    /* Make sure that SEQ's value fits in 5 digits.  */
    ++seq;
*** src/split.c~0	Sat Jan 25 06:06:22 1997
--- src/split.c	Sat Feb  1 12:11:46 1997
*************** main (int argc, char **argv)
*** 518,523 ****
--- 518,530 ----
  	error (EXIT_FAILURE, errno, "%s", infile);
      }
  
+ #ifdef __DJGPP__
+   /* Binary I/O is safer when bytecounts are used.  */
+   if (!isatty (input_desc))
+     setmode (input_desc, O_BINARY);
+   _fmode = O_BINARY;	/* for output files to be open in BINARY mode */
+ #endif
+ 
    /* No output file is open now.  */
    output_desc = -1;
  
*** src/sum.c~0	Sat Nov  2 23:42:26 1996
--- src/sum.c	Sat Feb  1 12:38:22 1997
*************** main (int argc, char **argv)
*** 243,248 ****
--- 243,256 ----
      usage (0);
  
    files_given = argc - optind;
+ 
+ #ifdef __DJGPP__
+   /* Need binary I/O, or else byte counts and checksums are incorrect.  */
+   _fmode = O_BINARY;
+   if (!isatty (0))
+     setmode (0, O_BINARY);
+ #endif
+ 
    if (files_given == 0)
      {
        if ((*sum_func) ("-", files_given) < 0)
*** src/tac.c~0	Sat Nov  2 23:42:26 1996
--- src/tac.c	Sat Feb  1 12:38:02 1997
*************** main (int argc, char **argv)
*** 658,663 ****
--- 658,677 ----
    else
      ++buffer;
  
+ #ifdef __DJGPP__
+   /* We need binary input, since `tac' relies on `lseek' and byte counts.  */
+   _fmode = O_BINARY;
+   /* Switch stdin to binary mode if it isn't a console device, in case
+      it will be mentioned as one of the input files.  */
+   if (!isatty (0))
+     setmode (0, O_BINARY);
+   /* Binary output will leave the lines' ends (NL or CR/LF) intact
+      when the output is a disk file; it has no visible effect if
+      the output is a console device.  */
+   if (!isatty (STDOUT_FILENO))
+     setmode (STDOUT_FILENO, O_BINARY);
+ #endif
+ 
    if (optind == argc)
      {
        have_read_stdin = 1;
*** src/tail.c~0	Mon Jan 27 02:28:14 1997
--- src/tail.c	Sat Feb  1 17:16:32 1997
*************** main (int argc, char **argv)
*** 1119,1124 ****
--- 1119,1134 ----
        || (header_mode == multiple_files && n_files > 1))
      print_headers = 1;
  
+ #ifdef __DJGPP__
+   /* We need binary input, since `tail' relies on `lseek' and byte counts.  */
+   _fmode = O_BINARY;
+   if (!isatty (0))
+     setmode (0, O_BINARY);
+   /* Binary output will preserve the style (Unix/DOS) of text file.  */
+   if (!isatty (1))
+     setmode (1, O_BINARY);
+ #endif
+ 
    if (n_files == 0)
      {
        exit_status |= tail_file ("-", n_units, 0);
*** src/wc.c~0	Sat Nov 23 22:00:52 1996
--- src/wc.c	Sat Feb  1 12:58:20 1997
*************** main (int argc, char **argv)
*** 305,310 ****
--- 305,317 ----
  
    nfiles = argc - optind;
  
+ #ifdef __DJGPP__
+   /* We need binary I/O, since `wc' relies on `lseek' and byte counts.  */
+   _fmode = O_BINARY;
+   if (!isatty (0))
+     setmode (0, O_BINARY);
+ #endif
+ 
    if (nfiles == 0)
      {
        have_read_stdin = 1;
*** configure.orig	Sun Jan 26 19:03:52 1997
--- djgpp/configure	Fri Jan 31 18:09:02 1997
***************
*** 535,545 ****
  
  ac_aux_dir=
  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
!   if test -f $ac_dir/install-sh; then
      ac_aux_dir=$ac_dir
      ac_install_sh="$ac_aux_dir/install-sh -c"
      break
!   elif test -f $ac_dir/install.sh; then
      ac_aux_dir=$ac_dir
      ac_install_sh="$ac_aux_dir/install.sh -c"
      break
--- 535,545 ----
  
  ac_aux_dir=
  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
!   if test -x $ac_dir/install-sh; then
      ac_aux_dir=$ac_dir
      ac_install_sh="$ac_aux_dir/install-sh -c"
      break
!   elif test -x $ac_dir/install.sh; then
      ac_aux_dir=$ac_dir
      ac_install_sh="$ac_aux_dir/install.sh -c"
      break
***************
*** 576,582 ****
      *)
        # OSF1 and SCO ODT 3.0 have their own names for install.
        for ac_prog in ginstall installbsd scoinst install; do
!         if test -f $ac_dir/$ac_prog; then
  	  if test $ac_prog = install &&
              grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  	    # AIX install.  It has an incompatible calling convention.
--- 576,582 ----
      *)
        # OSF1 and SCO ODT 3.0 have their own names for install.
        for ac_prog in ginstall installbsd scoinst install; do
!         if test -x $ac_dir/$ac_prog; then
  	  if test $ac_prog = install &&
              grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  	    # AIX install.  It has an incompatible calling convention.
***************
*** 731,737 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_PERL="$ac_dir/$ac_word"
        break
      fi
--- 731,737 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_PERL="$ac_dir/$ac_word"
        break
      fi
***************
*** 760,766 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_prog_CC="gcc"
        break
      fi
--- 760,766 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_prog_CC="gcc"
        break
      fi
***************
*** 790,796 ****
    ac_prog_rejected=no
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
          ac_prog_rejected=yes
  	continue
--- 790,796 ----
    ac_prog_rejected=no
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
          ac_prog_rejected=yes
  	continue
***************
*** 1038,1044 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_prog_RANLIB="ranlib"
        break
      fi
--- 1038,1044 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_prog_RANLIB="ranlib"
        break
      fi
***************
*** 3643,3649 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
  	break
--- 3643,3649 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
  	break
***************
*** 3732,3738 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
--- 3732,3738 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
***************
*** 3764,3770 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
--- 3764,3770 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
***************
*** 3933,3939 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_GENCAT="$ac_dir/$ac_word"
        break
      fi
--- 3933,3939 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_GENCAT="$ac_dir/$ac_word"
        break
      fi
***************
*** 3965,3971 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
--- 3965,3971 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
***************
*** 3998,4004 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
  	break
--- 3998,4004 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
  	break
***************
*** 4033,4039 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
--- 4033,4039 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
***************
*** 4091,4097 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
  	break
--- 4091,4097 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
  	break
***************
*** 4125,4131 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
--- 4125,4131 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
***************
*** 4157,4163 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
--- 4157,4163 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
***************
*** 4291,4297 ****
                 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
     fi
        sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
!      $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
  
              if test "$PACKAGE" = "gettext"; then
       GT_NO="#NO#"
--- 4291,4297 ----
                 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
     fi
        sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
!      $srcdir/intl/po2tblin.sed > intl/po2tbl.sed
  
              if test "$PACKAGE" = "gettext"; then
       GT_NO="#NO#"
***************
*** 4556,4561 ****
--- 4556,4562 ----
  for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
    # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
    case "$ac_file" in
+   *.in) ac_file_in=${ac_file}-in ;;
    *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
         ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
    *) ac_file_in="${ac_file}.in" ;;
***************
*** 4638,4643 ****
--- 4639,4645 ----
  for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
    # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
    case "$ac_file" in
+   *.h) ac_file_in=${ac_file}-in ;;
    *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
         ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
    *) ac_file_in="${ac_file}.in" ;;
*** djgpp/config.s~0	Fri Jan 31 17:45:44 1997
--- djgpp/config.sed	Sat Feb  1 13:21:54 1997
***************
*** 0 ****
--- 1,14 ----
+ # Add a few DJGPP-specific lines to config.h
+ $a\
+ \
+ #define DEFAULT_TMPDIR  "c:/"\
+ \
+ /* We need the declaration of `setmode' function.  */\
+ #include <io.h>\
+ \
+ /* We need the declaration of `__djgpp_set_ctrl_c' function.  */\
+ #include <sys/exceptn.h>\
+ \
+ /* We need the _USE_LFN macro.  */\
+ #include <fcntl.h>\
+ 
*** djgpp/tscript.s~0	Fri Jan 31 17:45:44 1997
--- djgpp/tscript.sed	Sat Feb  1 13:57:44 1997
***************
*** 0 ****
--- 1,34 ----
+ # Some filenames in the tests subdirectories are illegal on MS-DOS,
+ # or clash in the 8+3 namespace, so we need to edit the test scripts
+ # to reflect changes in these filenames.
+ s/T-0FF/_T-0FF/g
+ s/T-FF/_T-FF/g
+ s/T-bl/_T-bl/g
+ s/T-t/_T-t/g
+ s/Ta3-0FF/_Ta3-0FF/g
+ s/Ta3-FF/_Ta3-FF/g
+ s/Tb3-0FF/_Tb3-0FF/g
+ s/Tb3-FF/_Tb3-FF/g
+ s/n+2-5l17f-0FF/nx2-5l17f-0FF/g
+ s/n+2l17f-0FF/nx2l17f.0FF/g
+ s/n+2l17f-bl/nx2l17f.bl/g
+ s/n+3-7l24-FF/nx3-7l24-FF/g
+ s/n+3l17f-0FF/nx3l17f.0FF/g
+ s/n+3l17f-bl/nx3l17f.bl/g
+ s/n+3ml13f-bl-FF/nx3ml13f-bl.FF/g
+ s/n+3ml17f-bl-tn/nx3ml17f-bl.tn/g
+ s/n+3ml17f-tn-bl/nx3ml17f-tn.bl/g
+ s/n+4-8a2l17-FF/nx4-8a2l17-FF/g
+ s/n+4b2l10f-0FF/nx4b2l10f-0FF/g
+ s/n+5-8b3l10f-FF/nx5-8b3l10f-FF/g
+ s/n+5a3l6f-0FF/nx5a3l6f-0FF/g
+ s/n+6a2l17-FF/nx6a2l17-FF/g
+ s/n+6b3l6f-FF/nx6b3l6f-FF/g
+ s/n+7l24-FF/nx7l24-FF/g
+ s/n+8l20-FF/nx8l20-FF/g
+ s/nN1+3l17f-bl/nN1x3l17f-bl/g
+ s/njml17f-lm-lm-lo/njml17f-lm-lm.lo/g
+ s/njml17f-lm-lo-lm/njml17f-lm-lo.lm/g
+ s/nsml13-t-t-FF-FF/nsml13-t-t-FF.FF/g
+ s/nsml17-t-t-FF-FF/nsml17-t-t-FF.FF/g
+ 
*** djgpp/config.b~0	Fri Jan 31 17:45:44 1997
--- djgpp/config.bat	Fri Feb 14 17:33:24 1997
***************
*** 0 ****
--- 1,37 ----
+ @echo off
+ set SYSROOT=c:
+ set PATH_SEPARATOR=:
+ if not "%HOSTNAME%" == "" goto hostdone
+ if "%windir%" == "" goto msdos
+ set OS=MS-Windows
+ goto haveos
+ :msdos
+ set OS=MS-DOS
+ :haveos
+ if not "%USERNAME%" == "" goto haveuname
+ if not "%USER%" == "" goto haveuser
+ echo No USERNAME and no USER found in the environment, using default values
+ set HOSTNAME=Unknown PC
+ :haveuser
+ set HOSTNAME=%USER%'s PC
+ goto userdone
+ :haveuname
+ set HOSTNAME=%USERNAME%'s PC
+ :userdone
+ set HOSTNAME=%HOSTNAME%, %OS%
+ :hostdone
+ set OS=
+ set CONFIG_SHELL=bash.exe
+ if not exist configure.orig mv -f configure configure.orig
+ update djgpp/configure ./configure
+ bash ./configure --prefix='$(DJDIR)' --disable-nls
+ echo updating config.h and Makefiles for DJGPP...
+ mv -f config.h config.tmp
+ sed -f djgpp/config.sed config.tmp > config.h
+ touch config.h -r config.tmp
+ rm -f config.tmp
+ mv -f Makefile Makefile.tmp
+ sed -e 's/config\.h\.in/config.h-in/g' Makefile.tmp > Makefile
+ touch Makefile -r Makefile.tmp
+ rm -f Makefile.tmp
+ call djgpp\edtests
*** djgpp/build.b~0	Fri Jan 31 17:48:24 1997
--- djgpp/build.bat	Fri Feb 14 17:12:44 1997
***************
*** 0 ****
--- 1,3 ----
+ @echo off
+ call djgpp\edtests
+ make
*** djgpp/edtests.b~0	Fri Jan 31 17:48:24 1997
--- djgpp/edtests.bat	Fri Feb 14 17:11:40 1997
***************
*** 0 ****
--- 1,38 ----
+ @echo off
+ echo editing test scripts in tests/ subdirectories for DJGPP...
+ if not exist tests\cut-test\cut-tests.orig mv -f tests/cut-test/cut-tests tests/cut-test/cut-tests.orig
+ sed "s/tmissing-/tmiss-/g" tests/cut-test/cut-tests.orig > tests\cut-test\cut-tests
+ if not exist tests\pr-test\pr-tests.orig mv -f tests/pr-test/pr-tests tests/pr-test/pr-tests.orig
+ sed -f djgpp/tscript.sed tests/pr-test/pr-tests.orig > tests\pr-test\pr-tests
+ if not exist tests\md5sum-test\md5sum-tests.orig mv -f tests/md5sum-test/md5sum-tests tests/md5sum-test/md5sum-tests.orig
+ sed "s/md5sum'/md5sum -t'/" tests/md5sum-test/md5sum-tests.orig > tests\md5sum-test\md5sum-tests
+ rem
+ rem Need to convert expected test output files to DOS text format
+ rem for those programs which write stdout in text mode.  Otherwise
+ rem cmp will report differences and we will think the tests failed.
+ rem
+ utod tests/cut-test/*.exp
+ utod tests/join-test/*.exp
+ utod tests/md5sum-test/*.exp
+ utod tests/sort-test/*.exp
+ cd tests\pr-test
+ utod 0F 3-0F 3f-0F a3-0F a3f-0F 3a3f-0F b3-0F b3f-0F 3b3f-0F 0FF a3f-0FF
+ utod b3f-0FF 3b3f-0FF FF 3-FF 3f-FF a3f-FF b3f-FF 3b3f-FF l24-FF
+ utod a2l17-FF a2l15-FF b2l17-FF b2l15-FF 4l24-FF 4-7l24-FF 3a2l17-FF 3b2l17-FF
+ utod l24-t l17f-t 3l24-t 3l17f-t 3-5l17f-t a3l15-t a3l8f-t 3a3l15-t 3a3l8f-t
+ utod b3l15-t b3l8f-t 3b3l15-t 3b3l8f-t ml24-t ml17f-t 3ml24-t 3ml17f-t ml17f-0F
+ utod ml17f-t-0F ml24-FF ml24-t-FF ml20-FF-t 3ml24-FF 3ml24-t-FF t-t t-bl t-0FF
+ utod t-FF ta3-0FF ta3-FF tb3-0FF tb3-FF _T-t _T-bl _T-0FF _T-FF _Ta3-0FF
+ utod _Ta3-FF _Tb3-0FF _Tb3-FF nl17f-bl nN15l17f-bl nx2l17f.bl nx3l17f.bl
+ utod nN1x3l17f-bl nx2l17f.0FF nx2-5l17f-0FF nx3l17f.0FF nx7l24-FF nx3-7l24-FF
+ utod nx8l20-FF nx5a3l6f-0FF nx6a2l17-FF nx4-8a2l17-FF nx4b2l10f-0FF nx6b3l6f-FF
+ utod nx5-8b3l10f-FF nx3ml13f-bl.FF nx3ml17f-bl.tn nx3ml17f-tn.bl w72j-0FF
+ utod w48l17f-lm w26l17f-lm w25l17f-lm w20l17f-lm ml17f-lm-lo w35ml17f-lm-lo
+ utod jml17f-lm-lo w35jml17f-lm-lo njml17f-lm-lm.lo njml17f-lm-lo.lm a3l17f-lm
+ utod w35a3l17f-lm ja3l17f-lm w35ja3l17f-lm b3l17f-lm w35b3l17f-lm
+ utod jb3l17f-lm w35jb3l17f-lm nsml13-bl-FF nsml17-bl-FF nsml13-t-t-FF
+ utod nsml17-t-t-FF nsml13-t-t-FF.FF nsml17-t-t-FF.FF o3a3l17f-tn o3a3snl17f-tn
+ utod o3a3sl17f-tn o3b3l17f-tn o3b3sl17f-tn o3b3snl17f-tn o3ml17f-bl-tn
+ utod o3msl17f-bl-tn o3msnl17f-bl-tn o3jml17f-lm-lo
+ cd ..
+ cd ..
*** README.d~0	Fri Jan 31 17:45:44 1997
--- README.dos	Fri Feb 14 18:37:04 1997
***************
*** 0 ****
--- 1,114 ----
+ This is a port of GNU Textutils 1.22 to MSDOS/DJGPP.
+ 
+ Installation
+ ============
+ 
+ Just unzip the binary distribution from the top DJGPP installation
+ directory, preserving the directory structure (use -d switch if you do
+ this with PKUNZIP).  If you aren't familiar with the package, read the
+ info docs.  If you run the programs from plain DOS (no Windows), you
+ will need to install a DPMI host.  A free DPMI host is available as
+ csdpmi3b.zip from the peer directory ../v2misc at the same place you
+ got Textutils.  Note that the man pages are not included in the binary
+ distribution, since they are no longer maintained by the GNU project;
+ use the Info documentation instead.  (If you need the man pages, they
+ are available in the man subdirectory of the source distribution.)
+ 
+ 
+ Features
+ ========
+ 
+ The absolute majority of the DOS-specific changes for this package
+ take care of the text/binary file I/O issue.  Most (but not all) of
+ the ported programs do their I/O in binary mode, unless the input or
+ output is connected to the terminal device.  This ensures that
+ Unix-style text files (which don't have a CR character at the end of
+ each line) don't change while being processed by the utilities of this
+ package.  The only programs that do all I/O in text mode are those
+ which don't make sense in conjunction with binary files, like `sort'
+ and `pr'.  Some programs need to change their I/O mode when certain
+ options are given on the command line; for details, see the Info docs
+ of `cat' and `md5sum'.
+ 
+ The file DIFFS in the source distribution describes the changes
+ against the original package.
+ 
+ The GNU Gettext package is not supported yet in the ported version, so
+ don't expect the programs to talk to you in any language but English.
+ 
+ 
+ Required tools
+ ==============
+ 
+ If you want to recompile the package, you will need the DJGPP
+ development environment (GCC, header files and the libraries) and
+ DJGPP ports of the following tools:
+ 
+ 	- GNU Make 3.75 or later
+ 	- Bash (or some other Unix-like shell)
+ 	- GNU Sed
+ 	- GNU Fileutils
+ 	- GNU Textutils
+ 	- GNU Sh-utils
+ 	- GNU Grep (only if you need to run DJGPP\CONFIG.BAT)
+ 	- GNU Diffutils (only if you run the test suite)
+ 	- Perl (only if you need to change the test scripts)
+ 
+ These should be available from the DJGPP sites.  There are a few more
+ programs (such as `utod') invoked during the build process, but they
+ are all part of a standard DJGPP installation and should be already
+ installed on your system.
+ 
+ The package should be built with the latest port of Make 3.75.
+ Previous versions of Make ported to DJGPP didn't support Unix shells,
+ and the Makefiles for this package won't work without a Unix shell.
+ 
+ If you want to generate the formatted man pages, you will have to
+ invoke `cawf' or any other formatter to format them; `cawf' can be
+ found on SimTel mirrors (see the DJGPP FAQ list for the exact URL).
+ 
+ 
+ How to build
+ ============
+ 
+ Unzip the distribution preserving the directory structure (use -d
+ switch if you do that with PKUNZIP).  The package is already
+ configured for DJGPP v2.01, so if you only want to compile it, just
+ call BUILD.BAT from the DJGPP subdirectory:
+ 
+ 		djgpp\build
+ 
+ This edits a few files, then invokes Make.  When Make finishes, you
+ can install the package:
+ 
+ 		make install
+ 
+ If you make a change in some of the programs, it is a good idea to run
+ the test suite, so you know you didn't break anything:
+ 
+ 		make check
+ 
+ This will run for a while and should print PASSED for every program it
+ tests.  Note that the test suite needs 7 recursive invocations of
+ DJGPP programs at some points (5 recursive Make's and Bash + the
+ tested program on top of that), so some DPMI hosts, notably QDPMI,
+ might run out of free conventional memory.  CWSDPMI and Windows are
+ two DPMI hosts that should have no problems with running "make check".
+ 
+ If you build Textutils with DJGPP release other than 2.01, or if you
+ want to change the configuration options (e.g., use Rx instead of
+ Regex, or add the National Language Support), you will have to
+ reconfigure the package.  The CONFIG.BAT batch file in the DJGPP
+ subdirectory sets a few environment variables, then calls BASH to
+ run the configure script, so you should run CONFIG.BAT, then Make:
+ 
+ 		djgpp\config
+ 		make
+ 
+ The configure script run by CONFIG.BAT supports a few options (e.g.,
+ you could build the package with the GNU Rx library instead of the
+ default Regex).  Run "sh ./configure --help" to see all the options
+ recognized by the script.
+ 
+ 		Enjoy,
+ 				Eli Zaretskii <eliz@is.elta.co.il>
