pcg@aber-cs.UUCP (Piercarlo Grandi) (08/23/89)
Here is a shar file with a few patches (and gripes) about installing GNU LIB C++ on a 386 running system V 3.2. In a separate posting you will find some more extensive but vital changes to make g++ 1.35.o work under system V 3.2 as well. DISCLAIMER: The patches contained therein are the result of the personal work of the author, in his own time, on his own machine, in the course of pursuing his own research. In no way his employer, the University College of Wales, has supported, funded, aided or abetted this work, or the research activity for which it has been done, and bears no responsibility for such. On the other hand, I am grateful for the permission to use UCW's news system and thus to post this work. ----------------------------------cut here----------------------------------- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: PATCHES-i386v README-i386v # Wrapped by gnu@aware on Tue Aug 22 17:42:40 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'PATCHES-i386v' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'PATCHES-i386v'\" else echo shar: Extracting \"'PATCHES-i386v'\" \(3280 characters\) sed "s/^X//" >'PATCHES-i386v' <<'END_OF_FILE' RCS file: g++-include/File.h,v retrieving revision 1.1 diff -r1.1 g++-include/File.h X272c272 X< failif (!is_open() || (stat = ftell(fp) < 0)); X--- X> failif (!is_open() || (stat = ftell(fp)) < 0); X=================================================================== RCS file: g++-include/ctype.h,v retrieving revision 1.1 diff -r1.1 ctype.h X8a9,11 X> X> /* comment out the following define line on on USG systems */ X> #define _ctype_ _ctype X=================================================================== RCS file: g++-include/regex.h,v retrieving revision 1.1 diff -r1.1 regex.h X255a256 X> #if __STDC__ == 1 X270a272,284 X> #else X> extern char *re_compile_pattern(); X> /* Is this really advertised? */ X> extern void re_compile_fastmap(); X> extern int re_search(); X> extern int re_search_2(); X> extern int re_match(); X> extern int re_match_2(); X> X> /* 4.2 bsd compatibility (yuck) */ X> extern char *re_comp(); X> extern int re_exec(); X> #endif X=================================================================== RCS file: g++-include/stdio.h,v retrieving revision 1.1 diff -r1.1 g++-include/stdio.h X53a54,57 X> #ifndef USG X> /* If not on an USG system, comment the following line */ X> # define USG X> #endif X59c63 X< #endif X--- X> #define SPRINTF_RETURNS_INT X60a65,68 X> /* check and possibly redefine the following */ X> #define BUFSIZ 1024 X> #else X> /* #define HAVE_BUFSIZ */ X64a73,74 X> #define _NFILE 60 X> #endif X87a98,103 X> #ifdef USG X> #define _IOLBF 00100 X> #define _IORW 00200 X> #define _IOAPPEND 00000 /*Fake!*/ X> #define _IOSTRG 00000 /*Fake!*/ X> #else X91a108 X> #endif X=================================================================== RCS file: src/File.cc,v retrieving revision 1.1 diff -r1.1 src/File.cc X264a265 X> #ifndef _NFILE X265a267,271 X> #else X> fp->_file = _NFILE-1; // The last filedescriptor... X> extern unsigned char *_bufendtab[]; X> _bufendtab[fp->_file] = buf+sz-1; X> #endif X=================================================================== RCS file: src/builtin.cc,v retrieving revision 1.1 diff -r1.1 src/builtin.cc X177c177 X< b._cnt = BUFSIZ; X--- X> b._cnt = BUFSIZ-1; X363a364,409 X> } X> } X> } X> X> #endif X> X> #if defined(USG) X> X> #define TICKS_PER_SEC 100.0 X> X> extern "C" { X> #include <sys/types.h> X> #include <sys/times.h> X> long times(struct tms *); X> } X> X> static struct tms Old_Time; X> static struct tms New_Time; X> static int Timer_Set = 0; X> X> double start_timer() X> { X> Timer_Set = 1; X> times(&Old_Time); /* set starting process time */ X> return(Old_Time.tms_utime/TICKS_PER_SEC); X> } X> X> /* returns process time since Last_Time (if parameter is not DEFAULT_TIME, */ X> /* i.e., (double) 0.0 ),otherwise, if parameter == DEFAULT_TIME then */ X> /* the time since the Old_Time was set is returned. */ X> /* Returns TIMER_ERROR_VALUE */ X> /* if Start_Timer() is not called first */ X> X> double return_elapsed_time(double Last_Time) X> { X> if (!Timer_Set) { X> return(TIMER_ERROR_VALUE); X> } X> else { X> /* get process time */ X> times(&New_Time); X> if (Last_Time == 0.0) { X> return((New_Time.tms_utime - Old_Time.tms_utime)/TICKS_PER_SEC); X> } X> else { X> return(New_Time.tms_utime/TICKS_PER_SEC - Last_Time); END_OF_FILE if test 3280 -ne `wc -c <'PATCHES-i386v'`; then echo shar: \"'PATCHES-i386v'\" unpacked with wrong size! fi # end of 'PATCHES-i386v' fi if test -f 'README-i386v' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README-i386v'\" else echo shar: Extracting \"'README-i386v'\" \(4527 characters\) sed "s/^X//" >'README-i386v' <<'END_OF_FILE' X Copyright (C) 1989 Piercarlo Grandi X This material is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the XFree Software Foundation; either version 1, or (at your option) any later version. X This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. X You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software XFoundation, 675 Mass Ave, Cambridge, MA 02139, USA. X X In other words, you are welcome to use, share and improve this program. You are forbidden to forbid anyone else to use, share and improve what you give them. Help stamp out software-hoarding! X X X SETTING UP LIBG++ UNDER sysV 3.2 X A few modifications are necessary to successfully compile GNU LIB C++ under system V 3.2; first of all, you need GNU C++ itself, and this requires another set of modifications. In particular, you must have the simple fix to code generation that obviates the insufficient stack popping bug, or the library will not really work. X Having a working GNU C++, you need to apply the few patches supplied, a few to files in 'g++-include', a few to those in 'src'. You will also want to manually edit 'libconfig.h' and the relevant 'Makefile's for system dependent parameterization (in particular, remember that system V free(3) should not be called before realloc(3)). X Some source files, especially in the 'tests' and 'src' directories, are heavily BSD feature dependent. Class 'CursesWindow' also is not at all system V curses/terminfo compatible. X Several file names, such as 'CursesWindows.cc' in 'src' and many in X'g++-include' and 'etc' are way longer than the system V limit of 14 characters. Shorten them... X X X GRIPES X You will discover that if you have less than four megabytes of memory you will seem unable to compile some parts of the library (the X'Integer' class, without optimization, takes over half an hour on my two megabyte machine, with a stripped down kernel), and other will, but excruciatingly slow (the GNU C++ compiler trashes, because it has very poor locality of reference and consumes wanton amounts of memory). X Try compiling (with option '-dm' for added detail) a file consisting of the single line '#include <stream.h>'; it may well be enlightening. X You will also discover that since the various headers, and sources of classes and methods of packages have not been split up in separate files, when you link them in you will link in large objects even if you use only a small subset of the facilities of the package, and you will have to wait the compiler wading in large headers even if you only want just one declaration. X If you do not have a large BSD system with lots of memory and a very fast cpu, you may well want to do without GNU LIB C++ entirely and just, especially for transput, rely on Classic C services, like 'stdio'. X To see the difference, try compiling the following source (say, calling it 'hello.C'): X X #if STREAM X #include <stream.h> X #else X extern "C" X { X #include <stdio.h> X } X #endif X X extern int main() X { X #if STREAM X cout << "Hello world\n";; X #else X puts("Hello world"); X #endif X X return 0; X } X with the following two lines: X X time g++ -S -dm -DSTREAM=0 hello.C X and X X time g++ -S -dm -DSTREAM=1 hello.C X Stare in disbelief at the difference... Then you may decide that good old 'stdio' for all its unobjectorientedness is good for you (yes, the comparison is unfair, because 'stdio' is much less convenient and safe then 'stream', but but but...). X As a final advice, probably the most useful general purpose subset of things to put in the library, if you are short of space or time, is the following: X X Obstack builtin X Primitives used almost everywhere else X X File SFile stream X File manipulation X X regex String X String manipulation X X BitSet BitString X Bit sets and sequences X X ACG MLCG RNG X Random number generation X X Fix16 Complex Integer X Fixed point, complex and infinite precision numbers. X Remember, this is only my personal preference. X Naturally, if cost is no object to you, most of what written here does not apply. X Since constructive action is best, consider helping build a less profligate library. Help diffuse FSF software and ideas by making them more affordable! END_OF_FILE if test 4527 -ne `wc -c <'README-i386v'`; then echo shar: \"'README-i386v'\" unpacked with wrong size! fi # end of 'README-i386v' fi echo shar: End of shell archive. exit 0 -- Piercarlo "Peter" Grandi | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk Dept of CS, UCW Aberystwyth | UUCP: ...!mcvax!ukc!aber-cs!pcg Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk
ian@ssc-vax.UUCP (Ian R. Searle) (08/16/90)
Please excuse my ignorance, but can anybody tell me how to apply the patches that are posted for things such as gcc gdb etc... Please provide an ip address for anonymous ftp if possible. Thanks in advance Ian