This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Separate POD file and ExtUtils::ParseXS::Utilities
[perl5.git] / dist / ExtUtils-ParseXS / lib / ExtUtils / ParseXS / Utilities.pm
CommitLineData
a65c06db
S
1package ExtUtils::ParseXS::Utilities;
2use strict;
3use warnings;
4use Exporter;
5our (@ISA, @EXPORT_OK);
6@ISA = qw(Exporter);
7@EXPORT_OK = qw(
8 standard_typemap_locations
9);
10
11sub standard_typemap_locations {
12 my $include_ref = shift;
13 # Add all the default typemap locations to the search path
14 my @tm = qw(typemap);
15
16 my $updir = File::Spec->updir;
17 foreach my $dir (File::Spec->catdir(($updir) x 1), File::Spec->catdir(($updir) x 2),
18 File::Spec->catdir(($updir) x 3), File::Spec->catdir(($updir) x 4)) {
19
20 unshift @tm, File::Spec->catfile($dir, 'typemap');
21 unshift @tm, File::Spec->catfile($dir, lib => ExtUtils => 'typemap');
22 }
23 foreach my $dir (@{ $include_ref}) {
24 my $file = File::Spec->catfile($dir, ExtUtils => 'typemap');
25 unshift @tm, $file if -e $file;
26 }
27 return @tm;
28}
29
301;