From: kevin@tamri.com (Kevin Dalley)
Subject: patches for libg++-2.0 for mips-sgi-irix4
Reply-To: kevin@tamri.com
Organization: TOSHIBA America MRI, South San Francisco, CA
Distribution: gnu
Date: Wed, 15 Apr 1992 01:07:27 GMT

While these are not the best of all possible patches, I'll send them
out anyway.  Apply these patches from the top level directory.  Run:
./configure mips-sgi-irix4 -target=mips-sgi-irix4
cd libg++.  Then run make.
When you change to tests and run "make runtests", tString dumps a
core, but everything else works.  Finally, make install will put it in
the right place.

There are many places where I have put "#ifdef sgi" even though
something else is more appropriate.  The change to the configure files
are somewhat arbitrary.  Add more apologies here.  Anyway, here it is.

*** ./libg++/g++-include/sys/wait.h.O	Tue Mar 10 18:39:45 1992
--- ./libg++/g++-include/sys/wait.h	Wed Mar 18 18:06:02 1992
***************
*** 17,23 ****
--- 17,27 ----
  struct rusage;
  extern int wait(int*);
  extern int waitpid(int, int*, int);
+ #ifdef sgi
+ int wait3 (union wait *, int, struct rusage	*);
+ #else
  extern int wait3(int*, int options, struct rusage*);
+ #endif
  extern int wait4(int, int*, int, struct rusage*);
  #endif
  }
*** ./libg++/g++-include/sys/socket.h.O	Thu Feb  6 23:26:31 1992
--- ./libg++/g++-include/sys/socket.h	Wed Mar 18 18:12:33 1992
***************
*** 19,29 ****
--- 19,39 ----
  // void* in select, since different systems use int* or fd_set*
  int       select(int, void*, void*, void*, struct timeval*);
  
+ #ifdef sgi
+ int accept(int, void *, int *);
+ #else
  int       accept(int, struct sockaddr*, int*);
+ #endif
  int       bind(int, const void*, int);
+ #ifdef sgi
+ int connect(int, const void *, int);
+ int getsockname(int, void *, int *);
+ int getpeername(int, void *, int *);
+ #else
  int       connect(int, struct sockaddr*, int);
  int       getsockname(int, struct sockaddr*, int*);
  int       getpeername(int, struct sockaddr*, int*);  // 16 Oct 90 Talisman
+ #endif
  int       getsockopt(int, int, int, void*, int*);
  int       listen(int, int);
  int       rcmd(char**, int, const char*, const char*, const char*, int*);
***************
*** 33,41 ****
--- 43,59 ----
  int       rexec(char**, int, const char*, const char*, const char*, int*);
  int       rresvport(int*);
  int       send(int, const void*, int, int);
+ #ifdef sgi
+ int sendto(int, const void *, int, int, const void *, int);
+ #else
  int       sendto(int, const void*, int, int, const char*, int);
+ #endif
  int       sendmsg(int, const struct msghdr*, int);
+ #if sgi
+ int setsockopt(int, int, int, const void *, int);
+ #else
  int       setsockopt(int, int, int, const char*, int);
+ #endif
  int       shutdown(int, int);
  int       socket(int, int, int);
  int       socketpair(int, int, int, int sv[2]);
*** ./libg++/g++-include/sys/resource.h.O	Tue Mar 10 18:39:42 1992
--- ./libg++/g++-include/sys/resource.h	Mon Apr 13 20:11:01 1992
***************
*** 1,7 ****
  #ifndef __libgxx_sys_resource_h
  
