Quick install
=============

[WARNING!  This part only applies if you have a full distribution.]
[If you don't, there's no LINK.COM to run.  In such a case, you must]
[read "Slow install" instead]

To do this quick install, it is required that you have NETLIB.  You
can check if it's already installed by checking for the logical name
NETLIB_SHRXFR.  If yuo don't have it installed, please download
NETLIB022.ZIP from ftp://ftp.wku.edu/vms/fileserv/ or a mirror, unpack 
and install (it is done with SYS$UPDATE:VMSINSTAL.COM).

Also, since FISH is compiled with DEC C, you'll need to install AACRT060
if you run VMS pre-V6.0.  It's available in ftp://ftp.lp.se/vms/.

Now, all you have to do is the following:

	$ @LINK

That will give you FISH.EXE, which you either let stay put or move
to a place of your preference, and then all you need to do is to
make a foreign command of it:

	$ FISH :== $dev:[dir]FISH.EXE

Replace "dev" and "dir" with appropriate values.  That line should
also be inserted in SYS$MANAGER:SYLOGIN.COM if you intend to make
FISH available to everyone.

Also, you will find a FISH.HLP, that you can insert in the help
library of your choice.



Slow install
============

The libraries that come with this package have been put together on
VMS 6.2 and 7.1 for VAX and VMS 7.1 for AXP.  You *may* run into
problems due to differences between VMS versions.  In that case, a
recompile is in place.

To recompile, you need the following things:

	- DEC C (or VAX C if you really have to.  See below)
	- DEC MMS or MadGoat's MMK (a MMS clone).  I use MMK in my examples.
	- OpenSSL 0.9.3 or later
	- NETLIB

You will find the necessary things at the following places:

	NETLIB, MMK		ftp://ftp.wku.edu/vms/fileserv/ and mirrors
	OpenSSL 0.9.3a		ftp://ftp.lp.se/vms/OpenSSL-0_9_3a.tar-gz
	RSAREF (US only!)	ftp://ftp.rsa.com/rsaref/README

The compilation is done like this:

	$! dev:[dir] is the directory where you have put this package
	$ SET DEFAULT dev:[dir.SRC]

	$! If you have have OpenSSL installed so the libraries are in
	$! SSLLIB: and the header files are in SSLINCLUDE:, then all
	$! you need is this.
	$ MMK

	$! Otherwise, you want to change SSLINCLUDEDIR and SSLLIBDIR
	$! in DESCRIP.MMS or, like I do, give a different value for those.
	$ MMK/MACRO=(SSLINCLUDEDIR=SSLROOT:[INCLUDE],SSLLIBDIR=SSLLIB:)

	$! Also, if your crypto library has another name than mine
	$! (LIBCRYPTO.OLB), you can change it the same way.
	$ MMK/MACRO=(SSLLIBRARYNAME="CRYPTO-VAX-VAXC.OLB")

You may get a bunch of warnings from the linker, but that's usually
nothing to worry about.

The end result is that in dev:[dir] (the FISH distribution directory),
you should find a FISH.EXE and a FISH.HLP that can be installed according
to the quick install above.


What if I really have to compile with VAX C?
============================================

[WARNING!  I have not tried compiling this version of FISH with VAX C.]
[You're on your own!]

It's not recommended, since VAX C is pretty damn old these days.  But
it does work.  What you do is the following:

	$ MMK/MAC=(CC="CC/VAXC/DEBUG",LDFLAGS=",VAXCRTL.OPT/OPT") -
	_$ VAXCRTL.OPT,ALL

And if you don't have OpenSSL installed as desribed above, you will
need to add those MMS/MMK macros as well.


What if I really have to compile with GNU C?
============================================

First of all, I don't really believe you "have to" because you probably
compiled OpenSSL with DEC C, but you may want to compile with GNU C to
give support to the free software community.  That alone is a worthy
thing to do.

Unfortunatelly, GNU C can't really be supported since it doesn't really
support VMS.  On Alpha, it doesn't know that LIB$ESTABLISH is actually
an alias to a system routine that isn't really declared anywhere
($LIB_ESTABLISH).  On VAX, anything that involves global symbols or
global values becomes really ugly [1].

You will see, a little here and there, references to the C macro __GNUC__.
Those are showing the efforts that Jérôme Lauret and I have put into
trying to make this beats compile with GNU C.  I'm leaving everything in
place, in case someone gets GNU C to behave correctly on VMS some day,
or in case someone actually gets the FISH soucre to go through the
compilation and the linking.  To anyone who decides to do this, happy
hacking!  And please send me patches!

OK, that long story told, to use GNU C instead of DEC C (reminder:
Alpha only!), you just have to add the MMS macro "GNUC".  The rest
should work just as said in "Slow install".  Example of the most
normal compilation:

	$ MMK/MACRO=(GNUC=1)

-----
[1] The only reason I don't get things to work as they should on Alpha is
    because lib$establish remains something undefined during linking.  If
    that obstacle gets removed in some way, I'm sure FISH will link correctly
    after having been compiled with GNU C.

    On VAX, the story is entirely different.  There, GNU C suffers from a
    heavy chunk of legacy.  The reason it behaves the way it does is that
    it was once built to try to mimic the VAX C behavior.  VAX C normally
    implements global variables by creating program sections for each of
    them instead of creating global symbols.  GNU C just had to do the
    same instead of doing the right thing.  VAX C will cope with the need
    for global symbols with the extra keywords "globaldef" and "globalref"
    and also supports global values through the keyword "globalvalue"
    (incidently also supported by DEC C :-)).  GNU C doesn't support those
    keywords.  Instead, an ugly assembler hack is used, which is picked up
    by gas (the GNU assembler).

    You might wonder what the big deal is.  The big deal is that GNU C will
    barf quite a lot over OpenSSL.  So ok, I could provide ugly support for
    GNU C in the OpenSSL header files only and get it over with that way.
    Unfortunately, knowing nature of man, it would very probably mean that
    someone wants GNU C support when compiling OpenSSL.  And I don't think
    the OpenSSL core team would be very pleased with the kludges it would
    require.  I've tried to compile OpenSSL on VAX with GNU C.  It's no
    fun, let me tell you.

    I'd like to see GNU C enhanced in the following ways:

	- Upcase external symbols!  This is very important if you want to
	  support mixed languages or even mixed C compilers!
	- Real support for global values and global symbol declarations
	  (the latter is only needed on VAX, since the Alpha variant
	  creates global symbols from the start).
	- Correct VMS support (I'm still surprised noone has yet spotted
	  the LIB$ESTABLISH problem.  Does anyone try to compile real
	  programs with GNU C or not?).

    When that is done, I'll consider GNU C again.  Right now, I've grown
    pretty damn tired of it.

-- 
/Richard Levitte <richard@levitte.org>
