chiark / gitweb /
Prep v222: Update build system:
[elogind.git] / configure.ac
index c8a4aff8ff0a1ec81312176d6ae42edaec0f49bf..5da3365c0be46facfeec19c6190084cf5f80f2b9 100644 (file)
@@ -20,7 +20,7 @@
 AC_PREREQ([2.64])
 
 AC_INIT([elogind],
-        [221],
+        [222],
         [https://github.com/elogind/elogind/issues],
         [elogind],
         [https://github.com/elogind/elogind])
@@ -95,16 +95,7 @@ AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't s
 
 M4_DEFINES=
 
-# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
-m4_ifdef([GTK_DOC_CHECK], [
-GTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
-         [AM_CONDITIONAL([ENABLE_GTK_DOC], [false])
-          enable_gtk_doc=no])
-
-AS_IF([test "x$enable_gtk_doc" = "xyes" -a "x$XSLTPROC" = x], [
-        AC_MSG_ERROR([*** GTK doc requested but xsltproc not found])
-])
-
+AC_CHECK_TOOL(OBJCOPY, objcopy)
 AC_CHECK_TOOL(GPERF, gperf)
 if test -z "$GPERF" ; then
         AC_MSG_ERROR([*** gperf not found])
@@ -233,6 +224,54 @@ AC_CHECK_SIZEOF(rlim_t,,[
        #include <sys/resource.h>
 ])
 
+# ------------------------------------------------------------------------------
+# we use python to build the man page index, and for systemd-python
+have_python=no
+AC_ARG_WITH([python],
+        [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
+
+have_lxml=no
+AS_IF([test "x$with_python" != "xno"], [
+        AM_PATH_PYTHON(,, [:])
+        AS_IF([test "x$PYTHON" != "x:"], [
+                AC_MSG_CHECKING([for python lxml module])
+                AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
+                AC_MSG_RESULT([$have_lxml])
+                AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
+                      [AC_MSG_WARN([*** python support requires python-lxml module installed])])
+        ])
+])
+AS_IF([test "$have_python" != "yes"], [
+      AS_IF([test "$with_python" = "yes"],
+            [AC_MSG_ERROR([*** python support requested but python support not found])])
+      AS_IF([test "$with_python" != "no"],
+            [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
+])
+
+AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
+AS_IF([test "x$PYTHON_BINARY" = "x"],
+      [AS_IF([test "x$have_python" = "xyes"],
+             [PYTHON_BINARY="$(which "$PYTHON")"],
+             [PYTHON_BINARY=/usr/bin/python])])
+AC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])
+
+AS_IF([test "x$have_python" != "xyes" -a "x$enable_python_devel" = "xyes"],
+      [AC_MSG_ERROR([*** python-devel support requires --with-python])])
+
+have_python_devel=no
+AC_ARG_ENABLE(python_devel, AS_HELP_STRING([--disable-python-devel], [Do not build python modules]))
+AS_IF([test "x$have_python" = "xyes" -a "x$enable_python_devel" != "xno"], [
+      PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}],
+            [have_python_devel=yes],
+            [PKG_CHECK_MODULES([PYTHON_DEVEL], [python],
+                  [have_python_devel=yes],
+                  [have_python_devel=no])])
+      AS_IF([test "x$have_python_devel" = xno -a "x$enable_python_devel" = xyes],
+            [AC_MSG_ERROR([*** python-devel support requested but libraries not found])])
+      AC_PATH_PROGS(SPHINX_BUILD, sphinx-build-${PYTHON_VERSION} sphinx-build)
+])
+AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
+
 # ------------------------------------------------------------------------------
 
 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
@@ -501,8 +540,14 @@ fi
 
 AC_ARG_WITH(smack-run-label,
 AS_HELP_STRING([--with-smack-run-label=STRING],
-        [run elogind --system with a specific SMACK label]),
-        [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run with a smack label])],
+        [run elogind --system itself with a specific SMACK label]),
+        [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run elogind itself with SMACK label])],
+        [])
+
+AC_ARG_WITH(smack-default-process-label,
+AS_HELP_STRING([--with-smack-default-process-label=STRING],
+        [default SMACK label for executed processes]),
+        [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
         [])
 
 if test "x${have_smack}" = xyes ; then
@@ -511,6 +556,15 @@ fi
 
 AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
 
+# ------------------------------------------------------------------------------
+have_logind=yes
+#AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
+#if test "x$enable_logind" != "xno"; then
+#        have_logind=yes
+#fi
+AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
+AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
+
 # ------------------------------------------------------------------------------
 AC_ARG_WITH(system-uid-max,
         AS_HELP_STRING([--with-system-uid-max=UID]