]> mj.ucw.cz Git - leo.git/blob - perl/UCW/Configure/Doc.pm
Updated UCW::Configure to the version from current LibUCW
[leo.git] / perl / UCW / Configure / Doc.pm
1 # UCW Library configuration system: documentation requirements
2 # (c) 2008 Michal Vaner <vorner@ucw.cz>
3
4 package UCW::Configure::Doc;
5 use UCW::Configure;
6
7 use strict;
8 use warnings;
9
10 if (!IsGiven("CONFIG_DOC") || IsSet("CONFIG_DOC")) {
11         Test("HAVE_ASCII_DOC", "Checking for AsciiDoc", sub {
12                 my $version = `asciidoc --version 2>&1`;
13                 return "none" if !defined $version || $version eq "";
14                 my( $vnum ) = $version =~ / (\d+\.\S*)$/;
15                 return $vnum;
16         });
17
18         my( $major ) = Get("HAVE_ASCII_DOC") =~ /^(\d+)/;
19         if (defined $major && $major >= 7) {
20                 Set("CONFIG_DOC");
21         } else {
22                 if (IsGiven("CONFIG_DOC")) {
23                         Fail("Need asciidoc >= 7\n");
24                 } else {
25                         Warn("Need asciidoc >= 7 to build documentation\n");
26                         UnSet("CONFIG_DOC");
27                 }
28         }
29 }
30
31 # We succeeded
32 1;