Subject: make distcheck fails

From: Mike Gran <[email-masked]>
Date: Sun, 09 Mar 2025 17:49:55 -0700

Make distcheck on main is not working for me.  The issue is when it
tries to create a file called .version-t and then move it to .version.
It tries to create this file in $top_srcdir, which ought to be
read-only.

The following patch, in which I build it in $top_builddir, works for me.

Regards,
Mike Gran

>From d7bb81c3b6e26a320615cd7073468ca5207a08cf Mon Sep 17 00:00:00 2001
From: Michael Gran <[email-masked]>
Date: Sun, 9 Mar 2025 12:25:04 -0700
Subject: [PATCH] Fix make distcheck

The make distcheck would fail because it was generating a
.version file in the source directory, instead of the build directory

* Makefile.am (DISTCLEANFILES, BUILT_SOURCES, .version): use builddir for
  .version
---
 Makefile.am | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 6d73625c7..005d09b4e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -84,7 +84,7 @@ EXTRA_DIST = LICENSE HACKING GUILE-VERSION			\
 
 ACLOCAL_AMFLAGS = -I m4
 
-DISTCLEANFILES = check-guile.log
+DISTCLEANFILES = check-guile.log .version
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-error-on-warning --enable-mini-gmp
 
@@ -126,9 +126,9 @@ assert-no-store-file-names:
 	  exit 1 ;								\
 	fi
 
-BUILT_SOURCES += $(top_srcdir)/.version
-$(top_srcdir)/.version: Makefile
-	echo $(VERSION) > $@-t && mv $@-t $@
+BUILT_SOURCES += $(top_builddir)/.version
+$(top_builddir)/.version: Makefile
+	echo $(VERSION) > $(top_builddir)/$@-t && mv $(top_builddir)/$@-t $(top_builddir)/$@
 gen-tarball-version:
 	echo $(VERSION) > $(distdir)/.tarball-version
 
-- 
2.48.1