On Mon, 18 Dec 2000, Kort, Eric wrote:

> In the hopes that this is not rediculous, I offer the following question in
> answer to your questions: is perl compiled with dynamic loading support on
> your system?  We had trouble (for some reason) compiling perl with dynamic
> loading on our Unix system, and therefore we only have static linking
> enabled on that box.
> 
> Maybe something to check.  (How do you check?  I'm not sure off the top of
> my head, by I am sure you or someone else here knows.)

The config variable usedl sets dynamic loading for perl:

 % perl -V:usedl
 usedl='define';

The variable dlsrc mentions which xs implementation of Dynaloader was
used.  Perhaps the most common one is based on the dlopen() C RTL call
that was a part of POSIX (I think):

 % perl -V:dlsrc
 dlsrc='dl_dlopen.xs';

Although other values are possible, such as on VMS:

 $ perl "-V:dlsrc"
 dlsrc='dl_vms.c';

A value of dl_none.xs indicates a static only perl, for example:

 $ perl -V:usedl -V:dlsrc -e 'print "$^O\n"'
 usedl='undef';
 dlsrc='dl_none.xs';
 os390

Without resorting to -V command line shorthands you can access those
variables (in a Makefile.PL for example) via the Config module as in:

    use Config;
    my $usedl = $Config{'usedl'};
    my $dlsrc = $Config{'dlsrc'};

Peter Prymmer


Reply via email to