[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SWIG 1.3, guile 1.4, and compiled module loading
From: |
Brett Viren |
Subject: |
SWIG 1.3, guile 1.4, and compiled module loading |
Date: |
Mon, 18 Mar 2002 18:06:26 -0500 |
Hi all,
I am writing a small SWIG wrapper around a library. This may not be
pertinent, but I mention it for completeness. I am trying to
understand how to make things work so that I can do:
shell> guile
guile> (use-modules (mydir mymod))
Currently I run SWIG like:
swig-1.3 -guile -scmstub mymod.scm -Linkage passive -package mydir -module
mymod mymod.i
Which produces mymod.scm and mymod_wrap.[ch] which is compiled into a
libmymod.so. The .scm and the .so then get placed in a mydir/
directory which is in my %load-path.
In mymod.scm I have
(define-module (mydir mymod))
(define my-so (dynamic-link "/full/path/to/mydir/libmymod.so"))
(dynamic-call "scm_init_mydir_mymod_module" my-so)
(export sym1 sym2 sym3)
Everything after define-module and before export I have control over.
This gets executed when I do (use-modules (mydir mymod)) but my
problem is I can't figure out how to do the dynamic-link call in any
way except giving the full path to the library. Is there some way to
fix this so the installation of mydir/ is more portable?
Thanks,
-Brett.
- SWIG 1.3, guile 1.4, and compiled module loading,
Brett Viren <=