summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-06-19 17:15:26 +0200
committerJim Meyering <meyering@redhat.com>2011-06-19 17:15:26 +0200
commitc8b5b09d1393139ba443e7e239cfa6a9c3e92258 (patch)
tree364f3da63ad08b4c4d3b0f213fe94decf4120543
parente783a23b1944d89405342f5d6a09dba26c192005 (diff)
downloaddiffutils-c8b5b09d1393139ba443e7e239cfa6a9c3e92258.tar.gz
build: don't require perl when building from a tarball
But do ensure -- in all other circumstances -- that the man/*.1 files are rebuilt whenever the version number changes. * configure.ac (SRC_VERSION_C): Define. * man/Makefile.am (dist_man1_MANS): Rename from $(man1_MANS), so that we distribute those pesky man/*.1 files. (EXTRA_DIST): Reflect name change. (MAINTAINERCLEANFILES): Define this, not DISTCLEANFILES, now that these generated files are distributed. ($(dist_man1_MANS)): Depend on $(SRC_VERSION_C), so we get the full dependency when not building from a tarball.
-rw-r--r--configure.ac13
-rw-r--r--man/Makefile.am8
2 files changed, 17 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 45e0fab..1afc344 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,6 +144,19 @@ fi
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
+# When .tarball-version exists, we're building from a tarball
+# and must not make man/*.1 files depend on the generated src/version.c,
+# because that would induce a requirement to run the help2man perl script.
+# We are not yet prepared to make perl a build-from-tarball requirement.
+# Hence, here we detect .tarball-version existence. When not present,
+# we define a variable to be used in man/Makefile.am to induce the
+# proper dependency (so that man/*.1 will be rebuilt upon any version change),
+# but not when built from a tarball.
+AC_SUBST([SRC_VERSION_C])
+test -f $srcdir/.tarball-version \
+ && SRC_VERSION_C= \
+ || SRC_VERSION_C=../src/version.c
+
AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION([0.17])
XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
diff --git a/man/Makefile.am b/man/Makefile.am
index 7c982fe..2a4faf3 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-man1_MANS = cmp.1 diff.1 diff3.1 sdiff.1
-EXTRA_DIST = $(man1_MANS:%.1=%.x) help2man
-DISTCLEANFILES = $(man1_MANS)
+dist_man1_MANS = cmp.1 diff.1 diff3.1 sdiff.1
+EXTRA_DIST = $(dist_man1_MANS:%.1=%.x) help2man
+MAINTAINERCLEANFILES = $(dist_man1_MANS)
S = $(top_srcdir)/src
cmp.1: $S/cmp.c cmp.x
@@ -26,7 +26,7 @@ diff3.1: $S/diff3.c diff3.x
sdiff.1: $S/sdiff.c sdiff.x
# Depend on the former to get version number changes.
-$(man1_MANS): ../src/version.c help2man
+$(dist_man1_MANS): $(SRC_VERSION_C) help2man
$(AM_V_GEN)base=`expr $@ : '\(.*\).1'` \
&& (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $S/$$base.c) \
| PATH=..$(PATH_SEPARATOR)$$PATH \