Hi Paul-

I'm a bit confused by the discussion so far.  Alien modules are to
provide external dependencies "wrapped up" for perl modules to use
and not, in general, as a way to resolve C library dependencies.
Once installed, an Alien module should provide all the information
needed to use the library from/with perl without any other tools
being involved.

The only issue with the non-standard library location is that you
need to have the right location for the various compile and link
parts of install and execution for the perl module depending on the
provided Alien library.  In general, different platforms all have
different default and not-so-default locations for system package
installs.  Even in the case of a root user install, the specific
paths may need to be adjusted for the given platform type and/or
local configuration.

Here is a scenario that I think represents the case of interest
below and how it might be implemented.

I have a perl module MyXS that depends on library A and library B
(through the fact that library A uses library B).  In that case,
the MyXS install would have a dependency on Alien::A, which, when
satisfied, allows the MyXS configuration to determine everything
about what is needed to use the library A bindings for its work.

Since library A depends on library B, it might make sense to have
an Alien::B module whose job it is to install/detect library B and
to provide the needed information to Alien::A.  NOTE:  Alien::A
will be providing whatever is needed on the library B configuration
side to MyXS.  This is all determined by what and how the libraries
are to be used.

It should also be possible to have OtherXS need library B and to
have it as a direct dependency in CPAN which would configure or
install with the needed information to support perl development or
bindings using library B.

Cheers,
Chris

On Mon, Jan 6, 2014 at 1:51 PM, Paul "LeoNerd" Evans
<leon...@leonerd.org.uk> wrote:
>
> So, another Alien question.
>
> I have two C libraries. One depends on the other. (Actually, it's more
> of a one-of-many dependencies, but this way it easiest). How is best to
> arrange for this to happen then?
>
> Outside of perl/Alien wrappings, this is a purely manual process.
> Install first library (as root) so its pkg-config file is created, then
> the Makefile in the second library finds this, adds cflags/ldflags, all
> well and good.
>
> But Aliens complicate this, because of the requirement that non-root
> users can install and use them. This requires the first library to get
> installed somewhere in perl's @INC where the user can write. pkg-config
> won't automatically look there. This is OK for the Alien layer because
> the Alien/Foo.pm can know where to find the pkg-config file. But the
> second C library's Makefile can't. So how is it going to find the first
> one?
>
> I am beginning to think that this requirement that non-root users be
> able to install C libraries into non-system standard places is getting
> problematic.
>
> --
> Paul "LeoNerd" Evans
>
> leon...@leonerd.org.uk
> ICQ# 4135350       |  Registered Linux# 179460

Reply via email to