149696SbosticThis is the src tree for the second Berkeley networking distribution.
249696SbosticThis file is intended to be a simple, preliminary guide to finding your
349696Sbosticway around and compiling the programs.  We apologize that this
449696Sbosticdistribution has so little in the way of compatibility with previous
549696Sbosticsystems.  We had hoped that we could provide compatibility with at least
649698Smckusick4.3BSD, but we simply did not have sufficient time to accomplished the
7*50376Skarelstask.  In general, this release is similar to the 4.3BSD-Reno, although
8*50376Skarelsit has a new virtual memory system and other changes.
949696Sbostic
1049696SbosticFirst, there has been a major reorganization of the file system.  (You
11*50376Skarelsmay have seen similar reorganizations on 4.3BSD-Reno and systems shipped
12*50376Skarelsby Sun Microsytems and Digital Equipment Corporation, among others.)
13*50376SkarelsIn general, the reorganization is as follows.  (Directories not listed are
14*50376Skarelspretty much unchanged, i.e.  /dev is the same as always.)
1549696Sbostic
1649696Sbostic	/etc		configuration files (NO BINARIES)
1749696Sbostic	/bin		binaries needed when running single-user
1849698Smckusick	/sbin		binaries for the root user when running single-user
1949696Sbostic
2049696Sbostic	/var		per machine variable directories
2149696Sbostic	/var/mail	the old /usr/spool/mail
2249698Smckusick	/var/spool	the old /usr/spool directories
2349696Sbostic	/var/tmp	the old /usr/tmp
2449696Sbostic	/var/acct	the old /usr/adm
2549696Sbostic	/var/log	log files
2649696Sbostic	/var/crash	crash dumps
2749696Sbostic
2849696Sbostic	/usr/bin	the rest of the binaries
2949696Sbostic	/usr/lib	system libraries (NO BINARIES)
3049696Sbostic	/usr/libdata	system datafiles
3149696Sbostic	/usr/libexec	programs executed by other programs
3249698Smckusick	/usr/sbin	the rest of the binaries for the root user
3349696Sbostic	/usr/share	architecture independent files
3449696Sbostic
3549696SbosticThe directories containing the source tree parallel the directories where
3649696Sbosticthe binaries live, i.e. the binaries for /usr/bin are in /usr/src/usr.bin,
3749696Sbosticthe files that are installed in /usr/share/misc live in
3849696Sbostic/usr/src/share/misc, and so on.  It is our intent that the entire system
3949696Sbosticbe installed from /usr/src -- the files normally found in /etc are
4049696Sbosticprototyped (and installed) from /usr/src/etc.  Include files are installed
4149696Sbosticfrom /usr/src/include.  One exception to this is the software not
4249696Sbosticmaintained at Berkeley.  For example, the Kerberos software can be found
4349696Sbosticin /usr/src/kerberosIV, and the ISODE software is in
4449696Sbostic/usr/src/contrib/isode.  Manual pages are in the directories of the
4549696Sbosticprograms that they document; if they aren't directly related to a program,
4649696Sbosticthey are in /usr/src/share/man.
4749696Sbostic
4849696SbosticMake has changed a lot.  It's pretty well documented, so you should read
4949696Sbosticthe man page.  All of the makefiles in /usr/src have been modified to use
5049696Sbosticthe new make features.  Your make will almost certainly not work on these
5149696Sbosticmakefiles.  However, the new make will work on your old makefiles.  If
5249696Sbosticyou only wish to install one or two programs, you may want to just create
5349696Sbosticmakefiles for them and build them by hand.  If you want to build the entire
5449696Sbosticsystem, you probably want to get our make running on your system.
5549696Sbostic
5649696SbosticThis is done by by going to usr.bin/src/make and entering "make -f
5749696SbosticMakefile.dist".  This is a minimal makefile which just compiles the make
5849696Sbosticprogram.  It will create a binary named pmake.  Compiling pmake on your
5949696Sbosticsystem may fail.  If it does, there's probably a difference in your
6049696Sbostic/usr/include files that make is unhappy about.  You probably want to
6149696Sbosticfigure out what the real problem is in this case.  Loading make on your
6249696Sbosticsystem may also fail.  If it does, you are probably missing one or more
6349696Sbosticroutines in your C library that make needs.  Finding the correct routine
6449696Sbosticin the lib/libc/* directories, and creating a .o for the make directory
65*50376Skarelswill probably get you around this problem.  Once pmake compile and loads,
66*50376Skarelsit can be installed as "make".
6749696Sbostic
6849696SbosticOnce you have a "new" make working, you have to install the template files
6949713Sbosticthat it uses.  These files are in the directory src/share/mk.  Normally, they
7049696Sbosticare installed in the directory /usr/share/mk.  If you wish to install them
7149696Sbosticsomewhere else, change the file pathnames.h in src/usr.bin/make to reflect
7249696Sbosticwhere you plan to install them.  There's a file named bsd.README in the
7349696Sbosticsrc/share/mk directory that briefly discusses how the BSD make templates
7449696Sbosticwork.  It's not necessary reading, but it might be useful.
7549696Sbostic
7649696SbosticOnce you have a make compiled and its template files installed, you can use
7749696Sbosticthe standard makefiles.  One other comment, most of the standard makefiles
7849696Sbosticwill attempt to build manual pages as well as the program.  This will be a
7949696Sbosticproblem, because the manual pages require roff macro packages which will not
8049696Sbostichave been installed.  You can install these macros (see src/share/tmac),
8149696Sbosticor use the command "make NOMAN=noman" or add NOMAN=man as part of your
8249696Sbostic"MAKE" environmental variable when you make the BSD source to solve this
8349696Sbosticproblem.
8449696Sbostic
8549696SbosticIn each of the source directories you will find a symbolic link named "obj".
8649696SbosticThis symbolic link points to somewhere in the file hierarchy /usr/obj.  For
8749696Sbosticexample, the "obj" symlink in bin/ls points to /usr/obj/bin/ls.  This is the
8849696Sbosticway that we build multiple architectures from a single source tree.  We
8949696Sbosticcreate a /usr/obj that is local to each machine which is building for an
9049696Sbosticarchitecture.  Then, we remote mount the source tree (often read-only) and
9149696Sbosticstart the compile.  Make changes directory into the "obj" subdirectory, and
9249696Sbosticbuilds the object files there.  (There is one real nastiness in this scheme.
9349696SbosticAny makefile wishing to reference a file relative to the source directory
9449696Sbosticmust use the ${.CURDIR} macro before the path name, because when make runs
9549696Sbosticit cd's into the "obj" directory.  This *will* be corrected by 4.4BSD, but
9649713Sbosticwe haven't done it yet.)  A simple work-around is to remove the symbolic
9749713Sbosticlink obj, or make it a real sub-directory of the source directory.
9849696Sbostic
9949696SbosticNow you're ready to try and build the system.  First, we haven't really done
10049696Sbosticthis (as I said before, we just ran out of time).  So don't take the following
10149696Sbosticas a real solution, it's simply the way that we had planned to approach the
10249696Sbosticproblem.
10349696Sbostic
10449696SbosticThere are really two problems that you're likely to encounter.  The first
10549696Sbosticare include files that aren't what the BSD source expects, and the second
10649696Sbosticare C library routines that are either missing or different.  The include
10749696Sbosticfiles are probably best handled by creating a directory, called, for the
10849696Sbosticsake of discussion, bsdinclude, in the top level of the distribution
10949696Sbosticsource tree.  Add a -I include path to the CFLAGS macro in the source
11049696Sbosticmakefiles that you are trying to compile so that the compiler looks for
11149696Sbosticits include files in bsdinclude first.  (Another way to do this, to avoid
11249696Sbosticmodifying the makefiles, is to put the -I include path into the
11349713Sbosticenvironmental variable "COPTS".  This environmental variable is used by
11449713Sbosticmake.)  Then, as you encounter problems in compiling, create include files
11549713Sbosticthat fix the problem.
11649696Sbostic
11749696SbosticFor example, one of the changes that we've made in our release is that
11849696Sbosticwe've extracted all full path names from the source code and placed them
11949696Sbosticeither in an include file in the source directory or an include file in
12049696Sbostic/usr/include.  Therefore, you will find a number of programs that include
12149696Sbostic<paths.h> (the path include file for the entire system).  Since your
12249696Sbosticsystem will probably not have a paths.h include file, you can install the
12349696SbosticBSD one in bsdinclude (modifying it as necessary) and the problem should
12449696Sbosticgo away.  However, our <utmp.h> include file has had paths added to it,
12549696Sbosticas well, and now includes the <lastlog.h> include file as well.  To make
12649696Sbosticthis work, I'd suggest creating a utmp.h file in bsdinclude which #defines
12749696Sbosticthe paths that the BSD utmp.h include file does, but which then includes
12849713Sbosticyour standard utmp.h and lastlog.h include files.  So, the bsdinclude
12949696Sbosticversion of utmp.h might look like:
13049696Sbostic
13149696Sbostic	#define _PATH_UTMP      "/var/run/utmp"
13249696Sbostic	#define _PATH_WTMP      "/var/log/wtmp"
13349696Sbostic	#define _PATH_LASTLOG   "/var/log/lastlog"
13449696Sbostic
13549713Sbostic	#include "/usr/include/lastlog.h"
13649713Sbostic	#include "/usr/include/utmp.h"
13749696Sbostic
13849696SbosticI believe that this approach will make it possible to build the C library.
13949696SbosticOnce the C library is built, install it somewhere.  As you compile
14049696Sbosticprograms you will probably find unresolved references that need to be
14149696Sbosticsatisfied using the BSD library.  I'd suggest adding the BSD library
14249713Sbostic*after* the standard C library.  You can do this by changing the makefiles,
14349696Sbosticor adding the string "LDADD=-lc the/bsd/library/path" to your environment.
14449713SbosticNote, programs that require other libraries will probably require  additional
14549696Sbosticinformation in the LDADD environmental variable.
146