diff -cr libg++-2.7.2/libg++/src/Makefile \emx\gnu\libg++-2.7.2/libg++/src/Makefile
*** libg++-2.7.2/libg++/src/Makefile	Tue Sep  3 18:23:30 1996
--- \emx\gnu\libg++-2.7.2/libg++/src/Makefile	Tue Sep  3 15:54:04 1996
***************
*** 96,101 ****
--- 96,104 ----
  	else true ; \
  	fi
  
+ rx.o: ../../librx/rx.c
+ 	$(CC) -c $(CFLAGS) $(CINCLUDES) ../../librx/rx.c
+ 
  stamp-picdir:
  	if [ -n "$(PICFLAG)" ] && [ ! -d pic ]; then \
  	  mkdir pic; \
diff -cr libg++-2.7.2/libg++/src/Regx.cc \emx\gnu\libg++-2.7.2/libg++/src/Regx.cc
*** libg++-2.7.2/libg++/src/Regx.cc	Mon Jun 17 22:30:24 1996
--- \emx\gnu\libg++-2.7.2/libg++/src/Regx.cc	Tue Sep  3 15:54:04 1996
***************
*** 1,4 ****
! /* 
  Copyright (C) 1988 Free Software Foundation
      written by Doug Lea (dl@rocky.oswego.edu)
  
--- 1,4 ----
! /* Changed for emx by Eberhard Mattes -- Sep 1996
  Copyright (C) 1988 Free Software Foundation
      written by Doug Lea (dl@rocky.oswego.edu)
  
***************
*** 35,41 ****
  #endif
  }
  
! #include <Regex.h>
  
  Regex::~Regex()
  {
--- 35,41 ----
  #endif
  }
  
! #include <Regx.h>
  
  Regex::~Regex()
  {
diff -cr libg++-2.7.2/libg++/src/strclass.h \emx\gnu\libg++-2.7.2/libg++/src/strclass.h
*** libg++-2.7.2/libg++/src/strclass.h	Sat Apr 18 00:51:26 1992
--- \emx\gnu\libg++-2.7.2/libg++/src/strclass.h	Tue Sep  3 15:54:04 1996
***************
*** 1,5 ****
  #ifndef _strclass_h
  #define _strclass_h
! #include <String.h>
  typedef class String string;
  #endif
--- 1,6 ----
+ /* Changed for emx by Eberhard Mattes -- Sep 1996 */
  #ifndef _strclass_h
  #define _strclass_h
! #include <Strng.h>
  typedef class String string;
  #endif
