diff: library.m bootstrapping problem fix

Fergus Henderson fjh at cs.mu.oz.au
Tue Jul 29 13:42:15 AEST 1997


Fix a bootstrapping problem introduced by my previous change
to make library.m automatically generated from library.m.in.

configure.in:
runtime/conf.h.in:
	Get autoconfigure to generate MR_VERSION and MR_FULLARCH macros,
	for use by library/library.m

library/library.m.in:
library/library.m:
	Rename library.m.in back to library.m again, and implement
	library__version using `pragma c_code' to get MR_VERSION and
	MR_FULLARCH from runtime/conf.h.

library/library.nu.nl.in:
	New file, contains a definition of library__version using
	the old method from library.m.in.  We still need to use this
	method for Prolog, because of course `pragma c_code' won't
	work for Prolog.

library/Mmakefile:
	Automatically generate library.nu.nl rather than library.m.
	Add library.nu to the list of files for NU-Prolog and SICStus Prolog.
	(Also delete the definitions of CHMOD and CHGRP, since they are
	unused and long since obsolete.)


cvs diff: Diffing .
Index: configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/configure.in,v
retrieving revision 1.100
diff -u -r1.100 configure.in
--- configure.in	1997/07/28 08:51:53	1.100
+++ configure.in	1997/07/29 02:27:02
@@ -45,6 +45,8 @@
 AC_CANONICAL_HOST
 FULLARCH="$host"
 AC_SUBST(FULLARCH)
+AC_DEFINE_UNQUOTED(MR_FULLARCH, "$FULLARCH")
+AC_DEFINE_UNQUOTED(MR_VERSION, "$VERSION")
 if test "$prefix" = "NONE"; then
 	PREFIX="$ac_default_prefix"
 else
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/Togl-1.2
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing library
Index: library/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/Mmakefile,v
retrieving revision 1.11
diff -u -r1.11 Mmakefile
--- Mmakefile	1997/07/28 08:52:08	1.11
+++ Mmakefile	1997/07/29 02:44:42
@@ -64,12 +64,13 @@
 
 NU_LIBRARY_NOS = \
 	io.nu.no require.nu.no std_util.nu.no string.nu.no term_io.nu.no \
-	int.nu.no float.nu.no char.nu.no mercury_builtin.nu.no
+	int.nu.no float.nu.no char.nu.no mercury_builtin.nu.no library.nu.no
 NU_OVERRIDING_LIBRARY_NOS = map.nu.no assoc_list.nu.no array.nu.no
 
 NU_LIBRARY_QLS = \
 	io.nu.ql require.nu.ql std_util.nu.ql string.nu.ql term_io.nu.ql \
-	int.nu.ql float.nu.ql char.nu.ql mercury_builtin.nu.ql sp_lib.ql
+	int.nu.ql float.nu.ql char.nu.ql mercury_builtin.nu.ql library.nu.ql \
+	sp_lib.ql
 NU_OVERRIDING_LIBRARY_QLS = map.nu.ql assoc_list.nu.ql array.nu.ql
 
 #-----------------------------------------------------------------------------#
@@ -106,13 +107,10 @@
 
 #-----------------------------------------------------------------------------#
 
-library.m: library.m.in ../VERSION ../Mmake.common
+library.nu.nl: library.nu.nl.in ../VERSION ../Mmake.common
 	sed	-e 's/@VERSION@/$(VERSION)/g' \
 		-e 's/@FULLARCH@/$(FULLARCH)/' \
-		library.m.in > library.m
-
-library.dep : library.m
-library.depend : library.m
+		library.nu.nl.in > library.nu.nl
 
 #-----------------------------------------------------------------------------#
 
@@ -226,9 +224,6 @@
 	rm -f sicstus_saved_state sicstus_compile sp_builtin.pl
 
 #-----------------------------------------------------------------------------#
-
-CHGRP=mercury
-CHMOD=go+w
 
 # Installation targets
 
cvs diff: library/library.m is a new entry, no comparison available
cvs diff: library/library.m.in was removed, no comparison available
cvs diff: library/library.nu.nl.in is a new entry, no comparison available
cvs diff: Diffing lp_solve
cvs diff: Diffing lp_solve/lp_examples
cvs diff: Diffing profiler
cvs diff: Diffing runtime
Index: runtime/conf.h.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/conf.h.in,v
retrieving revision 1.18
diff -u -r1.18 conf.h.in
--- conf.h.in	1997/07/27 15:08:04	1.18
+++ conf.h.in	1997/07/29 02:30:54
@@ -165,4 +165,14 @@
 */
 #undef	IO_HAVE_TEMPNAM
 
+/*
+** Which version of Mercury is this?  (Taken from the file ../VERSION.)
+*/
+#define MR_VERSION "unknown"
+
+/*
+** What system is this version of Mercury configured for?
+*/
+#define MR_FULLARCH "unknown"
+
 #endif /* CONF_H */
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing scripts
cvs diff: Diffing tools
cvs diff: Diffing trial
cvs diff: Diffing util

--- library.m.in	Tue Jul 29 12:47:36 1997
+++ library.m	Tue Jul 29 12:48:54 1997
@@ -33,7 +33,14 @@
 :- import_module store, rbtree, parser, lexer, ops.
 :- import_module prolog.
 
-library__version("@VERSION@, configured for @FULLARCH@").
+% library__version must be implemented using pragma c_code,
+% so we can get at the MR_VERSION and MR_FULLARCH configuration
+% parameters.  We can't just generate library.m from library.m.in
+% at configuration time, because that would cause bootstrapping problems --
+% might not have a Mercury compiler around to compile library.m with.
+
+:- pragma c_code(library__version(Version::out), will_not_call_mercury,
+	"Version = MR_VERSION "", configured for "" MR_FULLARCH;").
 
 %---------------------------------------------------------------------------%
 %---------------------------------------------------------------------------%


library/library.nu.nl.in:
%---------------------------------------------------------------------------%
% Copyright (C) 1997 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%---------------------------------------------------------------------------%

% We need a Prolog version of library__version, since library__version
% is implemented in Mercury using pragma c_code, which in turn is due to
% bootstrapping reasons explained in the comments in library.m.

library__version("@VERSION@, configured for @FULLARCH@").

%---------------------------------------------------------------------------%

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list