Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > compile Perl as a STATIC library

Reply
Thread Tools

compile Perl as a STATIC library

 
 
Torsten Mohr
Guest
Posts: n/a
 
      02-11-2004
Hi,

i downloaded, compiled and installed Perl successfully on Win32.
I can now write programs that use the Perl interpreter to execute
some scripts. That's just fine.

But if i want to distribute this code to some other PCs, i need
to install Perl there completely, not just the perl58.dll, but
also the modules.

Is there some way to compile Perl as a STATIC library that already
includes all modules that come with a normal Perl installation?

I looked into the Makefile, the Readme's, but didn't yet find
any hint for this.

I hope it is clear what i want, i want to compile a static Perl
library and link it with my own programs so i can distribute them
as standalone programs and i can execute Perl scripts in these
programs.


Thanks for any hints,
Torsten.

 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      02-11-2004

Torsten Mohr <(E-Mail Removed)> wrote:
> But if i want to distribute this code to some other PCs, i need
> to install Perl there completely, not just the perl58.dll, but
> also the modules.
>
> Is there some way to compile Perl as a STATIC library that already
> includes all modules that come with a normal Perl installation?
>
> I looked into the Makefile, the Readme's, but didn't yet find
> any hint for this.
>
> I hope it is clear what i want, i want to compile a static Perl
> library and link it with my own programs so i can distribute them
> as standalone programs and i can execute Perl scripts in these
> programs.


If the 'programs' you are talking about are Perl programs, then you
want PAR. If they are C programs that use embedded Perl interpreters,
then you will want to build perl statically by passing -Uusedl to
Configure, and then you must make sure you create an perlxsi.c with
ExtUtils::Embed:s_init and link it into your executable.

Ben

--
Musica Dei donum optimi, trahit homines, trahit deos. |
Musica truces molit animos, tristesque mentes erigit. | http://www.velocityreviews.com/forums/(E-Mail Removed)
Musica vel ipsas arbores et horridas movet feras. |
 
Reply With Quote
 
 
 
 
Sisyphus
Guest
Posts: n/a
 
      02-12-2004
Torsten Mohr wrote:
> Hi,
>
> i downloaded, compiled and installed Perl successfully on Win32.
> I can now write programs that use the Perl interpreter to execute
> some scripts. That's just fine.
>
> But if i want to distribute this code to some other PCs, i need
> to install Perl there completely, not just the perl58.dll, but
> also the modules.
>


If they're perl scripts, then use PAR to build them into executables and
distribute those executables with the perl58.dll. (No need to distribute
the modules as well.)

> Is there some way to compile Perl as a STATIC library that already
> includes all modules that come with a normal Perl installation?
>


I spent a few minutes googling for info on how to build a static perl on
native win32 - also did a quick search of the ActiveState mailing list
archives - and found nothing. Would you let me know if you come up with
some info on how to achieve it ?

It might be readily achievable with Cygwin - though I personally have no
interest in following that route.

Cheers,
Rob

--
To reply by email u have to take out the u in kalinaubears.

 
Reply With Quote
 
Torsten Mohr
Guest
Posts: n/a
 
      02-13-2004
Hi,

> If the 'programs' you are talking about are Perl programs, then you
> want PAR. If they are C programs that use embedded Perl interpreters,
> then you will want to build perl statically by passing -Uusedl to
> Configure, and then you must make sure you create an perlxsi.c with
> ExtUtils::Embed:s_init and link it into your executable.


this sounds very interesting, thanks for that hint.
I'd like to do this on WIN32, so i can't really pass anything
to "configure", on Windows there's a Makefile for nmake.
I will look into it and undef "USEDL", but i think there
are more changes necessary.


Thanks,
Torsten.

 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      02-13-2004

Torsten Mohr <(E-Mail Removed)> wrote:
> Hi,
>
> > If the 'programs' you are talking about are Perl programs, then you
> > want PAR. If they are C programs that use embedded Perl interpreters,
> > then you will want to build perl statically by passing -Uusedl to
> > Configure, and then you must make sure you create an perlxsi.c with
> > ExtUtils::Embed:s_init and link it into your executable.

>
> this sounds very interesting, thanks for that hint.
> I'd like to do this on WIN32, so i can't really pass anything
> to "configure", on Windows there's a Makefile for nmake.
> I will look into it and undef "USEDL", but i think there
> are more changes necessary.


Get MinGW (http://www.mingw.org) and build it properly with Configure
and make: it's a supported configuration on win32. (NB this is not the
same as cygwin: the final perl.exe doesn't depend on any special dlls
or POSIX emulation layers, only on MSVCRT.dll as ever.)

Ben

--
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else * (E-Mail Removed)
 
Reply With Quote
 
Torsten Mohr
Guest
Posts: n/a
 
      02-15-2004
Hi,

> If they're perl scripts, then use PAR to build them into executables and
> distribute those executables with the perl58.dll. (No need to distribute
> the modules as well.)


That's the point, i don't want to ship an external perl58.dll, i
want it as a static lib.

On Linux i have a "libperl.a", why isn't this possible on Win32?


Best regards,
Torsten.

 
Reply With Quote
 
Torsten Mohr
Guest
Posts: n/a
 
      02-15-2004
Hi,

> Get MinGW (http://www.mingw.org) and build it properly with Configure
> and make: it's a supported configuration on win32. (NB this is not the
> same as cygwin: the final perl.exe doesn't depend on any special dlls
> or POSIX emulation layers, only on MSVCRT.dll as ever.)


Thanks for that hint. I tried it, but:

"Configure -d -Uusedl" starts fine, asks for the C library, continues
and at some point doesn't find some functions and then doesn't write
a Makefile.**No*way*to*continue...

What could be the problem? I don't remember the names of the missing
functions right now, i'll post them when i'm on that Win32 PC again.

On Linux i have libperl.a, shouldn't this be possible on Win32?


Thanks for hints,
Torsten.

 
Reply With Quote
 
Sisyphus
Guest
Posts: n/a
 
      02-17-2004
Torsten Mohr wrote:
> Hi,
>
>
>>If they're perl scripts, then use PAR to build them into executables and
>>distribute those executables with the perl58.dll. (No need to distribute
>>the modules as well.)

>
>
> That's the point, i don't want to ship an external perl58.dll, i
> want it as a static lib.
>
> On Linux i have a "libperl.a", why isn't this possible on Win32?
>


It's probably possible on Win32 - I just haven't heard of anyone having
done it - which leads to me think it may well be quite difficult.

I don't feel confident that *I* would be able to acieve this without
step-by-step instructions.

Perhaps someone on ActiveState's perl-win32-users mailing list can
provide some assistance/advice .... or maybe someone on the PAR mailing
list (though this is not really on-topic for either of those lists).

Cheers,
Rob


--
To reply by email u have to take out the u in kalinaubears.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile as static library googler.1.webmaster@spamgourmet.com Python 0 01-06-2009 12:53 PM
How to compile GLib as a static library on Windows ? Loic Mahe C Programming 1 06-08-2007 02:01 PM
Perl MakeMaker - how to force Perl linking with the static C library (libcrt.lib) instead of dynamic C library (msvcrt.lib) Avi Perl Misc 0 04-17-2007 09:20 PM
cant compile on linux system.cant compile on cant compile onlinux system. Nagaraj C++ 1 03-01-2007 11:18 AM
non static compile time constant .vs. static in tomcat ptg_abhishek@yahoo.com Java 1 11-17-2005 11:35 AM



Advertisments