-----BEGIN PGP SIGNED MESSAGE-----

Notes by Tim Svenson for compiling the sources of PGP 5.0i using the
freeware DJGPP V2 compiler (revised by Frank Pruefer
<moppel@le-line.net>).
=======================================================================

Welcome to PGP 5.0i for 32 bit DOS. It is a joint work with Georg
Bauer (http://www.westfalen.de/hugo/pgp/). He ported it to DOS using
Watcom C and then I made his version compilable with DJGPP V2. This
archive is the result.

See the file readme.dos for general documentation and how to compile
PGP with Watcom C.

If you are in the USA, this version is illegal because RSA is patented
in the USA. To make it legal you should remove the
src/lib/pgp/pubkey/pgprsagl.c file and get your hands on RSAREF. I
think you can still compile it without pgprsagl.c and RSAREF to get a
version with no RSA support. Have a look in pgp50ib8.dos/src/configur.

=======================================================================
System requirements:

386 or better.  DOS or a suitable DOS emulator.  A short file name
system works, and long name systems should work.  LOTS of memory for
compiling. I expanded from 4 Mb to 20 Mb but you might not need all
that. (Remark by Frank Pruefer: I've managed it to compile this
version under plain DOS with "only" 16 MB of RAM - but there was
absolutely no chance on <= 8 MB systems.)

=======================================================================
Preparation before compiling:

Unzip the internal archive pgp50isi.zip using "pkunzip -d pgp50isi
<target>" or "unzip pgp50isi -d<target>". All its contents will end up
in a new directory pgp50i.dos as a subdirectory of the <target>
directory. If you use pkunzip it will complain that it could not unzip
config.h.in. Ignore this error message. There is an identical file
called config.h-i that is used instead.

Get DJGPP. This is a C/C++ compilation environment especially designed
for porting UNIX programs to 32 bit DOS. It is available on the
Internet at http://www.delorie.com/djgpp/. Get everything the zip
picker says you might need for compiling C programs. When it doesn't
work, look at the following list of DJGPP zip files that I have and
download a few more zips from your favorite DJGPP mirror site:

(Note: not all of these files are needed to compile PGP!)
bnu281b.zip  GNU binutils 2.8.1 for DJGPP V2
bsh1147b.zip GNU bash 1.14.7 for DJGPP V2
bsh1147d.zip GNU bash 1.14.7 docs: texi/html/dvi/ps
csdpmi4b.zip CWSDPMI binary distribution (release 4)
dif271b.zip  GNU diff 2.7.1 for DJGPP V2
djdev201.zip DJGPP V2.01 Development Kit and Runtime
faq210b.zip  DJGPP V2 Frequently Asked Questions
fil316b.zip  GNU fileutils 3.16 for DJGPP V2
find41b.zip  GNU findutils 4.1 for DJGPP V2
gcc2721b.zip GNU GCC 2.7.2.1 for DJGPP V2
gdb416b.zip  GNU Debugger 4.16 for DJGPP V2
grep21b.zip  GNU grep 2.1 for DJGPP V2
gwk303b.zip  GNU awk 3.0.3 for DJGPP V2
gzp124b.zip  GNU gzip 1.2.4 for DJGPP V2
lss332b.zip  GNU less 322 binaries for DJGPP V2
mak3761b.zip GNU Make 3.76.1 for DJGPP V2
man11b.zip   tiny "man" replacement for DJGPP V2
mlp106b.zip  ML's Executable File Packer Binaries
perl54b.zip  GNU perl 5.004.2 for DJGPP
sed118b.zip  GNU sed 1.18 for DJGPP V2
shl112b.zip  GNU sh-utils 1.12 for DJGPP V2
tar112b.zip  GNU tar 1.12 for DJGPP V2
txi390b.zip  GNU texinfo 3.9 for DJGPP V2
txt122b.zip  GNU Textutils 1.22 for DJGPP V2

Start your favourite DPMI (e.g. CWSDPMI, available with DJGPP, see
above), otherwise a DOS box under Windows will do too. I don't know
how up to date your version of Windows has to be, but Windows 3.1
works for me.

In any case, under plain DOS there should be no problems, provided
that you have more than about 16 MB of RAM installed...

Copy file sgtty.h (found in this archive) to /djgpp/include. It is a
simple header file, containing only the following one line: #include
<sys/ioctl.h>

If running Windows, close everything except the DOS box before running
bash, otherwise make will run out of memory when making the PGP
libraries(!). I have 20 Mb of the stuff and I still have to. Maybe I
am doing something wrong. If you change a source file that is not in a
library, you don't need to shut everything down before remaking.

Change to directory src and start a UNIX-sort-of shell, such as the
Bourne Again Shell (bash) distributed with DJGPP. If /djgpp/bin/gcc is
where you keep your GCC compiler, add the following to your _bashrc
file:

CC=/djgpp/bin/gcc
export CC

There's another possibility to export the variable CC. Simply add an
appropriate DOS set command to the startup batch file for bash. Here's
an example for such a file, which also sets other environmental
variables needed by DJGPP (name it e.g. "runbash.bat", or what ever
you like):

@echo OFF
SET DJGPP=D:\DJGPP\DJGPP.ENV
SET PATH=D:\DJGPP\BIN;%PATH%
set LFN=n
set HOME=d:\djgpp
set SYSROOT=d:
rem set HISTFILE=%HOME%\_bhist
set AR=ar
set CC=gcc
set MAKE=make
set RANLIB=ranlib
set YACC=bison -b y -y
bash -login

=======================================================================
Compiling:

Run the command "./configur". You will get the following two error
messages. They are not important and should be ignored.

checking how to test for symlinks... C:/DJGPP/BIN/ln: foo: No such
file or directory (ENOENT)

Run the command "make".

=======================================================================
Installation of executables:

If everything goes well there will be two executables:
src/apps/pgp/pgp.exe and src/apps/pgpk/pgpk.exe. They still contain
LOTS of debugging code: if you trust this version not to have any
bugs, feel free to remove the debugging code from the executables by
setting DEBUG=0 in src/config/pre.in. Thanks to Frank Pruefer for
pointing this out.

In the appropriate directories, run the commands "strip pgp.exe" and
"strip pgpk.exe". The resulting executables are still more than 600 KB
long now. "strip" is available with DJGPP. Move the stripped
executables to your bin directory. Not leaving copies in the original
locations will ensure the executables are always updated when a source
file changes and you rerun make.

Have a go at compressing these executables with ML's executable file
compressor djp version >= 1.06, available at your favorite DJGPP
mirror site. Run the commands "djp -s pgp.exe" or "djp -s pgpk.exe",
respectively.  Now the exe's length is only about 300 KB each so that
they'll fit nicely (at the same time) on half a standard 1.44 MB
floppy disk, even leaving enough room for accompanying files such as
keyrings and the language and configuration file.

The programs you have just compiled require a DPMI, just like DJGPP.

Known bugs in executables made with DJGPP, and bugfixes, are listed at

http://www.maths.usyd.edu.au:8000/u/tims/pgp/pgp50dos.html.

Send comments and problem reports to:

tims@maths.usyd.edu.au

Tim Svenson.



-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Comment: www.maths.usyd.edu.au:8000/u/tims/pgp/pubkey.asc
Charset: cp850

iQCVAwUBNPnv8l1fb9iAJqgpAQFVNwP/ZXAg1lIgQV7fLR6NhOE9eQPGxukhjYz8
TZCQ8OrXGt1fiS9vbIEdfdWb+hqIzLLpN4MOIA93uFoYdYpkWgjui2o/+B9jjyfQ
aDGqkCnL3z44YvVCQLXfKEEOqa24FxikUtZ/u7Fk+H6LgrGwTc4HeneXDKSh47pw
UZcrI8PfRZo=
=zWn3
-----END PGP SIGNATURE-----