diff -cr libg++-2.7.2/libg++/src/Strng.cc \emx\gnu\libg++-2.7.2/libg++/src/Strng.cc
*** libg++-2.7.2/libg++/src/Strng.cc	Sun Mar 31 00:45:06 1996
--- \emx\gnu\libg++-2.7.2/libg++/src/Strng.cc	Tue Sep  3 15:54:04 1996
***************
*** 1,4 ****
! /* 
  Copyright (C) 1988 Free Software Foundation
      written by Doug Lea (dl@rocky.oswego.edu)
  
--- 1,4 ----
! /* Changed for emx by Eberhard Mattes -- Sep 1996
  Copyright (C) 1988 Free Software Foundation
      written by Doug Lea (dl@rocky.oswego.edu)
  
***************
*** 22,28 ****
  #ifdef __GNUG__
  #pragma implementation
  #endif
! #include <String.h>
  #include <std.h>
  #include <ctype.h>
  #include <limits.h>
--- 22,28 ----
  #ifdef __GNUG__
  #pragma implementation
  #endif
! #include <Strng.h>
  #include <std.h>
  #include <ctype.h>
  #include <limits.h>
diff -cr libg++-2.7.2/libg++/src/Strng.h \emx\gnu\libg++-2.7.2/libg++/src/Strng.h
*** libg++-2.7.2/libg++/src/Strng.h	Fri Jun 16 22:44:36 1995
--- \emx\gnu\libg++-2.7.2/libg++/src/Strng.h	Tue Sep  3 15:54:06 1996
***************
*** 1,5 ****
  // This may look like C code, but it is really -*- C++ -*-
! /* 
  Copyright (C) 1988 Free Software Foundation
      written by Doug Lea (dl@rocky.oswego.edu)
  
--- 1,5 ----
  // This may look like C code, but it is really -*- C++ -*-
! /* Changed for emx by Eberhard Mattes -- Sep 1996
  Copyright (C) 1988 Free Software Foundation
      written by Doug Lea (dl@rocky.oswego.edu)
  
***************
*** 24,30 ****
  #define _String_h 1
  
  #include <iostream.h>
! #include <Regex.h>
  
  #undef OK
  
--- 24,30 ----
  #define _String_h 1
  
  #include <iostream.h>
! #include <Regx.h>
  
  #undef OK
  
diff -cr libg++-2.7.2/libio/filebuf.cc \emx\gnu\libg++-2.7.2/libio/filebuf.cc
*** libg++-2.7.2/libio/filebuf.cc	Wed Feb 28 03:10:44 1996
--- \emx\gnu\libg++-2.7.2/libio/filebuf.cc	Tue Sep  3 15:54:06 1996
***************
*** 1,4 ****
--- 1,5 ----
  /* This is part of libio/iostream, providing -*- C++ -*- input/output.
+    Changed for emx by Eberhard Mattes -- Sep 1996
  Copyright (C) 1993, 1995 Free Software Foundation
  
  This file is part of the GNU IO Library.  This library is free
***************
*** 83,88 ****
--- 84,94 ----
      return NULL;
    int posix_mode;
    int read_write;
+ #ifdef __EMX__
+   int binary_mode = 0;
+   if (mode & ios::bin)
+     binary_mode |= O_BINARY, mode &= ~(int)ios::bin;
+ #endif /* __EMX__ */
    if (mode & ios::app)
      mode |= ios::out;
    if ((mode & (ios::in|ios::out)) == (ios::in|ios::out)) {
***************
*** 111,116 ****
--- 117,125 ----
      posix_mode |= O_CREAT;
    if (mode & (int)ios::noreplace)
      posix_mode |= O_EXCL;
+ #ifdef __EMX__
+   posix_mode |= binary_mode;
+ #endif /* __EMX__ */
    int fd = ::open(filename, posix_mode, prot);
    if (fd < 0)
      return NULL;
diff -cr libg++-2.7.2/libio/fileops.c \emx\gnu\libg++-2.7.2/libio/fileops.c
*** libg++-2.7.2/libio/fileops.c	Tue May 14 18:55:14 1996
--- \emx\gnu\libg++-2.7.2/libio/fileops.c	Tue Sep  3 15:54:06 1996
***************
*** 1,4 ****
! /* 
  Copyright (C) 1993, 1995 Free Software Foundation
  
  This file is part of the GNU IO Library.  This library is free
--- 1,4 ----
! /* Changed for emx by Eberhard Mattes -- Sep 1996
  Copyright (C) 1993, 1995 Free Software Foundation
  
  This file is part of the GNU IO Library.  This library is free
***************
*** 175,180 ****
--- 175,184 ----
      omode = O_RDWR;
      read_write &= _IO_IS_APPENDING;
    }
+ #ifdef __EMX__
+   if (mode[0] == 'b' || (mode[0] == '+' && mode[1] == 'b'))
+     oflags |= O_BINARY;
+ #endif /* __EMX__ */
    fdesc = open(filename, omode|oflags, oprot);
    if (fdesc < 0)
      return NULL;
diff -cr libg++-2.7.2/libio/gen-params \emx\gnu\libg++-2.7.2/libio/gen-params
*** libg++-2.7.2/libio/gen-params	Tue Sep  3 18:23:32 1996
--- \emx\gnu\libg++-2.7.2/libio/gen-params	Tue Sep  3 15:54:06 1996
***************
*** 49,64 ****
  rootdir=`pwd`/..
  gccdir=${gccdir-${rootdir}/gcc}
  binutilsdir=${binutilsdir-${rootdir}/binutils}
! CC=${CC-`if [ -f ${gccdir}/xgcc ] ; \
! 	then echo ${gccdir}/xgcc -B${gccdir}/ ; \
! 	else echo cc ; fi`}
! CXX=${CXX-`if [ -f ${gccdir}/xgcc ] ; \
! 	then echo ${gccdir}/xgcc -B${gccdir}/ ; \
! 	else echo gcc ; fi`}
  CPP=${CPP-`echo ${CC} -E`}
! CONFIG_NM=${CONFIG_NM-`if [ -f ${binutilsdir}/nm.new ] ; \
! 	then echo ${binutilsdir}/nm.new ; \
! 	else echo nm ; fi`}
  
  cat <<!EOF!
  /* AUTOMATICALLY GENERATED; DO NOT EDIT! */ 
--- 49,58 ----
  rootdir=`pwd`/..
  gccdir=${gccdir-${rootdir}/gcc}
  binutilsdir=${binutilsdir-${rootdir}/binutils}
! CC=gcc
! CXX='gcc -x c++'
  CPP=${CPP-`echo ${CC} -E`}
! CONFIG_NM=nm
  
  cat <<!EOF!
  /* AUTOMATICALLY GENERATED; DO NOT EDIT! */ 
diff -cr libg++-2.7.2/libio/iopopen.c \emx\gnu\libg++-2.7.2/libio/iopopen.c
*** libg++-2.7.2/libio/iopopen.c	Wed Feb 28 03:10:38 1996
--- \emx\gnu\libg++-2.7.2/libio/iopopen.c	Tue Sep  3 15:54:06 1996
***************
*** 1,4 ****
--- 1,5 ----
  /* 
+    Changed for emx by Eberhard Mattes -- Sep 1996
  Copyright (C) 1993 Free Software Foundation
  
  This file is part of the GNU IO Library.  This library is free
***************
*** 24,29 ****
--- 25,36 ----
  
  /*  written by Per Bothner (bothner@cygnus.com) */
  
+ #ifdef __EMX__
+ #include <stdlib.h>             /* before defining _POSIX_SOURCE */
+ #include <process.h>
+ #include <fcntl.h>
+ #endif /* __EMX__ */
+ 
  #define _POSIX_SOURCE
  #include "libioP.h"
  #include <sys/types.h>
***************
*** 83,88 ****
--- 90,99 ----
    int pipe_fds[2];
    int parent_end, child_end;
    _IO_pid_t child_pid;
+ #ifdef __EMX__
+   struct _IO_proc_file *pfc;
+   const char *sh, *base, *opt;
+ #endif /* __EMX__ */
    if (_IO_file_is_open(fp))
      return NULL;
    if (_IO_pipe(pipe_fds) < 0)
***************
*** 99,104 ****
--- 110,150 ----
        child_end = pipe_fds[0];
        read_or_write = _IO_NO_READS;
      }
