diff options
author | Nicholas Clark <nick@ccl4.org> | 2001-10-13 01:07:31 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-13 23:17:31 +0000 |
commit | 3e6e4ea82051ddca64991170b80a80549242e4b5 (patch) | |
tree | eacc4a9bed6c60ab750240fe09cc1b368e3667ab /utils | |
parent | 289e7e34b986656573013f1f4e82f2e7a46d8a46 (diff) | |
download | perl-3e6e4ea82051ddca64991170b80a80549242e4b5.tar.gz |
Re: default module version for h2xs (was Re: [PATCH] Re: What sort of Makefile.PL should h2xs write?)
Message-ID: <20011013000731.D67535@plum.flirble.org>
p4raw-id: //depot/perl@12432
Diffstat (limited to 'utils')
-rw-r--r-- | utils/h2xs.PL | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/utils/h2xs.PL b/utils/h2xs.PL index b8b91e807f..100d6b113d 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -126,7 +126,8 @@ For versions < 5.6.0, the changes are. - no 'use warnings' Specifying a compatibility version higher than the version of perl you -are using to run h2xs will have no effect. +are using to run h2xs will have no effect. If unspecified h2xs will default +to compatibility with the version of perl you are using to run h2xs. =item B<-c>, B<--omit-constant> @@ -551,8 +552,20 @@ if( $opt_b ){ usage "You must provide the backwards compatibility version in X.Y.Z form. " . "(i.e. 5.5.0)\n"; my ($maj,$min,$sub) = split(/\./,$opt_b,3); - $compat_version = sprintf("%d.%03d%02d",$maj,$min,$sub); -} + if ($maj < 5 || ($maj == 5 && $min < 6)) { + $compat_version = sprintf("%d.%03d%02d",$maj,$min,$sub); + } else { + $compat_version = sprintf("%d.%03d%03d",$maj,$min,$sub); + } +} else { + my ($maj,$min,$sub) = $compat_version =~ /(\d+)\.(\d\d\d)(\d\d\d?)/; + 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 +specify a minimum perl version with the -b option. + +EOF +} if( $opt_v ){ $TEMPLATE_VERSION = $opt_v; |