#17150 didn't expect -Uuseperlio.
[p5sagit/p5-mst-13.2.git] / ext / Encode / Makefile.PL
index 912f14d..2e74fe4 100644 (file)
@@ -10,6 +10,8 @@ my %tables =
     (
      def_t => ['ascii.ucm',
               '8859-1.ucm',
+              'null.ucm',
+              'ctrl.ucm',
               ]
      );
 
@@ -42,6 +44,7 @@ WriteMakefile(
              MAN3PODS  => {},
              INC       => "-I./Encode",
              PMLIBDIRS => \@pmlibdirs,
+             INSTALLDIRS => 'perl',
              );
 
 package MY;
@@ -74,6 +77,8 @@ sub post_initialize
     {
        push (@files,$table.$ext);
     }
+    $self->{SOURCE} .= " $table.c"
+       if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/;
 }
 $self->{'clean'}{'FILES'} .= join(' ',@files);
 return '';
@@ -84,7 +89,7 @@ sub postamble
     my $self = shift;
     my $dir  = $self->catdir($self->curdir,'ucm');
     my $str  = "# Encode\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n";
-    $str  .= 'Encode$(OBJ_EXT) :';
+    $str  .= $^O eq 'MacOS' ? 'Encode.c.{$(MACPERL_BUILD_EXT_STATIC)}.o :' : 'Encode$(OBJ_EXT) :';
     foreach my $table (keys %tables)
     {
        $str .= " $table.c";
@@ -108,9 +113,10 @@ sub postamble
                $continuator = '';
            }
        }
-       my $plib   = $ENV{PERL_CORE} ? '-I$(PERL_LIB)' : '';
-       my $ucopts = ($^O eq 'VMS')  ? '-"Q" -"O"' : '-Q -O'; 
-       $str .=  
+       my $plib   = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : '';
+       $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform;
+       my $ucopts = '-"Q" -"O"';
+       $str .=
            qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n};
        open (FILELIST, ">$table.fnm")
            || die "Could not open $table.fnm: $!";