[MLton-commit] r7074

Matthew Fluet fluet at mlton.org
Wed Apr 8 05:33:40 PDT 2009


Avoid world.

Set build date/node via autogenerated version.sml
----------------------------------------------------------------------

U   mlton/trunk/Makefile
U   mlton/trunk/bin/mlton-script
U   mlton/trunk/lib/mlton-stubs/mlton.sig
U   mlton/trunk/lib/mlton-stubs/mlton.sml
U   mlton/trunk/lib/mlton-stubs-for-polyml/mlton.sml
U   mlton/trunk/lib/mlton-stubs-for-smlnj/mlton.sml
U   mlton/trunk/mlton/Makefile
U   mlton/trunk/mlton/call-main.sml
A   mlton/trunk/mlton/control/.ignore
U   mlton/trunk/mlton/control/control-flags.sig
U   mlton/trunk/mlton/control/control-flags.sml
U   mlton/trunk/mlton/control/control.sml
U   mlton/trunk/mlton/control/sources.cm
U   mlton/trunk/mlton/control/sources.mlb
A   mlton/trunk/mlton/control/version_sml.src
D   mlton/trunk/mlton/main/export-mlton.sml
U   mlton/trunk/mlton/main/main.fun
U   mlton/trunk/mlton/main/sources.cm
U   mlton/trunk/mlton/main/sources.mlb
U   mlton/trunk/mlton/mlton-polyml.use

----------------------------------------------------------------------

Modified: mlton/trunk/Makefile
===================================================================
--- mlton/trunk/Makefile	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/Makefile	2009-04-08 12:33:36 UTC (rev 7074)
@@ -59,7 +59,7 @@
 
 .PHONY: all-no-docs
 all-no-docs:
-	$(MAKE) dirs runtime compiler world-no-check script mlbpathmap targetmap constants libraries tools
+	$(MAKE) dirs runtime compiler basis-no-check script mlbpathmap targetmap constants libraries tools
 # Remove $(AOUT) so that the $(MAKE) compiler below will remake MLton.
 # We also want to re-run the just-built tools (mllex and mlyacc)
 # because they may be better than those that were used for the first
@@ -68,7 +68,7 @@
 	rm -f "$(COMP)/$(AOUT)$(EXE)"
 	$(MAKE) -C "$(COMP)/front-end" clean
 endif
-	$(MAKE) compiler world
+	$(MAKE) compiler basis
 	@echo 'Build of MLton succeeded.'
 
 .PHONY: basis-no-check
@@ -118,8 +118,7 @@
 debugged:
 	$(MAKE) -C "$(COMP)" "AOUT=$(AOUT).debug" COMPILE_ARGS="-debug true -const 'Exn.keepHistory true' -profile-val true -const 'MLton.debug true' -drop-pass 'deepFlatten'"
 	$(CP) "$(COMP)/$(AOUT).debug" "$(LIB)/"
-	"$(LIB)/$(AOUT).debug" @MLton -- "$(LIB)/world.debug"
-	sed 's/mlton-compile/mlton-compile.debug/' < "$(MLTON)" | sed 's/world.mlton/world.debug.mlton/' > "$(MLTON).debug"
+	sed 's/mlton-compile/mlton-compile.debug/' < "$(MLTON)" > "$(MLTON).debug"
 	chmod a+x "$(MLTON).debug"
 
 .PHONY: dirs
@@ -186,10 +185,8 @@
 		$(MAKE) -C "$(COMP)" "AOUT=$(AOUT).$$t"			\
 			COMPILE_ARGS="-profile $$t";			\
 		$(CP) "$(COMP)/$(AOUT).$$t" "$(LIB)/";			\
-		"$(LIB)/$(AOUT).$$t" @MLton -- "$(LIB)/world.$$t";	\
-		sed "s/mlton-compile/mlton-compile.$$t/"		\
-			<"$(MLTON)" |					\
-			sed "s/world.mlton/world.$$t.mlton/"		\
+		sed "s/mlton-compile/mlton-compile.$$t/" 		\
+			<"$(MLTON)" | 					\
 			>"$(MLTON).$$t";				\
 		chmod a+x "$(MLTON).$$t";				\
 	done
