These are my changes to BRL/CAD 4.4 to allow it to be made for Linux using
the native shared library scheme.  It's a nasty hack, to be sure, but it
works, and saves significant space over the static versions, and if you
don't have elf installed already, you don't have to bother with it just to
run this package; and besides, I'm not so sure cad4.4 would've compiled even
with elf support...

In addition to hacking the Cakefiles to support Linux native shared libraries,
I made the following changes:

bench/perf.sh - use bc instead of dc
cake/cake_s.l - support for strings preceding and following [[...]] commands
cake/proc.c - killed unlinking of scripts before they are complete
anim/anim_sort.c - an uninitialized variable caused it to ignore the 1st file
fbserv/fbserv.c - changed NULL's to ""'s, as they should be
librt/db_open.c - added file rewind -- why, I don't remember
rt/shade.c - shade_inputs was referenced extern but declared HIDDEN (static)
rt/sh_light.c - aim_set was declared both extern and HIDDEN
util/loop.c - #include <stdlib.h> to prototype atof() (otherwise it screws up)
gen.sh - libwdb depends on librt, so it now comes later in sequence

I have tested a number of the programs minimally, and a few of the programs
extensively, and they seem to work...  I also, on a whim, compiled it (with
my minor bug patches) for Solaris2.3, and got many more crashes than with
Linux...

There are still some unresolved problems, such as the dependece of the
documentation on the source site's configuration for compilation, and a few
warnings [/errors] I still haven't bothered fixing; most notable a line in
lgt.c about passing the address of a local variable (which is true, and bad,
but I don't want to figure out how to fix it w/o geting into code purity
issues or actually trying to *understand* the code in question... perhaps
I'd be more willing to work on this stuff if my printed manuals would
finally arrive...)
I may, if I have time, get around to making svgalib and Amiga frame buffers
and mged modules, or "improve" the tk interface (to my liking), but don't hold
your breath...  If anyone compiles the xmged interface, though, please let
me know how it goes...

I don't think that I included enough relevant portions of the distribution
to warrant encryption, but of course you will still need the main
distribution off of ftp.brl.army.mil or wherever you can find it, which is
encrypted.. [see the directions there for how to register & get the printed
manual + decryption key].

The shared libraries require the dll toolkit, of which I used V2.16.  Also,
I had to make some optimization tweaks to keep gcc-2.6.2 from crashing, and
I don't know if any other version will even work..
Make sure the bin dir containing the tools is in your path before running
anything which might make a shared library.  I know the newer versions install
themselves in /usr/bin (and as jumpas), but they still create links in
/usr/dll that I depend on..  Just make sure they're there!

To install for linux:
---------------------

# get the registration form from ftp.brl.army.mil & send it in
# wait until you get a letter explaining how to decrypt/untar BRL/CAD
# decrypt/untar BRLCAD [I did it into /usr/src/cad]

cd /usr/src/cad 			    # or wherever you untar'd BRL/CAD
zcat ~/cad4.4.linux_patch.gz | patch -sEp1  # or wherever you put the patch

# bash/ksh/sh users know how to translate this..
# [don't worry about the path not existing yet]
set path=(/usr/brlcad/bin $path)
# don't do this if it has already been done; I've been having problems
# with using the LD_LIBRARY_PATH variable, so for now just:
echo /usr/brlcad/lib >>/etc/ld.so.conf
# although setting LD_LIBRARY_PATH to /usr/brlcad/lib before the compile may
# also work.  This is just so the stuff in db gets proccessed properly..

# the rest is directly out of INSTALL.TXT
mkdir /usr/brlcad
sh machinetype.sh -v
sh setup.sh
sh gen.sh all
sh gen.sh install
# following two lines only if you want tmged
sh gen.sh tcl
sh gen.sh install-tcl
# do whatever you want with the many uninstalled items, such as proc-db, db,
# conv/dbclean.sh, papers, doc, bench, pix, jove, pro-engineer, whetstone,
# dhrystone, etc.; then:
sh gen.sh clobber
foreach x (tcl libtcl libtk tmged)
	cd $x
	cake clobber
end

You'll need about 68M free space to compile everything, and an additional
14M or so to install everything.  If you want to do anything with the dirs
which are not automatically installed, you will probably need more.

-----------------------------------------------------------------------------
Thomas J. Moore, Ex Amiga Developer| Linux - a pain in the ass, but it works.
inet:  dark@mama.indstate.edu      | Must .... Kill .... Bugs.... AAARRRGGHHH
-----------------------------------------------------------------------------
