From patchwork Wed Apr 8 16:52:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 6181531 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1E5AABF4A6 for ; Wed, 8 Apr 2015 16:49:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D87420373 for ; Wed, 8 Apr 2015 16:49:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DD72720374 for ; Wed, 8 Apr 2015 16:49:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2692F6E270; Wed, 8 Apr 2015 09:49:26 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 843E96E6D1 for ; Wed, 8 Apr 2015 09:49:24 -0700 (PDT) Received: by wgbdm7 with SMTP id dm7so94629190wgb.1 for ; Wed, 08 Apr 2015 09:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P6vFlJoz8hS2Zg8qlYN35wjPDYFhTVbfO0w9d5ZZSuU=; b=oQRgI4p1YoP2CXkf+jkuGBHgKiKsLmnLfGASwXBULpJXwFQ8JV94BbcFWhB2TVzqIt j6qMuxslHJlL8WnOGOURcHMgvmeDC2QMOGQmr2+q0SL3pmoKadFwSvmnKejg8Y+K8Rkm e4qNTlkEoHY8l9akaWZPGYwqyVdGFwbfbaght9YCo4FevoQHel1fQa2iMn8KSEAYMnFt nzyD1gHFcxQ4BuMQrJX1llNtBaWDsf5How2hNSY+Ue7oC6butf/TkG5WdSUuycRkidb6 7SADYyN5lr7lk37CQoBsF85MAzoXD/vxIfItNGmupiuaKDdtSJilF/ylrK3Ce7riFV9J jf3g== X-Received: by 10.180.188.193 with SMTP id gc1mr15877383wic.7.1428511763527; Wed, 08 Apr 2015 09:49:23 -0700 (PDT) Received: from arch-x220.localdomain (cpc12-croy20-2-0-cust52.croy.cable.virginm.net. [82.44.54.53]) by mx.google.com with ESMTPSA id at4sm16383076wjc.16.2015.04.08.09.49.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Apr 2015 09:49:22 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 3/3] man: rework the Makefile.am Date: Wed, 8 Apr 2015 17:52:39 +0100 Message-Id: <1428511959-25990-3-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.3.1 In-Reply-To: <1428511959-25990-1-git-send-email-emil.l.velikov@gmail.com> References: <1428511959-25990-1-git-send-email-emil.l.velikov@gmail.com> Cc: Niveditha Rau , emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove GNU make specific constructs and take into consideration that Solaris man 7 is not the same as Linux man 7. This commit introduces a dependency of xorg-macros 1.12 (released 4+ years ago) which is used to handle the above man section discrepancies. Cc: Niveditha Rau Signed-off-by: Emil Velikov --- If people prefer I can split this patch into separate ones, but considering how much of a rework/rewrite of man/Makefile.am this turned up to be it might not be worth it. Niveditha, If you can grab the tarball [1] for your test it should handle most/all of the GNU make dependencies, as it's based on my for-solaris branch at https://github.com/evelikov/libdrm Thanks, Emil [1] http://people.freedesktop.org/~evelikov/for-solaris/libdrm-2.4.60.tar.gz --- Makefile.am | 8 +++++- configure.ac | 10 ++++++-- man/Makefile.am | 80 ++++++++++++++++++++++++++++++--------------------------- 3 files changed, 57 insertions(+), 41 deletions(-) diff --git a/Makefile.am b/Makefile.am index 42d3d7f..13df80c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,6 +73,12 @@ if HAVE_TEGRA TEGRA_SUBDIR = tegra endif +if BUILD_MANPAGES +if HAVE_MANPAGES_STYLESHEET +MAN_SUBDIR = man +endif +endif + SUBDIRS = \ . \ $(LIBKMS_SUBDIR) \ @@ -84,7 +90,7 @@ SUBDIRS = \ $(FREEDRENO_SUBDIR) \ $(TEGRA_SUBDIR) \ tests \ - man + $(MAN_SUBDIR) libdrm_la_LTLIBRARIES = libdrm.la libdrm_ladir = $(libdir) diff --git a/configure.ac b/configure.ac index 320e482..f8adf4f 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,13 @@ AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) +# Require xorg-macros minimum of 1.12 for XORG_WITH_XSLTPROC +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.12) +XORG_WITH_XSLTPROC +XORG_MANPAGE_SECTIONS + AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2]) # Enable quiet compiles on automake 1.11. @@ -378,9 +385,8 @@ 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@:>@]), + AS_HELP_STRING([--enable-manpages], [enable manpages @<:@default=auto@:>@]), [MANS=$enableval], [MANS=auto]) -AC_PATH_PROG(XSLTPROC, xsltproc) AM_CONDITIONAL([BUILD_MANPAGES], [test "x$XSLTPROC" != "x" -a "x$MANS" != "xno"]) # check for offline man-pages stylesheet diff --git a/man/Makefile.am b/man/Makefile.am index d25a293..44b63a5 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,63 +1,67 @@ # # This generates man-pages out of the Docbook XML files. Simply add your files -# to the $MANPAGES array. If aliases are created, please add them to the -# MANPAGES_ALIASES array so they get installed correctly. +# to the relevant *man_PRE array. If aliases are created, please add them to the +# *man_aliases_PRE array so they get installed correctly. # -MANPAGES = \ - drm.7 \ - drm-kms.7 \ - drm-memory.7 \ - drmAvailable.3 \ - drmHandleEvent.3 \ - drmModeGetResources.3 -MANPAGES_ALIASES = \ - drm-mm.7 \ - drm-gem.7 \ - drm-ttm.7 +libman_PRE = \ + drmAvailable.xml \ + drmHandleEvent.xml \ + drmModeGetResources.xml -XML_FILES = \ - $(patsubst %.1,%.xml,$(patsubst %.3,%.xml,$(patsubst %.5,%.xml,$(patsubst %.7,%.xml,$(MANPAGES))))) +miscman_PRE = \ + drm.xml \ + drm-kms.xml \ + drm-memory.xml -EXTRA_DIST = $(XML_FILES) -CLEANFILES = $(MANPAGES) $(MANPAGES_ALIASES) .man_fixup -man_MANS = +miscman_aliases_PRE = \ + drm-mm.xml \ + drm-gem.xml \ + drm-ttm.xml + +libmandir = $(LIB_MAN_DIR) +miscmandir = $(MISC_MAN_DIR) +miscman_aliasesdir = $(MISC_MAN_DIR) -if BUILD_MANPAGES -if HAVE_MANPAGES_STYLESHEET +libman_DATA = $(libman_PRE:.xml=.$(LIB_MAN_SUFFIX)) +miscman_DATA = $(miscman_PRE:.xml=.$(MISC_MAN_SUFFIX)) +miscman_aliases_DATA = $(miscman_aliases_PRE:.xml=.$(MISC_MAN_SUFFIX)) -man_MANS += $(MANPAGES) $(MANPAGES_ALIASES) +XML_FILES = \ + $(libman_PRE) \ + $(miscman_PRE) + +MAN_FILES = \ + $(libman_DATA) \ + $(miscman_DATA) \ + $(miscman_aliases_DATA) + +EXTRA_DIST = $(XML_FILES) +CLEANFILES = $(MAN_FILES) .man_fixup XSLTPROC_FLAGS = \ --stringparam man.authors.section.enabled 0 \ --stringparam man.copyright.section.enabled 0 \ --stringparam funcsynopsis.style ansi \ --stringparam man.output.quietly 1 \ - --nonet + --nonet \ + $(MANPAGES_STYLESHEET) XSLTPROC_PROCESS_MAN = \ - $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ - $(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) $(MANPAGES_STYLESHEET) "$<" && \ + $(AM_V_GEN)$(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) "$<" && \ touch .man_fixup -# Force .man_fixup if $(MANPAGES) are not built -.man_fixup: | $(MANPAGES) - @touch .man_fixup +# Force .man_fixup if $(miscman_DATA) are not built +.man_fixup: | $(miscman_DATA) + $(AM_V_GEN)touch .man_fixup -$(MANPAGES_ALIASES): $(MANPAGES) .man_fixup +$(miscman_aliases_DATA): $(miscman_DATA) .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) +SUFFIXES = .$(LIB_MAN_SUFFIX) .$(MISC_MAN_SUFFIX) .xml -%.3: $(top_srcdir)/man/%.xml +.xml.$(LIB_MAN_SUFFIX): $(XSLTPROC_PROCESS_MAN) -%.5: $(top_srcdir)/man/%.xml +.xml.$(MISC_MAN_SUFFIX): $(XSLTPROC_PROCESS_MAN) - -%.7: $(top_srcdir)/man/%.xml - $(XSLTPROC_PROCESS_MAN) - -endif # HAVE_MANPAGES_STYLESHEET -endif # BUILD_MANPAGES