2 # $Id: Makefile.PL,v 2.22 2017/10/06 22:21:53 dankogai Exp $
8 use ExtUtils::MakeMaker;
13 my %ARGV = map { my @r = split /=/,$_; defined $r[1] or $r[1]=1; @r } @ARGV;
14 $ARGV{DEBUG} and warn "$_ => $ARGV{$_}\n" for sort keys %ARGV;
15 $ENV{PERL_CORE} ||= $ARGV{PERL_CORE} if $ARGV{PERL_CORE};
16 # similar strictness as in core
17 my $ccflags = $Config{ccflags};
18 if (!$ENV{PERL_CORE}) {
19 if (my $gccver = $Config{gccversion}) {
20 $gccver =~ s/\.//g; $gccver =~ s/ .*//;
21 $gccver .= "0" while length $gccver < 3;
23 $ccflags .= ' -Werror=declaration-after-statement' if $gccver > 412;
24 $ccflags .= ' -Wpointer-sign' if !$Config{d_cplusplus} and $gccver > 400;
25 $ccflags .= ' -fpermissive' if $Config{d_cplusplus};
40 my @exe_files = qw(bin/enc2xs
44 my @more_exe_files = qw(
47 my @pmlibdirs = qw(lib Encode);
49 $ARGV{MORE_SCRIPTS} and push @exe_files, @more_exe_files;
50 $ARGV{INSTALL_UCM} and push @pmlibdirs, "ucm";
54 EXE_FILES => \@exe_files,
55 VERSION_FROM => 'Encode.pm',
56 ABSTRACT_FROM=> 'Encode.pm',
57 AUTHOR => 'Dan Kogai <dankogai@dan.co.jp>',
58 OBJECT => '$(O_FILES)',
60 COMPRESS => 'gzip -9f',
62 DIST_DEFAULT => 'all tardist',
65 INC => '-I' . File::Spec->catfile( '.', 'Encode' ),
68 Exporter => '5.57', # use Exporter 'import';
69 parent => '0.221', # version bundled with 5.10.1
70 Storable => '0', # bundled with Perl 5.7.3
73 'Test::More' => '0.81_01',
75 PMLIBDIRS => \@pmlibdirs,
76 INSTALLDIRS => ($] < 5.011 ? 'perl' : 'site'),
79 repository => 'https://github.com/dankogai/p5-encode',
82 'Alex Davies <alex.davies@talktalk.net>',
83 'Alex Kapranoff <alex@kapranoff.ru>',
84 'Alex Vandiver <alex@chmrr.net>',
85 'Andreas J. Koenig <andreas.koenig@anima.de>',
86 'Andrew Pennebaker <andrew.pennebaker@networkedinsights.com>',
87 'Andy Grundman <andyg@activestate.com>',
88 'Anton Tagunov <tagunov@motor.ru>',
89 'Autrijus Tang <autrijus@autrijus.org>',
90 'Benjamin Goldberg <goldbb2@earthlink.net>',
91 'Bjoern Hoehrmann <derhoermi@gmx.net>',
92 'Bjoern Jacke <debianbugs@j3e.de>',
93 'bulk88 <bulk88@hotmail.com>',
94 'Craig A. Berry <craigberry@mac.com>',
95 'Curtis Jewell <csjewell@cpan.org>',
96 'Dan Kogai <dankogai@dan.co.jp>',
97 'Dave Evans <dave@rudolf.org.uk>',
98 'David Golden <dagolden@cpan.org>',
99 'David Steinbrunner <dsteinbrunner@pobox.com>',
100 'Deng Liu <dengliu@ntu.edu.tw>',
101 'Dominic Dunlop <domo@computer.org>',
103 'Elizabeth Mattijsen <liz@dijkmat.nl>',
104 'Flavio Poletti <flavio@polettix.it>',
105 'Gerrit P. Haase <gp@familiehaase.de>',
106 'Gisle Aas <gisle@ActiveState.com>',
107 'Graham Barr <gbarr@pobox.com>',
108 'Graham Knop <haarg@haarg.org>',
109 'Graham Ollis <perl@wdlabs.com>',
110 'Gurusamy Sarathy <gsar@activestate.com>',
111 'H.Merijn Brand <h.m.brand@xs4all.nl>',
112 'Hugo van der Sanden <hv@crypt.org>',
113 'chansen <chansen@cpan.org>',
114 'Chris Nandor <pudge@pobox.com>',
115 'Inaba Hiroto <inaba@st.rim.or.jp>',
116 'Jarkko Hietaniemi <jhi@iki.fi>',
117 'Jesse Vincent <jesse@fsck.com>',
118 'Jungshik Shin <jshin@mailaps.org>',
119 'Karen Etheridge <ether@cpan.org>',
120 'Karl Williamson <khw@cpan.org>',
121 'Kenichi Ishigaki <ishigaki@cpan.org>',
122 'KONNO Hiroharu <hiroharu.konno@bowneglobal.co.jp>',
123 'Laszlo Molnar <ml1050@freemail.hu>',
124 'Makamaka <makamaka@donzoko.net>',
125 'Mark-Jason Dominus <mjd@plover.com>',
126 'Masahiro Iuchi <masahiro.iuchi@gmail.com>',
127 'MATSUNO Tokuhiro <tokuhirom+cpan@gmail.com>',
128 'Mattia Barbon <mbarbon@dsi.unive.it>',
129 'Michael G Schwern <schwern@pobox.com>',
130 'Michael LaGrasta <michael@lagrasta.com>',
131 'Miron Cuperman <miron@hyper.to>',
132 'Moritz Lenz <moritz@faui2k3.org>',
133 'MORIYAMA Masayuki <msyk@mtg.biglobe.ne.jp>',
134 'Nick Ing-Simmons <nick@ing-simmons.net>',
135 'Nicholas Clark <nick@ccl4.org>',
136 'Olivier Mengué <dolmen@cpan.org>',
138 'Pali <pali@cpan.org>',
139 'Paul Marquess <paul_marquess@yahoo.co.uk>',
140 'Peter Prymmer <pvhp@best.com>',
141 'Peter Rabbitson <ribasushi@cpan.org>',
142 'Philip Newton <pne@cpan.org>',
143 'Piotr Fusik <pfusik@op.pl>',
144 'Rafael Garcia-Suarez <rgarciasuarez@mandriva.com>',
145 'Randy Stauner <randy@magnificent-tears.com>',
146 'Reini Urban <rurban@cpan.org>',
147 'Robin Barker <rmb1@cise.npl.co.uk>',
148 'SADAHIRO Tomoyuki <SADAHIRO@cpan.org>',
149 'Simon Cozens <simon@netthink.co.uk>',
150 'Slaven Rezic <SREZIC@cpan.org>',
151 'Spider Boardman <spider@web.zk3.dec.com>',
152 'Steve Hay <steve.m.hay@googlemail.com>',
153 'Steve Peters <steve@fisharerojo.org>',
154 'SUGAWARA Hajime <sugawara@hdt.co.jp>',
155 'SUZUKI Norio <ZAP00217@nifty.com>',
156 'szr8 <blz.marcel@gmail.com>',
157 'Tatsuhiko Miyagawa <miyagawa@bulknews.net>',
158 'Tels <perl_dummy@bloodgate.com>',
159 'Tony Cook <tony@develop-help.com>',
160 'Vadim Konovalov <vkonovalov@peterstar.ru>',
161 'Victor <victor@vsespb.ru>',
162 'Ville Skyttä <ville.skytta@iki.fi>',
163 'Vincent van Dam <vvandam@sandvine.com>',
164 'Yitzchak Scott-Thoennes <sthoenna@efn.org>',
176 # Find existing O_FILES
177 foreach my $f (@{$self->{'O_FILES'}})
181 my $x = $self->{'OBJ_EXT'};
182 # Add the table O_FILES
183 foreach my $e (keys %tables)
187 # Trick case-blind filesystems.
188 delete $o{'encode'.$x};
191 $self->{'O_FILES'} = [sort keys %o];
193 foreach my $table (sort keys %tables)
195 foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm))
197 push (@files,$table.$ext);
199 $self->{SOURCE} .= " $table.c"
200 if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/;
202 $self->{'clean'}{'FILES'} .= join(' ',@files);
209 my $dir = $self->catdir($self->curdir,'ucm');
210 my $str = "# Encode\$(OBJ_EXT) does not depend on .c files directly\n";
211 $str .= "# (except Encode.c), but on .h and .exh files written by enc2xs\n";
212 $str .= $^O eq 'MacOS' ? 'Encode.c.{$(MACPERL_BUILD_EXT_STATIC)}.o :' : 'Encode$(OBJ_EXT) :';
214 foreach my $table (sort keys %tables)
219 foreach my $table (sort keys %tables)
222 my $lengthsofar = length($str);
223 my $continuator = '';
224 my $enc2xs = $self->catfile('bin', 'enc2xs');
225 $str .= "$table.c : $enc2xs Makefile.PL";
226 foreach my $file (@{$tables{$table}})
228 $str .= $continuator.' '.$self->catfile($dir,$file);
229 if ( length($str)-$lengthsofar > 128*$numlines )
231 $continuator .= " \\\n\t";
237 my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : '';
238 $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform;
239 my $ucopts = '-"Q" -"O"';
241 qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n};
242 open (FILELIST, ">$table.fnm")
243 || die "Could not open $table.fnm: $!";
244 foreach my $file (@{$tables{$table}})
246 print FILELIST $self->catfile($dir,$file) . "\n";