X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fperl%2FUCW%2FConfigure%2FDoc.pm;h=b1a701b4c69fb61c76d29161044de43a921be50e;hb=e13a0599ac0a39ea63ca21a722c4d2db1d39af02;hp=e15e4eddf8181843c92559de3fbe67a70bca5e02;hpb=40d4655860cd7e03368aec9e015c6c0a350bc190;p=libucw.git diff --git a/ucw/perl/UCW/Configure/Doc.pm b/ucw/perl/UCW/Configure/Doc.pm index e15e4edd..b1a701b4 100644 --- a/ucw/perl/UCW/Configure/Doc.pm +++ b/ucw/perl/UCW/Configure/Doc.pm @@ -7,19 +7,25 @@ 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