summaryrefslogtreecommitdiff
path: root/configpm
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-09-29 15:52:24 +0100
committerNicholas Clark <nick@ccl4.org>2009-09-29 16:26:41 +0100
commit4a5df3864868b2e99a39b861035a682e1ea6cb93 (patch)
treee574e9fcb49e9f9d77c2b8d481fe2fd7a7d891da /configpm
parente60ffd4f1584916e71476ec18523e5a74e213530 (diff)
downloadperl-4a5df3864868b2e99a39b861035a682e1ea6cb93.tar.gz
Move the implementation of ./perl -V to Internals::V and Config::_V
Previously it was a Perl program generated by code embedded in perl.c, with conditional compilation logic, hence a combination of C pre-processor, C and Perl.
Diffstat (limited to 'configpm')
-rwxr-xr-xconfigpm39
1 files changed, 39 insertions, 0 deletions
diff --git a/configpm b/configpm
index 5b6a4e68e0..9fb30eeaeb 100755
--- a/configpm
+++ b/configpm
@@ -122,6 +122,45 @@ package Config;
use strict;
# use warnings; Pulls in Carp
# use vars pulls in Carp
+
+sub _V {
+ my ($bincompat, $non_bincompat, $date, $osname, @patches) = Internals::V();
+
+ my $opts = join ' ', sort split ' ', "$bincompat $non_bincompat";
+
+ # wrap at 76 columns.
+
+ $opts =~ s/(?=.{53})(.{1,53}) /$1\n /mg;
+
+ print Config::myconfig();
+ if ($^O eq 'VMS') {
+ print "\nCharacteristics of this PERLSHR image: \n";
+ } else {
+ print "\nCharacteristics of this binary (from libperl): \n";
+ }
+
+ print " Compile-time options: $opts\n";
+
+ if (@patches) {
+ print " Locally applied patches:\n";
+ print "\t$_\n" foreach @patches;
+ }
+
+ print " Built under $osname\n";
+
+ print " $date\n" if defined $date;
+
+ my @env = map { "$_=\"$ENV{$_}\"" } sort grep {/^PERL/} keys %ENV;
+ push @env, "CYGWIN=\"$ENV{CYGWIN}\"" if $^O eq 'cygwin';
+
+ if (@env) {
+ print " \%ENV:\n";
+ print " $_\n" foreach @env;
+ }
+ print " \@INC:\n";
+ print " $_\n" foreach @INC;
+}
+
ENDOFBEG
my $myver = sprintf "%vd", $^V;