[comp.unix.i386] Patches for LIBG++ 1.37.0 for UNIX ISC 2.2

src@eliabel.sf.ca.us (08/18/90)

Here are the patches for LIBG++ 1.37.0 for UNIX ISC 2.2 using GNU
COFF. Two notes:

	+ Rename libgxx_ioob.{h,c} to libgxxioob.{h,c} in
	  include and src directories. The name was too long.

	+ Patches to libg++.texinfo are such that it can
	  be texinfo-formatted under GNU Emacs.

Eric P. Meyer
ELIABEL Corp.
emeyer@eliabel.sf.ca.us

diff -rp libg++-1.37.0/Makefile ../libg++-1.37.0/Makefile
*** libg++-1.37.0/Makefile	Wed Feb 28 02:17:18 1990
--- ../libg++-1.37.0/Makefile	Thu Aug  9 16:27:27 1990
*************** IDIR = $(prefix)/lib/g++-include
*** 57,69 ****
  # ------- use the second form of each for SystemV (USG)
  
  # g++ flags
! OSFLAG=
! #OSFLAG = -DUSG
  
  # other compilation control flags -- use any combination
  
  # use this only if you have a strange stdio implementation
! #XTRAFLAGS = -DDEFAULT_filebuf
  
  # use this if you do not want gnulib3 in libg++.a
  #XTRAFLAGS = -DNO_GNULIB3
--- 57,69 ----
  # ------- use the second form of each for SystemV (USG)
  
  # g++ flags
! #OSFLAG=
! OSFLAG = -DUSG
  
  # other compilation control flags -- use any combination
  
  # use this only if you have a strange stdio implementation
! XTRAFLAGS = -DDEFAULT_filebuf
  
  # use this if you do not want gnulib3 in libg++.a
  #XTRAFLAGS = -DNO_GNULIB3
*************** OSFLAG=
*** 82,100 ****
  #XTRAFLAGS = -DMALLOC_STATS
  
  # ld or ld++ flags
! OSLDFLAG =
! #OSLDFLAG= -lPW
  
  # how to install
! INSTALL=install -c
! #INSTALL=cp
  
  # ranlib if necessary
! RANLIB=ranlib
! #RANLIB=echo
  
  # which make?
! MAKE=make
  
  # not used, but convenient for those who preprocess things while compiling
  SHELL=/bin/sh
--- 82,100 ----
  #XTRAFLAGS = -DMALLOC_STATS
  
  # ld or ld++ flags
! #OSLDFLAG =
! OSLDFLAG= -lPW
  
  # how to install
! #INSTALL=install -c
! INSTALL=cp
  
  # ranlib if necessary
! #RANLIB=ranlib
! RANLIB=echo
  
  # which make?
! MAKE=gmake
  
  # not used, but convenient for those who preprocess things while compiling
  SHELL=/bin/sh
*************** GXXFLAGS = $(OSFLAG) $(GXX_INCLUDE_DIRS)
*** 145,151 ****
  CFLAGS= $(OSFLAG) $(GCC_INCLUDE_DIRS) $(DEBUG_FLAGS) $(GCC_OPTIMIZATION_FLAGS) $(VERBOSITY_FLAGS) $(XTRAFLAGS) $(PIPE_AS)
  
  # g++ load time flags 
! GXXLDFLAGS = -L$(PWD)/src -lg++ -lm $(OSLDFLAG)
  
  
  ###########################################################################
--- 145,151 ----
  CFLAGS= $(OSFLAG) $(GCC_INCLUDE_DIRS) $(DEBUG_FLAGS) $(GCC_OPTIMIZATION_FLAGS) $(VERBOSITY_FLAGS) $(XTRAFLAGS) $(PIPE_AS)
  
  # g++ load time flags 
! GXXLDFLAGS = -L$(PWD)/src -lm $(OSLDFLAG)
  
  
  ###########################################################################
