![]() |
compiling perl as a static library on win32, "use" command
Hi,
i managed to compile a static version of perl, now i have a perl58.lib that i can link with own programs. i did this by compiling perl from the sources with the "dmake" utility and adding an error command just after the DLL is created. I then took that command and changed some parameters (e.g. from -dll to -lib). There are lots of warnings, but it seems to work. The problem is, that when i let the LIB execute a perl script, it works ok. What i'd now also like to do is to let the script use the "use" command. But as there are no *.pm files anywhere, this fails. Can i somehow either: - add the perl modules i need to the LIB somehow and change the "use" command to not load the modules from the file system, but from internal memory or - break up the hierarchy of "use" and generate ONE large script that includes everything. Is something like this possible? Thanks for any hints, Torsten. |
Re: compiling perl as a static library on win32, "use" command
Torsten Mohr wrote:
> The problem is, that when i let the LIB execute a perl script, it > works ok. I can think of quite a few ways to help you get rid of that problem. ;-) -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl |
Re: compiling perl as a static library on win32, "use" command
Torsten Mohr <tmohr@s.netic.de> wrote: > Hi, > > i managed to compile a static version of perl, now > i have a perl58.lib that i can link with own programs. > > i did this by compiling perl from the sources with the > "dmake" utility and adding an error command just after > the DLL is created. > I then took that command and changed some parameters > (e.g. from -dll to -lib). > > There are lots of warnings, but it seems to work. > > The problem is, that when i let the LIB execute > a perl script, it works ok. > > What i'd now also like to do is to let the script > use the "use" command. > > But as there are no *.pm files anywhere, this fails. > > Can i somehow either: > > - add the perl modules i need to the LIB somehow and change > the "use" command to not load the modules from the > file system, but from internal memory Look at PAR; I think this may be what you want. As you are building your own perl embed you may want to adapt the code of PAR rather than use it directly. Remember that any modules with compiled components will need to be built into your static library. Ben -- And if you wanna make sense / Whatcha looking at me for? (Fiona Apple) * ben@morrow.me.uk * |
Re: compiling perl as a static library on win32, "use" command
Torsten Mohr wrote:
> > What i'd now also like to do is to let the script > use the "use" command. > > But as there are no *.pm files anywhere, this fails. > You mean there's *no* '.pm' files *anywhere* ?? Is that as it should be ? I've never used a static build of perl but I had always assumed that it would have the usual core modules that you could "use". How else would one, for example, "use Math::BigInt;" ? Cheers, Rob -- To reply by email u have to take out the u in kalinaubears. |
Re: compiling perl as a static library on win32, "use" command
Hi,
> You mean there's *no* '.pm' files *anywhere* ?? > Is that as it should be ? I've never used a static build of perl but I > had always assumed that it would have the usual core modules that you > could "use". How else would one, for example, "use Math::BigInt;" ? you're right, my description was not correct. The modules can't be found along the embedded perls module search path. But that's the way i want it to be, it should not look for anything in the file system, it should use its internal functions. Best regards, Torsten. |
Re: compiling perl as a static library on win32, "use" command
Hi,
> Look at PAR; I think this may be what you want. As you are building your > own perl embed you may want to adapt the code of PAR rather than use it > directly. thanks, i'll take a look at PAR. > Remember that any modules with compiled components will need to be built > into your static library. That's correct, thanks for that hint. By the way, i'm not too familiar with win32 programming, is there anything else to keep in mind if i compile perl as a static library, especially if i compile perl static? For example, in libperl58.dll, there is some initialisation in DllMain(). If i use it statically, i need to call the code by hand, right? Anything else, e.g. some additional defines or undefines? Best regards, Torsten. |
| All times are GMT. The time now is 02:20 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.