Changeset 2656 for Makefile.PL

Show
Ignore:
Timestamp:
05/03/05 20:15:53 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
4152
Message:

* experimental require_parrot() support.

(set the PUGS_EMBED env var to "parrot" to activate.)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Makefile.PL

    r2629 r2656  
    33use warnings; 
    44use Config; 
     5use Cwd qw(abs_path); 
    56use File::Spec; 
    67use lib 'lib'; 
     
    8687. 
    8788    } 
    88          
    8989 
    9090    my $ghc_output = "-o pugs$Config{_exe} src/Main.hs"; 
     
    103103    $ghc_output .= " $pcre @syck @pge $unicode"; 
    104104 
     105    my $embed_flags; 
     106    if ($ENV{PUGS_EMBED} and $ENV{PUGS_EMBED} =~ /\bparrot\b/i) { 
     107        my $base = $ENV{PARROT_PATH}; 
     108        if (!$base and -d "../parrot") { 
     109            $base = abs_path('../parrot/'); 
     110        } 
     111        (-d $base and -e "$base/parrot-config.imc") 
     112            or die "*** Please set \$ENV{PARROT_PATH} to the base path with a built parrot tree.\n"; 
     113        $embed_flags .= " -I$base/include -L$base/blib/lib -DPUGS_HAVE_PARROT=1 -L/usr/local/lib"; 
     114        $ghc_output .= " -lparrot -licuuc -licudata " 
     115    } 
     116 
    105117    my $config = get_pugs_config(); 
    106118    my $is_win32 = ($^O =~ /MSWin|mingw|cygwin/i); 
     
    159171 
    160172optimized :: src/Pugs/Config.hs @srcfiles $version_h @prereqs 
    161         $ghc $threaded -O --make $ghc_flags $ghc_output 
     173        $ghc $threaded -O --make $ghc_flags $embed_flags $ghc_output 
    162174 
    163175unoptimised :: optimized 
    164176 
    165177unoptimized :: src/Pugs/Config.hs @srcfiles $version_h @prereqs 
    166         $ghc $threaded -O0 --make $ghc_flags $ghc_output 
     178        $ghc $threaded -O0 --make $ghc_flags $embed_flags $ghc_output 
    167179 
    168180$pugs : src/Pugs/Config.hs @srcfiles $version_h @prereqs 
    169         $ghc $threaded -O --make $ghc_flags $ghc_output 
     181        $ghc $threaded -O --make $ghc_flags $embed_flags $ghc_output 
    170182 
    171183smoke : $pugs util/run-smoke.pl 
     
    173185 
    174186ghci :: 
    175         $ghc --interactive $ghc_flags $ghc_output 
     187        $ghc --interactive $ghc_flags $embed_flags $ghc_output 
    176188 
    177189tags : @srcfiles