Return to BSD News archive
Path: sserve!manuel.anu.edu.au!munnari.oz.au!uunet!think.com!ames!agate!usenet.ins.cwru.edu!ljo From: ljo@r2d2.eeap.cwru.edu (L. Jonas Olsson) Newsgroups: comp.unix.bsd Subject: [386BSD] libg++-2.2 patches Date: 25 Oct 1992 22:47:23 GMT Organization: Case Western Reserve Univ. Cleveland, Ohio (USA) Lines: 462 Message-ID: <1cf85rINN8o4@usenet.INS.CWRU.Edu> References: <1992Oct25.112332.25964@fcom.cc.utah.edu> <1992Oct25.183912@eklektix.com> <1cf4v8INNidl@terminator.rs.itd.umich.edu> NNTP-Posting-Host: johnny5.eeap.cwru.edu I'm here posting some patches for libg++-2.2 that I have used to successfully compile libg++ and my own programs. The patches are derived from patches to bsdi by Jon Block that are available at bsdi.com. There is at least some problems, the test tRational fails with floating exception. This could be because of incorrect values for various floating point limits. Hopefully other people that have ported libg++-2.2 will correct the errors I've made/overlooked. These patches would not have been done without the ref machine that Julian Elischer has so kindly provided. Jonas Olsson ljo@po.cwru.edu Procedure: ========== Make shure you are using gnu make-3.62 Make shure you have changed the values of DBL_MIN and DBL_MAX in gcc-2.2.2's include directory. Here's the values I use: #define DBL_MIN 2.2250738585072014e-308 #define DBL_MAX 1.7976931348623157e+308 get libg++-2.2 from a favorite site zcat libg++-2.2.tar.Z|tar xvf - patch -p0 < libg++-2.2.diffs cd libg++-2.2 ../configure i386-bsd make make install And if you want to test it more thoroughly: cd libg++/tests make -k check The only test that should fail is tRational. It fails with floating exception for me. If you want to debug why use gdb-4.7. Diff file: ========== <start of libg++-2.2.diffs> diff -rc2N libg++-2.2.orig/config/mh-bsd libg++-2.2/config/mh-bsd *** libg++-2.2.orig/config/mh-bsd --- libg++-2.2/config/mh-bsd Wed Aug 5 15:50:19 1992 *************** *** 0 **** --- 1,2 ---- + # Define SYSV as -DSYSV if you are using a System V operating system. + RANLIB = ranlib diff -rc libg++-2.2.orig/config.sub libg++-2.2/config.sub *** libg++-2.2.orig/config.sub Fri Jun 26 14:14:14 1992 --- libg++-2.2/config.sub Sat Oct 24 18:22:40 1992 *************** *** 115,120 **** --- 115,124 ---- basic_machine=i386-unknown os=-go32 ;; + i386-bsd* | bsdi) + basic_machine=i386-unknown + os=-bsd + ;; i386-isc* | isc) basic_machine=i386-unknown os=-iscsysv diff -rc libg++-2.2.orig/configure.in libg++-2.2/configure.in *** libg++-2.2.orig/configure.in Mon Jun 22 23:50:30 1992 --- libg++-2.2/configure.in Sat Oct 24 18:29:37 1992 *************** *** 20,25 **** --- 20,27 ---- sco*) host_makefile_frag=config/mh-sco ;; irix4) host_makefile_frag=config/mh-irix4 ;; linux) host_makefile_frag=config/mh-linux ;; + bsd) host_makefile_frag=config/mh-bsd ;; + bsdi) host_makefile_frag=config/mh-bsdi ;; ultrix*) case "${host_cpu}" in mips) host_makefile_frag=config/mh-decstation ;; diff -rc libg++-2.2.orig/libg++/configure.in libg++-2.2/libg++/configure.in *** libg++-2.2.orig/libg++/configure.in Fri Jun 26 12:32:57 1992 --- libg++-2.2/libg++/configure.in Sat Oct 24 18:22:41 1992 *************** *** 14,19 **** --- 14,20 ---- i386 | i486) case "${host_os}" in linux) my_host=linux ;; + bsdi) my_host=bsdi ;; *) ;; esac ;; diff -rc libg++-2.2.orig/libg++/g++-include/grp.h libg++-2.2/libg++/g++-include/grp.h *** libg++-2.2.orig/libg++/g++-include/grp.h Thu Feb 6 16:44:03 1992 --- libg++-2.2/libg++/g++-include/grp.h Sat Oct 24 18:22:42 1992 *************** *** 28,34 **** extern struct group* fgetgrent(FILE*); extern struct group* getgrgid(int); extern struct group* getgrnam(const char*); ! extern void setgrent(); extern void endgrent(); #endif --- 28,34 ---- extern struct group* fgetgrent(FILE*); extern struct group* getgrgid(int); extern struct group* getgrnam(const char*); ! extern int setgrent(); extern void endgrent(); #endif diff -rc libg++-2.2.orig/libg++/g++-include/memory.h libg++-2.2/libg++/g++-include/memory.h *** libg++-2.2.orig/libg++/g++-include/memory.h Thu Apr 30 14:04:14 1992 --- libg++-2.2/libg++/g++-include/memory.h Sat Oct 24 18:22:42 1992 *************** *** 15,21 **** void* memmove _G_ARGS((void*, const void*, _G_size_t)); void* memset _G_ARGS((void*, int, _G_size_t)); int ffs _G_ARGS((int)); ! _G_size_t getpagesize _G_ARGS((void)); void* valloc _G_ARGS((_G_size_t)); void bcopy _G_ARGS((const void*, void*, _G_size_t)); --- 15,21 ---- void* memmove _G_ARGS((void*, const void*, _G_size_t)); void* memset _G_ARGS((void*, int, _G_size_t)); int ffs _G_ARGS((int)); ! int getpagesize _G_ARGS((void)); void* valloc _G_ARGS((_G_size_t)); void bcopy _G_ARGS((const void*, void*, _G_size_t)); diff -rc libg++-2.2.orig/libg++/g++-include/signal.h libg++-2.2/libg++/g++-include/signal.h *** libg++-2.2.orig/libg++/g++-include/signal.h Fri May 29 13:15:44 1992 --- libg++-2.2/libg++/g++-include/signal.h Sat Oct 24 18:22:42 1992 *************** *** 45,53 **** extern SSignalHandler ssignal _G_ARGS((int sig, SSignalHandler action)); extern int gsignal _G_ARGS((int sig)); extern int kill _G_ARGS((_G_pid_t pid, int sig)); ! extern int killpg _G_ARGS((int, int)); extern int siginterrupt _G_ARGS((int, int)); ! extern void psignal _G_ARGS((unsigned, char*)); #ifndef hpux // Interviews folks claim that hpux doesn't like these extern int sigsetmask _G_ARGS((int mask)); --- 45,53 ---- extern SSignalHandler ssignal _G_ARGS((int sig, SSignalHandler action)); extern int gsignal _G_ARGS((int sig)); extern int kill _G_ARGS((_G_pid_t pid, int sig)); ! extern int killpg _G_ARGS((short int, int)); extern int siginterrupt _G_ARGS((int, int)); ! extern void psignal _G_ARGS((unsigned, const char*)); #ifndef hpux // Interviews folks claim that hpux doesn't like these extern int sigsetmask _G_ARGS((int mask)); diff -rc libg++-2.2.orig/libg++/g++-include/stdio.h libg++-2.2/libg++/g++-include/stdio.h *** libg++-2.2.orig/libg++/g++-include/stdio.h Fri May 29 16:11:40 1992 --- libg++-2.2/libg++/g++-include/stdio.h Sat Oct 24 18:22:43 1992 *************** *** 113,119 **** FILE* fdopen(int, const char*); int fflush(FILE*); int fgetc(FILE*); ! char* fgets(char*, int, FILE *); FILE* fopen(const char*, const char*); int fprintf(FILE*, const char* ...); int fputc(int, FILE*); --- 113,119 ---- FILE* fdopen(int, const char*); int fflush(FILE*); int fgetc(FILE*); ! char* fgets(char*, unsigned int, FILE *); FILE* fopen(const char*, const char*); int fprintf(FILE*, const char* ...); int fputc(int, FILE*); diff -rc libg++-2.2.orig/libg++/g++-include/sys/socket.h libg++-2.2/libg++/g++-include/sys/socket.h *** libg++-2.2.orig/libg++/g++-include/sys/socket.h Wed Jun 17 18:41:56 1992 --- libg++-2.2/libg++/g++-include/sys/socket.h Sat Oct 24 18:22:45 1992 *************** *** 19,29 **** #define __libgxx_sys_socket_h 1 // void* in select, since different systems use int* or fd_set* ! int select _G_ARGS((int, void*, void*, void*, struct timeval*)); int accept _G_ARGS((int, struct sockaddr*, int*)); ! int bind _G_ARGS((int, const void*, int)); ! int connect _G_ARGS((int, struct sockaddr*, int)); int getsockname _G_ARGS((int, struct sockaddr*, int*)); int getpeername _G_ARGS((int, struct sockaddr*, int*)); int getsockopt(int, int, int, void*, int*); --- 19,29 ---- #define __libgxx_sys_socket_h 1 // void* in select, since different systems use int* or fd_set* ! int select _G_ARGS((int, struct fd_set*, struct fd_set*, struct fd_set*, struct timeval*)); int accept _G_ARGS((int, struct sockaddr*, int*)); ! int bind _G_ARGS((int, const struct sockaddr*, int)); ! int connect _G_ARGS((int, const struct sockaddr*, int)); int getsockname _G_ARGS((int, struct sockaddr*, int*)); int getpeername _G_ARGS((int, struct sockaddr*, int*)); int getsockopt(int, int, int, void*, int*); *************** *** 30,43 **** int listen(int, int); int rcmd _G_ARGS((char**, int, const char*, const char*, const char*, int*)); int recv(int, void*, int, int); ! int recvfrom _G_ARGS((int, void*, int, int, void*, int *)); int recvmsg(int, struct msghdr*, int); int rexec(char**, int, const char*, const char*, const char*, int*); int rresvport(int*); int send _G_ARGS((int, const void*, int, int)); ! int sendto _G_ARGS((int, const void*, int, int, void*, int)); int sendmsg _G_ARGS((int, const struct msghdr*, int)); ! int setsockopt _G_ARGS((int, int, int, const char*, int)); int shutdown(int, int); int socket(int, int, int); int socketpair(int, int, int, int sv[2]); --- 30,43 ---- int listen(int, int); int rcmd _G_ARGS((char**, int, const char*, const char*, const char*, int*)); int recv(int, void*, int, int); ! int recvfrom _G_ARGS((int, void*, int, int, struct sockaddr*, int *)); int recvmsg(int, struct msghdr*, int); int rexec(char**, int, const char*, const char*, const char*, int*); int rresvport(int*); int send _G_ARGS((int, const void*, int, int)); ! int sendto _G_ARGS((int, const void*, int, int, const struct sockaddr*, int)); int sendmsg _G_ARGS((int, const struct msghdr*, int)); ! int setsockopt _G_ARGS((int, int, int, const void*, int)); int shutdown(int, int); int socket(int, int, int); int socketpair(int, int, int, int sv[2]); diff -rc libg++-2.2.orig/libg++/g++-include/sys/wait.h libg++-2.2/libg++/g++-include/sys/wait.h *** libg++-2.2.orig/libg++/g++-include/sys/wait.h Wed Jun 3 23:23:06 1992 --- libg++-2.2/libg++/g++-include/sys/wait.h Sat Oct 24 18:22:46 1992 *************** *** 31,37 **** extern _G_pid_t wait _G_ARGS((int*)); extern _G_pid_t waitpid _G_ARGS((_G_pid_t, int*, int)); extern _G_pid_t wait3 _G_ARGS((int*, int options, struct rusage*)); ! extern _G_pid_t wait4 _G_ARGS((int, int*, int, struct rusage*)); #endif } --- 31,37 ---- extern _G_pid_t wait _G_ARGS((int*)); extern _G_pid_t waitpid _G_ARGS((_G_pid_t, int*, int)); extern _G_pid_t wait3 _G_ARGS((int*, int options, struct rusage*)); ! extern _G_pid_t wait4 _G_ARGS((short int, int*, int, struct rusage*)); #endif } diff -rc libg++-2.2.orig/libg++/g++-include/time.h libg++-2.2/libg++/g++-include/time.h *** libg++-2.2.orig/libg++/g++-include/time.h Wed Jun 17 18:47:16 1992 --- libg++-2.2/libg++/g++-include/time.h Sat Oct 24 18:22:46 1992 *************** *** 94,101 **** #endif _G_time_t time(_G_time_t*); unsigned ualarm(unsigned, unsigned); ! unsigned usleep(unsigned); ! void profil _G_ARGS((unsigned short*, _G_size_t, unsigned int, unsigned)); #endif } --- 94,101 ---- #endif _G_time_t time(_G_time_t*); unsigned ualarm(unsigned, unsigned); ! void usleep(unsigned); ! int profil _G_ARGS((char*, int, int, int)); #endif } diff -rc libg++-2.2.orig/libg++/g++-include/unistd.h libg++-2.2/libg++/g++-include/unistd.h *** libg++-2.2.orig/libg++/g++-include/unistd.h Fri Jun 19 23:13:42 1992 --- libg++-2.2/libg++/g++-include/unistd.h Sat Oct 24 18:22:57 1992 *************** *** 65,71 **** #endif extern unsigned alarm _G_ARGS((unsigned)); ! extern int brk _G_ARGS((void*)); extern int chdir _G_ARGS((const char*)); extern int chmod _G_ARGS((const char*, _G_mode_t)); extern int chown (const char*, _G_uid_t, _G_gid_t); --- 65,71 ---- #endif extern unsigned alarm _G_ARGS((unsigned)); ! extern char* brk _G_ARGS((const char*)); extern int chdir _G_ARGS((const char*)); extern int chmod _G_ARGS((const char*, _G_mode_t)); extern int chown (const char*, _G_uid_t, _G_gid_t); *************** *** 73,87 **** extern char* crypt _G_ARGS((const char*, const char*)); extern int dup _G_ARGS((int)); extern int dup2 _G_ARGS((int, int)); ! extern void encrypt _G_ARGS((char*, int)); extern int execl (const char*, const char *, ...); extern int execle (const char*, const char *, ...); extern int execlp (const char*, const char*, ...); ! extern int exect _G_ARGS((const char*, const char**, char**)); ! extern int execv _G_ARGS((const char*, const * char *)); ! extern int execve _G_ARGS((const char*, const * char *, char * const *)); ! extern int execvp _G_ARGS((const char*, const * char *)); ! extern int fchown (int, _G_uid_t, _G_gid_t); extern _G_pid_t fork _G_ARGS((void)); extern int fsync _G_ARGS((int)); extern int ftruncate _G_ARGS((int, _G_off_t)); --- 73,87 ---- extern char* crypt _G_ARGS((const char*, const char*)); extern int dup _G_ARGS((int)); extern int dup2 _G_ARGS((int, int)); ! extern int encrypt _G_ARGS((char*, int)); extern int execl (const char*, const char *, ...); extern int execle (const char*, const char *, ...); extern int execlp (const char*, const char*, ...); ! extern int exect _G_ARGS((const char*, char * const *, char* const *)); ! extern int execv _G_ARGS((const char*, char * const *)); ! extern int execve _G_ARGS((const char*, char * const *, char * const *)); ! extern int execvp _G_ARGS((const char*, char * const *)); ! extern int fchown (int, int, int); extern _G_pid_t fork _G_ARGS((void)); extern int fsync _G_ARGS((int)); extern int ftruncate _G_ARGS((int, _G_off_t)); *************** *** 88,94 **** extern char* getcwd _G_ARGS((char*, _G_size_t)); extern int getdomainname _G_ARGS((char*, int)); extern int getdtablesize _G_ARGS((void)); ! extern int getgroups _G_ARGS((int, _G_gid_t*)); extern _G_uid_t geteuid _G_ARGS((void)); extern _G_gid_t getegid _G_ARGS((void)); extern _G_gid_t getgid _G_ARGS((void)); --- 88,94 ---- extern char* getcwd _G_ARGS((char*, _G_size_t)); extern int getdomainname _G_ARGS((char*, int)); extern int getdtablesize _G_ARGS((void)); ! extern int getgroups _G_ARGS((int, int*)); extern _G_uid_t geteuid _G_ARGS((void)); extern _G_gid_t getegid _G_ARGS((void)); extern _G_gid_t getgid _G_ARGS((void)); *************** *** 100,106 **** extern char* getlogin _G_ARGS((void)); extern char* getpass _G_ARGS((const char*)); extern _G_uid_t getuid _G_ARGS((void)); ! extern int ioctl (int, int, ... ); extern int isatty _G_ARGS((int)); extern int link _G_ARGS((const char*, const char*)); extern int mkstemp _G_ARGS((char*)); --- 100,106 ---- extern char* getlogin _G_ARGS((void)); extern char* getpass _G_ARGS((const char*)); extern _G_uid_t getuid _G_ARGS((void)); ! extern int ioctl (int, long unsigned int, ... ); extern int isatty _G_ARGS((int)); extern int link _G_ARGS((const char*, const char*)); extern int mkstemp _G_ARGS((char*)); *************** *** 111,117 **** extern int readlink _G_ARGS((const char*, char*, int)); extern int rename _G_ARGS((const char*, const char*)); extern int rmdir _G_ARGS((const char*)); ! extern void* sbrk _G_ARGS((int)); extern int syscall _G_ARGS((int, ...)); extern int setgid (_G_gid_t); extern int sethostname _G_ARGS((const char*, int)); --- 111,117 ---- extern int readlink _G_ARGS((const char*, char*, int)); extern int rename _G_ARGS((const char*, const char*)); extern int rmdir _G_ARGS((const char*)); ! extern char* sbrk _G_ARGS((int)); extern int syscall _G_ARGS((int, ...)); extern int setgid (_G_gid_t); extern int sethostname _G_ARGS((const char*, int)); *************** *** 119,125 **** extern _G_pid_t setpgrp _G_ARGS((void)); extern _G_pid_t setsid _G_ARGS((void)); #else ! extern _G_pid_t setpgrp _G_ARGS((_G_pid_t, _G_pid_t)); #endif extern int setregid _G_ARGS((int, int)); extern int setreuid _G_ARGS((int, int)); --- 119,125 ---- extern _G_pid_t setpgrp _G_ARGS((void)); extern _G_pid_t setsid _G_ARGS((void)); #else ! extern int setpgrp _G_ARGS((_G_pid_t, _G_pid_t)); #endif extern int setregid _G_ARGS((int, int)); extern int setreuid _G_ARGS((int, int)); *************** *** 133,139 **** extern int ttyslot _G_ARGS((void)); //extern int umask _G_ARGS((int)); /* commented out for now; wrong for SunOs4.1 */ extern int unlink _G_ARGS((const char*)); ! extern _G_pid_t vfork _G_ARGS((void)); extern int vadvise _G_ARGS((int)); extern int vhangup _G_ARGS((void)); extern _G_off_t lseek _G_ARGS((int, long, int)); --- 133,139 ---- extern int ttyslot _G_ARGS((void)); //extern int umask _G_ARGS((int)); /* commented out for now; wrong for SunOs4.1 */ extern int unlink _G_ARGS((const char*)); ! extern int vfork _G_ARGS((void)); extern int vadvise _G_ARGS((int)); extern int vhangup _G_ARGS((void)); extern _G_off_t lseek _G_ARGS((int, long, int)); diff -rc libg++-2.2.orig/libg++/src/regex.h libg++-2.2/libg++/src/regex.h *** libg++-2.2.orig/libg++/src/regex.h Wed Jun 3 17:16:02 1992 --- libg++-2.2/libg++/src/regex.h Sat Oct 24 18:33:12 1992 *************** *** 237,244 **** --- 237,248 ---- char *, int, int, struct re_registers *, int); /* 4.2 bsd compatibility. */ + #if !defined(__bsdi__) + #if !defined (__386BSD__) extern char *re_comp (char *); extern int re_exec (char *); + #endif + #endif #else /* !__STDC__ */ diff -rc libg++-2.2.orig/libg++/utils/gen-params libg++-2.2/libg++/utils/gen-params *** libg++-2.2.orig/libg++/utils/gen-params Fri Jun 26 12:29:41 1992 --- libg++-2.2/libg++/utils/gen-params Sat Oct 24 18:31:34 1992 *************** *** 284,289 **** --- 284,304 ---- #define ${macro_prefix}NULL ${NULL-0 /* default */} !EOF! + cat >dummy.c <<!EOF! + #if !defined(__bsdi__) + #if !defined (__386BSD__) + this should fail + #endif + #endif + main() + {} + !EOF! + + if ${CC} -c dummy.c >/dev/null 2>&1 ; then + echo "#define ${macro_prefix}USE_PROTOS" + else + echo "/* #define ${macro_prefix}USE_PROTOS */" + fi cat <<!EOF! #ifdef ${macro_prefix}USE_PROTOS