Changeset 8923 for lang/perl/Alien-MeCab

Show
Ignore:
Timestamp:
04/05/08 21:17:06 (8 months ago)
Author:
daisuke
Message:

lang/perl/Alien-MeCab?; fix minor problems for Win32, and I think I don't need to detect iconv for windows

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Alien-MeCab/trunk/Makefile.PL

    r8918 r8923  
    99 
    1010# Here's the file that we're going to use to extract some data 
    11 my $SPEC_FILE     = 'lib/Alien/MeCab.pm'; 
     11my $SPEC_FILE       = 'lib/Alien/MeCab.pm'; 
     12my $RUNNING_IN_HELL = $^O eq 'MSWin32'; 
    1213 
    1314# Get the version  
     
    2122my $MECAB_BASENAME   = "mecab-$MECAB_VERSION.tar.gz"; 
    2223my $MECAB_SOURCE     = File::Spec->catfile("src", $MECAB_BASENAME); 
    23 my $MECAB_EXE        = File::Spec->catfile("src", "mecab-$MECAB_VERSION.exe") if $^O eq 'MSWin32'; 
    24  
    25 eval { 
    26     Devel::CheckLib::assert_lib(lib => "iconv", libpath => $ENV{LIBDIR}); 
    27 }; 
    28 if ($@) { 
    29     print <<EOM; 
     24my $MECAB_EXE        = File::Spec->catfile("src", "mecab-$MECAB_VERSION.exe"); 
     25 
     26if (! $RUNNING_IN_HELL) { 
     27    eval { 
     28        Devel::CheckLib::assert_lib(lib => "iconv", libpath => $ENV{LIBDIR}); 
     29    }; 
     30    if ($@) { 
     31        print <<EOM; 
    3032 
    3133*** Whoa! libiconv was not detected! *** 
     
    4244#  (2) install libiconv by yourself by other means. 
    4345#before proceeding. 
    44     exit 0; 
     46        exit 0; 
     47    } 
    4548} 
    4649 
     
    6972 
    7073# Ask if we want to download the source. 
    71 my $sourcefile; 
    72 my $test; 
    73 $sourcefile = ($^O eq 'MSWin32') ? $MECAB_EXE 
    74                                  : $MECAB_SOURCE; 
    75 $test = ($^O eq 'MSWin32') ? "win\n" 
    76                            : "other\n"; 
     74my $sourcefile = $RUNNING_IN_HELL ? $MECAB_EXE : $MECAB_SOURCE; 
    7775if (! -f $sourcefile) { 
    7876    my $yn = prompt("mecab source file $sourcefile does not exist. Download it now?", "y"); 
     
    184182    my $make_str; 
    185183 
    186         if ($^O eq 'MSWin32') { 
     184        if ($RUNNING_IN_HELL) { 
    187185        $make_str = <<MAKE_FRAG; 
    188186libmecab: