[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: On the deprecated auto-loading of compiled-code modules
From: |
Matthias Koeppe |
Subject: |
Re: On the deprecated auto-loading of compiled-code modules |
Date: |
02 May 2001 13:35:08 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 |
Marius Vollmer <address@hidden> writes:
> Matthias Koeppe <address@hidden> writes:
>
> > 2) What is the "correct" way to register modules in the static case? I
> > somehow need to expose the C-level initialization function to the
> > yet-to-be-started interpreter; this is what
> > scm_register_modules_xxx was for.
>
> Ideally, I would like you to still use `dynamic-call' and
> `dynamic-link', even when doing static linking. Guile is using
> libltdl for doing the actual linking, and libltdl has support for
> statically linking dynamic libtool libraries. [...]
>
> In effect, I want Guile to hand over almost all dynamic linking
> issures to libtool, including the handling of libraries that are not
> really dynamically linked.
Of course this is possible. But I think that a real static linking
method, avoiding libtool's "export-dynamic" feature, should be
supported.
> If you don't want to go this untrodden route just now, there are two
> options I can see:
>
> - Write a Scheme file for your module (like you would for dynamic
> linking without explicit support), but don't use `dynamic-call' in
> it. Call the initialization procedure directly. Like so:
>
> In C:
>
> init_module_bindings ()
> {
> #include "foo.x"
> }
>
> init_module_initializer ()
> {
> scm_make_gsubr ("init-my-module", 0, 0, 0,
> (SCM (*)())init_module_bindings);
> }
>
> In Scheme:
>
> (define-module (my module))
>
> (init-my-module)
But who will call init_module_initializer? The Guile core modules are
all explicitly initialized in `scm_init_guile_1'. I can't plug in my
initializers here (and I don't want to). I use `scm_boot_guile' to
initialize Guile, and if I understand it right, I can't call
`scm_make_gsubr' when Guile has not been initialized yet. (Please
don't suggest I use `scm_init_guile' instead of `scm_boot_guile'.)
> - Explicitely create and select your module in the initialization routine
Same problem here.
--
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe