summaryrefslogtreecommitdiff
path: root/doc/configure.ac
blob: d4e8e99288fec6296c828004327030eba47a381f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# configure.in
#
# 	This library is free software; you can redistribute it and/or
#	modify it under the terms of the GNU Lesser General Public
#	License as published by the Free Software Foundation version 2.1
#	of the License.
#
# Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
#

AC_INIT(libnl-doc, [3.2.17], [http://www.infradead.org/~tgr/libnl/])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])

m4_include([m4/ax_python.m4])

#
# Generating the documentation
#
AC_ARG_ENABLE([doc],
	      AS_HELP_STRING([--disable-doc], [Do not generate documentation]),
	      [generate_doc="$enableval"], [generate_doc=auto])

if test "x$generate_doc" != "xno"; then
	AC_PROG_SED
	AC_PROG_EGREP

	AX_PYTHON

	AC_CHECK_PROG(HAVE_DOXYGEN, [doxygen], yes, no)
	if test "x$HAVE_DOXYGEN" = "xno" -a "x$generate_doc" = "xyes"; then
		AC_MSG_ERROR([*** doxygen package required to generate documentation])
	fi

	AC_CHECK_PROG(HAVE_DOT, [dot], yes, no)
	if test "x$HAVE_DOT" = "xno"; then
		if test "x$generate_doc" = "xyes"; then
			AC_MSG_ERROR([*** graphviz package required to generate documentation])
		else
			AC_MSG_WARN([*** graphviz not found, disabling building of API reference])
			HAVE_DOXYGEN=no
		fi
	fi

	AC_CHECK_PROG(HAVE_ASCIIDOC, [asciidoc], yes, no)
	if test "x$HAVE_ASCIIDOC" = "xno"; then
		if test "x$generate_doc" = "xyes"; then
			AC_MSG_ERROR([*** asciidoc package required to generate documentation])
		else
			AC_MSG_WARN([*** asciidoc not found, disabling building of guides])
		fi
	fi

	AC_CHECK_PROG(HAVE_SOURCE_HIGHLIGHT, [source-highlight], yes, no)
	if test "x$HAVE_SOURCE_HIGHLIGHT" = "xno"; then
		if test "x$generate_doc" = "xyes"; then
			AC_MSG_ERROR([*** source-highlight required to generate documentation])
		else
			AC_MSG_WARN([*** source-highlight not found, disabling building of guides])
			HAVE_ASCIIDOC=no
		fi
	fi

	AC_CHECK_PROG(HAVE_MSCGEN, [mscgen], yes, no)
	if test "x$HAVE_MSCGEN" = "xno"; then
		AC_MSG_WARN([*** mscgen not found, get it at http://www.mcternan.me.uk/mscgen/])
		if test "x$generate_doc" = "xyes"; then
			AC_MSG_ERROR([*** mscgen package required to generate documentation])
		else
			AC_MSG_WARN([*** Disabling building of guides])
			HAVE_ASCIIDOC=no
			HAVE_DOXYGEN=no
		fi
	fi

	AC_CHECK_PROG(HAVE_PYGMENTIZE, [pygmentize], yes, no)
	if test "x$HAVE_PYGMENTIZE" = "xno"; then
		if test "x$generate_doc" = "xyes"; then
			AC_MSG_ERROR([*** pygmentize package required to generate documentation])
		else
			AC_MSG_WARN([*** Disabling building of guides])
			HAVE_ASCIIDOC=no
		fi
	fi

	link_doc=yes
	if test "x$HAVE_DOXYGEN" = "xno"; then
		AC_MSG_WARN([*** Disabling API linking due to missing doxygen package])
		link_doc=no
	fi
fi

AM_CONDITIONAL([LINK_DOC], [test "x$link_doc" = "xyes"])
AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$HAVE_DOXYGEN" = "xyes"])
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "x$HAVE_ASCIIDOC" = "xyes"])

AM_CONDITIONAL([GENERATE_DOC], [test "x$generate_doc" != "xno"])

AC_CONFIG_FILES([
Doxyfile
Makefile
])

AC_OUTPUT