Also, can you please explain what you have stated below:

"Whether DynaLoader is involved depends on whether the extensions
to perl (not mere modules, but extensions) are set to load
dynamically or statically linked into a larger libperl"

is relevant to my requirement? i.e how do I
- set extentions to load dynamically?
  or
- statically link extensions into a larger libperl

Note that I do have:
EXTERN_C void boot_DynaLoader (pTHXo_ CV* cv);

EXTERN_C void xs_init(pTHXo)
{
    const char *file = __FILE__;
    dXSUB_SYS;
    newXS((char *)"DynaLoader::boot_DynaLoader", boot_DynaLoader, (char
*)file);
}

in my application. Is this what you mean by setting extentions to load
dynamically?

Thanks,
Manisha

-----Original Message-----
From: Manisha Mirajkar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 08, 2003 9:14 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Dynamic loading and linking with libperl.a and DynaLoader.a


Hi Peter,
Yes you are correct, I want extensions to be loadable. To explain the
requirement more clearly -
I have the following perl script - evtscript.pl
---------------------------------
package EVTSCRIPT;
use POSIX;
use strict;
sub BEGIN { }
sub END { }
1;
-----------------------------------
Using just the perl interpreter i.e perl evtscript.pl does not give me any
problems. But when I invoke it through my C application I get the following
error:
C application starting....
Can't load module POSIX, dynamic loading not available in this perl.
(You may need to build a new perl executable which either supports
dynamic loading or has the POSIX module statically linked into it.)
Compilation failed in require at /opt/evtscript.pl line
2.
BEGIN failed--compilation aborted at /opt/evtscript.pl
line
2.

But at the first place since I have linked my application with libperl.a and
DynaLoader.a why should I get the above error? Shouldn't the Dynaloader
take care of loading POSIX.so?

Then since the architecture is SuSE linux on os390, I configured perl
with -Dusedl flag. I linked with the newly generated libperl.a and
Dynaloader.a
and now I get the following error:
C application starting....
Can't load '/usr/local/lib/auto/POSIX/POSIX.so' for module POSIX:
/usr/local/lib/auto/POSIX/POSIX.so: undefined symbol: PL_sv_undef at
/usr/local/lib/XSLoader.pm line 75.
Compilation failed in require at /opt/evtscript.pl line 2.
BEGIN failed--compilation aborted at /opt/evtscript.pl line 2.

Do I really need to use a perl which is configured using -Dusedl for
my requitrment? Or Is there something else I am missing? Please let me
know if I am still ambiguous.

Thanks,
Manisha



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 7:00 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Dynamic loading and linking with libperl.a and DynaLoader.a






"Manisha Mirajkar" <[EMAIL PROTECTED]> wrote on 10/07/2003
08:51:19 AM:
> Hi,
> When using embedded perl in my C++ application, I want my C
> application to be able to work with perl scripts which has external
> modules e.g POSIX.
> i.e. I want these external perl modules to be loaded dynamically.

I think that I would state your requirement as "I want extensions
to be loadable".  Whether they are loaded dynamically or statically
is a matter separate from whether they are loadable at all.
An application that embeds perl may chose to embed a statically
linked perl or a dynamically linked perl.  It may do so dynamically
or statically.

> In this case all I need to do is:
> - Link my C application with libperl.a and DynaLoader.a libraries i.
> e static linking with these libraries.
>   The DynaLoader will then take care of loading the external perl
> modules e.g POSIX dynamically.
>   Is this true?

Whether DynaLoader is involved depends on whether the extensions
to perl (not mere modules, but extensions) are set to load
dynamically or statically linked into a larger libperl.

>   I saw in README.os390 whuich states that if you wish dymanic
> loading capability in your perl, then you need to use -Dusedl flag
> when configuring perl.
>   But this dynamic loading and the one I mentioned above is
> different according to what I have understood. Is this correct?

You've mentioned dynamic loading in three separate paragraphs.
You have not specified how you intend to link the application that
embeds perl.  You could link it to load code dynamically or you
could link it to load code all at once (statically).  Similarly
you can configure a build of perl to load extension code
dynamically (this is not the default on OS/390) or you could
configure a build of perl to load extension code statically
(this is the default).  If you intend to do extensive work with
dynamic loading be prepared to specify your LIBPATH environment
variable on OS/390 carefully.

> Can somebody please clarify my doubts

I hope the above has helped a bit.

Peter Prymmer

Reply via email to