--- swish-e-2.4.4/perl/Makefile.PL 2005-05-20 17:47:43.000000000 +1200 +++ swish-e-2.4.4/perl/Makefile.PL 2009-03-08 11:37:24.075404968 +1300 @@ -2,6 +2,7 @@ use strict; use ExtUtils::MakeMaker; +use Carp; use Config; # for path separator use File::Spec; # for catpath use File::Basename; # for locating swish-e binary based on location of swish-config @@ -22,6 +23,7 @@ NORECURS => 1, # keep it from recursing into subdirectories DIR => [], XSPROTOARG => '-noprototypes', + CCFLAGS => '-I../src', PREREQ_PM => { 'File::Spec' => '0.8', }, @@ -81,8 +83,7 @@ EOF $SIG{__DIE__} = sub { - print STDERR "\n ** ERROR: ", @_; - print STDERR " Run perl Makefile.PL SWISHHELP for options\n\n"; + Carp::cluck("** ERROR: ", @_ , "\n Run perl Makefile.PL SWISHHELP for options\n\n"); exit 1; }; @@ -107,7 +108,7 @@ test_version( $swish_config{VERSION}, $MIN_VERSION ) - or die "Swish version $swish_config{VERSION} is older than required version $MIN_VERSION\n"; + or Carp::croak("Swish version $swish_config{VERSION} is older than required version $MIN_VERSION\n"); @@ -123,10 +124,19 @@ $config{test}{TESTS} = 't/dummy.t'; } - - - -WriteMakefile( %make_maker_opts, %config ); +{ + # MakeMaker uses "Eval" for type-checking of sorts + # Hooking __DIE__ for it will result in the tests dying + # When there is really nothing wrong, and this causes + # Build to Exit! D: + # see perldoc -f eval for details + eval { + local $SIG{__DIE__} = 'DEFAULT'; + WriteMakefile( %make_maker_opts, %config ); + undef $@; + }; + die $@ if $@; +} #----------------------------------------------------------------------------------