*BSD News Article 20644


Return to BSD News archive

Xref: sserve alt.sources:6387 comp.unix.bsd:12585 comp.sys.sun.admin:18113
Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!sol.ctr.columbia.edu!destroyer!news.itd.umich.edu!hellcow.css.itd.umich.edu!pauls
From: pauls@css.itd.umich.edu (Paul Southworth)
Newsgroups: alt.sources,comp.unix.bsd,comp.sys.sun.admin
Subject: Net2 /bin/make diffs for SunOS 4.1.3
Date: 8 Sep 1993 19:25:48 GMT
Organization: University of Michigan ITD Consulting and Support Services
Lines: 198
Distribution: world
Message-ID: <26lbjs$cpp@terminator.rs.itd.umich.edu>
NNTP-Posting-Host: hellcow.css.itd.umich.edu

                             SUMMARY

Porting and installing Net2 /bin/make on a Sun SPARC running SunOS 4.1.3

I looked around, found Vix's ultrix patches, found an older Sun version
ported (which, for me, died more horribly than the original Net2 release)
then decided to redo the whole thing.  The following has not been
extensively tested, although I have used it to build Berkeley Sendmail 8.5.

This was an entertaining little adventure.  Most of the brain-work was done
by cseeger@nielsen.com, and all the leg-work was done by me.  I am probably
a more clueless programmer than you will meet on an average Sunday walk
in the park, so I suggest that you post questions to appropriate newsgroups.
These are probably good:  comp.unix.bsd, comp.sys.sun.wanted, 
comp.unix.questions.  My fearless leader used the unbundled "acc" compiler
to build it on his system.  I used GCC 2.4.5.  Both worked.  By unofficial
comparison the GCC-compiled binary "make" was 4k smaller.


Hopefully-Idiot-Proof-Instructions:

1. Retrieve make from a Net2 source distribution.  These diffs were created
   from working on sources from /systems/unix/bsd-sources/bin/make on
   ftp.uu.net.  wuarchive.wustl.edu also has the Net2 distribution.  Put
   these in a directory called "make".  For further instructions I will
   assume you're getting sources from UUNet.

2. Retrieve /systems/unix/bsd-sources/share/mk and put it in make/mk on
   your machine.

3. Retrieve getenv.c and setenv.c from ...bsd-sources/lib/libc/stdlib and
   put them both in make/lst.lib on your machine.

4. Copy your /usr/include/ranlib.h to make/ranlib.h on your machine.

5. cd to make and patch this source tree with "patch -p1 <make.diff"

