Subject: patch for libmh.so for netbsd, and other stuff.
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: None <mrg@mame.mu.OZ.AU>
List: current-users
Date: 06/19/1994 00:47:22
hi,

i've just got mh 6.8.3 compiled on my netbsd/sparc box
with a shared libmh.so.. saved me about 5 meg in disk
space ;)

below are two things; my MH config file, and a patch
file for mh 6.8.3.  i have not updated the mh
documentation to allow for the 'sharedlib netbsd', but
this can be seen in mh MH file.

if you have problems with this patch, or with running
mh with a shared libmh, please contact me before asking
the mh maintainers.

i've sent this to the mh maintainers, also.

good luck,
.mrg.

--- begin MH-sparc-netbsd ---
# netbsd/sparc; sparcstation 1+ running netbsd 0.9c
#

mts	sendmail/smtp
curses	-ltermcap -lcurses
signal	void
sprintf	int

bin	/local/bin
etc	/local/lib/mh
mail	/var/mail
mandir  /local/man
chown	/usr/sbin/chown

cc      cc
ccoptions -O42 -g -finline-functions
ldoptions -s
sharedlib netbsd
slflags -fpic
slibdir /local/lib

pop     on
manuals	standard

options BIND
options	BSD42
options BSD43
options	BSD44
options DBMPWD
options	FLOCK
options FOLDPROT='"0700"'
options GCOS_HACK
options ISI
options MHE
options MHRC
options MIME
options MORE='"/usr/bin/more"'
options MSGID
options MSGPROT='"0600"'
options NORUSERPASS
options NTOHLSWAP
options OVERHEAD
options POP
options POPSERVICE='"pop3"'
options POSIX
options RPATHS
options RPOP
options RENAME
options SENDMTS
options SMTP
options SYS5DIR
options TYPESIG=void
options UK
options UNISTD
options VSPRINTF
options WHATNOW
options ZONEINFO
--- end MH-sparc-netbsd ---

diff -rc mh-6.8.3.dist/conf/makefiles/sbr mh-6.8.3/conf/makefiles/sbr
*** mh-6.8.3.dist/conf/makefiles/sbr	Wed Dec  1 15:00:23 1993
--- mh-6.8.3/conf/makefiles/sbr	Sat Jun 18 20:32:49 1994
***************
*** 84,89 ****
--- 84,93 ----
  @BEGIN: SHAREDLIB
  		-rm -f $@ shared/$@
  		$(CC) $(CFLAGS) -c $(SLFLAGS) $*.c
+ @BEGIN: NETBSDSHLIB
+ 		-ld -x -r $@
+ 		-mv a.out $@
+ @END: NETBSDSHLIB
  		mv $@ shared/$@
  		-rm -f $@
  @END: SHAREDLIB
***************
*** 123,128 ****
--- 127,135 ----
  @BEGIN: SYS5SHLIB
  		(cd shared; ld -G -o ../$@ -h $@.$(SLIBVER) $(OFILES))
  @END: SYS5SHLIB
+ @BEGIN: NETBSDSHLIB
+ 		(cd shared; ld -Bshareable -Bforcearchive -o ../$@ $(OFILES))
+ @END: NETBSDSHLIB
  		-@rm -f $@.$(SLIBVER)
  		ln $@ $@.$(SLIBVER)
  		-@ls -l $@*
diff -rc mh-6.8.3.dist/conf/makefiles/support/bboards mh-6.8.3/conf/makefiles/support/bboards
*** mh-6.8.3.dist/conf/makefiles/support/bboards	Wed Dec  1 15:00:23 1993
--- mh-6.8.3/conf/makefiles/support/bboards	Sat Jun 18 19:44:18 1994
***************
*** 53,61 ****
  LIBES2	=	../../config/config.o ../../config/version.o \
  		../../sbr/libmh.so $(LIBES1)
  LDLIBS1	=	$(LIBES1) $(LDOPTLIB)
