ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ExtUtils-CXX/CXX.pm
(Generate patch)

Comparing ExtUtils-CXX/CXX.pm (file contents):
Revision 1.2 by root, Mon Aug 14 05:26:35 2017 UTC vs.
Revision 1.3 by root, Sun Mar 25 06:06:48 2018 UTC

64 64
65package ExtUtils::CXX; 65package ExtUtils::CXX;
66 66
67use common::sense; 67use common::sense;
68 68
69our $VERSION = 0.03; 69our $VERSION = '1.0';
70 70
71use Exporter 'import'; 71use Exporter 'import';
72 72
73our @EXPORT = qw(extutils_cxx); 73our @EXPORT = qw(extutils_cxx);
74 74
90 xlc => "xlC", 90 xlc => "xlC",
91 cc => "g++", 91 cc => "g++",
92 c89 => "g++", 92 c89 => "g++",
93); 93);
94 94
95our $PREFIX = qr{(?:\S+[\/\\])? (?:ccache|distcc)}x;
96
95sub _ccrepl { 97sub _ccrepl {
96 my ($cfgvar, $env) = @_; 98 my ($cfgvar, $env) = @_;
97 99
98 my $tie = tied %Config; 100 my $tie = tied %Config;
99 101
104 if ($env) { 106 if ($env) {
105 $val =~ s/^\S+/$env/; 107 $val =~ s/^\S+/$env/;
106 } else { 108 } else {
107 keys %cc; 109 keys %cc;
108 while (my ($k, $v) = each %cc) { 110 while (my ($k, $v) = each %cc) {
109 $val =~ s/^ (\S*[\/\\])? $k (-|\s|\d|$) /$1$v$2/x 111 $val =~ s/^ ((?:$PREFIX\s+)? \S*[\/\\])? $k (-|\s|\d|$) /$1$v$2/x
110 and goto done; 112 and goto done;
111 } 113 }
112 114
113 $val =~ s/^\S+/g++/; 115 $val =~ s/^($PREFIX\s+)? \S+/$1g++/x;
114 116
115 done: ; 117 done: ;
116 } 118 }
117 119
118 $tie->{$cfgvar} = $val; 120 $tie->{$cfgvar} = $val;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines