Subject: patches for NCSA mosaic 2.7b2 on DomainOS
From: [email-masked] (Vincent D. Skahan)
Date: Mon, 27 Nov 1995 16:59:05 GMT

Here are patches for NCSA Mosaic 2.7b2 to be able to run on DomainOS.  
These worked here with:
	DomainOS 10.4.0.11 cc 6.9 uedk 2.1 x11r5

To apply
	cd Mosaic_src
	patch < thisfile

Disclaimer:
	Of course, there are no warranties/guarantees, etc.

These patches have been submitted to NCSA for inclusion into
the next release (hopefully...)

*** ./libhtmlw/HTML-PSformat.c.original	Tue Nov 21 07:59:10 1995
--- ./libhtmlw/HTML-PSformat.c	Tue Nov 21 07:59:33 1995
***************
*** 65,71 ****
--- 65,73 ----
  #include <stdio.h>
  #include <ctype.h>
  #include <math.h>
+ #ifndef _NO_MALLOC_H_
  #include <malloc.h>
+ #endif
  #include <time.h>
  #include <sys/types.h>
  #include <time.h>
*** ./libnut/system.c.original	Tue Nov 21 08:10:53 1995
--- ./libnut/system.c	Mon Nov 27 08:14:03 1995
***************
*** 136,141 ****
--- 136,145 ----
   */
  int my_system(char *cmd, char *retBuf, int bufsize) {
  
+ #ifdef APOLLO
+ #define O_NONBLOCK 040
+ #endif
+ 
  char **sys_argv=NULL;
  int sys_argc;
  pid_t pid;
*** ./src/accept.c.original	Tue Nov 21 08:43:24 1995
--- ./src/accept.c	Tue Nov 21 08:44:03 1995
***************
*** 15,21 ****
--- 15,23 ----
  #endif
  
  /*For memset*/
+ #ifndef _NO_MEMORY_H_
  #include <memory.h>
+ #endif
  
  #ifdef MOTOROLA
  #include <sys/filio.h>
*** ./src/globalhist.c.original	Tue Nov 21 08:43:24 1995
--- ./src/globalhist.c	Tue Nov 21 08:44:59 1995
***************
*** 57,64 ****
  #include <time.h>
  
  /*for memset*/
  #include <memory.h>
! 
  extern char *cached_url;
  
  #define TRACE 0
--- 57,65 ----
  #include <time.h>
  
  /*for memset*/
+ #ifndef _NO_MEMORY_H_
  #include <memory.h>
! #endif
  extern char *cached_url;
  
  #define TRACE 0
*** ./src/grpan-www.c.original	Tue Nov 21 08:43:24 1995
--- ./src/grpan-www.c	Tue Nov 21 08:45:14 1995
***************
*** 55,62 ****
  #include "mosaic.h"
  
  /*for memcpy*/
  #include <memory.h>
! 
  #if 0
  
  /* libwww includes */
--- 55,63 ----
  #include "mosaic.h"
  
  /*for memcpy*/
+ #ifndef _NO_MEMORY_H_
  #include <memory.h>
! #endif
  #if 0
  
  /* libwww includes */
*** ./src/gui.c.original	Tue Nov 21 08:36:38 1995
--- ./src/gui.c	Mon Nov 27 08:20:16 1995
***************
*** 65,71 ****
--- 65,75 ----
  #include <netinet/in.h>
  #include <netdb.h>
  #include <ctype.h>
+ #ifdef APOLLO
+ #include "/sys5.3/usr/include/sys/utsname.h"
+ #else
  #include <sys/utsname.h>
+ #endif
  #include <pwd.h>
  
  #define __SRC__
*** ./src/history.c.original	Tue Nov 21 08:43:25 1995
--- ./src/history.c	Tue Nov 21 08:45:27 1995
***************
*** 61,68 ****
  #include "../libwww2/HTAAUtil.h"
  
  /*for memcpy*/
  #include <memory.h>
! 
  extern Display *dsp;
  
  /* ------------------------------------------------------------------------ */
--- 61,69 ----
  #include "../libwww2/HTAAUtil.h"
  
  /*for memcpy*/
+ #ifndef _NO_MEMORY_H_
  #include <memory.h>
! #endif
  extern Display *dsp;
  
  /* ------------------------------------------------------------------------ */
*** ./src/main.c.original	Tue Nov 21 08:20:39 1995
--- ./src/main.c	Mon Nov 27 08:20:59 1995
***************
*** 61,67 ****
--- 61,71 ----
  #include "mosaic.h"
  #include <signal.h>
  #include <sys/wait.h>
+ #ifdef APOLLO
+ #include "/sys5.3/usr/include/sys/utsname.h"
+ #else
  #include <sys/utsname.h>
+ #endif
  
  /* swp */
  #define _KCMS_H_
*** ./src/mo-www.c.original	Tue Nov 21 08:43:25 1995
--- ./src/mo-www.c	Tue Nov 21 08:45:39 1995
***************
*** 56,63 ****
  #include <ctype.h>
  
  /*for memcpy*/
  #include <memory.h>
! 
  /*SWP*/
  #define __SRC__
  #include "../libwww2/HTAAUtil.h"
--- 56,64 ----
  #include <ctype.h>
  
  /*for memcpy*/
+ #ifndef _NO_MEMORY_H_
  #include <memory.h>
! #endif
  /*SWP*/
  #define __SRC__
  #include "../libwww2/HTAAUtil.h"
*** ./src/mosaic.h.original	Tue Nov 21 12:09:20 1995
--- ./src/mosaic.h	Tue Nov 21 12:10:51 1995
***************
*** 133,146 ****
  
  #ifndef DOCUMENTS_MENU_SPECFILE
  #define DOCUMENTS_MENU_SPECFILE \
!   "/usr/local/lib/mosaic/documents.menu"
  #endif /* not DOCUMENTS_MENU_SPECFILE */
  
  #ifndef GLOBAL_EXTENSION_MAP
! #define GLOBAL_EXTENSION_MAP "/usr/local/lib/mosaic/mime.types"
  #endif
  #ifndef GLOBAL_TYPE_MAP
! #define GLOBAL_TYPE_MAP "/usr/local/lib/mosaic/mailcap"
  #endif

--- 133,146 ----
  
  #ifndef DOCUMENTS_MENU_SPECFILE
  #define DOCUMENTS_MENU_SPECFILE \
!   "/site/sw/www/mosaic/documents.menu"
  #endif /* not DOCUMENTS_MENU_SPECFILE */
  
  #ifndef GLOBAL_EXTENSION_MAP
! #define GLOBAL_EXTENSION_MAP "/site/sw/www/mosaic/lib/mime.types"
  #endif
  #ifndef GLOBAL_TYPE_MAP
! #define GLOBAL_TYPE_MAP "/site/sw/www/mosaic/lib/mailcap"
  #endif

*** ./src/pan.c.original	Tue Nov 21 08:43:25 1995
--- ./src/pan.c	Tue Nov 21 08:45:50 1995
***************
*** 59,66 ****
  #include "libhtmlw/HTML.h"
  
  /*for memset*/
  #include <memory.h>
! 
  #ifndef S_IRUSR
  #define S_IRUSR 400
  #define S_IWUSR 200
--- 59,67 ----
  #include "libhtmlw/HTML.h"
  
  /*for memset*/
+ #ifndef _NO_MEMORY_H_
  #include <memory.h>
! #endif
  #ifndef S_IRUSR
  #define S_IRUSR 400
  #define S_IWUSR 200
*** ./src/pixmaps.c.original	Tue Nov 21 08:43:26 1995
--- ./src/pixmaps.c	Tue Nov 21 08:46:01 1995
***************
*** 56,63 ****
  #include "pixmaps.h"
  
  /*for memcpy*/
  #include <memory.h>
! 
  extern unsigned char *ProcessXpm3Data();

--- 56,64 ----
  #include "pixmaps.h"
  
  /*for memcpy*/
+ #ifndef _NO_MEMORY_H_
  #include <memory.h>
! #endif
  extern unsigned char *ProcessXpm3Data();

*** ./src/proxy-dialogs.c.original	Tue Nov 21 09:21:14 1995
--- ./src/proxy-dialogs.c	Tue Nov 21 09:21:38 1995
***************
*** 66,72 ****
--- 66,74 ----
  #include <Xm/Label.h>
  #include <Xm/MessageB.h>
  
+ #ifndef _NO_MALLOC_H_
  #include <malloc.h>
+ #endif
  #include <string.h>
  #include "proxy.h"
  #include "mosaic.h"
*** ./src/support.c.original	Tue Nov 21 08:43:26 1995
--- ./src/support.c	Tue Nov 21 08:46:14 1995
***************
*** 2,8 ****
--- 2,10 ----
  #include <string.h>
  
  /*for memcpy*/
+ #ifndef _NO_MEMORY_H_
  #include <memory.h>
+ #endif
  
  #include "cci.h"
  
*** ./src/xpmread.c.original	Tue Nov 21 08:43:26 1995
--- ./src/xpmread.c	Tue Nov 21 08:46:28 1995
***************
*** 91,97 ****
--- 91,99 ----
  #include "xpm.h"
  
  /*for memset*/
+ #ifndef _NO_MEMORY_H_
  #include <memory.h>
+ #endif
  
  extern Display *dsp;
  
*** Makefile	Wed Oct 18 15:12:16 1995
--- Makefile.apollo	Mon Nov 27 08:25:12 1995
***************
*** 16,22 ****
  
  CC = cc
  #### On Sun's, this should be gcc (ANSI required).
! CC = gcc
  
  #### Linker Flags -- Primarily for linking static on linux-elf.
  #ldflags = -static
--- 16,22 ----
  
  CC = cc
  #### On Sun's, this should be gcc (ANSI required).
! #CC = gcc
  
  #### Linker Flags -- Primarily for linking static on linux-elf.
  #ldflags = -static
***************
*** 40,46 ****
  #### For Convex whatever, do -DCONVEX
  #### For SCO ODT 3.0, do -DSCO -DSVR4 -DMOTIF1_2
  #### For Motorola SVR4, do -DSVR4 -DMOTOROLA -DMOTIF1_2
! sysconfigflags = 
  
  #### System libraries.
  syslibs = -lPW -lsun -lmalloc
--- 40,46 ----
  #### For Convex whatever, do -DCONVEX
  #### For SCO ODT 3.0, do -DSCO -DSVR4 -DMOTIF1_2
  #### For Motorola SVR4, do -DSVR4 -DMOTOROLA -DMOTIF1_2
! sysconfigflags =  -D_NO_MEMORY_H_ -D_NO_MALLOC_H_ -DMOTIF1_2 -DMOTIF -DAPOLLO
  
  #### System libraries.
  syslibs = -lPW -lsun -lmalloc
***************
*** 70,79 ****
  #### HP X11R5 version:
  # xinc = -I/usr/include/Motif1.2 -I/usr/local/X11R5/include
  #### NeXT version:
! # xinc = -I/usr/include/X11
  #### BSD/386
  # xinc = -I/usr/X11/include
! xinc = -I/xdev/mosaic/X11R5/include
  
  #### X library locations.
  # xlibs = -lXm_s -lXmu -lXt_s -lX11_s
--- 70,79 ----
  #### HP X11R5 version:
  # xinc = -I/usr/include/Motif1.2 -I/usr/local/X11R5/include
  #### NeXT version:
! xinc = -I/usr/include/X11
  #### BSD/386
  # xinc = -I/usr/X11/include
! #xinc = -I/xdev/mosaic/X11R5/include
  
  #### X library locations.
  # xlibs = -lXm_s -lXmu -lXt_s -lX11_s
***************
*** 92,98 ****
  #### For SCO ODT 3.0 (I'm told that -lXtXm_s is *not* a typo :-):
  # xlibs = -lXtXm_s -lXmu -lX11_s
  #### For nearly everyone else:
! # xlibs = -lXm -lXmu -lXt -lX11
  #### For BSD/386:
  # xlibs = -L/usr/X11/lib -lXm -lXmu -lXt -lX11
  #### For Motorola SVR4:
--- 92,98 ----
  #### For SCO ODT 3.0 (I'm told that -lXtXm_s is *not* a typo :-):
  # xlibs = -lXtXm_s -lXmu -lX11_s
  #### For nearly everyone else:
! xlibs = -lXm -lXmu -lXt -lX11
  #### For BSD/386:
  # xlibs = -L/usr/X11/lib -lXm -lXmu -lXt -lX11
  #### For Motorola SVR4:
***************
*** 115,150 ****
  ####   sun, sgi, dec, ibm, next, cray, convex
  #### If your platform is not one of the above, then either do not compile
  #### with HDF/DTM support or try hacking libdtm/makefile.
! 
! dtmmachtype = sun
! dtmdirs = libdtm libnet
! dtmlibs = ../libnet/libnet.a ../libdtm/libdtm.a
! dtmflags = -DHAVE_DTM -I.. -I../libnet
! hdfdir = /hdf2/install/sun
! hdflibs = $(hdfdir)/lib/libnetcdf.a $(hdfdir)/lib/libdf.a
! hdfflags = -DHAVE_HDF -DHDF -I$(hdfdir)/include
! 
! 
! #### PNG SUPPORT
! #### For inline PNG support, the following should be defined:
! #### The libraries currently used are PNGLIB 0.81 and ZLIB 0.95
! 
! pngdir = /xdev/mosaic/libpng/sun
! pnglibdir = $(pngdir)/lib
! pngincludedir = $(pngdir)/include
! pnglibs = $(pnglibdir)/libpng.a $(pnglibdir)/libz.a -lm
! pngflags =  -I$(pngincludedir) -DHAVE_PNG
! 
! 
  #### JPEG SUPPORT
  #### For inline JPEG support, the following should be defined:
  #### The library used is Independent JPEG Group (IJG's) 5.0a.
  
- jpegdir = /xdev/mosaic/libjpeg/sun
- jpeglibs = $(jpegdir)/lib/libjpeg.a
- jpegflags = -I$(jpegdir)/include -DHAVE_JPEG
- 
- 
  #### KERBEROS SUPPORT
  ####
  #### If you want Mosaic to support Kerberos authentication, set the 
--- 115,148 ----
  ####   sun, sgi, dec, ibm, next, cray, convex
  #### If your platform is not one of the above, then either do not compile
  #### with HDF/DTM support or try hacking libdtm/makefile.
! #
! #dtmmachtype = sun
! #dtmdirs = libdtm libnet
! #dtmlibs = ../libnet/libnet.a ../libdtm/libdtm.a
! #dtmflags = -DHAVE_DTM -I.. -I../libnet
! #hdfdir = /hdf2/install/sun
! #hdflibs = $(hdfdir)/lib/libnetcdf.a $(hdfdir)/lib/libdf.a
! #hdfflags = -DHAVE_HDF -DHDF -I$(hdfdir)/include
! #
! #
! ##### PNG SUPPORT
! ##### For inline PNG support, the following should be defined:
! ##### The libraries currently used are PNGLIB 0.81 and ZLIB 0.95
! #
! #pngdir = /xdev/mosaic/libpng/sun
! #pnglibdir = $(pngdir)/lib
! #pngincludedir = $(pngdir)/include
! #pnglibs = $(pnglibdir)/libpng.a $(pnglibdir)/libz.a -lm
! #pngflags =  -I$(pngincludedir) -DHAVE_PNG
! #
! #
  #### JPEG SUPPORT
  #### For inline JPEG support, the following should be defined:
  #### The library used is Independent JPEG Group (IJG's) 5.0a.
+ jpegdir = ../libjpeg-6
+ jpeglibs = $(jpegdir)/libjpeg.a
+ jpegflags = -I$(jpegdir) -DHAVE_JPEG
  
  #### KERBEROS SUPPORT
  ####
  #### If you want Mosaic to support Kerberos authentication, set the 
***************
*** 154,169 ****
  #### define the KRB-ENCRYPT flag.
  
  ##krb4dir   = /usr/athena
! krb4dir   = /xdev/mosaic/libkrb4/sun
! krb4libs  = $(krb4dir)/lib/libkrb.a $(krb4dir)/lib/libdes.a
! krb4flags = -DKRB4 -I$(krb4dir)/include
! 
! ##krb5dir   = /krb5
! krb5dir   = /xdev/mosaic/libkrb5/sun
! krb5libs  = $(krb5dir)/lib/libkrb5.a $(krb5dir)/lib/libcrypto.a $(krb5dir)/util/et/libcom_err.a
! krb5flags = -DKRB5 -I$(krb5dir)/include -I$(krb5dir)/include/krb5
! 
! #Do not comment out.
  krbflags  = $(krb4flags) $(krb5flags)
  krblibs   = $(krb4libs) $(krb5libs) 
  
--- 152,167 ----
  #### define the KRB-ENCRYPT flag.
  
  ##krb4dir   = /usr/athena
! #krb4dir   = /xdev/mosaic/libkrb4/sun
! #krb4libs  = $(krb4dir)/lib/libkrb.a $(krb4dir)/lib/libdes.a
! #krb4flags = -DKRB4 -I$(krb4dir)/include
! #
! ###krb5dir   = /krb5
! #krb5dir   = /xdev/mosaic/libkrb5/sun
! #krb5libs  = $(krb5dir)/lib/libkrb5.a $(krb5dir)/lib/libcrypto.a $(krb5dir)/util/et/libcom_err.a
! #krb5flags = -DKRB5 -I$(krb5dir)/include -I$(krb5dir)/include/krb5
! #
! ##Do not comment out.
  krbflags  = $(krb4flags) $(krb5flags)
  krblibs   = $(krb4libs) $(krb5libs) 
  
***************
*** 182,194 ****
  #### servers via a HTTP gateway.
  
  #### -lm is required for freeWAIS 0.5, as ceil() is used.
! 
! waisroot = /xdev/mosaic/freeWAIS/sun4
! waisflags = -DDIRECT_WAIS -I$(waisroot)/include
! waislibdir = $(waisroot)/bin
! waislibs = $(waislibdir)/inv.a $(waislibdir)/wais.a $(waislibdir)/libftw.a -lm
! 
! 
  #### Customization flags:
  #### . If you want Mosaic to come up with monochrome colors by default,
  ####   use -DMONO_DEFAULT
--- 180,192 ----
  #### servers via a HTTP gateway.
  
  #### -lm is required for freeWAIS 0.5, as ceil() is used.
! #
! #waisroot = /xdev/mosaic/freeWAIS/sun4
! #waisflags = -DDIRECT_WAIS -I$(waisroot)/include
! #waislibdir = $(waisroot)/bin
! #waislibs = $(waislibdir)/inv.a $(waislibdir)/wais.a $(waislibdir)/libftw.a -lm
! #
! #
  #### Customization flags:
  #### . If you want Mosaic to come up with monochrome colors by default,
  ####   use -DMONO_DEFAULT
***************
*** 203,209 ****
  # ---------------------- END OF CUSTOMIZABLE OPTIONS -------------------------

! CFLAGS = -g $(sysconfigflags) $(prereleaseflags)
  
  # Don't worry about these -- for development purposes only.
  PURIFY = purify
--- 201,208 ----
  # ---------------------- END OF CUSTOMIZABLE OPTIONS -------------------------

! ##CFLAGS = -g $(sysconfigflags) $(prereleaseflags)
! CFLAGS = -O $(sysconfigflags) $(prereleaseflags)
  
  # Don't worry about these -- for development purposes only.
  PURIFY = purify
-- 
 ----------- Vince Skahan ------ [email-masked] -----------
  Microsoft Word for Windows doesn't have the word "Internet" in its spell
  checker.  It suggests the following alternates:
              Interment   Internee   Interned    Internees