[MLton-commit] r4172

Stephen Weeks MLton@mlton.org
Tue, 8 Nov 2005 12:22:57 -0800


Extended upgrade-basis with an "arch" and "os" argument so it can be
used correctly to upgrade the basis when cross compiling.

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

U   mlton/trunk/bin/upgrade-basis
U   mlton/trunk/mlton/Makefile

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

Modified: mlton/trunk/bin/upgrade-basis
===================================================================
--- mlton/trunk/bin/upgrade-basis	2005-11-08 02:59:15 UTC (rev 4171)
+++ mlton/trunk/bin/upgrade-basis	2005-11-08 20:22:55 UTC (rev 4172)
@@ -11,12 +11,14 @@
 name=`basename $0`
 
 usage () {
-        die "usage: $name <PATH>"
+        die "usage: $name <PATH> <ARCH> <OS>"
 }
 
 case "$#" in
-1)
+3)
         PATH="$1"
+	ARCH="$2"
+	OS="$3"
 ;;
 *)
         usage
@@ -94,7 +96,7 @@
 structure LargeWord = Word'
 
 eval `$bin/platform`
-case $HOST_ARCH in
+case "$ARCH" in
 alpha)
         arch='Alpha'
 ;;
@@ -132,7 +134,7 @@
         die "strange HOST_ARCH: $HOST_ARCH"
 esac
 
-case $HOST_OS in
+case "$OS" in
 cygwin)
         os='Cygwin'
 ;;

Modified: mlton/trunk/mlton/Makefile
===================================================================
--- mlton/trunk/mlton/Makefile	2005-11-08 02:59:15 UTC (rev 4171)
+++ mlton/trunk/mlton/Makefile	2005-11-08 20:22:55 UTC (rev 4172)
@@ -9,6 +9,7 @@
 SRC = $(shell cd .. && pwd)
 BUILD = $(SRC)/build
 BIN = $(BUILD)/bin
+HOST_ARCH = $(shell $(SRC)/bin/host-arch)
 HOST_OS = $(shell $(SRC)/bin/host-os)
 LIB = $(BUILD)/lib
 MLTON = mlton
@@ -85,7 +86,7 @@
 #! Pass $(PATH) to upgrade-basis because it is run via #!/usr/bin/env
 # bash, which resets the path.
 $(UP):
-	$(SRC)/bin/upgrade-basis "$(PATH)" >$(UP)
+	$(SRC)/bin/upgrade-basis "$(PATH)" "$(HOST_ARCH)" "$(HOST_OS)" >$(UP)
 
 mlton.sml: $(SOURCES)
 	rm -f mlton.sml && mlton -stop sml mlton.cm && chmod -w mlton.sml