! #ifndef USG
! 
  extern "C"
  {
  #ifdef __sys_resource_h_recursive
--- 1,6 ----
  #ifndef __libgxx_sys_resource_h
  
! #if !defined(USG) || defined(sgi)
  extern "C"
  {
  #ifdef __sys_resource_h_recursive
***************
*** 20,26 ****
--- 19,29 ----
  
  int getrusage(int, struct rusage*);
  int getrlimit (int resource, struct rlimit *rlp);
+ #ifdef sgi
+ int setrlimit (int resource, const struct rlimit *rlp);
+ #else
  int setrlimit (int resource, struct rlimit *rlp);
+ #endif
  long      ulimit(int, long);
  int       getpriority(int, int);
  int       setpriority(int, int, int);
*** ./libg++/g++-include/memory.h.O	Fri Jan 17 15:04:40 1992
--- ./libg++/g++-include/memory.h	Wed Mar 18 15:52:16 1992
***************
*** 19,29 ****
--- 19,38 ----
  }
  
  #ifdef USG
+ #ifdef sgi
+ extern "C" {
+ void      bcopy(const void*, void*, int); // USG uses version in bcopy.c
+ int       bcmp(const void*, const void*, int);
+ void      bzero(void*, int);
+ }
+ 
+ #else
  void  libgxx_bcopy(const void*, void*, size_t);
  inline void  bcopy(const void* s, void* d, size_t n) { libgxx_bcopy(s, d, n); }
  inline void  bzero(void* s, int l) { memset(s, 0, l); }
  inline int   bcmp(const void* s, const void* t, int l) {return memcmp(s,t,l);}
  
+ #endif /* sgi */
  #else /* not USG */
  
  extern "C" {
*** ./libg++/g++-include/unistd.h.O	Wed Feb 26 12:37:01 1992
--- ./libg++/g++-include/unistd.h	Thu Mar 12 21:12:51 1992
***************
*** 30,36 ****
  unsigned  alarm(unsigned);
  int       brk(void*);
  int       chdir(const char*);
! int       chmod(const char*, int);
  int       chown(const char*, int, int);
  int       close(int);
  char*     crypt(const char*, const char*);
--- 30,36 ----
  unsigned  alarm(unsigned);
  int       brk(void*);
  int       chdir(const char*);
! int       chmod(const char*, short unsigned int);
  int       chown(const char*, int, int);
  int       close(int);
  char*     crypt(const char*, const char*);
*** ./libg++/g++-include/signal.h.O	Fri Mar  6 16:28:19 1992
--- ./libg++/g++-include/signal.h	Wed Mar 18 18:20:20 1992
***************
*** 34,40 ****
--- 34,44 ----
  
  // The Interviews folks call this SignalHandler. Might as well conform.
  // Beware: some systems think that SignalHandler returns int.
+ #ifdef sgi
+ typedef void (*SignalHandler) (int, ...);
+ #else
  typedef void (*SignalHandler) (...);
+ #endif
  
  extern SignalHandler signal(int sig, SignalHandler action);
  extern SignalHandler sigset(int sig, SignalHandler action);
***************
*** 43,49 ****
--- 47,57 ----
  extern int           kill (int pid, int sig);
  extern int           killpg(int, int);
  extern int           siginterrupt(int, int);
+ #ifdef sgi
+ int	psignal(unsigned, char *);
+ #else
  extern void          psignal(unsigned, char*);
+ #endif
  
  #ifndef hpux // Interviews folks claim that hpux doesn't like these
  extern int           sigsetmask(int mask);
*** ./libg++/iostream/streambuf.h.O	Wed Mar 18 18:35:14 1992
--- ./libg++/iostream/streambuf.h	Wed Mar 18 18:35:05 1992
***************
*** 33,39 ****
--- 33,43 ----
  #define NULL ((void*)0)
  #endif
  #ifndef BUFSIZ
+ #ifdef sgi
+ #define	BUFSIZ	8192
+ #else
  #define BUFSIZ 1024
+ #endif
  #endif
  
  class ostream; class streambuf;
*** ./libg++/src/bcopy.cc.O	Fri Jan 17 15:27:10 1992
--- ./libg++/src/bcopy.cc	Wed Mar 18 15:53:05 1992
***************
*** 1,4 ****
! #if defined(USG) && !defined(hpux)
  
  /* SysV version of bcopy from Eric Newton */
  
--- 1,4 ----
! #if defined(USG) && !defined(hpux) && !defined(sgi)
  
  /* SysV version of bcopy from Eric Newton */
  
*** ./libg++/test-install/foo_main.cc.O	Mon Jan  6 01:05:55 1992
--- ./libg++/test-install/foo_main.cc	Mon Mar 30 20:45:31 1992
***************
*** 25,31 ****
      Foo::init_foo();
  }
  
! static Foo static_foo = Foo( "static_foo1"); 
  
  main() 
  { 
--- 25,31 ----
      Foo::init_foo();
  }
  
! static Foo static_foo( "static_foo1");
  
  main() 
  { 
*** ./libg++/tests/Makefile.in.O	Sat Mar  7 16:07:11 1992
--- ./libg++/tests/Makefile.in	Mon Apr 13 20:17:09 1992
***************
*** 146,152 ****
  LIBS = ../libg++.a
  
  .PHONY: all
! all:
  
  .PHONY: boltcc
  boltcc:
--- 146,152 ----
  LIBS = ../libg++.a
  
  .PHONY: all
! all: $(TESTS)
  
  .PHONY: boltcc
  boltcc:
*** ./libg++/configure.in.O	Sat Mar  7 16:04:14 1992
--- ./libg++/configure.in	Mon Apr 13 19:12:54 1992
***************
*** 11,16 ****
--- 11,37 ----
  
  # per-target:
  
+ case "${target_cpu}" in
+ 
+ mips)
+ 	case "${target_os}" in
+ 	irix4)	lib_target=irix4 ;;
+ 	esac
+ 	;;
+ 
+ esac
+ 
+ if [ ! -f ${srcdir}/config/mt-${lib_target} ]; then
+ 	echo '***' "libg++ does not support host ${host}" 1>&2
+ 	exit 1
+ fi
+ 
+ #  We really shouldn't depend on there being a space after TM_FILE= ...
+ targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <${srcdir}/config/mt-${lib_target}`
+ 
+ #host_makefile_frag=config/mh-${gdb_host}
+ target_makefile_frag=config/mt-${lib_target}
+ 
  case "${srcdir}" in
  ".") ;;
  *)
*** ./libg++/config/mt-irix4.O	Tue Apr 14 17:36:29 1992
--- ./libg++/config/mt-irix4	Tue Apr 14 13:04:21 1992
***************
*** 0 ****
--- 1,8 ----
+ # target specific configuration information for irix4
+ 
+ OSFLAG= -DUSG -DNO_ST_BLKSIZE -DNO_DOLLAR_IN_LABEL
+ XTRAFLAGS = -DCOFF_ENCAPSULATE $(OSFLAG)
+ OSLIBS = -lPW
+ RANLIB = echo >/dev/null
+ 
+ INSTALL = bsdinst.sh -c


--
Kevin Dalley
kevin@tamri.com



Newsgroups: gnu.g++.lib.bug