INSTALL

I have built this tree on NetBSD (i386,sparc), FreeBSD, SunOS, Solaris (sparc,x86). I have also built much of it on Linux, HP-UX, IRIX and Ultrix. Feeback is welcome.

Linux

I've only looked at one Linux system (Red Hat) which may have been very unrepresentative - there were no [n]curses headers and no lib[n]curses.so symlink. It also used iostreams for stdio which means libsslfd cannot hook in under stdio - which probably means bftp will not work. I created a symlink for libncurses.so so that stelnetd could compile, but the lack of headers ruled out compiling stn3270 (and probably some of the nifty features in bftp).

The good news is that bmake, SSLeay, SSLr* and stelnet all work fine.

bmake

First unless you are running 4.4BSD, you must build bmake. This tree is designed to be built with bmake and with support for multiple architectures. GNU autoconf is used to generate a config.h which handles most system dependencies, but the Makefiles rely on bmake. Fortunately my bmake uses autoconf :-)

If you are running 4.4BSD

You simply need to install my macros in /usr/share/mk, the following command will skip the bsd.*.mk and *.sys.mk files which you should not install on a 4.4BSD system as they will probably break your /usr/src builds:
# cp bmake/mk/[d-s]*.mk /usr/share/mk
I've not yet worked out why, but FreeBSD installs man pages into /usr/share/man/man/man*. Look in sys.mk for conflicts with man.mk

The easy solution is to simply install bmake.

Building bmake

This should be quite straight forward.

$ BASE=`pwd`
$ mkdir /tmp/bmake
$ cd /tmp/bmake
$ $BASE/bmake/configure
$ make -f makefile.boot
# make -f makefile.boot install
You may need to use gnu make for the above.

If you really want to, you can use the bmake thus produced to re-build bmake, though I never bother.

$ cd $BASE/bmake
$ bmake obj
$ bmake
# bmake install

Makefile.base

The Makefiles want to know where the top level directory is. If it is not /usr/local/src/sjg, then you should either create Makefile.base in the top level directory or set BASE in your environment.

