man: fix manpage build instructions

This fixes all the out-of-tree build-failures with manpages and uses a
.man_fixup file to avoid overriding man-pages on every build.

Manpages are only built if xsltproc is found and the stylesheets are
available locally. You can disable building manpages with
--disable-manpages so the quite expensive xsltproc procedure can be
skipped.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
main
David Herrmann 2013-01-16 19:35:25 +01:00 committed by Jesse Barnes
parent 481763c2c7
commit 08cb5c1d02
4 changed files with 42 additions and 15 deletions

1
.gitignore vendored
View File

@ -52,6 +52,7 @@ libkms.pc
libtool
ltmain.sh
mach64.kld
man/.man_fixup
mga.kld
missing
mkinstalldirs

View File

@ -49,7 +49,7 @@ if HAVE_EXYNOS
EXYNOS_SUBDIR = exynos
endif
SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) tests include
SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) tests include man
libdrm_la_LTLIBRARIES = libdrm.la
libdrm_ladir = $(libdir)

View File

@ -226,8 +226,26 @@ if test "x$HAVE_LIBUDEV" = xyes; then
fi
AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
# xsltproc for docbook manpages
AC_ARG_ENABLE([manpages],
AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
[MANS=$enableval], [MANS=auto])
AC_PATH_PROG(XSLTPROC, xsltproc)
AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
AM_CONDITIONAL([BUILD_MANPAGES], [test "x$XSLTPROC" != "x" -a "x$MANS" != "xno"])
# check for offline man-pages stylesheet
AC_MSG_CHECKING([for docbook manpages stylesheet])
MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$MANPAGES_STYLESHEET" > /dev/null 2>&1`],
[HAVE_MANPAGES_STYLESHEET=yes]))
if test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"; then
AC_SUBST(MANPAGES_STYLESHEET)
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], [test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"])
if test "x$INTEL" != "xno" -o "x$RADEON" != "xno" -o "x$NOUVEAU" != "xno" -o "x$OMAP" != "xno"; then
# Check for atomic intrinsics

View File

@ -18,37 +18,45 @@ MANPAGES_ALIASES = \
XML_FILES = \
${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubs %.7,%.xml,$(MANPAGES)}}}}
CLEANFILES =
EXTRA_DIST =
EXTRA_DIST = $(XML_FILES)
CLEANFILES = $(MANPAGES) $(MANPAGES_ALIASES) .man_fixup
man_MANS =
if HAVE_XSLTPROC
if BUILD_MANPAGES
if HAVE_MANPAGES_STYLESHEET
CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES)
EXTRA_DIST += $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES)
man_MANS += $(MANPAGES) $(MANPAGES_ALIASES)
XSLTPROC_FLAGS = \
--stringparam man.authors.section.enabled 0 \
--stringparam man.copyright.section.enabled 0 \
--stringparam funcsynopsis.style ansi \
--stringparam man.output.quietly 1
--stringparam man.output.quietly 1 \
--nonet
XSLTPROC_PROCESS_MAN = \
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \
$(SED) -i -e 's/^\.so \(.*\)\.\(.\)$$/\.so man\2\/\1\.\2/' $(MANPAGES_ALIASES)
$(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) $(MANPAGES_STYLESHEET) "$<" && \
touch .man_fixup
%.1: %.xml
# Force .man_fixup if $(MANPAGES) are not built
.man_fixup: | $(MANPAGES)
@touch .man_fixup
$(MANPAGES_ALIASES): $(MANPAGES) .man_fixup
$(AM_V_GEN)if test -n "$@" ; then $(SED) -i -e 's/^\.so \([a-z_]\+\)\.\([0-9]\)$$/\.so man\2\/\1\.\2/' "$@" ; fi
%.1: $(top_srcdir)/man/%.xml
$(XSLTPROC_PROCESS_MAN)
%.3: %.xml
%.3: $(top_srcdir)/man/%.xml
$(XSLTPROC_PROCESS_MAN)
%.5: %.xml
%.5: $(top_srcdir)/man/%.xml
$(XSLTPROC_PROCESS_MAN)
%.7: %.xml
%.7: $(top_srcdir)/man/%.xml
$(XSLTPROC_PROCESS_MAN)
endif # HAVE_XSLTPROC
endif # HAVE_MANPAGES_STYLESHEET
endif # BUILD_MANPAGES