On Mar 24, 2006, at 9:29 PM, John E. Malmberg wrote:


Both lib/ExtUtils/CBuilder/t/01-basic.t and lib/ExtUtils/CBuilder/t/ 02-link both pass with that.


Cool - then I assume this small rewrite of that method also makes things pass?

---------------------------------------------
sub arg_defines {
  my ($self, %args) = @_;

  s/"/""/g foreach values %args;

  my @config_defines;

# VMS can only have one define qualifier; add the one from config, if any. if ($self->{config}{ccflags} =~ s{/ def[^=]+ =+ \(? ([^\/\)] *) } {}ix) {
    push @config_defines, $1;
  }

  return '' unless keys(%args) || @config_defines;

  return ('/define=('
          . join(',',
                 @config_defines,
map "\"$_" . ( length($args{$_}) ? "=$args{$_}" : '') . "\"",
                     keys %args)
          . ')');
}
---------------------------------------------


Note that there's perhaps still a problem here if someone's trying to override a $Config{ccflags} setting with one of the %args, because both will make it into the final string. I think the only way to solve that would be to parse keys & values out of the ccflags string and stick them in the hash too if they're not already there. But I'm not going to work on that just yet.

 -Ken

Reply via email to