- LDLIBS2	=	$(LIBES2) $(LDOPTLIB)
  LDLIBS2	=	../../config/config.o ../../config/version.o \
  		-Bdynamic @(SLDFLAG) -lmh$(SLIBVER) $(LIBES1) $(LDOPTLIB)
  @END: SHAREDLIB
  
  LINT	=	lint
--- 53,64 ----
  LIBES2	=	../../config/config.o ../../config/version.o \
  		../../sbr/libmh.so $(LIBES1)
  LDLIBS1	=	$(LIBES1) $(LDOPTLIB)
  LDLIBS2	=	../../config/config.o ../../config/version.o \
  		-Bdynamic @(SLDFLAG) -lmh$(SLIBVER) $(LIBES1) $(LDOPTLIB)
+ @BEGIN: NETBSDSHLIB
+ LDLIBS2	=	../../config/config.o ../../config/version.o \
+ 		@(SLDFLAG) -lmh$(SLIBVER) $(LIBES1) $(LDOPTLIB)
+ @END: NETBSDSHLIB
  @END: SHAREDLIB
  
  LINT	=	lint
diff -rc mh-6.8.3.dist/conf/makefiles/support/pop mh-6.8.3/conf/makefiles/support/pop
*** mh-6.8.3.dist/conf/makefiles/support/pop	Wed Dec  1 15:00:23 1993
--- mh-6.8.3/conf/makefiles/support/pop	Sat Jun 18 19:44:01 1994
***************
*** 61,66 ****
--- 61,70 ----
  LDLIBS1	=	$(LIBES1) $(LDOPTLIB)
  LDLIBS2	=	../../config/config.o ../../config/version.o \
  		-Bdynamic @(SLDFLAG) -lmh$(SLIBVER) $(LIBES1) $(LDOPTLIB)
+ @BEGIN: NETBSDSHLIB
+ LDLIBS2	=	../../config/config.o ../../config/version.o \
+ 		@(SLDFLAG) -lmh$(SLIBVER) $(LIBES1) $(LDOPTLIB)
+ @END: NETBSDSHLIB
  @END: SHAREDLIB
  
  LINT	=	lint
diff -rc mh-6.8.3.dist/conf/makefiles/uip mh-6.8.3/conf/makefiles/uip
*** mh-6.8.3.dist/conf/makefiles/uip	Wed Dec  1 15:00:23 1993
--- mh-6.8.3/conf/makefiles/uip	Sat Jun 18 19:40:27 1994
***************
*** 142,147 ****
--- 142,151 ----
  		../zotnet/libzot.a
  LDLIBES	=	../config/config.o -Bdynamic @(SLDFLAG) -lmh$(SLIBVER) \
  		../mts/libmts.a  ../zotnet/libzot.a
+ @BEGIN: NETBSDSHLIB
+ LDLIBES	=	../config/config.o @(SLDFLAG) -lmh$(SLIBVER) \
+ 		../mts/libmts.a  ../zotnet/libzot.a
+ @END: NETBSDSHLIB
  LDLIBS	=	$(LDLIBES) ../config/version.o $(LDOPTLIB)
  @END: SHAREDLIB
  LINT	=	lint
diff -rc mh-6.8.3.dist/conf/mhconfig.c mh-6.8.3/conf/mhconfig.c
*** mh-6.8.3.dist/conf/mhconfig.c	Wed Dec  1 15:00:24 1993
--- mh-6.8.3/conf/mhconfig.c	Sat Jun 18 17:00:29 1994
***************
*** 448,453 ****
--- 448,457 ----
  	fprintf (fp, "/^@BEGIN: STDLIB$/d\n/^@END: STDLIB$/d\n");
  	fprintf (fp, "/^@BEGIN: SHAREDLIB$/,/^@END: SHAREDLIB$/d\n");
      }
