[gnu.gdb.bug] changes to gdb3.2 for hp-ux

glenne@HPLSLA.HP.COM (Glenn Engel) (07/21/89)

I found the following patches to gdb3.2 necessary to compile gdb on hpux 6.5.

1) change HPUX to hpux in malloc.c
2) change HPUX to hpux in readline.c
   additional qualifier to determine which rl_getc to use.
3) addition of SYSV_MUNCH in Makefile.  hp's nm matches the second
   form in munch so the regular SYSV_DEFINE cannot be passed to munch
   for hpux.
4) modification of __GNU__ to __GNUC__ in m-hp9k320.h

Glenn Engel
glenne@hplsla%hplabs.hp.com

*** malloc.c.orig	Mon Jul 17 12:17:51 1989
--- malloc.c	Mon Jul 17 15:27:24 1989
***************
*** 160,165
  #endif /* SIGIO */
  #endif /* SIGTSTP */
  
  #endif /* not emacs */
  
  /* Define getpagesize () if the system does not.  */

--- 160,169 -----
  #endif /* SIGIO */
  #endif /* SIGTSTP */
  
+ #ifdef hpux
+ #define USG
+ #endif
+ 
  #endif /* not emacs */
  
  /* Define getpagesize () if the system does not.  */
***************
*** 678,684
    return aligned;
  }
  
! #ifndef HPUX
  /* This runs into trouble with getpagesize on HPUX.
     Patching out seems cleaner than the ugly fix needed.  */
  char *

--- 682,688 -----
    return aligned;
  }
  
! #ifndef hpux
  /* This runs into trouble with getpagesize on HPUX.
     Patching out seems cleaner than the ugly fix needed.  */
  char *
***************
*** 686,692
  {
    return memalign (getpagesize (), size);
  }
! #endif /* not HPUX */
  #endif /* not VMS */
  
  #ifdef MSTATS

--- 690,696 -----
  {
    return memalign (getpagesize (), size);
  }
! #endif /* not hpux */
  #endif /* not VMS */
  
  #ifdef MSTATS
***************
*** 770,775
   *	BSD systems this is the total space allocatable to stack and
   *	data.  On USG systems this is the data space only.
   */
  
  #ifdef USG
  

--- 774,781 -----
   *	BSD systems this is the total space allocatable to stack and
   *	data.  On USG systems this is the data space only.
   */
+ 
+ 
  
  #ifdef USG
  
*** readline.c.ori	Sun May 21 09:38:12 1989
--- readline.c	Mon Jul 17 12:16:09 1989
***************
*** 40,46
  extern int login_shell;
  #endif
  
! #if !defined(SYSV) || defined(HPUX)
  #include <sys/dir.h>
  #else  /* SYSV */
  #include <dirent.h>

--- 40,46 -----
  extern int login_shell;
  #endif
  
! #if !defined(SYSV) || defined(hpux)
  #include <sys/dir.h>
  #else  /* SYSV */
  #include <dirent.h>
***************
*** 65,71
  #endif
  #endif
  
! #ifdef SYSV
  #define rl_getc(x) sysv_getc (x)
  #else
  #define rl_getc(x) getc (x)

--- 65,71 -----
  #endif
  #endif
  
! #if defined SYSV && !defined hpux
  #define rl_getc(x) sysv_getc (x)
  #else
  #define rl_getc(x) getc (x)
***************
*** 990,996
    }
  }
  
! #if defined(SYSV) || defined(HPUX)
  static struct termio otio;
  
  static

--- 990,996 -----
    }
  }
  
! #if defined(SYSV) || defined(hpux)
  static struct termio otio;
  
  static
***************
*** 1061,1067
    ioctl (tty, TIOCSETN, &the_ttybuff);
    readline_echoing_p = 1;
  }
! #endif  /* SYSV || HPUX */
  
  
  /* **************************************************************** */

--- 1061,1067 -----
    ioctl (tty, TIOCSETN, &the_ttybuff);
    readline_echoing_p = 1;
  }
! #endif  /* SYSV || hpux */
  
  
  /* **************************************************************** */
*** Makefile.orig	Mon Jul 17 10:08:07 1989
--- Makefile	Thu Jul 20 21:25:59 1989
***************
*** 88,93
  # define this to be SYSV if compiling on a system V or HP machine.
  # SYSV_DEFINE = -DSYSV
  SYSV_DEFINE =
  
  # Flags that describe where you can find the termcap library.
  # You may need to make other arrangements for USG.

--- 88,95 -----
  # define this to be SYSV if compiling on a system V or HP machine.
  # SYSV_DEFINE = -DSYSV
  SYSV_DEFINE =
+ #
+ # SYSV_MUNCH = -DSYSV
  
  # Flags that describe where you can find the termcap library.
  # You may need to make other arrangements for USG.
***************
*** 166,172
  
  gdb : $(OBS) $(TSOBS) ${ADD_DEPS}
  	rm -f init.c
! 	./munch ${SYSV_DEFINE} $(OBS) $(TSOBS) > init.c
  	${CC-LD} $(LDFLAGS) -o gdb init.c $(OBS) $(TSOBS) $(CLIBS)
  
  xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS}

--- 168,174 -----
  
  gdb : $(OBS) $(TSOBS) ${ADD_DEPS}
  	rm -f init.c
! 	./munch ${SYSV_MUNCH} $(OBS) $(TSOBS) > init.c
  	${CC-LD} $(LDFLAGS) -o gdb init.c $(OBS) $(TSOBS) $(CLIBS)
  
  xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS}
***************
*** 171,177
  
  xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS}
  	rm -f init.c
! 	./munch ${SYSV_DEFINE} $(OBS) $(TSOBS) xgdb.o > init.c
  	$(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
  	-lXaw -lXmu -lXt -lX11 $(CLIBS)
  

--- 173,179 -----
  
  xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS}
  	rm -f init.c
! 	./munch ${SYSV_MUNCH} $(OBS) $(TSOBS) xgdb.o > init.c
  	$(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
  	-lXaw -lXmu -lXt -lX11 $(CLIBS)
  
***************
*** 181,187
  
  kdb : $(NTSSTART) $(OBS) $(NTSOBS)${ADD_DEPS}
  	rm -f init.c
! 	./munch ${SYSV_DEFINE} $(OBS) $(NTSOBS) > init.c
  	$(CC-LD) $(LDFLAGS) -c init.c $(CLIBS)
  	ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o -lc $(CLIBS)
  

--- 183,189 -----
  
  kdb : $(NTSSTART) $(OBS) $(NTSOBS)${ADD_DEPS}
  	rm -f init.c
! 	./munch ${SYSV_MUNCH} $(OBS) $(NTSOBS) > init.c
  	$(CC-LD) $(LDFLAGS) -c init.c $(CLIBS)
  	ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o -lc $(CLIBS)
  
*** m-hp9k320.h.orig	Mon Jul 17 12:11:47 1989
--- m-hp9k320.h	Mon Jul 17 12:11:56 1989
***************
*** 30,36
  #define HP_OS_BUG
  
  /* Set flag to indicate whether HP's assembler is in use. */
! #ifdef __GNU__
  #ifdef __HPUX_ASM__
  #define HPUX_ASM
  #endif

--- 30,36 -----
  #define HP_OS_BUG
  
  /* Set flag to indicate whether HP's assembler is in use. */
! #ifdef __GNUC__
  #ifdef __HPUX_ASM__
  #define HPUX_ASM
  #endif