]> mj.ucw.cz Git - libucw.git/commitdiff
Doc system: Detect asciidoc
authorMichal Vaner <vorner@ucw.cz>
Fri, 31 Oct 2008 14:57:21 +0000 (15:57 +0100)
committerMichal Vaner <vorner@ucw.cz>
Fri, 31 Oct 2008 14:57:21 +0000 (15:57 +0100)
And decide if we build documentation.

free/libs/configure
ucw/perl/UCW/Configure/Doc.pm [new file with mode: 0644]

index b2433fc1776c45c43c473c99f57ec491e95739b8..000d71a8cc23c009d2be54b630ff23b7fd9427d1 100755 (executable)
@@ -29,6 +29,7 @@ Include Get("CONFIG");
 require UCW::Configure::Paths;
 require UCW::Configure::C;
 require UCW::Configure::LibUCW;
+require UCW::Configure::Doc;
 Finish();
 
 Log "\nConfigured, run `make' to build everything.\n";
diff --git a/ucw/perl/UCW/Configure/Doc.pm b/ucw/perl/UCW/Configure/Doc.pm
new file mode 100644 (file)
index 0000000..fe5a8a1
--- /dev/null
@@ -0,0 +1,26 @@
+# UCW Library configuration system: documentation requirements
+# (c) 2008 Michal Vaner <vorner@ucw.cz>
+
+package UCW::Configure::Paths;
+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(Get("ASCII_DOC") eq "yes") {
+       Set("CONFIG_DOC");
+} else {
+       Warn("Need asciidoc >= 7 to build documentation");
+       UnSet("CONFIG_DOC");
+}
+
+# We succeeded
+1;