use strict; use ExtUtils::MakeMaker; use Config; use File::Spec; my ($cc, $exe) = @Config{'cc', '_exe'}; $cc =~ s/\s+-.+$//; #remove possible trailing options my $comp = (split /\./, $cc)[0]; my $found = 0; my $delim = $Config::Config{path_sep}; if ($cc =~ m|/:\[|) { $found = -f "$comp$exe"; } # $Config{cc} might be something like '/some/place/cc' elsif ($cc =~ m|/|) { $found = -f "$comp$exe" || -l $cc; } # $Config{cc} might be something like 'ccache cc' elsif ($cc =~ m|ccache|) { my @cc = split /\s+/, $cc; $found = -f "$cc[0]$exe" || -l $cc[0]; if($found && $cc[1]) {$found = -f "$cc[1]$exe" || -l $cc[1]} } else { my $comp = (split /\./, $cc)[0]; for my $lib (split $delim, $ENV{PATH}) { $found = -f File::Spec->catfile($lib,"$comp$exe") and last; } } print < 'Inline::C', clean => {FILES => '_Inline_test'}, ) } else { open MF, "> Makefile" or die "Can't open Makefile for output"; print MF <<'END'; all:: test:: clean:: END close MF; }