Update NEWS with the latest changes
[geany-mirror.git] / m4 / geany-gtkdoc-header.m4
blob2b6d87f50da19a089e362d07ae07fc1fe068624d
1 AC_DEFUN([_GEANY_CHECK_GTKDOC_HEADER_ERROR],
3         AC_MSG_ERROR([GtkDoc header generation enabled but $1])
4 ])
6 dnl GEANY_CHECK_GTKDOC_HEADER
7 dnl checks for GtkDoc header generation requirements and define
8 dnl ENABLE_GTKDOC_HEADER Automake conditional as appropriate
9 AC_DEFUN([GEANY_CHECK_GTKDOC_HEADER],
11         AC_REQUIRE([GEANY_CHECK_DOXYGEN])
13         AC_ARG_ENABLE([gtkdoc-header],
14                         [AS_HELP_STRING([--enable-gtkdoc-header],
15                                         [generate the GtkDoc header suitable for GObject introspection [default=auto]])],
16                         [geany_enable_gtkdoc_header="$enableval"],
17                         [geany_enable_gtkdoc_header="auto"])
19         AS_IF([test "x$geany_enable_gtkdoc_header$geany_with_doxygen" = "xyesno"],
20               [_GEANY_CHECK_GTKDOC_HEADER_ERROR([Doxygen support not available])],
21               [test "x$geany_enable_gtkdoc_header" != "xno"],
22         [
23                 dnl python
24                 AM_PATH_PYTHON([2.7], [have_python=yes], [have_python=no])
25                 dnl lxml module
26                 AS_IF([test "x$have_python" = xyes],
27                       [have_python_and_lxml=yes
28                        AC_MSG_CHECKING([for python lxml package])
29                        AS_IF([$PYTHON -c 'import lxml' >/dev/null 2>&1],
30                              [have_python_and_lxml=yes],
31                              [have_python_and_lxml=no])
32                        AC_MSG_RESULT([$have_python_and_lxml])],
33                       [have_python_and_lxml=no])
34                 dnl final result
35                 AS_IF([test "x$geany_enable_gtkdoc_header$have_python_and_lxml" = "xyesno"],
36                       [_GEANY_CHECK_GTKDOC_HEADER_ERROR([python or its lxml module not found])],
37                       [geany_enable_gtkdoc_header=$have_python_and_lxml])
38         ])
40         AM_CONDITIONAL([ENABLE_GTKDOC_HEADER], [test "x$geany_enable_gtkdoc_header" = "xyes"])
41         GEANY_STATUS_ADD([Generate GtkDoc header], [$geany_enable_gtkdoc_header])