mirror of
https://git.proxmox.com/git/proxmox-perl-rs
synced 2025-05-23 20:11:03 +00:00
package template: introduce libdirs() method
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
6583f4d840
commit
08eba82025
@ -28,12 +28,15 @@ sub library {
|
|||||||
return '{{LIBRARY}}';
|
return '{{LIBRARY}}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Keep on a single line, modified by testsuite!
|
||||||
|
sub libdirs { return (map "-L$_/auto", @INC); }
|
||||||
|
|
||||||
sub load : prototype($) {
|
sub load : prototype($) {
|
||||||
my ($pkg) = @_;
|
my ($pkg) = @_;
|
||||||
|
|
||||||
my $mod_name = $pkg->library();
|
my $mod_name = $pkg->library();
|
||||||
|
|
||||||
my @dirs = (map "-L$_/auto", @INC);
|
my @dirs = $pkg->libdirs();
|
||||||
my $mod_file = DynaLoader::dl_findfile({{DEBUG_LIBPATH}}@dirs, $mod_name);
|
my $mod_file = DynaLoader::dl_findfile({{DEBUG_LIBPATH}}@dirs, $mod_name);
|
||||||
die "failed to locate shared library for $mod_name (lib${mod_name}.so)\n" if !$mod_file;
|
die "failed to locate shared library for $mod_name (lib${mod_name}.so)\n" if !$mod_file;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user