autoconf-patches
[Top][All Lists]
Advanced

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

Generate package.m4 in build-dir, not srcdir.


From: Jim Meyering
Subject: Generate package.m4 in build-dir, not srcdir.
Date: Sat, 10 Nov 2007 22:36:06 +0100

I don't know why the current code tries to build package.m4
in $(srcdir), but it fails when $(srcdir) is read-only, and
it appears to be unnecessary.  Here's how I propose to fix it:

        Generate package.m4 in build-dir, not srcdir.
        * tests/Makefile.am (package.m4): Adjust target.
        Don't redirect directly to address@hidden
        (CLEANFILES): Add package.m4.
        ($(TESTSUITE)): Depend on just-built package.m4, not the one
        in $(srcdir).
        When running $(AUTOTEST), search "." before searching $(srcdir).

---
 ChangeLog         |    8 ++++++++
 tests/Makefile.am |   11 ++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7934933..b94102a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2007-11-10  Jim Meyering  <address@hidden>

+       Generate package.m4 in build-dir, not srcdir.
+       * tests/Makefile.am (package.m4): Adjust target.
+       Don't redirect directly to address@hidden
+       (CLEANFILES): Add package.m4.
+       ($(TESTSUITE)): Depend on just-built package.m4, not the one
+       in $(srcdir).
+       When running $(AUTOTEST), search "." before searching $(srcdir).
+
        Avoid a race condition that would make parallel "distclean" fail.
        * tests/Makefile.am (distclean-generic): Replace the default,
        automake-provided rule with an identical one, but with an additional
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e069a0a..aa43da6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -35,7 +35,7 @@ include ../lib/freeze.mk
 ## ------------ ##

 # The `:;' works around a redirected compound command bash exit status bug.
-$(srcdir)/package.m4: Makefile
+package.m4: Makefile
        :; \
        {                                       \
          echo '# Signature of the current package.'; \
@@ -44,7 +44,8 @@ $(srcdir)/package.m4: Makefile
          echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])'; \
          echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])'; \
          echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
-       } >$(srcdir)/package.m4
+       } > address@hidden
+       mv address@hidden $@



@@ -53,7 +54,7 @@ $(srcdir)/package.m4: Makefile
 ## ---------- ##

 wrappers = autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames
-CLEANFILES = wrapper.in $(wrappers)
+CLEANFILES = wrapper.in $(wrappers) package.m4

 wrapper.in: $(srcdir)/wrapper.as $(m4sh_m4f_dependencies)
        $(MY_AUTOM4TE) --language=M4sh $(srcdir)/wrapper.as -o $@
@@ -109,12 +110,12 @@ TESTSUITE = ./testsuite
 # Don't use AUTOM4TE since `make alpha' makes it unavailable although
 # we are allowed to use it (since we ship it).
 AUTOTEST = $(MY_AUTOM4TE) --language=autotest
-$(TESTSUITE): $(srcdir)/package.m4 \
+$(TESTSUITE): package.m4 \
              local.at \
              $(TESTSUITE_AT) \
              $(autotest_m4f_dependencies)
        cd $(top_builddir)/lib/autotest && $(MAKE) $(AM_MAKEFLAGS) autotest.m4f
-       $(AUTOTEST) -I $(srcdir) suite.at -o address@hidden
+       $(AUTOTEST) -I . -I $(srcdir) suite.at -o address@hidden
        mv address@hidden $@

 atconfig: $(top_builddir)/config.status
--
1.5.3.5.622.g6fd7a




reply via email to

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