Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 102 lines (66 sloc) 1.798 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
use strict;
use Config;
use ExtUtils::MakeMaker;
my $Verbose = 1;

my $lddl=$Config{"lddlflags"};

my @plugins= qw(dyntest dt2 mandelbrot flines);

my $libstr=join(' ',map { $_.'.$(SO)' } @plugins);

#print $libstr,"\n";
#print $objstr,"\n";
#print MY::top_targets();

WriteMakefile(
    NAME => 'Imager::plugins',
    SKIP => [qw(all dynamic static )],
    clean => {'FILES' => $libstr},
);




sub lddl_magic {
  my $t;
  $t=$lddl;
  $t=~s/-bI:\$\(PERL_INC\)\/perl.exp//;
  $t=~s/\$\(BASEEXT\)/$_[0]/;
  return $t;
}




sub MY::top_targets {
    use Config;
if ($^O eq 'aix') {
        '
all :: dynamic

dynamic :: '.$libstr.(join("\n",map { qq{

$_.\$(SO): $_\$(OBJ_EXT)
LD_RUN_PATH="\$(LD_RUN_PATH)" \$(LD) -o \$\@ }.lddl_magic($_).qq{ \$(OTHERLDFLAGS) $_\$(OBJ_EXT)

} } @plugins)).'


pure_all ::
$(NOOP)

';

}
elsif ($^O =~ /win32/i && $Config{cc} =~ /cl/) {
  my @libpth = grep /\S/, split /("[^"]*"|\S+)/,$Config{libpth};
        '
all :: dynamic

dynamic :: '.$libstr.(join("\n",map { qq{

$_.\$(SO): $_\$(OBJ_EXT)
\$(LD) /OUT:\$\@ }.lddl_magic($_).qq{ \$(OTHERLDFLAGS) $_\$(OBJ_EXT) $Config{libs} }.join(' ', map "/libpath:$_", @libpth).qq{

} } @plugins)).'


pure_all ::
$(NOOP)

';

} else {
  my $ldrun = $^O =~ /win32/i ? '' : 'LD_RUN_PATH="$(LD_RUN_PATH)"';
  my $phony_colon = $Config{make} eq 'dmake' ? ':' : '::';
    
        "
all $phony_colon dynamic

dynamic $phony_colon ".$libstr.(join("\n",map { qq{

$_.\$(SO): $_\$(OBJ_EXT)
$ldrun \$(LD) -o \$\@ \$(LDDLFLAGS) \$(OTHERLDFLAGS) $_\$(OBJ_EXT)

} } @plugins)).'


pure_all ::
$(NOOP)

';

}
}

# EU::MM crashes without this when we define it in the base Makefile.PL
# but then warns about redefinition, so delete the GLOB entry
BEGIN { delete $MY::{metafile} }
sub MY::metafile {
  '';
}
Something went wrong with that request. Please try again.