~ubuntu-branches/ubuntu/wily/libxml-bare-perl/wily

« back to all changes in this revision

Viewing changes to Makefile.PL

  • Committer: Package Import Robot
  • Author(s): Nuno Carvalho, gregor herrmann, Salvatore Bonaccorso, Axel Beckert, Nuno Carvalho
  • Date: 2013-09-17 15:54:28 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130917155428-4d0xb5cissw2323f
Tags: 0.53-1
* Team upload.

[ gregor herrmann ]
* debian/control: update {versioned,alternative} (build) dependencies.

[ Salvatore Bonaccorso ]
* Change Vcs-Git to canonical URI (git://anonscm.debian.org)
* Change search.cpan.org based URIs to metacpan.org based URIs

[ Axel Beckert ]
* debian/copyright: migrate pre-1.0 format to 1.0 using "cme fix dpkg-
  copyright"

[ Nuno Carvalho ]
* New upstream release.
* debian/copyright: update copyright years.
* debian/control: update standards version.
* debian/control: update debhelper required version, in order to pass all
  the hardening flags to EUMM.
* Add lintian override to apparently false-positive warning.
* Add set of patches accepted upstream but still not included in this
  release, visit https://rt.cpan.org/Public/Bug/Display.html?id=88155
  for details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This Makefile.PL for  was generated by Dist::Zilla.
2
 
# Don't edit it but the dist.ini used to construct it.
3
 
BEGIN { require 5.008; }
4
 
use strict;
5
 
use warnings;
6
 
use ExtUtils::MakeMaker 6.30;
7
 
 
8
 
my %WriteMakefileArgs = (
9
 
  'ABSTRACT' => 'Minimal XML parser implemented via a C state engine',
10
 
  'AUTHOR' => 'David Helkowski <cpan@codechild.com>, Nigel Metheringham <nigelm@cpan.org>',
11
 
  'BUILD_REQUIRES' => {
12
 
    'Data::Dumper' => '0',
13
 
    'English' => '0',
14
 
    'File::Find' => '0',
15
 
    'File::Temp' => '0',
16
 
    'Scalar::Util' => '0',
17
 
    'Test::Harness' => '0',
18
 
    'Test::More' => '0.94'
19
 
  },
20
 
  'CONFIGURE_REQUIRES' => {
21
 
    'ExtUtils::MakeMaker' => '6.30'
22
 
  },
23
 
  'DISTNAME' => 'XML-Bare',
24
 
  'EXE_FILES' => [],
25
 
  'LICENSE' => 'gpl',
26
 
  'NAME' => 'XML::Bare',
27
 
  'OBJECT' => 'Bare.o parser.o',
28
 
  'PREREQ_PM' => {
29
 
    'Carp' => '0',
30
 
    'DynaLoader' => '0',
31
 
    'Exporter' => '0',
32
 
    'bytes' => '0',
33
 
    'utf8' => '0',
34
 
    'vars' => '0'
35
 
  },
36
 
  'VERSION' => '0.47',
37
 
  'XSOPT' => '-nolinenumbers',
38
 
  'test' => {
39
 
    'TESTS' => 't/*.t'
40
 
  }
 
1
#!/usr/bin/perl
 
2
use ExtUtils::MakeMaker;
 
3
require 5.006;
 
4
my @basics = ( 
 
5
    AUTHOR       => 'David Helkowski <cpan@codechild.com>',
 
6
    ABSTRACT     => 'A minimal XML parser / schema checker / pretty-printer using C internally.',
 
7
    NAME         => 'XML::Bare',
 
8
    VERSION_FROM => 'Bare.pm',
 
9
    XSOPT        => '-nolinenumbers', # line number defines were causing issues on some platforms
 
10
    BUILD_REQUIRES => {
 
11
        'Data::Dumper' => 0,
 
12
        'English' => 0,
 
13
        'File::Find' => 0,
 
14
        'File::Temp' => 0,
 
15
        'Scalar::Util' => 0,
 
16
        'Test::Harness' => 0,
 
17
        'Test::More' => '0.94'
 
18
    },
 
19
    CONFIGURE_REQUIRES => {
 
20
        'ExtUtils::MakeMaker' => '6.30'
 
21
    },
 
22
    PREREQ_PM => {
 
23
        Carp => 0,
 
24
        DynaLoader => 0,
 
25
        Exporter => 0
 
26
    },
41
27
);
42
28
 
43
 
 
44
 
unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
45
 
  my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
46
 
  my $pp = $WriteMakefileArgs{PREREQ_PM};
47
 
  for my $mod ( keys %$br ) {
48
 
    if ( exists $pp->{$mod} ) {
49
 
      $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
50
 
    }
51
 
    else {
52
 
      $pp->{$mod} = $br->{$mod};
53
 
    }
54
 
  }
55
 
}
56
 
 
57
 
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
58
 
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
59
 
 
60
 
WriteMakefile(%WriteMakefileArgs);
 
29
my $cc = getcc();
 
30
if( $cc ) {
 
31
  push( @basics, CC => $cc );
 
32
}
 
33
if( $ExtUtils::MakeMaker::VERSION >= 6.31 ) {
 
34
  push( @basics, LICENSE => 'perl' );
 
35
}
 
36
 
 
37
if( $^O eq 'MSWin32' && !$cc ) {
 
38
  gen_msvc(); # special case for msvc
 
39
}
 
40
elsif( $^O eq 'darwin' ) {
 
41
  gen_darwin();
 
42
}
 
43
elsif( $^O eq 'solaris' ) {
 
44
  gen_solaris();
 
45
}
 
46
else {
 
47
  gen_cc(); # all others
 
48
}
 
49
sub gen_msvc {
 
50
  require Config;
 
51
  my $libpath = Config->{'archlibexp'};
 
52
  my $ver = $]*1000000;
 
53
  my $sub = $ver % 1000;
 
54
  $ver -= $sub;
 
55
  $ver /= 1000;
 
56
  my $minor = $ver % 1000;
 
57
  $ver -= $minor;
 
58
  my $major = $ver / 1000;
 
59
  WriteMakefile( @basics,
 
60
    CCFLAGS   => "/MT /DWIN32 /TP /DNOSTRING",
 
61
    LIBS      => ["$libpath\\core\\perl$major$minor.lib"],
 
62
    OBJECT    => 'Bare.o parser.o',
 
63
    LDDLFLAGS => '/DLL /NODEFAULTLIB:libcmt',
 
64
    #OPTIMIZE  => '-Zl -DNDEBUG -O1', # Because -MD is included by default BLEH
 
65
  );
 
66
}
 
