Try to detect when people are using one version of libguile and a
authorJim Blandy <jimb@red-bean.com>
Sun, 22 Jun 1997 23:46:41 +0000 (23:46 +0000)
committerJim Blandy <jimb@red-bean.com>
Sun, 22 Jun 1997 23:46:41 +0000 (23:46 +0000)
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
ice-9/Makefile.in
ice-9/boot-9.scm
ice-9/version.scm.in [new file with mode: 0644]

index bbd77d1..a8e0d75 100644 (file)
@@ -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
index 707e22d..8793034 100644 (file)
@@ -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)
index f449b71..25831be 100644 (file)
     (define-module (guile) :use-module (ice-9 regex)))
 
 \f
+;;; {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)))))
+    
+\f
 
 (define-module (guile))
 
diff --git a/ice-9/version.scm.in b/ice-9/version.scm.in
new file mode 100644 (file)
index 0000000..e69de29