1 package Wx::build::MakeMaker::Any_OS;
4 use base 'Wx::build::MakeMaker';
5 use File::Spec::Functions qw(curdir);
6 use Wx::build::Options;
7 use Wx::build::Utils qw(xs_dependencies lib_file);
9 my $exp = lib_file( 'Wx/Wx_Exp.pm' );
10 my @generated_xs = qw(XS/ItemContainer.xs XS/ItemContainerImmutable.xs
11 XS/VarScrollHelperBase.xs XS/VarVScrollHelper.xs
12 XS/VarHScrollHelper.xs XS/VarHVScrollHelper.xs);
17 if( %Wx::build::MakeMaker::additional_arguments ) {
18 $config{WX}{lc $_} = $Wx::build::MakeMaker::additional_arguments{$_}
19 foreach keys %Wx::build::MakeMaker::additional_arguments;
20 $ExtUtils::MakeMaker::Recognized_Att_Keys{WX} = 1;
21 %Wx::build::MakeMaker::additional_arguments = ();
24 if( $config{WX}{wx_overload} ) {
25 $_ = File::Spec->catfile( split /\//, $_ )
26 foreach values %{$config{WX}{wx_overload}};
29 $config{INC} .= '-I' . curdir . ' ';
30 $config{INC} .= '-I' . $this->get_api_directory . ' ';
32 unless( $this->_core ) {
33 $config{DEFINE} .= " -DWXPL_EXT ";
36 if( $this->_static ) {
37 $config{DEFINE} .= " -DWXPL_STATIC ";
43 sub metafile_target_ext {
44 return '' if Wx::build::MakeMaker::is_wxPerl_tree;
45 return shift->MM::metafile_target( @_ );
48 sub metafile_target_core {
49 return shift->MM::metafile_target( @_ );
54 my %config = $this->get_flags;
57 { FILES => "$config{WX}{wx_overload}{source}" .
58 " $config{WX}{wx_overload}{header} exists overload Opt" .
59 " copy_files files.lst cpp/combopopup.h cpp/odcombo.h" .
60 " cpp/setup.h cpp/plwindow.h cpp/artprov.h cpp/popupwin.h" .
61 " fix_alien cpp/vlbox.h cpp/vscroll.h cpp/v_cback_def.h" .
62 " " . join( " ", @generated_xs ) .
63 " cpp/vscrl.h overload.lst" };
70 my %config = $this->get_flags;
72 my( $ovlc, $ovlh ) = $config{WX}{wx_overload} ?
73 @{$config{WX}{wx_overload}}{qw(source header)} : ();
74 if( $ovlc && $ovlh ) {
76 { FILES => "$config{WX}{wx_overload}{source}" .
77 " $config{WX}{wx_overload}{header} overload" };
83 sub files_with_constants {
85 return @{$this->{wx_files_with_constants}}
86 if $this->{wx_files_with_constants};
87 return @{$this->{wx_files_with_constants} =
88 [ Wx::build::Utils::files_with_constants ]};
91 sub files_with_overload {
93 return @{$this->{wx_files_with_overload}}
94 if $this->{wx_files_with_overload};
95 return @{$this->{wx_files_with_overload} =
96 [ Wx::build::Utils::files_with_overload ]};
103 my $top_file = $this->{WX}{wx_top}
104 || $this->{ARGS}{VERSION_FROM}
105 || $this->{ARGS}{ABSTRACT_FROM}
107 my( $ovlc, $ovlh ) = $this->{WX}{wx_overload} ?
108 @{$this->{WX}{wx_overload}}{qw(source header)} : ();
109 return ( xs_dependencies( $this, [ curdir, $this->get_api_directory
111 Wx::build::Utils::src_dir( $top_file ) ),
114 ( $ovlc => 'overload',
124 my %files = $this->files_to_install();
125 my %depend = ( _depend_common( $this ),
126 $exp => join( ' ', $this->files_with_constants ),
127 '$(INST_STATIC)' => "fix_alien $exp",
128 '$(INST_DYNAMIC)' => "fix_alien $exp",
129 'fix_alien' => 'pm_to_blib',
130 'pm_to_blib' => 'copy_files',
131 'blibdirs' => 'copy_files',
132 'blibdirs.ts' => 'copy_files',
133 'copy_files' => join( ' ', keys %files ),
134 'distmeta' => 'check_my_metafile',
136 my %this_depend = @_;
138 foreach ( keys %depend ) {
139 $this_depend{$_} .= ' ' . $depend{$_};
142 $this->SUPER::depend_core( %this_depend );
148 my %depend = _depend_common( $this );
149 my %this_depend = @_;
151 foreach ( keys %depend ) {
152 $this_depend{$_} .= ' ' . $depend{$_};
155 $this->SUPER::depend_ext( %this_depend );
160 my $text = $this->SUPER::subdirs_core( @_ );
162 return <<EOT . $text;
170 my $text = $this->SUPER::subdirs_core( @_ );
172 return ( $this->{WX}{wx_overload} ? <<EOT : '' ) . $text;
178 sub postamble_overload {
181 # command line length workaround
182 if( !Wx::build::MakeMaker::is_wxPerl_tree
183 || Wx::build::MakeMaker::is_core ) {
184 Wx::build::Utils::write_string( 'overload.lst',
185 join "\n", $this->files_with_overload );
187 my $ovl_script = Wx::build::MakeMaker::is_wxPerl_tree() ?
188 'script/wxperl_overload' : "-S wxperl_overload";
189 my( $ovlc, $ovlh ) = $this->{WX}{wx_overload} ?
190 @{$this->{WX}{wx_overload}}{qw(source header)} : ();
191 return ( $this->{WX}{wx_overload} ? <<EOT : '' );
193 \t\$(PERL) $ovl_script $ovlc $ovlh overload.lst
201 my %files = $this->files_to_install();
203 Wx::build::Utils::write_string( 'files.lst',
204 Data::Dumper->Dump( [ \%files ] ) );
205 my $text = <<EOT . $this->postamble_overload;
208 \t\$(PERL) script/make_exp_list.pl $exp @{[$this->files_with_constants]}
211 \t\$(PERL) script/copy_files.pl files.lst
212 \t\$(TOUCH) copy_files
214 fix_alien : lib/Wx/Mini.pm
215 \t\$(PERL) script/fix_alien_path.pl lib/Wx/Mini.pm blib/lib/Wx/Mini.pm
216 \t\$(TOUCH) fix_alien
219 yapp -v -s -m Wx::XSP::Grammar -o build/Wx/XSP/Grammar.pm build/Wx/XSP/XSP.yp
221 typemap : typemap.tmpl script/make_typemap.pl
222 \$(PERL) script/make_typemap.pl typemap.tmpl typemap
224 cpp/v_cback_def.h : script/make_v_cback.pl
225 \$(PERL) script/make_v_cback.pl > cpp/v_cback_def.h
228 \$(PERL) -e "eval 'require ExtUtils::MY_Metafile; 1' || die 'Install ExtUtils::MY_Metafile'"
232 foreach my $f ( @generated_xs ) {
233 my $file = File::Spec->canonpath( $f );
234 $text .= sprintf <<EOT, $file, $file, $file, $file;
236 \$(PERL) -MExtUtils::XSpp::Cmd -e xspp -- -t typemap.xsp %sp > %s
241 $text .= sprintf <<EOT, join( ' ', @generated_xs );
242 generated : cpp/v_cback_def.h typemap %s overload
252 return $this->postamble_overload;
255 # here because File::Find::find chdirs, and our is_core is,
258 my( $this, $inst ) = @_;
260 $inst =~ s/(\W+)build\W+Wx/$1Wx/i && return $inst;
262 return $this->SUPER::libscan_core( $inst );
268 foreach my $k ( grep { m/~$/ } keys %{$this->{PM}} ) {
269 delete $this->{PM}{$k};
272 return $this->SUPER::constants_core( @_ );
275 # returns an hash of files to be copied
276 sub files_to_install {
277 my @api = qw(cpp/chkconfig.h
291 # in arch, so $INC{'Opt.pm'} will tell where arch is
292 return ( 'Opt', Wx::build::Utils::arch_file( 'Wx/build/Opt.pm' ),
293 ( map { ( $_ => Wx::build::Utils::lib_file( "Wx/$_" ) ) } @api ),
297 sub manifypods_core {
300 s{([\\/])build::}{$1} foreach values %{$self->{MAN3PODS}};
302 return $self->SUPER::manifypods_core;