• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SPDX-License-Identifier: LGPL-2.1-only
2#
3# Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
4#
5
6AC_INIT(libnl-doc, [3.7.0], [http://www.infradead.org/~tgr/libnl/])
7AC_CONFIG_MACRO_DIR([m4])
8AC_CONFIG_AUX_DIR([build-aux])
9AM_INIT_AUTOMAKE([foreign])
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
11
12#
13# Generating the documentation
14#
15AC_ARG_ENABLE([doc],
16	      AS_HELP_STRING([--disable-doc], [Do not generate documentation]),
17	      [generate_doc="$enableval"], [generate_doc=auto])
18
19if test "x$generate_doc" != "xno"; then
20	AC_PROG_SED
21	AC_PROG_EGREP
22
23	AC_CHECK_PROG(HAVE_PYTHON, [python], yes, no)
24	if test "x$HAVE_PYTHON" = "xno"  -a "x$generate_doc" = "xyes"; then
25		AC_MSG_ERROR([*** python binary required to generate documentation])
26	fi
27
28	AC_CHECK_PROG(HAVE_DOXYGEN, [doxygen], yes, no)
29	if test "x$HAVE_DOXYGEN" = "xno" -a "x$generate_doc" = "xyes"; then
30		AC_MSG_ERROR([*** doxygen package required to generate documentation])
31	fi
32
33	AC_CHECK_PROG(HAVE_DOT, [dot], yes, no)
34	if test "x$HAVE_DOT" = "xno"; then
35		if test "x$generate_doc" = "xyes"; then
36			AC_MSG_ERROR([*** graphviz package required to generate documentation])
37		else
38			AC_MSG_WARN([*** graphviz not found, disabling building of API reference])
39			HAVE_DOXYGEN=no
40		fi
41	fi
42
43	AC_CHECK_PROG(HAVE_ASCIIDOC, [asciidoc], yes, no)
44	if test "x$HAVE_ASCIIDOC" = "xno"; then
45		if test "x$generate_doc" = "xyes"; then
46			AC_MSG_ERROR([*** asciidoc package required to generate documentation])
47		else
48			AC_MSG_WARN([*** asciidoc not found, disabling building of guides])
49		fi
50	fi
51
52	AC_CHECK_PROG(HAVE_SOURCE_HIGHLIGHT, [source-highlight], yes, no)
53	if test "x$HAVE_SOURCE_HIGHLIGHT" = "xno"; then
54		if test "x$generate_doc" = "xyes"; then
55			AC_MSG_ERROR([*** source-highlight required to generate documentation])
56		else
57			AC_MSG_WARN([*** source-highlight not found, disabling building of guides])
58			HAVE_ASCIIDOC=no
59		fi
60	fi
61
62	AC_CHECK_PROG(HAVE_MSCGEN, [mscgen], yes, no)
63	if test "x$HAVE_MSCGEN" = "xno"; then
64		AC_MSG_WARN([*** mscgen not found, get it at http://www.mcternan.me.uk/mscgen/])
65		if test "x$generate_doc" = "xyes"; then
66			AC_MSG_ERROR([*** mscgen package required to generate documentation])
67		else
68			AC_MSG_WARN([*** Disabling building of guides])
69			HAVE_ASCIIDOC=no
70			HAVE_DOXYGEN=no
71		fi
72	fi
73
74	AC_CHECK_PROG(HAVE_PYGMENTIZE, [pygmentize], yes, no)
75	if test "x$HAVE_PYGMENTIZE" = "xno"; then
76		if test "x$generate_doc" = "xyes"; then
77			AC_MSG_ERROR([*** pygmentize package required to generate documentation])
78		else
79			AC_MSG_WARN([*** Disabling building of guides])
80			HAVE_ASCIIDOC=no
81		fi
82	fi
83
84	link_doc=yes
85	if test "x$HAVE_DOXYGEN" = "xno"; then
86		AC_MSG_WARN([*** Disabling API linking due to missing doxygen package])
87		link_doc=no
88	fi
89fi
90
91AM_CONDITIONAL([LINK_DOC], [test "x$link_doc" = "xyes"])
92AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$HAVE_DOXYGEN" = "xyes"])
93AM_CONDITIONAL([HAVE_ASCIIDOC], [test "x$HAVE_ASCIIDOC" = "xyes"])
94
95AM_CONDITIONAL([GENERATE_DOC], [test "x$generate_doc" != "xno"])
96
97AC_CONFIG_FILES([
98Doxyfile
99Makefile
100])
101
102AC_OUTPUT
103