btrfs-progs: autoconf: detect tools to build docs

Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
David Sterba 2015-02-03 15:38:17 +01:00
parent 505669320b
commit e1f0d9d446
2 changed files with 17 additions and 6 deletions

View File

@ -47,18 +47,20 @@ mandir ?= $(prefix)/share/man
man8dir = $(mandir)/man8 man8dir = $(mandir)/man8
man5dir = $(mandir)/man5 man5dir = $(mandir)/man5
ASCIIDOC = asciidoc ASCIIDOC = @ASCIIDOC@
ASCIIDOC_EXTRA = ASCIIDOC_EXTRA =
MANPAGE_XSL = manpage-normal.xsl MANPAGE_XSL = manpage-normal.xsl
XMLTO = xmlto XMLTO = @XMLTO@
XMLTO_EXTRA = XMLTO_EXTRA =
XMLTO_EXTRA = -m manpage-bold-literal.xsl XMLTO_EXTRA = -m manpage-bold-literal.xsl
GZIPCMD = gzip GZIPCMD = @GZIP@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
RM = @RM@ RM = @RM@
RMDIR = @RMDIR@ RMDIR = @RMDIR@
LN_S = @LN_S@ LN_S = @LN_S@
BTRFS_VERSION = $(shell sed -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p'\ MV = @MV@
SED = @SED@
BTRFS_VERSION = $(shell $(SED) -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p'\
../config.h) ../config.h)
ifneq ($(findstring $(MAKEFLAGS),s),s) ifneq ($(findstring $(MAKEFLAGS),s),s)
@ -88,7 +90,7 @@ install-man: man
$(INSTALL) -m 644 $(GZ_MAN5) $(DESTDIR)$(man5dir) $(INSTALL) -m 644 $(GZ_MAN5) $(DESTDIR)$(man5dir)
# the source file name of btrfs.5 clashes with section 8 page, but we # the source file name of btrfs.5 clashes with section 8 page, but we
# want to keep the code generic # want to keep the code generic
mv $(DESTDIR)$(man5dir)/btrfs-mount.5.gz $(DESTDIR)$(man5dir)/btrfs.5.gz $(MV) $(DESTDIR)$(man5dir)/btrfs-mount.5.gz $(DESTDIR)$(man5dir)/btrfs.5.gz
$(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir) $(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir)
$(LN_S) -f btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz $(LN_S) -f btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz
@ -118,4 +120,4 @@ clean:
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \ $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
$(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \ $(ASCIIDOC_EXTRA) -abtrfs_version=$(BTRFS_VERSION) \
-o $@+ $< && \ -o $@+ $< && \
mv $@+ $@ $(MV) $@+ $@

View File

@ -76,6 +76,15 @@ AC_ARG_ENABLE([documentation],
AS_IF([test "x$enable_documentation" = xyes], [DISABLE_DOCUMENTATION=0], [DISABLE_DOCUMENTATION=1]) AS_IF([test "x$enable_documentation" = xyes], [DISABLE_DOCUMENTATION=0], [DISABLE_DOCUMENTATION=1])
AC_SUBST([DISABLE_DOCUMENTATION]) AC_SUBST([DISABLE_DOCUMENTATION])
dnl detect tools to build documentation
if test "x$enable_documentation" = xyes; then
AC_PATH_PROG([ASCIIDOC], [asciidoc], [asciidoc])
AC_PATH_PROG([XMLTO], [xmlto], [xmlto])
AC_PATH_PROG([GZIP], [gzip], [gzip])
AC_PATH_PROG([MV], [mv], [mv])
AC_PROG_SED
fi
dnl Define <NAME>_LIBS= and <NAME>_CFLAGS= by pkg-config dnl Define <NAME>_LIBS= and <NAME>_CFLAGS= by pkg-config
dnl dnl