# UCW Library configuration system: documentation requirements # (c) 2008 Michal Vaner package UCW::Configure::Doc; use UCW::Configure; use strict; use warnings; 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; }); my( $major ) = Get("HAVE_ASCII_DOC") =~ /^(\d+)/; if (defined $major && $major >= 7) { Set("CONFIG_DOC"); } else { if (IsGiven("CONFIG_DOC")) { Fail("Need asciidoc >= 7\n"); } else { Warn("Need asciidoc >= 7 to build documentation\n"); UnSet("CONFIG_DOC"); } } } # We succeeded 1;