Fixing lang/ocaml for NetBSD/powerpc?

Hi,
I've noticed that lang/ocaml fails to build for NetBSD/macppc 4.0
with the following build failure:
gcc -O2 -I/usr/include -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE
-DTARGET_power -DSYS_elf -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
-DDB_DBM_HSEARCH -I/usr/include -c -o signals_asm.o signals_asm.c
signals_asm.c: In function 'handle_signal':
signals_asm.c:87: error: 'struct sigcontext' has no member named 'regs'
signals_asm.c:87: error: 'struct sigcontext' has no member named 'regs'
signals_asm.c:88: error: 'struct sigcontext' has no member named 'regs'
signals_asm.c: In function 'trap_handler':
signals_asm.c:160: error: 'struct sigcontext' has no member named 'regs'
signals_asm.c:161: error: 'struct sigcontext' has no member named 'regs'
gmake[1]: *** [signals_asm.o] Error 1
gmake[1]: Leaving directory `/usr/pkgsrc/lang/ocaml/work/ocaml-3.10.2/asmrun'
gmake: *** [runtimeopt] Error 2
*** Error code 2
The attached patch gets the package compiling, however, it misses
a number of files when it's installed (see list of "complaints"
as the second attachment), and I've not been able to figure out
what causes that.
As can be seen from the patch below, we fall into the "SYS_elf"
branch up until now used only for Linux, with the result that I
had to add some ifdefs in there. The if'ed code is liberally
adapted from the FreeBSD code in the following section in the
file (can you say "cargo cult"? :)
The package itself does not appear to contain any self-tests, and
since I've never actually used this packge myself, I don't know
if the result even works as it should. Testing and further input
is therefore hereby solicitated.
(I just picked this one up because this package being broken
resulted in 36 other packages being skipped in my latest pkgsrc
bulk build for NetBSD/powerpc 4.0...)
Regards,
- Håvard