Pass $Config{cc} to charmonizer verbatim Don't split $Config{cc} into compiler command and arguments when passing them to charmonizer. Pass the unmodified string as `--cc` option even if it contains spaces. This makes compiler values like `ccache cc` work.
Fixes CLOWNFISH-111. Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/fd6393d4 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/fd6393d4 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/fd6393d4 Branch: refs/heads/0.6 Commit: fd6393d4c77121d327c3a7a03f71867997256b3f Parents: 9bf89ad Author: Nick Wellnhofer <wellnho...@aevum.de> Authored: Tue Nov 29 11:34:08 2016 +0100 Committer: Nick Wellnhofer <wellnho...@aevum.de> Committed: Tue Nov 29 11:34:08 2016 +0100 ---------------------------------------------------------------------- compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fd6393d4/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm ---------------------------------------------------------------------- diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm index 247aec0..73ae65e 100644 --- a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm +++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm @@ -52,7 +52,7 @@ my $CHARMONY_PM_PATH = 'Charmony.pm'; sub ACTION_charmony { my $self = shift; - my ($cc, @cc_args) = $self->split_like_shell($self->config('cc')); + my $cc = $self->config('cc'); my $is_msvc = lc($cc) =~ /^cl\b/; my $charmonizer_c = $self->charmonizer_params('charmonizer_c'); my $create_makefile = $self->charmonizer_params('create_makefile'); @@ -60,7 +60,7 @@ sub ACTION_charmony { $self->add_to_cleanup($CHARMONIZER_EXE_PATH); if ( !$self->up_to_date( $charmonizer_c, $CHARMONIZER_EXE_PATH ) ) { print "\nCompiling $CHARMONIZER_EXE_PATH...\n\n"; - my @command = ($cc, @cc_args, $charmonizer_c); + my @command = ( $self->split_like_shell($cc), $charmonizer_c ); if ($is_msvc) { push @command, "/Fe$CHARMONIZER_EXE_PATH"; } @@ -88,7 +88,7 @@ sub ACTION_charmony { # Prepare arguments to charmonizer. my @command = ( $CHARMONIZER_EXE_PATH, - "--cc=$cc", + "--cc=$cc", # May contain spaces and args. '--host=perl', '--enable-c', '--enable-perl', @@ -105,7 +105,7 @@ sub ACTION_charmony { push @command, '--disable-threads'; } push @command, ( - '--', @cc_args, $self->config('ccflags'), + '--', $self->config('ccflags'), '-I' . File::Spec->catdir($self->config('archlibexp'), 'CORE'), ); if ( $ENV{CHARM_VALGRIND} ) {