summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2010-06-09 18:52:35 +0200
committerJulien Cristau <jcristau@debian.org>2010-06-09 18:52:35 +0200
commit939250fa7e39c60f16ce648be07f3c6d11e79337 (patch)
tree3b7be0ef3d6fb971f012638edcaef1770f6b8201
parent59a7d41a255a6b9d7738245983e5c775a7147f08 (diff)
Check for ps2pdf and pdftk in configure
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--configure.ac13
-rw-r--r--specs/XProtocol/Makefile.am12
2 files changed, 17 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 256cc5f..388e7b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,10 +25,10 @@ AC_INIT([xorg-docs], [1.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
-# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+# Require xorg-macros 1.6 or later: XORG_WITH_PS2PDF
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
DEFAULT_X11DOCDIR=${datadir}/X11/doc
@@ -52,6 +52,13 @@ AC_ARG_ENABLE(html, AS_HELP_STRING([--enable-html],
[Build HTML versions of documents (default: disabled)]),
[BUILD_HTMLDOC=$enableval], [BUILD_HTMLDOC=no])
+XORG_WITH_PS2PDF
+if ! test -x "$PS2PDF"; then
+ AC_MSG_ERROR([ps2pdf is required to build the X protocol spec])
+fi
+AC_PATH_PROG([PDFTK], [pdftk])
+AM_CONDITIONAL(HAVE_PDFTK, test -x "$PDFTK")
+
AM_CONDITIONAL(BUILD_TXTDOC, test "x$BUILD_TXTDOC" = xyes)
AM_CONDITIONAL(BUILD_PDFDOC, test "x$BUILD_PDFDOC" = xyes)
AM_CONDITIONAL(BUILD_PSDOC, test "x$BUILD_PSDOC" = xyes)
diff --git a/specs/XProtocol/Makefile.am b/specs/XProtocol/Makefile.am
index 120c7e8..fc571e5 100644
--- a/specs/XProtocol/Makefile.am
+++ b/specs/XProtocol/Makefile.am
@@ -11,13 +11,16 @@ SRCS = $(UTIL)/macros.t $(protoSRCS)
ISRCS = $(indexSRCS) $(UTIL)/indexmacros.t
EXTRA_DIST = $(indexSRCS) $(protoSRCS)
-x11doc_DATA = x11.pdf proto.pdf proto.idx.pdf
+x11doc_DATA = proto.pdf proto.idx.pdf
+if HAVE_PDFTK
+x11doc_DATA += x11.pdf
+endif
x11.pdf: proto.pdf proto.idx.pdf
- pdftk proto.pdf proto.idx.pdf cat output $@
+ $(PDFTK) proto.pdf proto.idx.pdf cat output $@
proto.pdf index.raw: $(SRCS)
- $(TBL) $^ | $(EQN) | $(TROFF) $(MSMACROS) 2> index.raw | ps2pdf - proto.pdf
+ $(TBL) $^ | $(EQN) | $(TROFF) $(MSMACROS) 2> index.raw | $(PS2PDF) - proto.pdf
index.pageno: index.raw
tail -1 $< > $@
@@ -26,7 +29,6 @@ index.troff: index.pageno $(UTIL)/block.awk $(UTIL)/fixindex.awk
grep -v '^.pn ' index.raw | sort -f -t: +1 -3 +0n -1n | awk -f $(UTIL)/fixindex.awk | awk -f $(UTIL)/block.awk > index.troff
proto.idx.pdf: $(ISRCS) index.troff
- cat $^ | $(TROFF) -me | ps2pdf - proto.idx.pdf
+ cat $^ | $(TROFF) -me | $(PS2PDF) - proto.idx.pdf
CLEANFILES = proto.pdf proto.idx.pdf x11.pdf index.raw index.pageno index.troff
-