]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add optional linkchecker for documentation
authorPieter Lexis <pieter@plexis.eu>
Tue, 20 Jan 2015 07:10:35 +0000 (08:10 +0100)
committerPieter Lexis <pieter@plexis.eu>
Thu, 22 Jan 2015 16:23:58 +0000 (17:23 +0100)
   * This allows all internal links (including anchors) in the
   documentation to be verified.

configure.ac
docs/Makefile.am
m4/pdns_check_linkchecker.m4 [new file with mode: 0644]

index 6604febd71e965b19bdc37f75b22d2645d9b1efb..b1972524dc619f69ded8a08c89715299de378071 100644 (file)
@@ -102,6 +102,7 @@ PDNS_WITH_SQLITE3
 
 PDNS_CHECK_PANDOC
 PDNS_CHECK_MKDOCS
+PDNS_CHECK_LINKCHECKER
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_SIZE_T
index 5a1a4e1b3db81ce0ad433868329223279e971579..2af0ddc76e7b18174b1ce8028e3bfd2c93e613d1 100644 (file)
@@ -43,6 +43,17 @@ $(MANPAGES_TARGET):
        exit 1
 endif
 
+if HAVE_LINKCHECKER
+check-links: html
+       linkchecker --anchors \
+         --ignore-url=.eot$ \
+         --ignore-url=\.svg \
+         --ignore-url=mailto \
+         --ignore-url=.ttf$ \
+         --ignore-url=woff$ \
+         html/index.html
+endif
+
 clean:
        rm -rf html *.8 *.1
 
diff --git a/m4/pdns_check_linkchecker.m4 b/m4/pdns_check_linkchecker.m4
new file mode 100644 (file)
index 0000000..38d70c8
--- /dev/null
@@ -0,0 +1,9 @@
+AC_DEFUN([PDNS_CHECK_LINKCHECKER], [
+  AC_CHECK_PROG([LINKCHECKER], [linkchecker], [linkchecker], [no])
+
+  AS_IF([test "x$LINKCHECKER" = "xno"], [
+      AC_MSG_WARN([linkchecker is missing, unable to verify links in the documentation.])
+    ])
+  AM_CONDITIONAL([HAVE_LINKCHECKER], [test "x$LINKCHECKER" != "xno"])
+])
+