compiling rim on RS6000 - help?

I have managed to compile grass 4.1 and xgrass on an RS6000 with little difficulty.
I got src.related/ rim and rimlib.a to compile, after a bit of editing of the
(ancient) SETUP-AIX file and a few of the AIX/*.f files.

Now I am trying to compile the src.garden/grass.rim utilities, without success.
Has anyone had better luck? The problem seems to be with the only fortran files
in the source code, s.db.rim.f and v.db.rim.f.

The details are as follows, and are pretty much identical for both v.db.rim and s.db.rim:
1. The remove.c file won't compile because remove is being redeclared. This is traced to
   the remove define in <stdio.h>. To correct this, I simply made a local "stdio.h", and
   edited it. This worked ok, and all the source compiled to objects.

2. Now the gmake crashes at the Gmakefile line
       f77 $(LDFLAGS) -o $@ $(FFLAGS) $(OBJFILES) $(MYLIBS) $(GISLIB)
with the error statement
  0706-317 ERROR: Unresolved or undefined symbols detected:
                 Symbols in error (followed by references) are
                 dumped to the load map.
                 The -bloadmap:<filename> option will create a load map.

Changing the line to
       f77 -bloadmap:loadfile $(LDFLAGS) -o $@ $(FFLAGS) $(OBJFILES) $(MYLIBS) $(GISLIB)
creates a "loadfile" that states what the problem is, and it results in the following
lines:

0706-290 The following symbols were left unresolved:
0706-350 Name Address Type Stg Information Filename Hash Value Imp/Exp/Ent
     [10].toplevel 0000031E ER PR s.db.rim.f from OBJ.RS6000/s.db.rim.o
         [11]<.main> 00000482 AL.26( [10].toplevel) s.db.rim.f from OBJ.RS6000/s.db.rim.o
0706-120 The return code is 8

At which point I'm at a loss. But I have questions. Such as, why are s.db.rim.f and v.db.rim.f
still fortran code?

Tim.

-------------------------------------------------------------
  Tim Martin *
  Spatial Information Systems * These opinions are my own:
  University of Alberta * My employer has none!
  martin@ulysses.sis.ualberta.ca *
-------------------------------------------------------------