From patchwork Wed Jan 16 18:35:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 1993211 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 1CE5DDF2A2 for ; Wed, 16 Jan 2013 18:34:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5434E6AB1 for ; Wed, 16 Jan 2013 10:34:25 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f45.google.com (mail-bk0-f45.google.com [209.85.214.45]) by gabe.freedesktop.org (Postfix) with ESMTP id C98BBE69FB for ; Wed, 16 Jan 2013 10:33:01 -0800 (PST) Received: by mail-bk0-f45.google.com with SMTP id jk13so878310bkc.4 for ; Wed, 16 Jan 2013 10:33:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=qot5fXxSaqfw07xFXk9zaohg58W02GSr2rEapdw42to=; b=SaW86AqvO6t+KhAsvcsrXjysTu9l5h8kIy432V0qmrQM1I/NT3737iDlENYMQ2sotU rgOrr9fjb4bI2D7Rq58hrkSlMw21ZtsUv+K1exKoCXXnWNghTWfGUVaHFFGd/+gwWaQe hh76kzhnewrRcJ8Mk/YVztBwNlYjDIHecTLDZQJRUaiVHGsNj1TFqUJt73joduP8OH7a ZAfWRTxCarogrACvTlyOx5Ic1HNMzeoYCUopeY3bGB3gkdkN5b4QvNiZb73xZisXuIRj LnRZ8xjifZFiYmmQCfMjNYIyj7u2um7mfuPOfMh7ALl8pqV4Rmgm5NEGk2Ya6ByIz5kC ZBrA== X-Received: by 10.204.147.135 with SMTP id l7mr757758bkv.119.1358361180944; Wed, 16 Jan 2013 10:33:00 -0800 (PST) Received: from localhost.localdomain (stgt-5f71b0c3.pool.mediaWays.net. [95.113.176.195]) by mx.google.com with ESMTPS id c10sm16458783bkw.1.2013.01.16.10.32.59 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jan 2013 10:32:59 -0800 (PST) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH] man: fix manpage build instructions Date: Wed, 16 Jan 2013 19:35:25 +0100 Message-Id: <1358361325-18379-1-git-send-email-dh.herrmann@googlemail.com> X-Mailer: git-send-email 1.8.1.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org 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 --- Hi This is how I build manpages for kmscon and it worked until now so it should also work for libdrm. I tried every kind of failure and out-of-tree builds and everything worked. distcheck also passed fine. I hope that fixes all issues. Regards David .gitignore | 1 + Makefile.am | 2 +- configure.ac | 20 +++++++++++++++++++- man/Makefile.am | 34 +++++++++++++++++++++------------- 4 files changed, 42 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 1de66bc..225fd80 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ libkms.pc libtool ltmain.sh mach64.kld +man/.man_fixup mga.kld missing mkinstalldirs diff --git a/Makefile.am b/Makefile.am index 9f106d3..8ecd9d9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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) diff --git a/configure.ac b/configure.ac index 10cc9a4..9ee7940 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/man/Makefile.am b/man/Makefile.am index 32acd07..25202e2 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -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