From: Andre Noll <maan@systemlinux.org>
Date: Sat, 4 Jun 2011 11:18:05 +0000 (+0200)
Subject: configure: Check for help2man.
X-Git-Tag: v0.4.8~9^2
X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=a4c69582ab4ea52ff5bfdb4e09c424d36f5585af;p=paraslash.git

configure: Check for help2man.

help2man is required for generating the man pages, so we should print
a proper error message at configure time if help2man is not installed.
---

diff --git a/Makefile.in b/Makefile.in
index 58553d77..660c381b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -12,6 +12,7 @@ cmdline_dir := @cmdline_dir@
 executables := @executables@
 
 GENGETOPT := @gengetopt@
+HELP2MAN := @help2man@
 
 build_date := $(shell date)
 uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS")
@@ -123,17 +124,17 @@ server_command_lists_ch = server_command_list.c afs_command_list.c \
 	server_command_list.h afs_command_list.h
 server_command_lists_man = server_command_list.man afs_command_list.man
 man/man1/para_server.1: para_server $(server_command_lists_man) | $(man_dir)
-	@[ -z "$(Q)" ] || echo 'HELP2MAN $<'
+	@[ -z "$(Q)" ] || echo 'MAN $<'
 	$(Q) opts="-h --detailed-help -N `for i in $(server_command_lists_man); do printf "%s\n" "-i $$i"; done`"; \
-	help2man $$opts ./para_server > $@
+	$(HELP2MAN) $$opts ./para_server > $@
 
 man/man1/para_audiod.1: para_audiod audiod_command_list.man | $(man_dir)
-	@[ -z "$(Q)" ] || echo 'HELP2MAN $<'
-	$(Q) help2man -h --detailed-help -N -i audiod_command_list.man ./para_audiod > $@
+	@[ -z "$(Q)" ] || echo 'MAN $<'
+	$(Q) $(HELP2MAN) -h --detailed-help -N -i audiod_command_list.man ./para_audiod > $@
 
 man/man1/%.1: % | $(man_dir)
-	@[ -z "$(Q)" ] || echo 'HELP2MAN $<'
-	$(Q) help2man -h --detailed-help -N ./$< > $@
+	@[ -z "$(Q)" ] || echo 'MAN $<'
+	$(Q) $(HELP2MAN) -h --detailed-help -N ./$< > $@
 
 man/html/%.html: man/man1/%.1
 	@[ -z "$(Q)" ] || echo 'MAN2HTML $<'
diff --git a/configure.ac b/configure.ac
index fd2e073b..cc88cf83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,9 @@ AC_PATH_PROG([gengetopt], [gengetopt])
 test -z "$gengetopt" && AC_MSG_ERROR(
 	[gengetopt is required to build this package])
 
-
+AC_PATH_PROG([help2man], [help2man])
+test -z "$help2man" && AC_MSG_ERROR(
+	[help2man is required to build this package])
 
 AC_PROG_CC
 AC_PROG_CPP