Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!luth!sunic!bmc.uu.se!kuling!jand From: jand@kuling.UUCP (Jan Dj{rv) Newsgroups: comp.sys.hp Subject: How to make gcc & g++ on HP-UX 7.0 (Patches part 02/02) Message-ID: <1586@kuling.UUCP> Date: 4 Jul 90 08:54:31 GMT Reply-To: jand@kuling.UUCP (Jan Dj{rv) Organization: Dept. of Computer Systems, Uppsala University, Sweden Lines: 724 #!/bin/sh # This is a shell archive (shar 3.30) # made 07/04/1990 08:23 UTC by jhd@irfu.se # Source directory /users/nobackup/data/jhd # # existing files WILL be overwritten # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 7414 -rw-r--r-- g++.diff # 10007 -rw-r--r-- libg++.diff # if touch 2>&1 | fgrep 'mmdd' > /dev/null then TOUCH=touch else TOUCH=true fi # ============= g++.diff ============== echo "x - extracting g++.diff (Text)" sed 's/^X//' << 'SHAR_EOF' > g++.diff && X*** g++/Makefile.orig Mon Feb 26 15:37:46 1990 X--- g++/Makefile Mon Jul 2 18:40:18 1990 X*************** X*** 46,52 **** X # HAVE_UNISTD_H = -DNO_UNISTD_H X X # CFLAGS = -g -DSOS -DESKIT -O X! CFLAGS = -g -DGATHER_STATISTICS -O $(COFFLAGS) -B../gcc-test/ X CC = gcc X BISON = bison X BISONFLAGS = -v -d X--- 46,52 ---- X # HAVE_UNISTD_H = -DNO_UNISTD_H X X # CFLAGS = -g -DSOS -DESKIT -O X! CFLAGS = -g -DGATHER_STATISTICS -O $(COFFLAGS) -B../gcc-test/ -I../binutils/hp-include X CC = gcc X BISON = bison X BISONFLAGS = -v -d X*************** X*** 53,59 **** X AR = ar X SHELL = /bin/sh X # on sysV, define this as cp. X! INSTALL = install -c X # on sysV, define this as ln. X LINK = ln -s X X--- 53,59 ---- X AR = ar X SHELL = /bin/sh X # on sysV, define this as cp. X! INSTALL = cp X # on sysV, define this as ln. X LINK = ln -s X X*************** X*** 71,77 **** X # uncomment the following line. But turncoats who claim officially X # to support System V, but really try to be Berkeley (and thus X # break with USG defined), may need to define this. X! # USG_STDIO = -DUSG_STDIO X X prefix=/usr/local X X--- 71,77 ---- X # uncomment the following line. But turncoats who claim officially X # to support System V, but really try to be Berkeley (and thus X # break with USG defined), may need to define this. X! USG_STDIO = -DUSG_STDIO X X prefix=/usr/local X X*************** X*** 80,88 **** X # Directory in which to put the executable for the command `g++' X bindir = $(prefix)/bin X # Directory in which to put the subprograms used by the compiler. X! libdir = $(prefix)/lib X # Directory in which to put the crt0+.o, crt1+.o, and other such files. X! startdir = $(prefix)/lib X # Directory in which to put man pages. X mandir = $(prefix)/man/man1 X # Number to put in man-page filename. X--- 80,88 ---- X # Directory in which to put the executable for the command `g++' X bindir = $(prefix)/bin X # Directory in which to put the subprograms used by the compiler. X! libdir = $(prefix)/lib/gnu X # Directory in which to put the crt0+.o, crt1+.o, and other such files. X! startdir = $(prefix)/lib/gnu X # Directory in which to put man pages. X mandir = $(prefix)/man/man1 X # Number to put in man-page filename. X*************** X*** 257,263 **** X DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \ X elif cmp -s tm.h config/tm-hp9k320g.h; then \ X OPTS='-Dmc68020 -DNON_NATIVE -DUSG' \ X! DFLTS='"$(libdir)/gnu", "/lib", "/usr/lib", "/usr/local/lib"'; \ X elif cmp -s tm.h config/tm-altos3068.h; then \ X OPTS='-DCOFF_ENCAPSULATE -DNON_NATIVE -DUSG -DPORTAR'; \ X elif cmp -s tm.h config/tm-newsgas.h; then \ X--- 257,263 ---- X DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \ X elif cmp -s tm.h config/tm-hp9k320g.h; then \ X OPTS='-Dmc68020 -DNON_NATIVE -DUSG' \ X! DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \ X elif cmp -s tm.h config/tm-altos3068.h; then \ X OPTS='-DCOFF_ENCAPSULATE -DNON_NATIVE -DUSG -DPORTAR'; \ X elif cmp -s tm.h config/tm-newsgas.h; then \ X*************** X*** 277,283 **** X fi X X ld++: ld.o cplus-dem.o X! $(CC) -o ld++ $(PROFILE) ld.o cplus-dem.o -lg -lc X X collect: collect.c config.h $(LIBDEPS) X COLLECT_LIBS="-lld"; \ X--- 277,283 ---- X fi X X ld++: ld.o cplus-dem.o X! $(CC) -o ld++ $(PROFILE) ld.o cplus-dem.o -lc X X collect: collect.c config.h $(LIBDEPS) X COLLECT_LIBS="-lld"; \ X*** g++/cplus-decl.c.orig Mon Feb 26 15:36:42 1990 X--- g++/cplus-decl.c Mon Jul 2 18:40:21 1990 X*************** X*** 2312,2318 **** X return t; X } X X! static int sigsegv () X { X error ("Segmentation violation"); X signal (SIGSEGV, SIG_DFL); X--- 2312,2318 ---- X return t; X } X X! static void sigsegv () X { X error ("Segmentation violation"); X signal (SIGSEGV, SIG_DFL); X*** g++/toplev.c.orig Fri Feb 9 00:32:34 1990 X--- g++/toplev.c Mon Jul 2 18:40:23 1990 X*************** X*** 1936,1942 **** X file_size = lseek(file, 0L, SEEK_END); X lseek(file, 0L, SEEK_SET); X brk((char*)(&my_edata) + file_size); X! if (read (file, &my_edata, file_size) != file_size) X perror(name); X } X X--- 1936,1942 ---- X file_size = lseek(file, 0L, SEEK_END); X lseek(file, 0L, SEEK_SET); X brk((char*)(&my_edata) + file_size); X! if (read (file, (char *)&my_edata, file_size) != file_size) X perror(name); X } X X*************** X*** 1985,1991 **** X signal (SIGPIPE, pipe_closed); X X decl_printable_name = decl_name; X! lang_expand_expr = fancy_abort; X X /* Initialize whether `char' is signed. */ X flag_signed_char = DEFAULT_SIGNED_CHAR; X--- 1985,1991 ---- X signal (SIGPIPE, pipe_closed); X X decl_printable_name = decl_name; X! lang_expand_expr = (struct rtx_def *(*)())fancy_abort; X X /* Initialize whether `char' is signed. */ X flag_signed_char = DEFAULT_SIGNED_CHAR; X*** g++/ld.c.orig Mon Jul 2 18:39:18 1990 X--- g++/ld.c Mon Jul 2 18:40:24 1990 X*************** X*** 4429,4437 **** X symtab_init () X { X #ifndef nounderscore X! edata_symbol = getsym ("_edata"); X! etext_symbol = getsym ("_etext"); X! end_symbol = getsym ("_end"); X #else X edata_symbol = getsym ("edata"); X etext_symbol = getsym ("etext"); X--- 4429,4437 ---- X symtab_init () X { X #ifndef nounderscore X! edata_symbol = getsym ("__edata"); X! etext_symbol = getsym ("__etext"); X! end_symbol = getsym ("__end"); X #else X edata_symbol = getsym ("edata"); X etext_symbol = getsym ("etext"); X*************** X*** 4746,4751 **** X--- 4746,4752 ---- X X #endif X X+ #ifdef sun X #if TARGET == SUN4 X X /* Don't use local pagesize to build for Sparc. */ X*************** X*** 4754,4757 **** X--- 4755,4759 ---- X { X return (8192); X } X+ #endif X #endif X*** g++/cplus-dem.c.orig Sat Feb 17 05:40:07 1990 X--- g++/cplus-dem.c Mon Jul 2 18:40:25 1990 X*************** X*** 48,53 **** X--- 48,54 ---- X #include X #include X #include X+ #include "config.h" X X #ifdef USG X #include X*************** X*** 203,209 **** X return tem; X } X /* static data member */ X! if (*type != '_' && (p = strchr (type, '$')) != NULL) X { X int n = strlen (type) + 2; X char *tem = (char *) xmalloc (n); X--- 204,210 ---- X return tem; X } X /* static data member */ X! if (*type != '_' && (p = (char *)strchr (type, '$')) != NULL) X { X int n = strlen (type) + 2; X char *tem = (char *) xmalloc (n); X*** g++/malloc.c.orig Sat Feb 17 05:34:08 1990 X--- g++/malloc.c Mon Jul 2 18:40:26 1990 X*************** X*** 178,189 **** X X #ifdef BSD X #ifndef DATA_SEG_BITS X! #define start_of_data() &etext X #endif X #endif X X #ifndef emacs X! #define start_of_data() &etext X #endif X X #define ISALLOC ((char) 0xf7) /* magic byte that implies allocation */ X--- 178,189 ---- X X #ifdef BSD X #ifndef DATA_SEG_BITS X! #define start_of_data() &_etext X #endif X #endif X X #ifndef emacs X! #define start_of_data() &_etext X #endif X X #define ISALLOC ((char) 0xf7) /* magic byte that implies allocation */ X*************** X*** 194,200 **** X being the distance to the true X beginning of the block. */ X X! extern char etext; X X /* These two are for user programs to look at, when they are interested. */ X X--- 194,200 ---- X being the distance to the true X beginning of the block. */ X X! extern char _etext; X X /* These two are for user programs to look at, when they are interested. */ X SHAR_EOF $TOUCH -am 0702184090 g++.diff && chmod 0644 g++.diff || echo "restore of g++.diff failed" set `wc -c g++.diff`;Wc_c=$1 if test "$Wc_c" != "7414"; then echo original size 7414, current size $Wc_c fi # ============= libg++.diff ============== echo "x - extracting libg++.diff (Text)" sed 's/^X//' << 'SHAR_EOF' > libg++.diff && X*** libg++-1.37.0/g++-include/sys/param.h.orig Tue Sep 5 13:04:07 1989 X--- libg++-1.37.0/g++-include/sys/param.h Mon Jul 2 18:42:21 1990 X*************** X*** 6,14 **** X extern "C" X { X X- #define KERNEL X #include "//usr/include/sys/param.h" X- #undef KERNEL X X #ifndef param_h X #define param_h 1 X--- 6,12 ---- X*** libg++-1.37.0/g++-include/std.h.orig Sat Feb 24 20:48:13 1990 X--- libg++-1.37.0/g++-include/std.h Mon Jul 2 18:42:21 1990 X*************** X*** 48,59 **** X int chdir(const char*); X int chmod(const char*, int); X int chown(const char*, int, int); X! long clock(void); X int close(int); X #ifdef DGUX X int creat(char*, unsigned long int); X #else X! int creat(const char*, unsigned long int); X #endif X char* crypt(const char*, const char*); X char* ctermid(char*); X--- 48,59 ---- X int chdir(const char*); X int chmod(const char*, int); X int chown(const char*, int, int); X! unsigned long clock(void); X int close(int); X #ifdef DGUX X int creat(char*, unsigned long int); X #else X! int creat(const char*, unsigned short int); X #endif X char* crypt(const char*, const char*); X char* ctermid(char*); X*************** X*** 78,84 **** X int fcntl(int, int, ...); X char* fcvt(double, int, int*, int*); X int ffs(int); X! int flock(int, int); X int fork(void); X void free(void*); X int fsync(int); X--- 78,84 ---- X int fcntl(int, int, ...); X char* fcvt(double, int, int*, int*); X int ffs(int); X! /* int flock(int, int); */ X int fork(void); X void free(void*); X int fsync(int); X*** libg++-1.37.0/g++-include/stdio.h.orig Mon Jan 15 19:45:42 1990 X--- libg++-1.37.0/g++-include/stdio.h Mon Jul 2 18:42:21 1990 X*************** X*** 92,98 **** X #define HAVE_SETLINEBUF X #define IOBUF_FLAG_TYPE int X #define IOBUF_FILE_TYPE int X! #define _NFILE 64 X #define IOBUF_EXTRA_FIELDS int _reserve[27]; X #define SPRINTF_RETURNS_INT X #define BUFEND_ENTRY_TYPE unsigned char * X--- 92,98 ---- X #define HAVE_SETLINEBUF X #define IOBUF_FLAG_TYPE int X #define IOBUF_FILE_TYPE int X! #define _NFILE 60 X #define IOBUF_EXTRA_FIELDS int _reserve[27]; X #define SPRINTF_RETURNS_INT X #define BUFEND_ENTRY_TYPE unsigned char * X*************** X*** 114,120 **** X #endif X X #ifdef hpux X! #define IOBUF_FLAG_TYPE char X #endif X X #ifdef USG X--- 114,120 ---- X #endif X X #ifdef hpux X! #define IOBUF_FLAG_TYPE short X #endif X X #ifdef USG X*************** X*** 141,147 **** X #endif X X #if defined(USG) && !defined(_NFILE) X! #define _NFILE 20 X #endif X X #ifdef USG X--- 141,147 ---- X #endif X X #if defined(USG) && !defined(_NFILE) X! #define _NFILE 60 X #endif X X #ifdef USG X*************** X*** 156,170 **** X #endif X X /* check this -- hardly any systems need this these days */ X! /* #define SPRINTF_RETURNS_INT */ X X /* check and possibly redefine the following */ X #define BUFSIZ 1024 X X extern struct _iobuf { X! int _cnt; X! char* _ptr; X! char* _base; X IOBUF_BUFSIZ_FIELD X IOBUF_FLAG_TYPE _flag; X IOBUF_FILE_TYPE _file; X--- 156,170 ---- X #endif X X /* check this -- hardly any systems need this these days */ X! #define SPRINTF_RETURNS_INT X X /* check and possibly redefine the following */ X #define BUFSIZ 1024 X X extern struct _iobuf { X! int _cnt; X! char *_ptr; X! char *_base; X IOBUF_BUFSIZ_FIELD X IOBUF_FLAG_TYPE _flag; X IOBUF_FILE_TYPE _file; X*** libg++-1.37.0/g++-include/math.h.orig Sat Jan 6 15:09:52 1990 X--- libg++-1.37.0/g++-include/math.h Mon Jul 2 18:42:22 1990 X*************** X*** 88,94 **** X double gamma(double); X double hypot(double,double); X double infnan(int); X! #if !defined(sequent) && !defined(DGUX) /* see below */ X int isinf(double); X int isnan(double); X #endif X--- 88,94 ---- X double gamma(double); X double hypot(double,double); X double infnan(int); X! #if !defined(sequent) && !defined(DGUX) && !defined(hpux)/* see below */ X int isinf(double); X int isnan(double); X #endif X*************** X*** 154,160 **** X #endif X X /* sequents don't supply these. The following should suffice */ X! #if defined(sequent) || defined(DGUX) X static inline int isnan(double x) { return x != x; } X static inline int isinf(double x) { return x > MAXDOUBLE || x < -MAXDOUBLE; } X #endif X--- 154,160 ---- X #endif X X /* sequents don't supply these. The following should suffice */ X! #if defined(sequent) || defined(DGUX) || defined(hpux) X static inline int isnan(double x) { return x != x; } X static inline int isinf(double x) { return x > MAXDOUBLE || x < -MAXDOUBLE; } X #endif X*** libg++-1.37.0/g++-include/time.h.orig Mon Feb 26 22:03:35 1990 X--- libg++-1.37.0/g++-include/time.h Mon Jul 2 18:42:22 1990 X*************** X*** 24,30 **** X X #define KERNEL X X! #ifndef USG X #include "//usr/include/sys/time.h" X #endif X #include "//usr/include/sys/times.h" X--- 24,33 ---- X X #define KERNEL X X! #if !defined(USG) || defined(hpux) X! #ifdef hpux X! #define _INCLUDE_POSIX_SOURCE X! #endif X #include "//usr/include/sys/time.h" X #endif X #include "//usr/include/sys/times.h" X*************** X*** 51,65 **** X extern void tzset(); X extern void tzsetwall(); X X extern long times(struct tms*); X X! #if defined(USG) X extern long timezone; X extern int daylight; X extern char* tzname[]; X #else X typedef struct c_proto_timezone timezone; X extern char* timezone(int, int); X extern int getitimer(int, struct itimerval*); X extern int setitimer(int, struct itimerval*, struct itimerval*); X extern int gettimeofday(struct timeval*, struct timezone*); X--- 54,79 ---- X extern void tzset(); X extern void tzsetwall(); X X+ #ifdef hpux X+ extern unsigned long times(struct tms*); X+ #else X extern long times(struct tms*); X+ #endif X X! #if defined(USG) && !defined (hpux) X extern long timezone; X extern int daylight; X extern char* tzname[]; X #else X typedef struct c_proto_timezone timezone; X+ #ifdef hpux X+ #undef timezone X+ extern long timezone; X+ extern int daylight; X+ extern char* tzname[]; X+ #else X extern char* timezone(int, int); X+ #endif X extern int getitimer(int, struct itimerval*); X extern int setitimer(int, struct itimerval*, struct itimerval*); X extern int gettimeofday(struct timeval*, struct timezone*); X*** libg++-1.37.0/tests/Makefile.orig Wed Feb 28 11:14:07 1990 X--- libg++-1.37.0/tests/Makefile Mon Jul 2 18:42:23 1990 X*************** X*** 215,221 **** X X libtest.a: $(LHDRS) $(LOBJS) X rm -f libtest.a X! ar r libtest.a $(LOBJS) X $(RANLIB) libtest.a X X test0: test0.h test.hello.o test.bye test.bye2 test.shell X--- 215,221 ---- X X libtest.a: $(LHDRS) $(LOBJS) X rm -f libtest.a X! gnu-ar r libtest.a $(LOBJS) X $(RANLIB) libtest.a X X test0: test0.h test.hello.o test.bye test.bye2 test.shell X*** libg++-1.37.0/src/Makefile.orig Wed Feb 28 11:14:22 1990 X--- libg++-1.37.0/src/Makefile Mon Jul 2 18:42:23 1990 X*************** X*** 166,172 **** X X libg++.a: $(OBJS) X rm -f libg++.a X! ar r libg++.a $(OBJS) X $(RANLIB) libg++.a X X clean: X--- 166,172 ---- X X libg++.a: $(OBJS) X rm -f libg++.a X! gnu-ar r libg++.a $(OBJS) X $(RANLIB) libg++.a X X clean: X*** libg++-1.37.0/src/malloc.c.orig Wed Feb 7 15:22:02 1990 X--- libg++-1.37.0/src/malloc.c Mon Jul 2 18:42:24 1990 X*************** X*** 205,211 **** X extern "C" { X #endif X X! #ifdef USG X extern void* memset(void*, int, int); X extern void* memcpy(void*, const void*, int); X inline void bzero(void* s, int l) { memset(s, 0, l); } X--- 205,211 ---- X extern "C" { X #endif X X! #if defined(USG) || defined(hpux) X extern void* memset(void*, int, int); X extern void* memcpy(void*, const void*, int); X inline void bzero(void* s, int l) { memset(s, 0, l); } X*** libg++-1.37.0/Makefile.orig Wed Feb 28 11:17:18 1990 X--- libg++-1.37.0/Makefile Mon Jul 2 18:42:24 1990 X*************** X*** 28,35 **** X # ------ source locations X X # Manually set PWD to *this* directory if you are not using gnu make X! PWD := $(shell pwd) X! #PWD=/home/dl/libg++ X X # source include directory X SRCIDIR= $(PWD)/g++-include X--- 28,35 ---- X # ------ source locations X X # Manually set PWD to *this* directory if you are not using gnu make X! #PWD := $(shell pwd) X! PWD=/users/jhd/gnu/libg++-1.37.0 X X # source include directory X SRCIDIR= $(PWD)/g++-include X*************** X*** 41,56 **** X # set `prefix' to something else if you want to install things X # in nonstandard places X X! prefix =/usr/gnu X X # libg++.a destination X! LIBDIR = $(prefix)/lib X X # executables directory: location to install the genclass class generator X BINDIR = $(prefix)/bin X X # location to install include file directory X! IDIR = $(prefix)/lib/g++-include X X X # ------- System-dependent defines X--- 41,56 ---- X # set `prefix' to something else if you want to install things X # in nonstandard places X X! prefix =/usr/local X X # libg++.a destination X! LIBDIR = $(prefix)/lib/gnu X X # executables directory: location to install the genclass class generator X BINDIR = $(prefix)/bin X X # location to install include file directory X! IDIR = $(prefix)/lib/gnu/g++-include X X X # ------- System-dependent defines X*************** X*** 57,64 **** X # ------- use the second form of each for SystemV (USG) X X # g++ flags X! OSFLAG= X! #OSFLAG = -DUSG X X # other compilation control flags -- use any combination X X--- 57,64 ---- X # ------- use the second form of each for SystemV (USG) X X # g++ flags X! #OSFLAG= X! OSFLAG = -DUSG X X # other compilation control flags -- use any combination X X*************** X*** 86,96 **** X #OSLDFLAG= -lPW X X # how to install X! INSTALL=install -c X! #INSTALL=cp X X # ranlib if necessary X! RANLIB=ranlib X #RANLIB=echo X X # which make? X--- 86,96 ---- X #OSLDFLAG= -lPW X X # how to install X! #INSTALL=install -c X! INSTALL=cp X X # ranlib if necessary X! RANLIB=gnu-ranlib X #RANLIB=echo X X # which make? SHAR_EOF $TOUCH -am 0702184290 libg++.diff && chmod 0644 libg++.diff || echo "restore of libg++.diff failed" set `wc -c libg++.diff`;Wc_c=$1 if test "$Wc_c" != "10007"; then echo original size 10007, current size $Wc_c fi exit 0