summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2005-01-17 16:57:10 +0000
committerSteve Hay <SteveHay@planit.com>2005-01-17 16:57:10 +0000
commit22c912faaf945ceea91cfe4270b8d3a749048950 (patch)
treee2067b100530371ea3faae0473e6f900886ca6b8 /win32
parentb073e9b36f3d4efdd506165a3b6548dac658ea08 (diff)
downloadperl-22c912faaf945ceea91cfe4270b8d3a749048950.tar.gz
Get $Config{ccversion} or $Config{gccversion} filled in on Win32
p4raw-id: //depot/perl@23806
Diffstat (limited to 'win32')
-rw-r--r--win32/config_sh.PL16
1 files changed, 16 insertions, 0 deletions
diff --git a/win32/config_sh.PL b/win32/config_sh.PL
index e1bc2dd691..6381cc9a9e 100644
--- a/win32/config_sh.PL
+++ b/win32/config_sh.PL
@@ -72,6 +72,22 @@ $opt{'version_patchlevel_string'} .= " patchlevel $opt{PERL_PATCHLEVEL}" if exis
$opt{'osvers'} = join '.', (Win32::GetOSVersion())[1,2];
+if (exists $opt{cc}) {
+ # cl and bcc32 version detection borrowed from Test::Smoke's configsmoke.pl
+ if ($opt{cc} eq 'cl') {
+ my $output = `cl --version 2>&1`;
+ $opt{ccversion} = $output =~ /^.*Version\s+([\d.]+)/ ? $1 : '?';
+ }
+ elsif ($opt{cc} eq 'bcc32') {
+ my $output = `bcc32 --version 2>&1`;
+ $opt{ccversion} = $output =~ /(\d+.*)/ ? $1 : '?';
+ $opt{ccversion} =~ s/\s+copyright.*//i;
+ }
+ elsif ($opt{cc} eq 'gcc') {
+ chomp($opt{gccversion} = `gcc -dumpversion`);
+ }
+}
+
$opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
$opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]
unless $opt{'cf_email'};