This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make hv_notallowed a static as suggested by Nicholas Clark;
[perl5.git] / lib / ExtUtils / MM_Any.pm
CommitLineData
f6d6199c
MS
1package ExtUtils::MM_Any;
2
3use strict;
4use vars qw($VERSION @ISA);
5$VERSION = 0.04;
6
7use Config;
8use File::Spec;
9
10
11=head1 NAME
12
13ExtUtils::MM_Any - Platform agnostic MM methods
14
15=head1 SYNOPSIS
16
17 FOR INTERNAL USE ONLY!
18
19 package ExtUtils::MM_SomeOS;
20
21 # Temporarily, you have to subclass both. Put MM_Any first.
22 require ExtUtils::MM_Any;
23 require ExtUtils::MM_Unix;
24 @ISA = qw(ExtUtils::MM_Any ExtUtils::Unix);
25
26=head1 DESCRIPTION
27
28B<FOR INTERNAL USE ONLY!>
29
30ExtUtils::MM_Any is a superclass for the ExtUtils::MM_* set of
31modules. It contains methods which are either inherently
32cross-platform or are written in a cross-platform manner.
33
34Subclass off of ExtUtils::MM_Any I<and> ExtUtils::MM_Unix. This is a
35temporary solution.
36
37B<THIS MAY BE TEMPORARY!>
38
39=head1 Inherently Cross-Platform Methods
40
41These are methods which are by their nature cross-platform and should
42always be cross-platform.
43
44=head2 File::Spec wrappers B<DEPRECATED>
45
46The following methods are deprecated wrappers around File::Spec
47functions. They exist from before File::Spec did and in fact are from
48which File::Spec sprang.
49
50They are all deprecated. Please use File::Spec directly.
51
52=over 4
53
54=item canonpath
55
56=cut
57
58sub canonpath {
59 shift;
60 return File::Spec->canonpath(@_);;
61}
62
63=item catdir
64
65=cut
66
67sub catdir {
68 shift;
69 return File::Spec->catdir(@_);
70}
71
72=item catfile
73
74=cut
75
76sub catfile {
77 shift;
78 return File::Spec->catfile(@_);
79}
80
81=item curdir
82
83=cut
84
85my $Curdir = File::Spec->curdir;
86sub curdir {
87 return $Curdir;
88}
89
90=item file_name_is_absolute
91
92=cut
93
94sub file_name_is_absolute {
95 shift;
96 return File::Spec->file_name_is_absolute(@_);
97}
98
99=item path
100
101=cut
102
103sub path {
104 return File::Spec->path();
105}
106
107=item rootdir
108
109=cut
110
111my $Rootdir = File::Spec->rootdir;
112sub rootdir {
113 return $Rootdir;
114}
115
116=item updir
117
118=cut
119
120my $Updir = File::Spec->updir;
121sub updir {
122 return $Updir;
123}
124
125=back
126
127=head1 Thought To Be Cross-Platform Methods
128
129These are methods which are thought to be cross-platform by virtue of
130having been written in a way to avoid incompatibilities.
131
132=over 4
133
134=item test_via_harness
135
136 my $command = $mm->test_via_harness($perl, $tests);
137
138Returns a $command line which runs the given set of $tests with
139Test::Harness and the given $perl.
140
141Used on the t/*.t files.
142
143=cut
144
145sub test_via_harness {
146 my($self, $perl, $tests) = @_;
147
148 return qq{\t$perl "-MExtUtils::testlib" "-MExtUtils::Command::MM" }.
149 qq{"-e" "test_harness(\$(TEST_VERBOSE))" $tests\n};
150}
151
152=item test_via_script
153
154 my $command = $mm->test_via_script($perl, $script);
155
156Returns a $command line which just runs a single test without
157Test::Harness. No checks are done on the results, they're just
158printed.
159
160Used for test.pl, since they don't always follow Test::Harness
161formatting.
162
163=cut
164
165sub test_via_script {
166 my($self, $perl, $script) = @_;
167 return "\t$perl \$(TEST_LIBS) $script\n";
168}
169
170=back
171
172=head1 AUTHOR
173
174Michael G Schwern <schwern@pobox.com> with code from ExtUtils::MM_Unix
175and ExtUtils::MM_Win32.
176
177
178=cut
179
1801;