From 9946dd45a43e19a0de11ebc07e4dc9ed727fdd1b Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sun, 22 Jun 1997 23:46:41 +0000 Subject: [PATCH] Try to detect when people are using one version of libguile and a different version of ice-9. People have been skewing things and sending in bug reports. * version.scm.in: New file, which the configure script munges to produce version.scm, which contains the ice-9 config stamp. * boot-9.scm: Compare the libguile and ice-9 config stamps; display a warning if the two are different. * Makefile.am: Install version.scm, but don't distribute it. Distribute version.scm.in, but don't install it. * Makefile.in: Regenerated. --- ice-9/Makefile.am | 12 +++++++++--- ice-9/Makefile.in | 23 ++++++++++++++++++----- ice-9/boot-9.scm | 23 +++++++++++++++++++++++ ice-9/version.scm.in | 0 4 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 ice-9/version.scm.in diff --git a/ice-9/Makefile.am b/ice-9/Makefile.am index bbd77d190..a8e0d75af 100644 --- a/ice-9/Makefile.am +++ b/ice-9/Makefile.am @@ -2,10 +2,16 @@ AUTOMAKE_OPTIONS = foreign -subpkgdatadir = $(pkgdatadir)/$(VERSION)/ice-9 -subpkgdata_DATA = boot-9.scm debug.scm expect.scm hcons.scm lineio.scm \ +# These should be installed and distributed. +ice9_sources = boot-9.scm debug.scm expect.scm hcons.scm lineio.scm \ mapping.scm poe.scm regex.scm slib.scm tags.scm threads.scm r4rs.scm + +# These should be installed, but not distributed. +ice9_generated = version.scm + +subpkgdatadir = $(pkgdatadir)/$(VERSION)/ice-9 +subpkgdata_DATA = $(ice9_sources) $(ice9_generated) ETAGS_ARGS = $(subpkgdata_DATA) ## test.scm is not currently installed. -EXTRA_DIST = $(subpkgdata_DATA) test.scm +EXTRA_DIST = $(ice9_sources) test.scm version.scm.in diff --git a/ice-9/Makefile.in b/ice-9/Makefile.in index 707e22d61..879303478 100644 --- a/ice-9/Makefile.in +++ b/ice-9/Makefile.in @@ -58,6 +58,11 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CPP = @CPP@ +GUILE_MAJOR_VERSION = @GUILE_MAJOR_VERSION@ +GUILE_MINOR_VERSION = @GUILE_MINOR_VERSION@ +GUILE_STAMP = @GUILE_STAMP@ +GUILE_VERSION = @GUILE_VERSION@ +LD = @LD@ LIBLOBJS = @LIBLOBJS@ LIBTOOL = @LIBTOOL@ MAINT = @MAINT@ @@ -76,18 +81,24 @@ target_libs = @target_libs@ AUTOMAKE_OPTIONS = foreign -subpkgdatadir = $(pkgdatadir)/$(VERSION)/ice-9 -subpkgdata_DATA = boot-9.scm debug.scm expect.scm hcons.scm lineio.scm \ +# These should be installed and distributed. +ice9_sources = boot-9.scm debug.scm expect.scm hcons.scm lineio.scm \ mapping.scm poe.scm regex.scm slib.scm tags.scm threads.scm r4rs.scm + +# These should be installed, but not distributed. +ice9_generated = version.scm + +subpkgdatadir = $(pkgdatadir)/$(VERSION)/ice-9 +subpkgdata_DATA = $(ice9_sources) $(ice9_generated) ETAGS_ARGS = $(subpkgdata_DATA) -EXTRA_DIST = $(subpkgdata_DATA) test.scm +EXTRA_DIST = $(ice9_sources) test.scm version.scm.in mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../libguile/scmconfig.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = version.scm DATA = $(subpkgdata_DATA) -DIST_COMMON = COPYING ChangeLog Makefile.am Makefile.in +DIST_COMMON = COPYING ChangeLog Makefile.am Makefile.in version.scm.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -104,6 +115,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status +version.scm: $(top_builddir)/config.status version.scm.in + cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status install-subpkgdataDATA: $(subpkgdata_DATA) @$(NORMAL_INSTALL) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index f449b715e..25831be53 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -3852,6 +3852,29 @@ (if (memq 'regex *features*) (define-module (guile) :use-module (ice-9 regex))) + +;;; {Check that the interpreter and scheme code match up.} + +(let ((show-line + (lambda args + (with-output-to-port (current-error-port) + (lambda () + (display (car (command-line))) + (display ": ") + (for-each (lambda (string) (display string)) + args) + (newline)))))) + + (load-from-path "ice-9/version.scm") + + (if (not (string=? + (libguile-config-stamp) ; from the interprpreter + (ice-9-config-stamp))) ; from the Scheme code + (begin + (show-line "warning: different versions of libguile and ice-9:") + (show-line "libguile: configured on " (libguile-config-stamp)) + (show-line "ice-9: configured on " (ice-9-config-stamp))))) + (define-module (guile)) diff --git a/ice-9/version.scm.in b/ice-9/version.scm.in new file mode 100644 index 000000000..e69de29bb