]> git.imager.perl.org - imager.git/blob - dynfilt/Makefile.PL
handle failure to clone the log filehandle when cloning the Imager context
[imager.git] / dynfilt / Makefile.PL
1 use strict;
2 use Config;
3 use ExtUtils::MakeMaker;
4 my $Verbose = 1;
5
6 my $lddl=$Config{"lddlflags"};
7
8 my @plugins= qw(dyntest dt2 mandelbrot flines);
9
10 my $libstr=join(' ',map { $_.'.$(SO)' } @plugins);
11
12 #print $libstr,"\n";
13 #print $objstr,"\n";
14 #print MY::top_targets();
15
16 WriteMakefile(
17     NAME      => 'Imager::plugins',
18     SKIP      => [qw(all dynamic static )],
19     clean     => {'FILES' => $libstr},
20 );
21
22
23
24
25 sub lddl_magic {
26   my $t;
27   $t=$lddl;
28   $t=~s/-bI:\$\(PERL_INC\)\/perl.exp//;
29   $t=~s/\$\(BASEEXT\)/$_[0]/;
30   return $t;
31 }
32
33
34
35
36 sub MY::top_targets {
37     use Config;
38 if ($^O eq 'aix') {
39         '
40 all :: dynamic
41
42 dynamic ::       '.$libstr.(join("\n",map { qq{
43
44 $_.\$(SO): $_\$(OBJ_EXT)
45         LD_RUN_PATH="\$(LD_RUN_PATH)" \$(LD) -o \$\@ }.lddl_magic($_).qq{ \$(OTHERLDFLAGS) $_\$(OBJ_EXT)
46
47 } } @plugins)).'
48
49
50 pure_all :: 
51         $(NOOP)
52
53 ';
54
55 }
56 elsif ($^O =~ /win32/i && $Config{cc} =~ /cl/) {
57   my @libpth = grep /\S/, split /("[^"]*"|\S+)/,$Config{libpth};
58         '
59 all :: dynamic
60
61 dynamic :: '.$libstr.(join("\n",map { qq{
62
63 $_.\$(SO): $_\$(OBJ_EXT)
64     \$(LD) /OUT:\$\@ }.lddl_magic($_).qq{ \$(OTHERLDFLAGS) $_\$(OBJ_EXT) $Config{libs} }.join(' ', map "/libpath:$_", @libpth).qq{
65
66 } } @plugins)).'
67
68
69 pure_all :: 
70         $(NOOP)
71
72 ';
73
74 } else {
75   my $ldrun = $^O =~ /win32/i ? '' : 'LD_RUN_PATH="$(LD_RUN_PATH)"';
76   my $phony_colon = $Config{make} eq 'dmake' ? ':' : '::';
77     
78         "
79 all $phony_colon dynamic
80
81 dynamic $phony_colon ".$libstr.(join("\n",map { qq{
82
83 $_.\$(SO): $_\$(OBJ_EXT)
84         $ldrun \$(LD) -o \$\@ \$(LDDLFLAGS) \$(OTHERLDFLAGS) $_\$(OBJ_EXT)
85
86 } } @plugins)).'
87
88
89 pure_all :: 
90         $(NOOP)
91
92 ';
93
94 }
95 }
96
97 # EU::MM crashes without this when we define it in the base Makefile.PL
98 # but then warns about redefinition, so delete the GLOB entry
99 BEGIN { delete $MY::{metafile} }
100 sub MY::metafile {
101   '';
102 }