diff -rp libg++-1.37.0/etc/graph/Makefile ../libg++-1.37.0/etc/graph/Makefile
*** libg++-1.37.0/etc/graph/Makefile	Sat Jan  6 06:09:56 1990
--- ../libg++-1.37.0/etc/graph/Makefile	Thu Aug  9 16:11:51 1990
*************** test: graph test.dat test2.dat
*** 109,117 ****
  	./graph -d <test.dat >test.pl
  	@echo use plot to look at the plot files test.pl and test2.pl
  
! libgraph.a : point.Plex.o point.XPlex.o eGetOpt.o ePlotFile.o read_data.o tick_interval.o
  	rm -f libgraph.a
! 	ar cr libgraph.a point.Plex.o point.XPlex.o eGetOpt.o ePlotFile.o read_data.o tick_interval.o
  	$(RANLIB) libgraph.a
  
  graph : graph.o libgraph.a
--- 109,117 ----
  	./graph -d <test.dat >test.pl
  	@echo use plot to look at the plot files test.pl and test2.pl
  
! libgraph.a : point.Plex.o point.XPlex.o eGetOpt.o ePlotFile.o read_data.o tick_int.o
  	rm -f libgraph.a
! 	ar cr libgraph.a point.Plex.o point.XPlex.o eGetOpt.o ePlotFile.o read_data.o tick_int.o
  	$(RANLIB) libgraph.a
  
  graph : graph.o libgraph.a
*************** depend::
*** 141,148 ****
  DIST = Makefile graph.tex ChangeLog \
  eGetOpt.cc		read_data.cc \
  eGetOpt.h		read_data.h \
! ePlotFile.cc		tick_interval.cc \
! ePlotFile.h		tick_interval.h \
  graph.cc		point.defs.h
  
  graph.tar.Z : $(DIST) CHECKSUMS
--- 141,148 ----
  DIST = Makefile graph.tex ChangeLog \
  eGetOpt.cc		read_data.cc \
  eGetOpt.h		read_data.h \
! ePlotFile.cc		tick_int.cc \
! ePlotFile.h		tick_int.h \
  graph.cc		point.defs.h
  
  graph.tar.Z : $(DIST) CHECKSUMS
*************** realclean: clean
*** 172,181 ****
  eGetOpt.o : eGetOpt.cc eGetOpt.h 
  ePlotFile.o : ePlotFile.cc ePlotFile.h 
  graph.o : graph.cc read_data.h point.XPlex.h point.Plex.h point.defs.h \
!   eGetOpt.h ePlotFile.h tick_interval.h 
  point.Plex.o : point.Plex.cc point.Plex.h point.defs.h 
  point.XPlex.o : point.XPlex.cc point.XPlex.h point.Plex.h point.defs.h 
  read_data.o : read_data.cc read_data.h point.XPlex.h point.Plex.h \
    point.defs.h 
! tick_interval.o : tick_interval.cc tick_interval.h
  
--- 172,181 ----
  eGetOpt.o : eGetOpt.cc eGetOpt.h 
  ePlotFile.o : ePlotFile.cc ePlotFile.h 
  graph.o : graph.cc read_data.h point.XPlex.h point.Plex.h point.defs.h \
!   eGetOpt.h ePlotFile.h tick_int.h 
  point.Plex.o : point.Plex.cc point.Plex.h point.defs.h 
  point.XPlex.o : point.XPlex.cc point.XPlex.h point.Plex.h point.defs.h 
  read_data.o : read_data.cc read_data.h point.XPlex.h point.Plex.h \
    point.defs.h 
! tick_int.o : tick_int.cc tick_int.h
  
diff -rp libg++-1.37.0/g++-include/std.h ../libg++-1.37.0/g++-include/std.h
*** libg++-1.37.0/g++-include/std.h	Sat Feb 24 11:48:13 1990
--- ../libg++-1.37.0/g++-include/std.h	Wed Aug  8 14:12:37 1990
*************** int       close(int);
*** 53,59 ****
--- 53,63 ----
  #ifdef DGUX
  int       creat(char*, unsigned long int);
  #else
