1 require 5.00503; 2 use strict; 3 use ExtUtils::MakeMaker; 4 5 use lib qw( ./lib ); 6 7 $| = 1; 8 9 eval q| require JSON |; 10 11 # B module can't install? I'm not careful for such a problem. 12 # Leave us alone today? 13 if ($@) { 14 print "We try to look up lib/JSON.pm, but in vain. B module can't install?\n"; 15 print "Set the environmental variable 'PERL_DL_NONLAZY' with 0.\n"; 16 print "And see to ExtUtils::MM_Unix.\n"; 17 print "perl says : $@"; 18 print "We do not make Makefile by requiring Perl version 7.0.\n"; 19 require 7.0000; 20 } 21 22 23 my $version = JSON->VERSION; 24 my $message; 25 26 27 print <<EOF; 28 Welcome to JSON (v.$version) 29 ============================= 30 $message 31 32 ************************** CAUTION ************************** 33 * This is 'JSON version 2' and there are many differences * 34 * to version 1.xx * 35 * Please check your applications useing old version. * 36 * See to 'INCOMPATIBLE CHANGES TO OLD VERSION' and 'TIPS' * 37 ************************************************************* 38 39 40 EOF 41 42 43 WriteMakefile( 44 'NAME' => 'JSON', 45 'VERSION_FROM' => 'lib/JSON.pm', # finds $VERSION 46 'PREREQ_PM' => { 47 'Test::More' => 0, 48 }, 49 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 50 (ABSTRACT_FROM => 'lib/JSON.pm', # retrieve abstract from module 51 AUTHOR => 'Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>') : ()), 52 ( $ExtUtils::MakeMaker::VERSION >= 6.3002 ? ('LICENSE' => 'perl', ) : () ), 53 54 ( $ExtUtils::MakeMaker::VERSION >= 6.46 ? ( 55 'META_MERGE' => { 56 resources => { 57 repository => 'https://github.com/makamaka/JSON', 58 }, 59 recommends => { 60 'JSON::XS' => JSON->require_xs_version, 61 }, 62 } ) : () 63 ), 64 ); 65 66 67 if ($] < 5.006) { # I saw to http://d.hatena.ne.jp/asakusabashi/20051231/p1 68 open(IN, "Makefile"); 69 open(OUT,">Makefile.tmp") || die; 70 while(<IN>) { 71 s/PERL_DL_NONLAZY=1//g; 72 print OUT; 73 } 74 close(OUT); 75 close(IN); 76 rename("Makefile.tmp" => "Makefile"); 77 } 78