This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to ExtUtils-MakeMaker-6.48
[perl5.git] / lib / ExtUtils / MM_OS2.pm
index 1db55c4..9e6fdfa 100644 (file)
@@ -1,16 +1,15 @@
 package ExtUtils::MM_OS2;
 
 use strict;
-use vars qw($VERSION @ISA);
 
 use ExtUtils::MakeMaker qw(neatvalue);
 use File::Spec;
 
-$VERSION = '1.02_01';
+our $VERSION = '6.48';
 
 require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
-@ISA = qw(ExtUtils::MM_Any ExtUtils::MM_Unix);
+our @ISA = qw(ExtUtils::MM_Any ExtUtils::MM_Unix);
 
 =pod
 
@@ -32,17 +31,20 @@ the semantics.
 
 =over 4
 
+=item init_dist
+
+Define TO_UNIX to convert OS2 linefeeds to Unix style.
+
 =cut
 
-sub dist {
-    my($self, %attribs) = @_;
+sub init_dist {
+    my($self) = @_;
 
-    $attribs{TO_UNIX} ||= sprintf <<'MAKE_TEXT', $self->{NOECHO};
-%s$(TEST_F) tmp.zip && $(RM) tmp.zip; \\
-$(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM) tmp.zip
+    $self->{TO_UNIX} ||= <<'MAKE_TEXT';
+$(NOECHO) $(TEST_F) tmp.zip && $(RM_F) tmp.zip; $(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM_F) tmp.zip
 MAKE_TEXT
 
-    return $self->SUPER::dist(%attribs);
+    $self->SUPER::init_dist;
 }
 
 sub dlsyms {
@@ -72,13 +74,12 @@ $self->{BASEEXT}.def: Makefile.PL
     if ($self->{IMPORTS} && %{$self->{IMPORTS}}) {
        # Make import files (needed for static build)
        -d 'tmp_imp' or mkdir 'tmp_imp', 0777 or die "Can't mkdir tmp_imp";
-       open IMP, '>tmpimp.imp' or die "Can't open tmpimp.imp";
-       my ($name, $exp);
-       while (($name, $exp)= each %{$self->{IMPORTS}}) {
+       open my $imp, '>', 'tmpimp.imp' or die "Can't open tmpimp.imp";
+       while (my($name, $exp) = each %{$self->{IMPORTS}}) {
            my ($lib, $id) = ($exp =~ /(.*)\.(.*)/) or die "Malformed IMPORT `$exp'";
-           print IMP "$name $lib $id ?\n";
+           print $imp "$name $lib $id ?\n";
        }
-       close IMP or die "Can't close tmpimp.imp";
+       close $imp or die "Can't close tmpimp.imp";
        # print "emximp -o tmpimp$Config::Config{lib_ext} tmpimp.imp\n";
        system "emximp -o tmpimp$Config::Config{lib_ext} tmpimp.imp" 
            and die "Cannot make import library: $!, \$?=$?";
@@ -118,38 +119,33 @@ sub maybe_command {
     return;
 }
 
-sub perl_archive {
-    return "\$(PERL_INC)/libperl\$(LIB_EXT)";
-}
+=item init_linker
 
-=item perl_archive_after
+=cut
 
-This is an internal method that returns path to a library which
-should be put on the linker command line I<after> the external libraries
-to be linked to dynamic extensions.  This may be needed if the linker
-is one-pass, and Perl includes some overrides for C RTL functions,
-such as malloc().
+sub init_linker {
+    my $self = shift;
 
-=cut 
+    $self->{PERL_ARCHIVE} = "\$(PERL_INC)/libperl\$(LIB_EXT)";
 
-sub perl_archive_after
-{
return "\$(PERL_INC)/libperl_override\$(LIB_EXT)" unless $OS2::is_aout;
return "";
+    $self->{PERL_ARCHIVE_AFTER} = $OS2::is_aout
+      ? ''
     : '$(PERL_INC)/libperl_override$(LIB_EXT)';
   $self->{EXPORT_LIST} = '$(BASEEXT).def';
 }
 
-sub export_list
-{
- my ($self) = @_;
- return "$self->{BASEEXT}.def";
-}
+=item os_flavor
 
-1;
+OS/2 is OS/2
 
-__END__
+=cut
 
-=pod
+sub os_flavor {
+    return('OS/2');
+}
 
 =back
 
 =cut
+
+1;