67
sub gen_cc {
 
68
  WriteMakefile( @basics,
 
69
    OBJECT    => 'Bare.o parser.o',
 
70
    LDDLFLAGS => '-shared -L/usr/local/lib',
 
71
  );
 
72
}
 
73
sub gen_solaris {
 
74
  WriteMakefile( @basics,
 
75
    LIBS      => ['-lm'],
 
76
    OBJECT    => 'Bare.o parser.o',
 
77
    LDDLFLAGS => '-G -L/usr/local/lib', # -G is equiv of -shared
 
78
  );
 
79
}
 
80
sub gen_darwin {
 
81
  if( substr(`which gcc`,0,2) eq 'no' ) {
 
82
    print "XCode must be installed.\n";
 
83
    exit 1;
 
84
  }
 
85
  WriteMakefile( @basics,
 
86
    LIBS      => ['-lm'],
 
87
    OBJECT    => 'Bare.o parser.o',
 
88
    CCFLAGS   => "-dynamiclib -DDARWIN -fno-common",
 
89
    LDDLFLAGS => '',
 
90
  );
 
91
}
 
92
sub getcc {
 
93
  my $div = (substr($ENV{'PATH'},0,1) eq '/') ? ':' : ';';
 
94
  my @path = split($div,$ENV{'PATH'});
 
95
  foreach my $dir ( @path ) {
 
96
    return 'gcc' if( -e "$dir/gcc" || -e "$dir/gcc.exe" ); # prefer gcc
 
97
    return 'cc'  if( -e "$dir/cc"  || -e "$dir/cc.exe"  );
 
98
  }               
 
99
  return 0;
 
100
}
 
101
 
 
102
# The following are hacks to force static linking and so remove need for msvcr## dll
 
103
package MY;
 
104
 
 
105
sub cflags {
 
106
  my $res = shift->SUPER::cflags( @_ );
 
107
  if( $^O eq 'MSWin32' ) {
 
108
    $res =~ s/-O1/-O2/g;
 
109
    $res =~ s/-MD/-MT/g;
 
110
  }
 
111
  return $res;
 
112
}
 
113
 
 
114
sub const_loadlibs {
 
115
  my $res = shift->SUPER::const_loadlibs( @_ );
 
116
  if( $^O eq 'MSWin32' ) {
 
117
    $res =~ s/msvcrt\.lib/libcmt\.lib/gi;
 
118
  }
 
119
  return $res;
 
120
}
61
121