[PATCH libxtrans] doc: use new macros XORG_WITH_GROFF and PS2PDF
Gaetan Nadon
memsize at videotron.ca
Fri Feb 5 10:25:19 PST 2010
These control the usage of doc tools
Also use XORG_ENABLE_DOCS to control generation of docs
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
.gitignore | 8 +++++++-
Makefile.am | 7 +++++--
configure.ac | 25 ++++++-------------------
3 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/.gitignore b/.gitignore
index dcba0cc..4010eee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,8 +71,14 @@ core
*.tar.bz2
*.tar.gz
#
-# Add & Override patterns for libxtrans
+# Add & Override patterns for libxtrans
#
# Edit the following section as needed
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
+Xtrans.html
+Xtrans.pdf
+Xtrans.txt
+index.Xtrans.html.raw
+index.Xtrans.ps.raw
+index.Xtrans.txt.raw
diff --git a/Makefile.am b/Makefile.am
index af68a7a..a824f02 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,13 +32,15 @@ dist-hook: ChangeLog INSTALL
# Rules to convert documentation from troff to other formats
doc_sources = Xtrans.mm
+if ENABLE_DOCS
+if HAVE_GROFF
+
if HAVE_PS2PDF
printable_format = .pdf
else
printable_format = .ps
endif
-if BUILD_DOCS
doc_DATA = $(doc_sources:.mm=.txt) \
$(doc_sources:.mm=$(printable_format)) \
$(doc_sources:.mm=.html)
@@ -69,4 +71,5 @@ SUFFIXES = .mm .ps .txt .html .pdf
.ps.pdf:
$(AM_V_GEN) $(PS2PDF) $< $@
-endif BUILD_DOCS
+endif HAVE_GROFF
+endif ENABLE_DOCS
diff --git a/configure.ac b/configure.ac
index 383a1c1..6dad5a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,11 +25,14 @@ AC_INIT(xtrans, [1.2.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xor
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
-# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+# Require xorg-macrosr: XORG_DEFAULT_OPTIONS
m4_ifndef([XORG_MACROS_VERSION],
- [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.3)
+ [m4_fatal([must install xorg-macros 1.6 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.6)
XORG_DEFAULT_OPTIONS
+XORG_ENABLE_DOCS
+XORG_WITH_GROFF
+XORG_WITH_PS2PDF
# Because xtrans is included into other modules rather than being linked
# with, these defines have to be added to the cflags line
@@ -49,21 +52,5 @@ sticky_bit_define="-DHAS_STICKY_DIR_BIT"
AC_SUBST(sticky_bit_define)
-# Documentation is currently provided in troff format, built on request
-AC_PATH_PROGS([GROFF], [groff], [none], [$PATH:/usr/gnu/bin])
-AC_PATH_PROGS([PS2PDF], [ps2pdf], [none], [$PATH:/usr/gnu/bin])
-
-AC_MSG_CHECKING([whether to build documentation])
-AC_ARG_ENABLE(docs, AC_HELP_STRING([--enable-docs],
- [Enable building of documentation]),
- [build_docs="${enableval}"], [build_docs="no"])
-AC_MSG_RESULT([${build_docs}])
-if test "x${build_docs}" = xyes && test "x${GROFF}" = xnone ; then
- AC_MSG_ERROR([can't build documentation without groff])
-fi
-
-AM_CONDITIONAL(BUILD_DOCS, [test x$build_docs = xyes])
-AM_CONDITIONAL(HAVE_PS2PDF, [test x$PS2PDF != xnone])
-
AC_OUTPUT([Makefile
xtrans.pc])
--
1.6.0.4
More information about the xorg-devel
mailing list