X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ucw%2Fperl%2FUCW%2FConfigure%2FDoc.pm;h=b1a701b4c69fb61c76d29161044de43a921be50e;hb=1ddc0f01053b355c5805df3659866e11d50d60d0;hp=fe5a8a14d2161ec86d4a461663a8ab1ade80f7eb;hpb=efaa9aa9201e5d35927b49be4167e02ca6ba9437;p=libucw.git diff --git a/ucw/perl/UCW/Configure/Doc.pm b/ucw/perl/UCW/Configure/Doc.pm index fe5a8a14..b1a701b4 100644 --- a/ucw/perl/UCW/Configure/Doc.pm +++ b/ucw/perl/UCW/Configure/Doc.pm @@ -1,25 +1,31 @@ # UCW Library configuration system: documentation requirements # (c) 2008 Michal Vaner -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