diff options
-rw-r--r-- | src/mkhelp.pl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mkhelp.pl b/src/mkhelp.pl index 8b7f72157..4b540744c 100644 --- a/src/mkhelp.pl +++ b/src/mkhelp.pl @@ -113,8 +113,19 @@ print <<HEAD HEAD ; if($c) { - # if compressed - use IO::Compress::Gzip; + # If compression requested, check that the Gzip module is available + # or else disable compression + $c = eval + { + require IO::Compress::Gzip; + IO::Compress::Gzip->import(); + 1; + }; + print STDERR "Warning: compression requested but Gzip is not available\n" if (!$c) +} + +if($c) +{ my $content = join("", @out); my $gzippedContent; IO::Compress::Gzip::gzip( |