diff options
Diffstat (limited to 'Makefile.PL')
-rw-r--r-- | Makefile.PL | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Makefile.PL b/Makefile.PL index 702e5a8..3d1902e 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -21,6 +21,8 @@ use Alien::Base::Wrapper qw( Alien::Libxml2 ); use ExtUtils::MakeMaker; use Config; +my $SKIP_SAX_INSTALL = $ENV{SKIP_SAX_INSTALL}; + my %ConfigReqs = ( "Alien::Libxml2" => '0.14', "Alien::Base::Wrapper" => 0, @@ -141,6 +143,26 @@ delete $WriteMakefileArgs{LICENSE} WriteMakefile(%WriteMakefileArgs); +# append the install method to include the SAX parser INI file changes +sub MY::install { + package MY; + my $script = shift->SUPER::install(@_); + if ( $SKIP_SAX_INSTALL ) { + warn "Note: 'make install' will skip XML::LibXML::SAX registration with XML::SAX!\n"; + } + else { + $script =~ s/install :: (.*)$/install :: $1 install_sax_driver/m; + $script .= <<"INSTALL"; + +install_sax_driver : +\t-\@\$(PERL) -I\$(INSTALLSITELIB) -I\$(INSTALLSITEARCH) -MXML::SAX -e "XML::SAX->add_parser(q(XML::LibXML::SAX::Parser))->save_parsers()" +\t-\@\$(PERL) -I\$(INSTALLSITELIB) -I\$(INSTALLSITEARCH) -MXML::SAX -e "XML::SAX->add_parser(q(XML::LibXML::SAX))->save_parsers()" + +INSTALL + } + return $script; +} + # helper functions to build the Makefile sub MY::manifypods { package MY; |