Changeset 21689 for Makefile.PL

Show
Ignore:
Timestamp:
08/01/08 14:59:56 (4 months ago)
Author:
audreyt
Message:

* Allow for bootstrapping cabal.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Makefile.PL

    r21686 r21689  
    1919my $setup_exe  = File::Spec->catfile('.', "Setup$Config{_exe}"); 
    2020 
    21 unlink $_ for qw(Setup.hi Setup.o); 
    22 unlink $setup_exe; 
    23 system($ghc, qw(--make -O0), -o => $setup_exe, 'Setup.lhs'); 
     21rebuild_setup(); 
    2422my $app_dir = `$setup_exe -d`; 
    2523chomp $app_dir; 
     
    3735print "[Automatic Installation]\n"; 
    3836 
    39 bootstrap_with(Cabal            => qr/1\.4\./, '1.4.0'); 
    40 bootstrap_with(HTTP             => qr/300[01]\./, '3000.0'); 
    41 bootstrap_with(zlib             => qr/0\.(?:[4-9]|[1-9]\d)\./, '0.4'); 
    42 bootstrap_with('cabal-install'  => qr/0\.(?:[5-9]|[1-9]\d)\./, '0.5'); 
     37my $rebuilt; 
     38$rebuilt ||= bootstrap_with(Cabal            => qr/1\.4\./, '1.4.0'); 
     39$rebuilt ||= bootstrap_with(HTTP             => qr/300[01]\./, '3000.0'); 
     40$rebuilt ||= bootstrap_with(zlib             => qr/0\.(?:[4-9]|[1-9]\d)\./, '0.4'); 
     41$rebuilt ||= bootstrap_with('cabal-install'  => qr/0\.(?:[5-9]|[1-9]\d)\./, '0.5'); 
     42 
     43if ($rebuilt) { 
     44    rebuild_setup(); 
     45} 
    4346 
    4447print "[Pugs Dependencies]\n"; 
     
    196199 
    197200    chdir $FindBin::RealBin; 
     201    return 1; 
    198202} 
    199203 
     
    214218    return join("\n", @cmds); 
    215219} 
     220 
     221sub rebuild_setup { 
     222    unlink $_ for qw(Setup.hi Setup.o); 
     223    unlink $setup_exe; 
     224    system($ghc, qw(--make -O0), -o => $setup_exe, 'Setup.lhs'); 
     225}