+ #ifdef USG
+ int 	creat(char const *, unsigned short);
+ #else
  int       creat(const char*, unsigned long int);
+ #endif
  #endif
  char*     crypt(const char*, const char*);
  char*     ctermid(char*);
diff -rp libg++-1.37.0/g++-include/sys/resource.h ../libg++-1.37.0/g++-include/sys/resource.h
*** libg++-1.37.0/g++-include/sys/resource.h	Thu Nov 16 02:57:15 1989
--- ../libg++-1.37.0/g++-include/sys/resource.h	Thu Aug  9 16:22:55 1990
***************
*** 5,10 ****
--- 5,11 ----
  
  extern "C"
  {
+ #ifndef USG
  
  #define KERNEL
  #include "//usr/include/sys/resource.h"
*************** int getrusage(int, struct rusage*);
*** 18,23 ****
--- 19,25 ----
  int getrlimit (int resource, struct rlimit *rlp);
  int setrlimit (int resource, struct rlimit *rlp);
  
+ #endif
  }
  
  #endif
diff -rp libg++-1.37.0/gperf/gperf.texinfo ../libg++-1.37.0/gperf/gperf.texinfo
*** libg++-1.37.0/gperf/gperf.texinfo	Sun Feb 18 16:53:01 1990
--- ../libg++-1.37.0/gperf/gperf.texinfo	Mon Aug 13 19:45:14 1990
*************** archived in comp.sources.unix, volume 20
*** 444,452 ****
  A @dfn{static search structure} is an Abstract Data Type with certain
  fundamental operations, @emph{e.g.}, @emph{initialize}, @emph{insert},
  and @emph{retrieve}.  Conceptually, all insertions occur before any
! retrievals.@footnote{In practice, @code{gperf} generates a @code{static} array 
  containing search set keywords and any associated  attributes specified by the 
! user.  Thus, there is essentially no execution-time cost for the insertions.} 
  It is a useful data structure for representing 
  @emph{static search sets}.  Static search sets occur
  frequently in software system applications.  Typical static search
--- 444,452 ----
  A @dfn{static search structure} is an Abstract Data Type with certain
  fundamental operations, @emph{e.g.}, @emph{initialize}, @emph{insert},
  and @emph{retrieve}.  Conceptually, all insertions occur before any
! retrievals.In practice, @code{gperf} generates a @code{static} array 
  containing search set keywords and any associated  attributes specified by the 
! user.  Thus, there is essentially no execution-time cost for the insertions.
  It is a useful data structure for representing 
  @emph{static search sets}.  Static search sets occur
  frequently in software system applications.  Typical static search
*************** particular class of static search sets. 
*** 472,481 ****
  function is defined by two properties:
  
  @itemize @bullet
! @item It allows keyword recognition in a static search set using
  at most @emph{one} probe into the hash table.  This represents the
  ``perfect'' property.
! @item The actual memory allocated to store the keywords is precisely
  large enough for the keyword set, and @emph{no larger}.  This is the
  ``minimal'' property.
  @end itemize
--- 472,483 ----
  function is defined by two properties:
  
  @itemize @bullet
! @item
! It allows keyword recognition in a static search set using
  at most @emph{one} probe into the hash table.  This represents the
  ``perfect'' property.
! @item 
! The actual memory allocated to store the keywords is precisely
  large enough for the keyword set, and @emph{no larger}.  This is the
  ``minimal'' property.
  @end itemize
*************** search structures by hand.  It has prove
*** 500,507 ****
  for serious programming projects.  Output from @code{gperf} is
  currently used in several production and research compilers, including
  GNU C, GNU C++, GNU Pascal, and GNU Modula 