@@ -260,8 +257,7 @@
 traced:
 	$(MAKE) -C "$(COMP)" "AOUT=$(AOUT).trace" COMPILE_ARGS="-const 'Exn.keepHistory true' -profile-val true -const 'MLton.debug true' -drop-pass 'deepFlatten'"
 	$(CP) "$(COMP)/$(AOUT).trace" "$(LIB)/"
-	"$(LIB)/$(AOUT).trace" @MLton -- "$(LIB)/world.trace"
-	sed 's/mlton-compile/mlton-compile.trace/' < "$(MLTON)" | sed 's/world.mlton/world.trace.mlton/' > "$(MLTON).trace"
+	sed 's/mlton-compile/mlton-compile.trace/' < "$(MLTON)" > "$(MLTON).trace"
 	chmod a+x "$(MLTON).trace"
 
 .PHONY: tools
@@ -283,7 +279,7 @@
 		package/debian/changelog				\
 		"$(SPEC)"						\
 		package/freebsd/Makefile				\
-		mlton/control/control-flags.sml;			\
+		mlton/control/version_sml.src;				\
 	do								\
 		sed "s/\(.*\)MLTONVERSION\(.*\)/\1$(VERSION)\2/" <"$$f" >z && \
 		mv z "$$f";						\
@@ -291,21 +287,7 @@
 	sed <"$(SPEC)" >z "/^Release:/s;.*;Release: $(RELEASE);"
 	mv z "$(SPEC)"
 
-.PHONY: world-no-check
-world-no-check:
-	@echo 'Making world.'
-	$(MAKE) basis-no-check
-	"$(LIB)/$(AOUT)$(EXE)" @MLton -- "$(LIB)/world"
 
-.PHONY: world
-world:
-	$(MAKE) world-no-check
-	@echo 'Type checking basis.'
-	"$(MLTON)" -disable-ann deadCode \
-		-stop tc \
-		'$$(SML_LIB)/basis/libs/all.mlb' \
-		>/dev/null
-
 # The TBIN and TLIB are where the files are going to be after installing.
 # The DESTDIR and is added onto them to indicate where the Makefile actually
 # puts them.

Modified: mlton/trunk/bin/mlton-script
===================================================================
--- mlton/trunk/bin/mlton-script	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/bin/mlton-script	2009-04-08 12:33:36 UTC (rev 7074)
@@ -17,7 +17,6 @@
 ;;
 esac
 mlton="$lib/mlton-compile$exe"
-mlton_world="$lib/world.mlton"
 
 smlnj='sml'
 # Try to use the SML/NJ .arch-n-opsys
@@ -49,7 +48,7 @@
 esac
 
 doitMLton () {
-    exec "$mlton" @MLton load-world "$mlton_world" ram-slop 0.5 "${rargs[@]}" -- "$@"
+    exec "$mlton" @MLton ram-slop 0.5 "${rargs[@]}" -- "$@"
 }
 doitSMLNJ () {
     exec "$smlnj" @SMLload="$mlton_smlnj_heap" "$@"
@@ -58,10 +57,8 @@
     exec "$mlton_polyml" "$@"
 }
 
