]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/perl/UCW/Configure/Doc.pm
Updated years in all README's.
[libucw.git] / ucw / perl / UCW / Configure / Doc.pm
index fe5a8a14d2161ec86d4a461663a8ab1ade80f7eb..b1a701b4c69fb61c76d29161044de43a921be50e 100644 (file)
@@ -1,25 +1,31 @@
 # UCW Library configuration system: documentation requirements
 # (c) 2008 Michal Vaner <vorner@ucw.cz>
 
-package UCW::Configure::Paths;
+package UCW::Configure::Doc;
 use UCW::Configure;
 
 use strict;
 use warnings;
 
-Test("ASCII_DOC", "Checking for AsciiDoc", sub {
-       my $version = `asciidoc --version`;
-       return "none" if !defined $version || $version eq "";
-       my( $vnum ) = $version =~ / (\d+)\.\S*$/;
-       return "old" if $vnum < 7;
-       return "yes";
-});
+if (!IsGiven("CONFIG_DOC") || IsSet("CONFIG_DOC")) {
+       Test("HAVE_ASCII_DOC", "Checking for AsciiDoc", sub {
+               my $version = `asciidoc --version 2>&1`;
+               return "none" if !defined $version || $version eq "";
+               my( $vnum ) = $version =~ / (\d+\.\S*)$/;
+               return $vnum;
+       });
 
-if(Get("ASCII_DOC") eq "yes") {
-       Set("CONFIG_DOC");
-} else {
-       Warn("Need asciidoc >= 7 to build documentation");
-       UnSet("CONFIG_DOC");
+       my( $major ) = Get("HAVE_ASCII_DOC") =~ /^(\d+)/;
+       if (defined $major && $major >= 7) {
+               Set("CONFIG_DOC");
+       } else {
+               if (IsGiven("CONFIG_DOC")) {
+                       Fail("Need asciidoc >= 7");
+               } else {
+                       Warn("Need asciidoc >= 7 to build documentation");
+                       UnSet("CONFIG_DOC");
+               }
+       }
 }
 
 # We succeeded