! 3.@footnote{The latter two compilers are not yet part of the official GNU distr
! ibution.} 
  Each compiler utilizes @code{gperf} to automatically generate static search
  structures that efficiently identify their respective reserved
  keywords.
--- 502,508 ----
  for serious programming projects.  Output from @code{gperf} is
  currently used in several production and research compilers, including
  GNU C, GNU C++, GNU Pascal, and GNU Modula 
! 3. The latter two compilers are not yet part of the official GNU distribution. 
  Each compiler utilizes @code{gperf} to automatically generate static search
  structures that efficiently identify their respective reserved
  keywords.
diff -rp libg++-1.37.0/gperf/src/Makefile ../libg++-1.37.0/gperf/src/Makefile
*** libg++-1.37.0/gperf/src/Makefile	Sun Dec 10 13:45:35 1989
--- ../libg++-1.37.0/gperf/src/Makefile	Thu Aug  9 16:30:27 1990
*************** OFLAGS= -O -fdelayed-branch -fsave-memoi
*** 24,30 ****
  GXXFLAGS= $(DFLAGS) $(OFLAGS)
  OBJS  = new.o options.o iterator.o main.o gen-perf.o key-list.o list-node.o \
          hash-table.o bool-array.o read-line.o std-err.o version.o 
! LIBS  = -lg++
  .SUFFIXES: .cc
  .cc.o:
  	$(GXX) $(GXXFLAGS) -c  $<
--- 24,30 ----
  GXXFLAGS= $(DFLAGS) $(OFLAGS)
  OBJS  = new.o options.o iterator.o main.o gen-perf.o key-list.o list-node.o \
          hash-table.o bool-array.o read-line.o std-err.o version.o 
! LIBS  = -lm
  .SUFFIXES: .cc
  .cc.o:
  	$(GXX) $(GXXFLAGS) -c  $<
diff -rp libg++-1.37.0/gperf/src/gen-perf.cc ../libg++-1.37.0/gperf/src/gen-perf.cc
*** libg++-1.37.0/gperf/src/gen-perf.cc	Fri Feb 23 14:46:51 1990
--- ../libg++-1.37.0/gperf/src/gen-perf.cc	Thu Aug  9 16:34:28 1990
*************** the Free Software Foundation, 675 Mass A
*** 26,31 ****
--- 26,36 ----
  #include "options.h"
  #include "gen-perf.h"
  
+ #ifdef USG
+ #define random() rand()
+ #define srandom(x) srand(x)
+ #endif
+ 
  /* Current release version. */
  extern char *version_string;
  
diff -rp libg++-1.37.0/src/Makefile ../libg++-1.37.0/src/Makefile
*** libg++-1.37.0/src/Makefile	Wed Feb 28 02:14:22 1990
--- ../libg++-1.37.0/src/Makefile	Wed Aug  8 15:47:17 1990
*************** SRCS = AllocRing.cc  Obstack.cc File.cc 
*** 142,148 ****
   Fix.cc Fix16.cc Fix24.cc Curses.cc GetOpt.cc gnulib3.c EH.cc EH2.c \
   malloc.c new.cc delete.cc xyzzy.cc chr.cc dtoa.cc error.cc \
   form.cc gcd.cc hash.cc itoa.cc \
!  lg.cc libgxx_fmtq.cc libgxx_io_ob.cc pow.cc sqrt.cc str.cc timer.cc
  
  OBJS = AllocRing.o Obstack.o File.o  ostream.o istream.o \
   streambuf.o filebuf.o Filebuf.o \
--- 142,148 ----
   Fix.cc Fix16.cc Fix24.cc Curses.cc GetOpt.cc gnulib3.c EH.cc EH2.c \
   malloc.c new.cc delete.cc xyzzy.cc chr.cc dtoa.cc error.cc \
   form.cc gcd.cc hash.cc itoa.cc \