+     if (strcmp (sharedlib, "netbsd") == 0 || strcmp (sharedlib, "on") == 0)
+ 	fprintf (fp, "/^@BEGIN: NETBSDSHLIB$/d\n/^@END: NETBSDSHLIB$/d\n");
+     else
+ 	fprintf (fp, "/^@BEGIN: NETBSDSHLIB$/,/^@END: NETBSDSHLIB$/d\n");
      if (strcmp (sharedlib, "sun4") == 0 || strcmp (sharedlib, "on") == 0)
  	fprintf (fp, "/^@BEGIN: SUN4SHLIB$/d\n/^@END: SUN4SHLIB$/d\n");
      else
***************
*** 774,782 ****
  
      if (strcmp (sharedlib, "on") && strcmp (sharedlib, "off")
  	    && strcmp (sharedlib, "sun4") && strcmp (sharedlib, "sys5")
! 	    && strcmp (sharedlib, "secure"))
  	adios (NULLCP,
! 	    "sharedlib should be either \"sun4\", \"sys5\", or \"off\", not %s",
  	    sharedlib);
  
      (void) sprintf(buffer, "TYPESIG=%s", signl);
--- 778,786 ----
  
      if (strcmp (sharedlib, "on") && strcmp (sharedlib, "off")
  	    && strcmp (sharedlib, "sun4") && strcmp (sharedlib, "sys5")
! 	    && strcmp (sharedlib, "secure") && strcmp (sharedlib, "netbsd"))
  	adios (NULLCP,
! 	    "sharedlib should be either \"sun4\", \"sys5\", \"netbsd\", or \"off\", not %s",
  	    sharedlib);
  
      (void) sprintf(buffer, "TYPESIG=%s", signl);
diff -rc mh-6.8.3.dist/uip/inc.c mh-6.8.3/uip/inc.c
*** mh-6.8.3.dist/uip/inc.c	Wed Dec  1 15:01:36 1993
--- mh-6.8.3/uip/inc.c	Sat Jun 18 18:10:25 1994
***************
*** 883,889 ****
  /*  */
  
  #ifdef	POP
! void	done (status)
  int	status;
  {
      if (file && pd != NOTOK)
--- 883,889 ----
  /*  */
  
  #ifdef	POP
! static void	done (status)
  int	status;
  {
      if (file && pd != NOTOK)
Only in mh-6.8.3/uip: ktrace.out
diff -rc mh-6.8.3.dist/uip/mhn.c mh-6.8.3/uip/mhn.c
*** mh-6.8.3.dist/uip/mhn.c	Wed Dec  1 15:01:36 1993
--- mh-6.8.3/uip/mhn.c	Sat Jun 18 18:10:43 1994
***************
*** 7223,7229 ****
  
  /*  */
  
! void done (status)
  int	status;
  {
      register CT	   *ctp;
--- 7223,7229 ----
  
  /*  */
  
! static void done (status)
  int	status;
  {
      register CT	   *ctp;
diff -rc mh-6.8.3.dist/uip/sendsbr.c mh-6.8.3/uip/sendsbr.c
*** mh-6.8.3.dist/uip/sendsbr.c	Wed Dec  1 15:01:38 1993
--- mh-6.8.3/uip/sendsbr.c	Sat Jun 18 18:05:49 1994
***************
*** 594,600 ****
  
  /*  */
  
! void done (status)
  int	status;
  {
      if (armed)
--- 594,600 ----
  
  /*  */
  
! static void done (status)
  int	status;
  {
      if (armed)
diff -rc mh-6.8.3.dist/uip/slocal.c mh-6.8.3/uip/slocal.c
*** mh-6.8.3.dist/uip/slocal.c	Wed Dec  1 15:01:38 1993
--- mh-6.8.3/uip/slocal.c	Sat Jun 18 21:21:06 1994
***************
*** 1304,1309 ****
--- 1304,1310 ----
  		    (void) fclose (in);
  		    return NOTOK;
  		}
+ #ifndef BSD44
  #ifdef FCNTL
  		{
  		    struct flock fl;
***************
*** 1328,1333 ****
--- 1329,1335 ----
  		    advise (file, "unable to perform flock on");
  		    goto out;
  		}
+ #endif
  #endif
  #endif
  

------------------------------------------------------------------------------