6. cd to make and "make -f Makefile.dist"
   Make directory /usr/share/mk, and then copy make/mk/* to /usr/share/mk.
   Then "./pmake".
   This will build a binary "make".  I installed it as "pmake" since I
   use it rarely.

7. If you want to be clever about it, you can then build Berkeley mkdep and
   "./pmake depend" before building for the last time.

My resulting binary was 131k.

Your mileage may vary, and I can't do anything about it!

Paul Southworth
Archivist - etext.archive.umich.edu
pauls@umich.edu


This is make.diff

------------------------slice-and-dice-here---------------------------------

diff -cr make/Makefile make.fixed/Makefile
*** make/Makefile	Fri Mar 15 19:21:32 1991
--- make.fixed/Makefile	Wed Sep  8 11:00:37 1993
***************
*** 1,7 ****
  #	@(#)Makefile	5.2 (Berkeley) 12/28/90
! 
  PROG=	make
! CFLAGS+=-I${.CURDIR}
  SRCS=	arch.c buf.c compat.c cond.c dir.c hash.c job.c main.c \
  	make.c parse.c str.c suff.c targ.c var.c
  SRCS+=	lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
--- 1,8 ----
  #	@(#)Makefile	5.2 (Berkeley) 12/28/90
! CC=	gcc
  PROG=	make
! # bsd defines MACHINE in <sys/param.h>, but not Sun
! CFLAGS+=-I${.CURDIR} -DMACHINE='"sparc"'
  SRCS=	arch.c buf.c compat.c cond.c dir.c hash.c job.c main.c \
  	make.c parse.c str.c suff.c targ.c var.c
  SRCS+=	lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
***************
*** 9,14 ****
--- 10,19 ----
  	lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
  	lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
  	lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
+ SRCS+=	getenv.c setenv.c
  .PATH:	${.CURDIR}/lst.lib
  
+ BINDIR=	/local/ucb
+ 
  .include <bsd.prog.mk>
+ 
diff -cr make/Makefile.dist make.fixed/Makefile.dist
*** make/Makefile.dist	Sun May 12 18:25:59 1991
--- make.fixed/Makefile.dist	Wed Sep  8 00:38:35 1993
***************
*** 1,7 ****
  # a very simple makefile...
  pmake:
  	@echo 'make started.'
! 	cc -I. -c *.c
! 	cd lst.lib; cc -I.. -c *.c
! 	cc *.o lst.lib/*.o -o pmake
  	@echo 'make completed.'
--- 1,8 ----
  # a very simple makefile...
+ DEFS = -O -Usparc -DMACHINE='"sparc"'
  pmake:
  	@echo 'make started.'
! 	gcc ${DEFS} -I. -c *.c
! 	cd lst.lib; gcc ${DEFS} -I.. -c *.c
! 	gcc ${DEFS} *.o lst.lib/*.o -o pmake
  	@echo 'make completed.'
diff -cr make/lst.lib/setenv.c make.fixed/lst.lib/setenv.c
*** make/lst.lib/setenv.c	Wed Sep  8 15:04:58 1993
--- make.fixed/lst.lib/setenv.c	Wed Sep  8 00:36:58 1993
***************
*** 110,115 ****
--- 110,116 ----
  	extern char **environ;
  	register char **P;
  	int offset;
+ 	char *_findenv();
  
  	while (_findenv(name, &offset))		/* if set multiple times */
  		for (P = &environ[offset];; ++P)
diff -cr make/make.h make.fixed/make.h
*** make/make.h	Thu Apr 18 19:11:53 1991
--- make.fixed/make.h	Wed Sep  8 00:36:24 1993
***************
*** 48,53 ****
--- 48,56 ----
  
  #include <sys/types.h>
  #include <string.h>
+ #ifdef sun
+ #include <strings.h>
+ #endif
  #include <ctype.h>
  #include "sprite.h"
  #include "lst.h"
diff -cr make/mk/bsd.lib.mk make.fixed/mk/bsd.lib.mk
*** make/mk/bsd.lib.mk	Wed Sep  8 14:55:08 1993
--- make.fixed/mk/bsd.lib.mk	Wed Sep  8 14:21:26 1993
***************
*** 5,11 ****
  .endif
  
  LIBDIR?=	/usr/lib
! LINTLIBDIR?=	/usr/libdata/lint
  LIBGRP?=	bin
  LIBOWN?=	bin
  LIBMODE?=	444
--- 5,11 ----
  .endif
  
  LIBDIR?=	/usr/lib
! LINTLIBDIR?=	/usr/lib/lint
  LIBGRP?=	bin
  LIBOWN?=	bin
  LIBMODE?=	444
diff -cr make/mk/sys.mk make.fixed/mk/sys.mk
*** make/mk/sys.mk	Wed Sep  8 14:55:10 1993
--- make.fixed/mk/sys.mk	Wed Sep  8 14:52:52 1993
***************
*** 31,37 ****
  LINT=		lint
  LINTFLAGS=	-chapbx
  
! MAKE=		make
  
  PC=		pc
  PFLAGS=
--- 31,37 ----
  LINT=		lint
  LINTFLAGS=	-chapbx
  
! MAKE=		pmake
  
  PC=		pc
  PFLAGS=
diff -cr make/ranlib.h make.fixed/ranlib.h
*** make/ranlib.h	Wed Sep  8 14:56:18 1993
--- make.fixed/ranlib.h	Wed Sep  8 10:06:41 1993
***************
*** 12,17 ****
--- 12,21 ----
  #ifndef _ranlib_h
  #define _ranlib_h
  
+ /* #define RANLIBMAG	"!<arch>\n__.SYMDEF"	/* archive file name */
+ #define RANLIBMAG	"__.SYMDEF"	/* archive file name */
+ #define RANLIBSKEW	3		/* creation time offset */
+ 
  struct	ranlib {
  	union {
  		off_t	ran_strx;	/* string table index of */