Mailinglist Archive: opensuse (1640 mails)

< Previous Next >
Re: How to deploy a dynamically linked perl XS library? (Re: [opensuse] libperl.a gone in opensuse-11.0?)
  • From: Anders Johansson <ajohansson@xxxxxxx>
  • Date: Fri, 1 Aug 2008 09:37:59 +0200
  • Message-id: <200808010938.00083.ajohansson@xxxxxxx>
Am Freitag 01 August 2008 08:45:06 schrieb Josef Wolf:
The question now becomes, how to (painless) deploy a perl XS library
which makes callbacks into perl. That means, the XS library needs
access to the my_perl variable, which is declared as

static PerlInterpreter *my_perl;

in the original libperl.so

Any hints?

You'd access it in exactly the same way that you access any other variable.
Declare it "external" in your code and simply use it. The linker will take
care of the rest

The "static" there has nothing to do with linking. It simply means that the
variable isn't created dynamically every time a function is called, it is
created once and keeps its value. Static or dynamic linking doesn't enter into
it at all

By the way, your previous comment about having to compile locally on all
machines is wrong. The remark in the man page you quoted is about using the
same compiler flags as was used for perl. That doesn't mean it has to be
rebuilt every time it is installed

Anders

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References