summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--man/Makefile.am26
2 files changed, 17 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index b4e8b86..d8fd67f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,9 +22,7 @@ dnl ---------------------------------------------------------------------------
dnl - Manual page build
dnl ---------------------------------------------------------------------------
AC_PATH_PROG(XMLTO, xmlto, no)
-if test "$XMLTO" = "no" ; then
- AC_MSG_ERROR([Cannot find xmlto. Aborting...])
-fi
+AM_CONDITIONAL(HAVE_XMLTO, [test "x$XMLTO" != xno])
dnl ---------------------------------------------------------------------------
dnl - Make paths available for source files
diff --git a/man/Makefile.am b/man/Makefile.am
index a95d07e..f16edb1 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,32 +1,38 @@
-man_MANS = \
+pm_mans = \
on_ac_power.1 \
pm-is-supported.1 \
pm-pmu.8 \
pm-powersave.8 \
pm-action.8
+if HAVE_XMLTO
+man_MANS = $(pm_mans)
+endif
+
EXTRA_DIST = \
on_ac_power.xml \
pm-pmu.xml \
pm-is-supported.xml \
pm-powersave.xml \
pm-action.xml \
- $(man_MANS)
+ $(pm_mans)
MAINTAINERCLEANFILES = \
- $(man_MANS)
+ $(pm_mans)
.xml.1:
- $(XMLTO) man $?
+ $(XMLTO) man $<
.xml.8:
- $(XMLTO) man $?
+ $(XMLTO) man $<
-install-data-hook:
- -mkdir -p $(DESTDIR)$(mandir)/man8
- -ln -s pm-action.8 $(DESTDIR)$(mandir)/man8/pm-suspend.8
- -ln -s pm-action.8 $(DESTDIR)$(mandir)/man8/pm-hibernate.8
- -ln -s pm-action.8 $(DESTDIR)$(mandir)/man8/pm-suspend-hybrid.8
+install-data-hook: install-man
+ @if test -f $(DESTDIR)$(mandir)/man8/pm-action.8; then \
+ for page in pm-suspend pm-hibernate pm-suspend-hybrid; do \
+ echo ln -s pm-action.8 $(DESTDIR)$(mandir)/man8/$$page.8; \
+ ln -s pm-action.8 $(DESTDIR)$(mandir)/man8/$$page.8 || exit 1; \
+ done; \
+ fi
clean-local :
rm -f *~