-# If $mlton is executable and $mlton_world exists and is not older than
-# $njHeap (which exists), then use MLton, otherwise use SML/NJ.
 doit () {
-        if [ -x "$mlton" -a -s "$mlton_world" ]; then
+        if [ -x "$mlton" ]; then
             doitMLton "$@"
         elif [ -s "$mlton_smlnj_heap" ]; then
             doitSMLNJ "$@"

Modified: mlton/trunk/lib/mlton-stubs/mlton.sig
===================================================================
--- mlton/trunk/lib/mlton-stubs/mlton.sig	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/lib/mlton-stubs/mlton.sig	2009-04-08 12:33:36 UTC (rev 7074)
@@ -48,5 +48,5 @@
 (*       structure Weak: MLTON_WEAK *)
 (*       structure Word: MLTON_WORD *)
 (*       structure Word8: MLTON_WORD *)
-      structure World: MLTON_WORLD
+(*       structure World: MLTON_WORLD *)
    end

Modified: mlton/trunk/lib/mlton-stubs/mlton.sml
===================================================================
--- mlton/trunk/lib/mlton-stubs/mlton.sml	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/lib/mlton-stubs/mlton.sml	2009-04-08 12:33:36 UTC (rev 7074)
@@ -490,10 +490,9 @@
 
       structure World =
          struct
-            datatype status = datatype MLton.World.status
-            val save = MLton.World.save
-
+            datatype status = Clone | Original
             fun load _ = raise Fail "World.load"
+            fun save _ = raise Fail "MLton.World.save"
             fun saveThread _ = raise Fail "World.saveThread"
          end
 

Modified: mlton/trunk/lib/mlton-stubs-for-polyml/mlton.sml
===================================================================
--- mlton/trunk/lib/mlton-stubs-for-polyml/mlton.sml	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/lib/mlton-stubs-for-polyml/mlton.sml	2009-04-08 12:33:36 UTC (rev 7074)
@@ -20,9 +20,4 @@
             fun setMessages (b : bool) = ()
             fun pack () = collect ()
          end
-      structure World =
-         struct
-            datatype status = Clone | Original
-            val save = fn _ => raise Fail "MLton.World.save"
-         end
    end

Modified: mlton/trunk/lib/mlton-stubs-for-smlnj/mlton.sml
===================================================================
--- mlton/trunk/lib/mlton-stubs-for-smlnj/mlton.sml	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/lib/mlton-stubs-for-smlnj/mlton.sml	2009-04-08 12:33:36 UTC (rev 7074)
@@ -20,9 +20,4 @@
             fun setMessages b = SMLofNJ.Internals.GC.messages b
             fun pack () = collect ()
          end
-      structure World =
-         struct
-            datatype status = Clone | Original
-            val save = fn _ => raise Fail "MLton.World.save"
-         end
    end

Modified: mlton/trunk/mlton/Makefile
===================================================================
--- mlton/trunk/mlton/Makefile	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/Makefile	2009-04-08 12:33:36 UTC (rev 7074)
@@ -78,9 +78,17 @@
 front-end/mlb.grm.sig front-end/mlb.grm.sml: front-end/mlb.grm
 	$(MAKE) -C front-end mlb.grm.sig mlb.grm.sml
 
+control/version.sml: control/version_sml.src
+	cat control/version_sml.src |						\
+		sed "s/\(.*\)MLTONBUILDDATE\(.*\)/\1`date`\2/" |		\
+		sed "s/\(.*\)MLTONBUILDNODE\(.*\)/\1`uname -n`\2/" >		\
+		control/version.sml
+
 $(AOUT): $(SOURCES)
 	rm -f $(UP)
 	$(MAKE) $(UP)
+	rm -f control/version.sml
+	$(MAKE) control/version.sml
 	@echo 'Compiling mlton (takes a while)'
 	mlton $(FLAGS) $(FILE)
 
@@ -108,6 +116,8 @@
 
 .PHONY: smlnj-mlton
 smlnj-mlton: $(SOURCES)
+	rm -f control/version.sml
+	$(MAKE) control/version.sml
 	(									\
 		echo 'SMLofNJ.Internals.GC.messages false;';			\
 		echo '#set CM.Control.verbose false;';				\
@@ -119,6 +129,8 @@
 
 .PHONY: smlnj-mlton-dual
 smlnj-mlton-dual: $(SOURCES)
+	rm -f control/version.sml
+	$(MAKE) control/version.sml
 	(									\
 		echo 'SMLofNJ.Internals.GC.messages false;';			\
 		echo '#set CM.Control.verbose false;';				\
@@ -132,6 +144,8 @@
 
 .PHONY: smlnj-mlton-quad
 smlnj-mlton-quad: $(SOURCES)
+	rm -f control/version.sml
+	$(MAKE) control/version.sml
 	(									\
 		echo 'SMLofNJ.Internals.GC.messages false;';			\
 		echo '#set CM.Control.verbose false;';				\
@@ -176,6 +190,8 @@
 
 .PHONY: polyml-mlton
 polyml-mlton: mlton-polyml.use $(SOURCES)
+	rm -f control/version.sml
+	$(MAKE) control/version.sml
 	(									\
 		echo 'use "mlton-polyml.use";';					\
 		echo 'PolyML.export("mlton-polyml", Main.mainWrapped);';	\

Modified: mlton/trunk/mlton/call-main.sml
===================================================================
--- mlton/trunk/mlton/call-main.sml	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/call-main.sml	2009-04-08 12:33:36 UTC (rev 7074)
@@ -7,4 +7,4 @@
  * See the file MLton-LICENSE for details.
  *)
 
-val _ = ExportMLton.exportMLton ()
+val _ = Main.mainWrapped ()

Added: mlton/trunk/mlton/control/.ignore
===================================================================
--- mlton/trunk/mlton/control/.ignore	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/control/.ignore	2009-04-08 12:33:36 UTC (rev 7074)
@@ -0,0 +1 @@
+version.sml

Modified: mlton/trunk/mlton/control/control-flags.sig
===================================================================
--- mlton/trunk/mlton/control/control-flags.sig	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/control/control-flags.sig	2009-04-08 12:33:36 UTC (rev 7074)
@@ -24,9 +24,6 @@
 
       val atMLtons: string vector ref
 
-      (* build identifies the machine on which this MLton was built. *)
-      val build: string
-
       datatype chunk =
          OneChunk
        | ChunkPerFunc
@@ -371,9 +368,6 @@
        | Detail
       val verbosity: verbosity ref
 
-      (* version number *)
-      val version: string
-
       val warnAnn: bool ref
 
       val zoneCutDepth: int ref

Modified: mlton/trunk/mlton/control/control-flags.sml
===================================================================
--- mlton/trunk/mlton/control/control-flags.sml	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/control/control-flags.sml	2009-04-08 12:33:36 UTC (rev 7074)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -32,9 +33,6 @@
                         toString = fn v => Layout.toString (Vector.layout
                                                             String.layout v)}
 
-val build = concat ["(built ", Date.toString (Date.now ()),
-                    " on ", Process.hostName (), ")"]
-
 structure Chunk =
    struct
       datatype t =
@@ -1088,8 +1086,6 @@
                          default = Silent,
                          toString = Verbosity.toString}
 
-val version = "MLton MLTONVERSION"
-
 val warnAnn = control {name = "warn unrecognized annotation",
                        default = true,
                        toString = Bool.toString}

Modified: mlton/trunk/mlton/control/control.sml
===================================================================
--- mlton/trunk/mlton/control/control.sml	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/control/control.sml	2009-04-08 12:33:36 UTC (rev 7074)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -37,7 +38,7 @@
    let
       val (pre, suf) = preSuf style
       val lines =
-         concat [version, " ", build]
+         Version.banner
          :: concat ["  created this file on ", Date.toString (Date.now ()), "."]
          :: "Do not edit this file."
          :: "Flag settings: "

Modified: mlton/trunk/mlton/control/sources.cm
===================================================================
--- mlton/trunk/mlton/control/sources.cm	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/control/sources.cm	2009-04-08 12:33:36 UTC (rev 7074)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -18,6 +19,7 @@
 structure Source
 structure SourcePos
 structure System
+structure Version
 
 is
 
@@ -32,6 +34,7 @@
 region.sml
 source.sig
 source.sml
+version.sml
 control.sig
 control.sml
 system.sig

Modified: mlton/trunk/mlton/control/sources.mlb
===================================================================
--- mlton/trunk/mlton/control/sources.mlb	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/control/sources.mlb	2009-04-08 12:33:36 UTC (rev 7074)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -18,6 +19,7 @@
    region.sml
    source.sig
    source.sml
+   version.sml
    control.sig
    control.sml
    system.sig
@@ -33,4 +35,5 @@
    structure Source
    structure SourcePos
    structure System
+   structure Version
 end

Added: mlton/trunk/mlton/control/version_sml.src
===================================================================
--- mlton/trunk/mlton/control/version_sml.src	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/control/version_sml.src	2009-04-08 12:33:36 UTC (rev 7074)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2009 Matthew Fluet.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Version =
+   struct
+      val version = "MLTONVERSION"
+      val buildDate = "MLTONBUILDDATE"
+      val buildNode = "MLTONBUILDNODE"
+
+      val banner = concat ["MLton ", version,
+                           " (built ", buildDate,
+                           " on ", buildNode, ")"]
+   end
\ No newline at end of file

Deleted: mlton/trunk/mlton/main/export-mlton.sml
===================================================================
--- mlton/trunk/mlton/main/export-mlton.sml	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/main/export-mlton.sml	2009-04-08 12:33:36 UTC (rev 7074)
@@ -1,20 +0,0 @@
-(* Copyright (C) 2009 Matthew Fluet.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- *)
-
-structure ExportMLton =
-   struct
-      fun exportMLton (): unit =
-         case CommandLine.arguments () of
-            [worldFile] =>
-               let
-                  open MLton.World OS.Process
-               in
-                  case save (worldFile ^ ".mlton") of
-                     Original => exit success
-                   | Clone => Main.mainWrapped ()
-               end
-          | _ => Error.bug "usage: exportMLton worldFile"
-   end

Modified: mlton/trunk/mlton/main/main.fun
===================================================================
--- mlton/trunk/mlton/main/main.fun	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/main/main.fun	2009-04-08 12:33:36 UTC (rev 7074)
@@ -1068,7 +1068,7 @@
                                       MLton.Platform.OS.toString targetOS])
                else ()
       fun printVersion (out: Out.t): unit =
