----- Original Message ----- From: "Joel Peshkin" <j...@peshkin.net>
To: <inline@perl.org>
Sent: Thursday, December 24, 2009 8:13 AM
Subject: Re: Static Linking with Inline::C




I like to remove the Inline::C dependency from any extensions that I write
-
and I wrote InlineX::C2XS to facilitate this.


Rob,

 This is fantastic.  It has me almost where I need to be.

 After I added some t/ tests and a MANIFEST, this enables me to do a
"make dist" and make a very easy package.  The one problem I have is
that I currently use...

  LIBS => '-L/path/to/local/copy/of/special/libraries -lfirstlib
-lsecondlib -lthirdlib -lfirstlib -lsecondlib -lthirdlib'

 I do this because the libraries refer to each other.  The problem is now
the person who does tries to install the dist on another machine may
have those same libraries at a different path.   Is there a way that
they could pass in a variable when they do "perl Makefile.PL" without
having to specify all of the -l options themselves?


I guess you could instruct them to run:

perl Makefile.PL /path/to/local/copy/of/special/libraries

and have, near the beginning of the Makefile.PL, something like:

if ($ARGV[0]) {
$libs = "-L$ARGV[0] -lfirstlib -lsecondlib -lthirdlib -lfirstlib -lsecondlib -lthirdlib";
}
else { # assume the libraries will be found by default
$libs = "-lfirstlib -lsecondlib -lthirdlib -lfirstlib -lsecondlib -lthirdlib";
}

And also specify (in the Makefile.PL):

LIBS => $libs;

Cheers,
Rob



Reply via email to