File: Makefile.PL.embedded

package info (click to toggle)
libdbd-mysql-perl 4.041-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,068 kB
  • ctags: 409
  • sloc: ansic: 4,511; perl: 817; makefile: 27; sh: 22
file content (35 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (9)
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
use ExtUtils::MakeMaker;
use File::Path;

$/="\n";

chomp($pwd = `pwd`); $pwd = "." if ($pwd eq '');
require "$pwd/Makefile.conf" || die "Can't read Configuration file: $!\n";

if (! -d "$pwd/t/test")
{
  eval { mkpath "$pwd/t/test" };
  if ($@)
  {
    print "Couldn't create $pwd/t/test directory for test database: $@\n";
  }
}
ExtUtils::MakeMaker::WriteMakefile(%{$o});

package MY;

no warnings;

sub MY::postamble {
  require DBI::DBD;
  "\n" . DBI::DBD::dbd_postamble(@_);
};

sub MY::dynamic_lib {
  my $self = shift;
  my $result = $self->SUPER::dynamic_lib(@_);
  if (!$::opt->{nocatchstderr}  &&  $result =~ /\$\(LD\)/) {
    $result =~ s/(\$\(LD\))/\$\(PERL\) myld \$(LD)/sg;
  }
  return $result;
};