[comp.os.minix] Minix FP Packages

sgerakin@hawk.ulowell.edu (Steve Gerakines) (09/10/90)

Well in my bliss of successfully upgrading to Minix-ST 1.5.10, I just realized
that there is no math lib for the C compiler.  To make a long story short, I
dug up a port of P.S. Housels Minix-PC floating point package, and it seems
just dandy.  The only thing I didn't like about it was using a silly "fcc"
batch file to "convince" cc to allow floats.

I came up with a real simple solution that's transparent to cc, doesn't
require patching binaries (ick!), and doesn't require finding a new "cc"
program.  Basically all I did was write a program called "cg", and rename
the original "cg" to "cg.real".  The "cg" program I wrote just plays with
the command arguments, and forks off two processes for "fpp" and then
"cg.real" right afterwards.  Brute force, but it works.  :-)  This little
fix makes the order nice and clean:

/usr/lib/cem     prog.c  prog.k
/usr/lib/opt     prog.k  prog.m
/usr/lib/cg      prog.m  prog.s  the usual parameters, 
/usr/lib/fpp     prog.m  prog.n  then play switcheroo to fool fpp
/usr/lib/cg.real prog.n  prog.s  and cg.real
/usr/lib/as      prog.s  prog.o

Anyway, I thought it was pretty sneaky.  Anyone else come across this
before?  I'd like to hear some other suggestions.  Now maybe I can get my
mtv tracing.  :-)

-Steve Gerakines

 ----------------------------------------------------------------------------
| Usenet: sgerakin@hawk.ulowell.edu       | SteveNet: GENESIS:Steve2         |
| UUCP:   ...!harvard!swan!sgerakin@hawk  | "My kingdom for a smoke!!!"      |
 ----------------------------------------------------------------------------