Support arguments in $Config{cc}
Some Perl setups have a command with additional arguments in $Config{cc}
like 'ccache cc'.
Fixes CLOWNFISH-16.
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
index 2e49e73..a37b6b4 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
@@ -74,16 +74,18 @@
}
# Prepare arguments to charmonizer.
+ my @cc_args = $self->split_like_shell($self->config('cc'));
+ my $cc = shift(@cc_args);
my @command = (
$CHARMONIZER_EXE_PATH,
- '--cc=' . $self->config('cc'),
+ "--cc=$cc",
'--enable-c',
'--enable-perl',
);
if ( !$self->config('usethreads') ) {
push @command, '--disable-threads';
}
- push @command, ( '--', $self->config('ccflags') );
+ push @command, ( '--', @cc_args, $self->config('ccflags') );
if ( $ENV{CHARM_VALGRIND} ) {
unshift @command, "valgrind", "--leak-check=yes";
}