. "(i.e. 5.5.0)\n";
my ($maj,$min,$sub) = split(/\./,$opt_b,3);
if ($maj < 5 || ($maj == 5 && $min < 6)) {
- $compat_version = sprintf("%d.%03d%02d",$maj,$min,$sub);
+ $compat_version =
+ $sub ? sprintf("%d.%03d%02d",$maj,$min,$sub) :
+ sprintf("%d.%03d", $maj,$min);
} else {
- $compat_version = sprintf("%d.%03d%03d",$maj,$min,$sub);
+ $compat_version =
+ $sub ? sprintf("%d.%03d%03d",$maj,$min,$sub) :
+ sprintf("%d.%03d", $maj,$min);
}
} else {
- my ($maj,$min,$sub) = $compat_version =~ /(\d+)\.(\d\d\d)(\d\d\d?)/;
+ my ($maj,$min,$sub) = $compat_version =~ /(\d+)\.(\d\d\d)(\d*)/;
+ $sub ||= 0;
warn sprintf <<'EOF', $maj,$min,$sub;
Defaulting to backwards compatibility with perl %d.%d.%d
If you intend this module to be compatible with earlier perl versions, please
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
- 'NAME' => '$module',
- 'VERSION_FROM' => '$modfname.pm', # finds \$VERSION
- 'PREREQ_PM' => {$prereq_pm}, # e.g., Module::Name => 1.1
- (\$] >= 5.005 ? ## Add these new keywords supported since 5.005
- (ABSTRACT_FROM => '$modfname.pm', # retrieve abstract from module
- AUTHOR => '$author <$email>') : ()),
+ NAME => '$module',
+ VERSION_FROM => '$modfname.pm', # finds \$VERSION
+ PREREQ_PM => {$prereq_pm}, # e.g., Module::Name => 1.1
+ (\$] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT_FROM => '$modfname.pm', # retrieve abstract from module
+ AUTHOR => '$author <$email>') : ()),
END
if (!$opt_X) { # print C stuff, unless XS is disabled
$opt_F = '' unless defined $opt_F;
EOC
print PL <<END;
- 'LIBS' => ['$extralibs'], # e.g., '-lm'
- 'DEFINE' => '$opt_F', # e.g., '-DHAVE_SOMETHING'
-$Icomment 'INC' => '$I', # e.g., '${Ihelp}-I/usr/include/other'
+ LIBS => ['$extralibs'], # e.g., '-lm'
+ DEFINE => '$opt_F', # e.g., '-DHAVE_SOMETHING'
+$Icomment INC => '$I', # e.g., '${Ihelp}-I/usr/include/other'
END
my $C = grep {$_ ne "$modfname.c"}
EOC
print PL <<END;
-$Ccomment $Cpre\'OBJECT' => '\$(O_FILES)', # link all the C files too
+$Ccomment ${Cpre}OBJECT => '\$(O_FILES)', # link all the C files too
END
} # ' # Grr
print PL ");\n";