[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] [PATCH] build: don't require perl when building from a t

From: Jim Meyering
Subject: [bug-diffutils] [PATCH] build: don't require perl when building from a tarball
Date: Sun, 19 Jun 2011 17:33:43 +0200

The most recent changes added an undesirable build-from-tarball dependency
on perl.  This removes it, yet retains (in all other cases) the improved
man->../src/version.c dependency tracking:

>From c8b5b09d1393139ba443e7e239cfa6a9c3e92258 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 19 Jun 2011 17:15:26 +0200
Subject: [PATCH] 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.
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.
 configure.ac    |   13 +++++++++++++
 man/Makefile.am |    8 ++++----
 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

+# 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.
+test -f $srcdir/.tarball-version \
+  && SRC_VERSION_C= \
+  || SRC_VERSION_C=../src/version.c
 AM_GNU_GETTEXT([external], [need-ngettext])
 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
+dist_man1_MANS = cmp.1 diff.1 diff3.1 sdiff.1
+EXTRA_DIST = $(dist_man1_MANS:%.1=%.x) help2man

 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                           \

reply via email to

[Prev in Thread] Current Thread [Next in Thread]