!  lg.cc libgxx_fmtq.cc libgxx_ioob.cc pow.cc sqrt.cc str.cc timer.cc
  
  OBJS = AllocRing.o Obstack.o File.o  ostream.o istream.o \
   streambuf.o filebuf.o Filebuf.o \
*************** OBJS = AllocRing.o Obstack.o File.o  ost
*** 155,161 ****
   Fix.o Fix16.o Fix24.o Curses.o GetOpt.o EH.o EH2.o\
   xyzzy.o gnulib3.o new.o delete.o malloc.o chr.o dtoa.o error.o form.o gcd.o \
   hash.o itoa.o \
!  lg.o libgxx_fmtq.o libgxx_io_ob.o pow.o sqrt.o str.o timer.o
  
  ###########################################################################
  #
--- 155,161 ----
   Fix.o Fix16.o Fix24.o Curses.o GetOpt.o EH.o EH2.o\
   xyzzy.o gnulib3.o new.o delete.o malloc.o chr.o dtoa.o error.o form.o gcd.o \
   hash.o itoa.o \
!  lg.o libgxx_fmtq.o libgxx_ioob.o pow.o sqrt.o str.o timer.o
  
  ###########################################################################
  #
*************** libgxx_fmtq.o : libgxx_fmtq.cc $(SRCIDIR
*** 412,418 ****
    $(SRCIDIR)/stddef.h $(SRCIDIR)/std.h \
    $(SRCIDIR)/stdio.h $(SRCIDIR)/math.h \
    $(SRCIDIR)/values.h $(SRCIDIR)/AllocRing.h 
! libgxx_io_ob.o : libgxx_io_ob.cc $(SRCIDIR)/Obstack.h \
    $(SRCIDIR)/std.h $(SRCIDIR)/stddef.h \
    $(SRCIDIR)/stdio.h 
  new.o : new.cc $(SRCIDIR)/stddef.h \
--- 412,418 ----
    $(SRCIDIR)/stddef.h $(SRCIDIR)/std.h \
    $(SRCIDIR)/stdio.h $(SRCIDIR)/math.h \
    $(SRCIDIR)/values.h $(SRCIDIR)/AllocRing.h 
! libgxx_ioob.o : libgxx_ioob.cc $(SRCIDIR)/Obstack.h \
    $(SRCIDIR)/std.h $(SRCIDIR)/stddef.h \
    $(SRCIDIR)/stdio.h 
  new.o : new.cc $(SRCIDIR)/stddef.h \
diff -rp libg++-1.37.0/tests/test.hello.cc ../libg++-1.37.0/tests/test.hello.cc
*** libg++-1.37.0/tests/test.hello.cc	Fri Dec 29 06:12:49 1989
--- ../libg++-1.37.0/tests/test.hello.cc	Wed Aug  8 16:10:19 1990
*************** extern "C" {
*** 13,18 ****
--- 13,22 ----
  
  #include <sys/file.h>
  
+ #ifdef USG
+ #include <unistd.h>
+ #endif
+ 
  #if defined(MIPSEL) || defined(USG) 
  #if !defined(hpux)
  #define exec aouthdr
*************** void *tfile::load ()
*** 75,80 ****
--- 79,86 ----
    int size = header.a_text + header.a_data;
  #ifdef EXEC_PAGESIZE
    int pagsiz = EXEC_PAGESIZE;
+ #elif i386
+   int pagsiz = 4096;
  #elif !defined(PAGSIZ)
    int pagsiz = getpagesize();
  #else
*************** void *tfile::load ()
*** 103,109 ****
--- 109,119 ----
      }
  
    int fd = open (tname, 2, 0);
+ #ifdef USG
+   if (lseek (fd, sizeof (header), SEEK_SET) < 0)
+ #else
    if (lseek (fd, sizeof (header), L_SET) < 0)
+ #endif
      {
        perror ("Error in temp file seek\n");
        delete this;