[Module::Build] [PATCH] have_c_compiler() die's if there is no C compiler
Status: Beta
Brought to you by:
kwilliams
|
From: John P. <jpe...@ro...> - 2006-02-19 16:53:29
|
This should have the correct behavior on machines without any C compiler at all:
=== 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). :(
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
|