aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Herrmann2013-01-16 12:35:25 -0600
committerNikhil Devshatwar2013-05-17 04:51:31 -0500
commit0c72cc8e66886b6d85e8d90360d8d5e70eeb2110 (patch)
tree64f419f4ec410deeafc36b45fa0fa52f52e72513
parentbd0c5c201812079de140f8c63b42f0f3cc63a114 (diff)
downloadlibdrm-0c72cc8e66886b6d85e8d90360d8d5e70eeb2110.tar.gz
libdrm-0c72cc8e66886b6d85e8d90360d8d5e70eeb2110.tar.xz
libdrm-0c72cc8e66886b6d85e8d90360d8d5e70eeb2110.zip
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>
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac20
-rw-r--r--man/Makefile.am34
4 files changed, 42 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index 1de66bca..225fd801 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,6 +52,7 @@ libkms.pc
52libtool 52libtool
53ltmain.sh 53ltmain.sh
54mach64.kld 54mach64.kld
55man/.man_fixup
55mga.kld 56mga.kld
56missing 57missing
57mkinstalldirs 58mkinstalldirs
diff --git a/Makefile.am b/Makefile.am
index e6cd0f5f..320e5640 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,7 +49,7 @@ if HAVE_EXYNOS
49EXYNOS_SUBDIR = exynos 49EXYNOS_SUBDIR = exynos
50endif 50endif
51 51
52SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) tests include 52SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) tests include man
53 53
54libdrm_la_LTLIBRARIES = libdrm.la 54libdrm_la_LTLIBRARIES = libdrm.la
55libdrm_ladir = $(libdir) 55libdrm_ladir = $(libdir)
diff --git a/configure.ac b/configure.ac
index 9f06cc5f..1127a948 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,8 +226,26 @@ if test "x$HAVE_LIBUDEV" = xyes; then
226fi 226fi
227AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes]) 227AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
228 228
229# xsltproc for docbook manpages
230AC_ARG_ENABLE([manpages],
231 AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
232 [MANS=$enableval], [MANS=auto])
229AC_PATH_PROG(XSLTPROC, xsltproc) 233AC_PATH_PROG(XSLTPROC, xsltproc)
230AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"]) 234AM_CONDITIONAL([BUILD_MANPAGES], [test "x$XSLTPROC" != "x" -a "x$MANS" != "xno"])
235
236# check for offline man-pages stylesheet
237AC_MSG_CHECKING([for docbook manpages stylesheet])
238MANPAGES_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
239AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
240 AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$MANPAGES_STYLESHEET" > /dev/null 2>&1`],
241 [HAVE_MANPAGES_STYLESHEET=yes]))
242if test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"; then
243 AC_SUBST(MANPAGES_STYLESHEET)
244 AC_MSG_RESULT([yes])
245else
246 AC_MSG_RESULT([no])
247fi
248AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], [test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"])
231 249
232if test "x$INTEL" != "xno" -o "x$RADEON" != "xno" -o "x$NOUVEAU" != "xno" -o "x$OMAP" != "xno"; then 250if test "x$INTEL" != "xno" -o "x$RADEON" != "xno" -o "x$NOUVEAU" != "xno" -o "x$OMAP" != "xno"; then
233 # Check for atomic intrinsics 251 # Check for atomic intrinsics
diff --git a/man/Makefile.am b/man/Makefile.am
index 32acd076..25202e28 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -18,37 +18,45 @@ MANPAGES_ALIASES = \
18 18
19XML_FILES = \ 19XML_FILES = \
20 ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubs %.7,%.xml,$(MANPAGES)}}}} 20 ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubs %.7,%.xml,$(MANPAGES)}}}}
21CLEANFILES = 21EXTRA_DIST = $(XML_FILES)
22EXTRA_DIST = 22CLEANFILES = $(MANPAGES) $(MANPAGES_ALIASES) .man_fixup
23man_MANS = 23man_MANS =
24 24
25if HAVE_XSLTPROC 25if BUILD_MANPAGES
26if HAVE_MANPAGES_STYLESHEET
26 27
27CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES)
28EXTRA_DIST += $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES)
29man_MANS += $(MANPAGES) $(MANPAGES_ALIASES) 28man_MANS += $(MANPAGES) $(MANPAGES_ALIASES)
30 29
31XSLTPROC_FLAGS = \ 30XSLTPROC_FLAGS = \
32 --stringparam man.authors.section.enabled 0 \ 31 --stringparam man.authors.section.enabled 0 \
33 --stringparam man.copyright.section.enabled 0 \ 32 --stringparam man.copyright.section.enabled 0 \
34 --stringparam funcsynopsis.style ansi \ 33 --stringparam funcsynopsis.style ansi \
35 --stringparam man.output.quietly 1 34 --stringparam man.output.quietly 1 \
35 --nonet
36 36
37XSLTPROC_PROCESS_MAN = \ 37XSLTPROC_PROCESS_MAN = \
38 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ 38 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
39 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< && \ 39 $(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) $(MANPAGES_STYLESHEET) "$<" && \
40 $(SED) -i -e 's/^\.so \(.*\)\.\(.\)$$/\.so man\2\/\1\.\2/' $(MANPAGES_ALIASES) 40 touch .man_fixup
41 41
42%.1: %.xml 42# Force .man_fixup if $(MANPAGES) are not built
43.man_fixup: | $(MANPAGES)
44 @touch .man_fixup
45
46$(MANPAGES_ALIASES): $(MANPAGES) .man_fixup
47 $(AM_V_GEN)if test -n "$@" ; then $(SED) -i -e 's/^\.so \([a-z_]\+\)\.\([0-9]\)$$/\.so man\2\/\1\.\2/' "$@" ; fi
48
49%.1: $(top_srcdir)/man/%.xml
43 $(XSLTPROC_PROCESS_MAN) 50 $(XSLTPROC_PROCESS_MAN)
44 51
45%.3: %.xml 52%.3: $(top_srcdir)/man/%.xml
46 $(XSLTPROC_PROCESS_MAN) 53 $(XSLTPROC_PROCESS_MAN)
47 54
48%.5: %.xml 55%.5: $(top_srcdir)/man/%.xml
49 $(XSLTPROC_PROCESS_MAN) 56 $(XSLTPROC_PROCESS_MAN)
50 57
51%.7: %.xml 58%.7: $(top_srcdir)/man/%.xml
52 $(XSLTPROC_PROCESS_MAN) 59 $(XSLTPROC_PROCESS_MAN)
53 60
54endif # HAVE_XSLTPROC 61endif # HAVE_MANPAGES_STYLESHEET
62endif # BUILD_MANPAGES