197 | 197 |
$instpath = File::Spec->rel2abs ($instpath);
|
198 | 198 |
}
|
199 | 199 |
|
200 | |
my @typemaps = map {
|
201 | |
File::Spec->rel2abs ($_, $instpath)
|
202 | |
} @{"$depinstallfiles\::typemaps"};
|
|
200 |
my (@typemaps, $inc, $libs, @deps);
|
|
201 |
|
|
202 |
@deps = eval { $depinstallfiles->deps };
|
|
203 |
@deps = @{"$depinstallfiles\::deps"}
|
|
204 |
if $@ and exists ${"$depinstallfiles\::"}{deps};
|
|
205 |
|
|
206 |
my $inline = eval { $depinstallfiles->Inline('C') };
|
|
207 |
if (!$@) {
|
|
208 |
$inc = $inline->{INC} // '';
|
|
209 |
$libs = $inline->{LIBS} // '';
|
|
210 |
@typemaps = @{ $inline->{TYPEMAPS} || [] };
|
|
211 |
} else {
|
|
212 |
$inc = ${"$depinstallfiles\::inc"} // '';
|
|
213 |
$libs = ${"$depinstallfiles\::libs"} // '';
|
|
214 |
@typemaps = @{"$depinstallfiles\::typemaps"};
|
|
215 |
}
|
|
216 |
@typemaps = map { File::Spec->rel2abs ($_, $instpath) } @typemaps;
|
203 | 217 |
|
204 | 218 |
{
|
205 | 219 |
instpath => $instpath,
|
206 | 220 |
typemaps => \@typemaps,
|
207 | |
inc => "-I$instpath ".${"$depinstallfiles\::inc"},
|
208 | |
libs => ${"$depinstallfiles\::libs"},
|
|
221 |
inc => "-I$instpath $inc",
|
|
222 |
libs => $libs,
|
209 | 223 |
# this will not exist when loading files from old versions
|
210 | 224 |
# of ExtUtils::Depends.
|
211 | |
(exists ${"$depinstallfiles\::"}{deps}
|
212 | |
? (deps => \@{"$depinstallfiles\::deps"})
|
213 | |
: ()),
|
|
225 |
deps => \@deps,
|
214 | 226 |
}
|
215 | 227 |
}
|
216 | 228 |
|
|
600 | 612 |
=back
|
601 | 613 |
|
602 | 614 |
If you want to make module I<name> support this, you must provide
|
603 | |
a module I<name>::Install::Files, which on loading will provide the
|
604 | |
following package variables: C<@typemaps>, C<$inc>, C<$libs>, C<$deps>,
|
605 | |
with the same contents as above (not coincidentally). The C<load>
|
606 | |
function will supply the C<instpath>. An easy way to achieve this is
|
607 | |
to use the method L</"$depends-E<gt>save_config ($filename)">, but your
|
608 | |
package may have different facilities already.
|
|
615 |
a module I<name>::Install::Files, which on loading will implement the
|
|
616 |
following class methods:
|
|
617 |
|
|
618 |
$hashref = name::Install::Files->Inline('C');
|
|
619 |
# hash to contain any necessary TYPEMAPS (array-ref), LIBS, INC
|
|
620 |
@deps = name::Install::Files->deps;
|
|
621 |
# any modules on which "name" depends
|
|
622 |
|
|
623 |
An easy way to achieve this is to use the method
|
|
624 |
L</"$depends-E<gt>save_config ($filename)">, but your package may have
|
|
625 |
different facilities already.
|
609 | 626 |
|
610 | 627 |
=item $depends->load_deps
|
611 | 628 |
|