Re: [Module::Build] [PATCH] have_c_compiler() die's if there is no C compiler
Status: Beta
Brought to you by:
kwilliams
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-02-19 17:38:46
|
On Sun, Feb 19, 2006 at 11:53:45AM -0500, John Peacock wrote:
> This should have the correct behavior on machines without any C
> compiler at all:
For benefit of anyone else reading this, now or in the archives, I
want to emphasize that have_c_compiler doesn't check for "any C
compiler at all". It checks for ExtUtils::CBuilder being installed
and able to compile and link a sample library.
> === lib/Module/Build/Base.pm
> ==================================================================
> --- lib/Module/Build/Base.pm (revision 1834)
> +++ lib/Module/Build/Base.pm (local)
> @@ -3497,7 +3497,8 @@
> return $p->{have_compiler} if defined $p->{have_compiler};
>
> $self->log_verbose("Checking if compiler tools configured... ");
> - my $have = $self->_cbuilder->have_compiler;
> + my $have = eval { $self->_cbuilder->have_compiler };
> + $have = 0 if $@; # no compiler support possible
> $self->log_verbose($have ? "ok.\n" : "failed.\n");
> return $p->{have_compiler} = $have;
> }
>
> It's kind of not fair to provide a function testing whether there is an
> effective C compiler available and then die if there isn't (and no fallback
> either). :(
|