These Makefiles use my own macro files which are derrived from the bsd.*.mk macros, if you are not allowed to install bmake/mk/*.mk in /usr/share/mk or /usr/local/share/mk you can use:

	bmake -I ${BASE}/bmake/mk
Finally, if you do not have the BSD mandoc macros for [nt]roff, or you do not want the man pages formatted, set NOMAN=no in your environment or in Makefile.base

Macro files

A couple of my macro files differ from the bsd.* originals (apart from being more portable), man.mk handles installing unformatted nroff, as well as formatted pages with the normal extension rather than BSD's .0 Unless SUBDIR_MUST_EXIST is defined, subdir.mk will skip missing subdirs (after telling you...) rather than die.

Building

In various directories, you may find symlinks named src pointing off to no where. These should point to the directories holding the appropriate distribution. For instance:
$ ls -l ssl/bin/rdist/src
lrwxrwxr-x  1 sjg  wheel  17 Jun 20  1996 ssl/bin/rdist/src@ -> ../../../../rdist-6.1.3
$ 
Obviously you will need these links correct before you can expect to build things like SSLrdist. See other distributions for details on where to get the other distrbutions you might need.

Now just:

$ cd $BASE
$ bmake obj
$ bmake depend
$ bmake
# bmake install

mkdep

When you run bmake depend, the macros will use ${MKDEP} (default is /usr/bin/mkdep or /usr/local/share/bin/mkdeps.sh) If you don't have either skip the bmake depend step.

obj

Note that I always use obj dirs to keep the build tree neat and facilitate build/editing within emacs while shareing the src via NFS. WARNING: If you skip the bmake obj step, don't be surprised when the build fails in subtle ways.

I have an arrangement like:

/usr/local/obj -> src/obj.${MACHINE}
and then I set

BSDSRCDIR=`cd /usr/local/src; /bin/pwd`
BSDOBJDIR=/usr/local/obj
You must set BSDSRCDIR with the same value that /bin/pwd produces as otherwise obj.mk will do the wrong thing.

shared libraries

The lib.mk macros know how to build shared libraries on NetBSD, FreeBSD, SunOS, Solaris, HP-UX and OSF/1. I currently build shared versions of libsslfd as will as SSLeay's libssl and libcrypto.

For other systems lib.mk will use the GNU libtool if you set USE_LIBTOOL=yes though this is a bit more limited.

If you do not want shared libraries built, either set NOPIC in Makefile.base or on the command line, or create .nopic in the src or obj directories concerned.

Alternatively if NOARCHIVE is set you can skip building the archive libraries and use just the shared libs. This can save considerable time on non-development systems.

symlinks

Note that on Solaris, Linux and probably some others you need to make a symlink like:
# ln -s /usr/local/lib/libsslfd.so.0.3 /usr/lib/libsslfd.so.0
Before the libraries are really usable. Solaris does not really handle shared lib versioning the way that BSD and SunOS do, so we give it just the major version number to look for. Also, in order to link against a shared lib on Solaris you need to create a link like:
# ln -s libsslfd.so.0.3 libsslfd.so
On HP-UX you need to ensure that shared libs are executable!

SSL

The ssl tree here expects SSLeay to be installed in /usr/local/ssl the ssl/build tree can be used to build SSLeay using bmake, just make ssl/build/dist a symlink to the location of the SSLeay srcs, it is currently configured for SSLeay-6.6, build-081 handles SSLeay-0.8.1

Example

An example usually helps. The following assumes that SSLeay has been built and installed.

First unpack all the Quick.com.au packages in a single tree such as /usr/local/src/sjg.

$ mkdir -p /usr/local/src/sjg
$ cd /usr/local/src/sjg
$ gzcat /tmp/bmake.tar.gz | tar xvf -
$ gzcat /tmp/SSLrsh.tar.gz | tar xvf -
..
..
Note that I usually export the src tree read-only so on the server I do:
$ cd /usr/local/src/sjg
$ bmake obj
===> conf
/share/src/sjg/conf/obj -> /usr/local/obj/sjg/conf
...
...
$ cd /usr/local/obj
$ find sjg -type d -print | cpio -oac | compress > /usr/local/src/sjg/objdirs.C.Z
Then on the build system with /usr/local/src NFS mounted read-only:
$ mkdir /tmp/bmake
$ cd /tmp/bmake
$ /usr/local/src/sjg/bmake/configure
$ make -f makefile.boot
# make -f makefile.boot install
/usr/local/src/sjg/bmake/install-sh -m755 bmake /usr/local/bin
test -d /usr/local/share/mk || /usr/local/src/sjg/bmake/install-sh -m775 -d /usr/local/share/mk
/usr/local/src/sjg/bmake/install-sh -m644 /usr/local/src/sjg/bmake/mk/[d-s]*.mk /usr/local/share/mk
test -s /usr/local/share/mk/bsd.own.mk || /usr/local/src/sjg/bmake/install-sh -m644 /usr/local/src/sjg/bmake/mk/bsd*.mk /usr/local/share/mk
test -s /usr/local/share/mk/sys.mk || /usr/local/src/sjg/bmake/install-sh -m644 /usr/local/src/sjg/bmake/mk/`uname`.sys.mk /usr/local/share/mk/sys.mk
With bmake installed we can either run bmake obj, or with the src mounted read-only we:
$ mkdir /usr/local/obj
$ cd /usr/local/obj
$ zcat ../src/sjg/objdirs.C.Z | cpio -icd
Of course /usr/local/obj can be a symlink off to somewhere convenient (eg /var/obj).

Anyway, now you can return to the main game.

With a clean tree you can just:

$ cd /usr/local/src/sjg
$ bmake
Actually, the first time bmake is invoked it will cause Makefile.base to be created and then tell you to restart make. Also, you will need to be root to install anything as the install macros use chown which is usually restricted to root.

# bmake install

breakage

It is highly likely that your source tree is a small subset of ours. We have taken setps to try and ensure that the build will work for you despite this, but we may have missed something.

In general it is safest to start with a clean tree. If you have unpacked previous versions of SSLrsh.tar you may have Makefiles or headers present that are not in the current release and will cause you problems. If in doubt just:

$ mv /usr/local/src/sjg /usr/local/src/sjg.old
$ mkdir /usr/local/src/sjg
$ ...
$ ...

$Id: install.html,v 1.11 1998/11/06 02:18:43 sjg Exp $
Copyright (c) 1997 QUICK.COM.AU