+ #ifdef __EMX__
+   child_pid = -1;
+   for (pfc = proc_file_chain; pfc != NULL; pfc = pfc->next)
+     {
+       /* TODO: Save previous state and restore after starting child. */
+       _fcntl (_IO_fileno ((_IO_FILE *)pfc), F_SETFD, 1);
+     }
+   _fcntl (parent_end, F_SETFD, 1);
+   sh = getenv ("EMXSHELL");
+   if (sh == NULL)
+     sh = getenv ("COMSPEC");
+   if (sh != NULL)
+     {
+       int child_std_end = mode[0] == 'r' ? 1 : 0;
+       int org = _dup (child_std_end);
+       if (org != -1)
+         {
+ 	  _IO_dup2 (child_end, child_std_end);
+ 	  _IO_close (child_end);
+           child_end = -1;
+           base = _getname (sh);
+           if (_stricmp (base, "cmd.exe") == 0
+               || _stricmp (base, "4os2.exe") == 0)
+             opt = "/c";
+           else
+             opt = "-c";
+           child_pid = _spawnlp (P_NOWAIT, sh, sh, opt, command, (char *)0);
+           _IO_dup2 (org, child_std_end);
+           _IO_close (org);
+         }
+     }
+   ((_IO_proc_file*)fp)->pid = child_pid;
+   if (child_end != -1)
+     _IO_close (child_end);
+ #else /* not __EMX__ */
    ((_IO_proc_file*)fp)->pid = child_pid = _IO_fork();
    if (child_pid == 0)
      {
***************
*** 122,127 ****
--- 168,174 ----
        _IO__exit(127);
      }
    _IO_close(child_end);
+ #endif /* not __EMX__ */
    if (child_pid < 0)
      {
        _IO_close(parent_end);