-         Out.output (out, concat [version, " ", build, "\n"])
+         Out.output (out, concat [Version.banner, "\n"])
       val () =
          case !show of
             NONE => ()
@@ -1539,9 +1539,6 @@
 
 val main = fn (_, args) => commandLine args
 
-val mainWrapped = fn () =>
-   OS.Process.exit
-   (main (CommandLine.name (), CommandLine.arguments ())
-    handle _ => OS.Process.failure)
+val mainWrapped = fn () => OS.Process.exit (commandLine (CommandLine.arguments ()))
 
 end

Modified: mlton/trunk/mlton/main/sources.cm
===================================================================
--- mlton/trunk/mlton/main/sources.cm	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/main/sources.cm	2009-04-08 12:33:36 UTC (rev 7074)
@@ -10,10 +10,6 @@
 Group
 
 structure Main
-#if (defined (SMLNJ_VERSION))
-#else
-structure ExportMLton
-#endif
 
 is
 
@@ -39,7 +35,3 @@
 main.sig
 main.fun
 main.sml
-#if (defined (SMLNJ_VERSION))
-#else
-export-mlton.sml
-#endif

Modified: mlton/trunk/mlton/main/sources.mlb
===================================================================
--- mlton/trunk/mlton/main/sources.mlb	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/main/sources.mlb	2009-04-08 12:33:36 UTC (rev 7074)
@@ -30,7 +30,6 @@
    main.sig
    main.fun
    main.sml
-   export-mlton.sml
 in
-   structure ExportMLton
+   structure Main
 end

Modified: mlton/trunk/mlton/mlton-polyml.use
===================================================================
--- mlton/trunk/mlton/mlton-polyml.use	2009-04-08 12:33:34 UTC (rev 7073)
+++ mlton/trunk/mlton/mlton-polyml.use	2009-04-08 12:33:36 UTC (rev 7074)
@@ -221,6 +221,7 @@
 use "control/region.sml";
 use "control/source.sig";
 use "control/source.sml";
+use "control/version.sml";
 use "control/control.sig";
 use "control/control.sml";
 use "control/system.sig";




More information about the MLton-commit mailing list