summaryrefslogtreecommitdiff
path: root/win32/config_sh.PL
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
commit2018b34778e5bd6adb24a41e62ec81aa880a20ff (patch)
treee2067b100530371ea3faae0473e6f900886ca6b8 /win32/config_sh.PL
parent96b96e0098295f23da078cabf7dcf4850b59a331 (diff)
downloadperl-2018b34778e5bd6adb24a41e62ec81aa880a20ff.tar.gz
Get $Config{ccversion} or $Config{gccversion} filled in on Win32
p4raw-id: //depot/perl@23806
Diffstat (limited to 'win32/config_sh.PL')
-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'};