[MLton-commit] r4866

Matthew Fluet fluet at mlton.org
Tue Nov 28 14:08:07 PST 2006


Merge trunk revisions 4851:4865 into x86_64 branch
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/Makefile
U   mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-2002/top-level/Makefile
U   mlton/branches/on-20050822-x86_64-branch/benchmark/Makefile
U   mlton/branches/on-20050822-x86_64-branch/doc/examples/ffi/Makefile
U   mlton/branches/on-20050822-x86_64-branch/doc/examples/finalizable/Makefile
U   mlton/branches/on-20050822-x86_64-branch/doc/examples/profiling/Makefile
U   mlton/branches/on-20050822-x86_64-branch/doc/examples/save-world/Makefile
U   mlton/branches/on-20050822-x86_64-branch/doc/hacker-guide/Makefile
U   mlton/branches/on-20050822-x86_64-branch/doc/library-guide/Makefile
U   mlton/branches/on-20050822-x86_64-branch/doc/mlb-formal/Makefile
U   mlton/branches/on-20050822-x86_64-branch/doc/style-guide/Makefile
U   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml
U   mlton/branches/on-20050822-x86_64-branch/lib/opengl/Makefile
U   mlton/branches/on-20050822-x86_64-branch/mllex/Makefile
U   mlton/branches/on-20050822-x86_64-branch/mlnlffigen/Makefile
U   mlton/branches/on-20050822-x86_64-branch/mlprof/Makefile
U   mlton/branches/on-20050822-x86_64-branch/mlton/Makefile
U   mlton/branches/on-20050822-x86_64-branch/mlton/front-end/Makefile
U   mlton/branches/on-20050822-x86_64-branch/mlyacc/Makefile
U   mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c

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

Modified: mlton/branches/on-20050822-x86_64-branch/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,46 +6,51 @@
  # See the file MLton-LICENSE for details.
  ##
 
-export TARGET = self
-export TARGET_ARCH = $(shell bin/host-arch)
-export TARGET_OS = $(shell bin/host-os)
-ROOT = $(shell pwd)
-BUILD = $(ROOT)/build
-SRC = $(ROOT)
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-INC = $(LIB)/include
-COMP = $(SRC)/mlton
-MLTON = $(BIN)/mlton
-AOUT = mlton-compile
+export TARGET := self
+export TARGET_ARCH := $(shell bin/host-arch)
+export TARGET_OS := $(shell bin/host-os)
+ROOT := $(shell pwd)
+BUILD := $(ROOT)/build
+SRC := $(ROOT)
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+INC := $(LIB)/include
+COMP := $(SRC)/mlton
+RUN := $(SRC)/runtime
+MLTON := $(BIN)/mlton
+AOUT := mlton-compile
 ifeq (mingw, $(TARGET_OS))
-EXE = .exe
+EXE := .exe
 else
-EXE =
+EXE :=
 endif
-MLBPATHMAP = $(LIB)/mlb-path-map
-TARGETMAP = $(LIB)/target-map
-SPEC = package/rpm/mlton.spec
-LEX = mllex
-PROF = mlprof
-YACC = mlyacc
-NLFFIGEN = mlnlffigen
-PATH = $(BIN):$(SRC)/bin:$(shell echo $$PATH)
-CP = /bin/cp -fpR
-GZIP = gzip --force --best
-RANLIB = ranlib
+MLBPATHMAP := $(LIB)/mlb-path-map
+TARGETMAP := $(LIB)/target-map
+SPEC := package/rpm/mlton.spec
+LEX := mllex
+PROF := mlprof
+YACC := mlyacc
+NLFFIGEN := mlnlffigen
+PATH := $(BIN):$(SRC)/bin:$(shell echo $$PATH)
+CP := /bin/cp -fpR
+GZIP := gzip --force --best
+RANLIB := ranlib
 
 # If we're compiling with another version of MLton, then we want to do
 # another round of compilation so that we get a MLton built without
 # stubs.
 ifeq (other, $(shell if [ ! -x "$(BIN)/mlton" ]; then echo other; fi))
-	BOOTSTRAP_OTHER=true
+	BOOTSTRAP_OTHER:=true
 else
-	BOOTSTRAP_OTHER=false
+	BOOTSTRAP_OTHER:=false
 endif
 
-VERSION ?= $(shell date +%Y%m%d)
-RELEASE ?= 1
+ifeq ($(origin VERSION), undefined)
+	VERSION := $(shell date +%Y%m%d)
+endif
+ifeq ($(origin RELEASE), undefined)
+	RELEASE := 1
+endif
 
 .PHONY: all
 all:
@@ -108,7 +113,7 @@
 	./tmp >"$(LIB)/$(TARGET)/constants"
 	rm -f tmp tmp.c
 
-DEBSRC = mlton-$(VERSION).orig
+DEBSRC := mlton-$(VERSION).orig
 .PHONY: deb
 deb:
 	$(MAKE) clean clean-svn version
@@ -156,7 +161,7 @@
 		bin/make-pdf-guide; \
 	fi
 
-BSDSRC = /tmp/mlton-$(VERSION)
+BSDSRC := /tmp/mlton-$(VERSION)
 .PHONY: freebsd
 freebsd:
 	$(MAKE) clean clean-svn version
@@ -168,7 +173,7 @@
         # do not change "make" to "$(MAKE)" in the following line
 	cd "$(BSDSRC)/package/freebsd" && MAINTAINER_MODE=yes make build-package  
 
-LIBRARIES = ckit-lib cml mlnlffi-lib mlyacc-lib smlnj-lib
+LIBRARIES := ckit-lib cml mlnlffi-lib mlyacc-lib smlnj-lib
 
 .PHONY: libraries-no-check
 libraries-no-check:
@@ -257,8 +262,8 @@
 		chmod a+x "$(MLTON).$$t";				\
 	done
 
-TOPDIR = 'TOPDIR-unset'
-SOURCEDIR = $(TOPDIR)/SOURCES/mlton-$(VERSION)
+TOPDIR := 'TOPDIR-unset'
+SOURCEDIR := $(TOPDIR)/SOURCES/mlton-$(VERSION)
 .PHONY: rpms
 rpms:
 	$(MAKE) clean clean-svn version
@@ -352,44 +357,44 @@
 # 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.
-DESTDIR = $(CURDIR)/install
-PREFIX = /usr
+DESTDIR := $(CURDIR)/install
+PREFIX := /usr
 ifeq ($(TARGET_OS), cygwin)
-PREFIX = /
+PREFIX := /
 endif
 ifeq ($(TARGET_OS), darwin)
-PREFIX = /usr/local
+PREFIX := /usr/local
 endif
 ifeq ($(TARGET_OS), mingw)
-PREFIX = /mingw
+PREFIX := /mingw
 endif
 ifeq ($(TARGET_OS), solaris)
-PREFIX = /usr/local
+PREFIX := /usr/local
 endif
-prefix = $(PREFIX)
-MAN_PREFIX_EXTRA =
-TBIN = $(DESTDIR)$(prefix)/bin
-ULIB = lib/mlton
-TLIB = $(DESTDIR)$(prefix)/$(ULIB)
-TMAN = $(DESTDIR)$(prefix)$(MAN_PREFIX_EXTRA)/man/man1
-TDOC = $(DESTDIR)$(prefix)/share/doc/mlton
+prefix := $(PREFIX)
+MAN_PREFIX_EXTRA :=
+TBIN := $(DESTDIR)$(prefix)/bin
+ULIB := lib/mlton
+TLIB := $(DESTDIR)$(prefix)/$(ULIB)
+TMAN := $(DESTDIR)$(prefix)$(MAN_PREFIX_EXTRA)/man/man1
+TDOC := $(DESTDIR)$(prefix)/share/doc/mlton
 ifeq ($(TARGET_OS), cygwin)
-TDOC = $(DESTDIR)$(prefix)/usr/share/doc/mlton
+TDOC := $(DESTDIR)$(prefix)/usr/share/doc/mlton
 endif
 ifeq ($(TARGET_OS), solaris)
-TDOC = $(DESTDIR)$(prefix)/doc/mlton
+TDOC := $(DESTDIR)$(prefix)/doc/mlton
 endif
-TEXM = $(TDOC)/examples
+TEXM := $(TDOC)/examples
 
-GZIP_MAN = true
+GZIP_MAN := true
 ifeq ($(TARGET_OS), solaris)
-GZIP_MAN = false
+GZIP_MAN := false
 endif
 
 .PHONY: install
 install: install-docs install-no-docs
 
-MAN_PAGES =  \
+MAN_PAGES :=  \
 	mllex.1 \
 	mlnlffigen.1 \
 	mlprof.1 \
@@ -447,7 +452,7 @@
 	find "$(TEXM)/" -name .svn -type d | xargs rm -rf
 	find "$(TEXM)/" -name .ignore -type f | xargs rm -rf
 
-TDOCBASE = $(DESTDIR)$(prefix)/share/doc-base
+TDOCBASE := $(DESTDIR)$(prefix)/share/doc-base
 
 .PHONY: post-install-debian
 post-install-debian:	

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-2002/top-level/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-2002/top-level/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-2002/top-level/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -5,7 +5,7 @@
  # See the file MLton-LICENSE for details.
  ##
 
-GEN = generate-overloads
+GEN := generate-overloads
 
 overloads.sml: $(GEN).sml
 	mlton $(GEN).sml

Modified: mlton/branches/on-20050822-x86_64-branch/benchmark/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/benchmark/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/benchmark/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,17 +6,17 @@
  # See the file MLton-LICENSE for details.
  ##
 
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET)	\
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET)	\
 	-default-ann 'sequenceNonUnit warn' \
 	-default-ann 'warnUnused true'
-NAME = benchmark
-PATH = $(BIN):$(shell echo $$PATH)
+NAME := benchmark
+PATH := $(BIN):$(shell echo $$PATH)
 
 all: 	$(NAME)
 
@@ -40,19 +40,19 @@
 tags:
 	etags *.fun *.sig *.sml
 
-BENCH = barnes-hut boyer checksum count-graphs DLXSimulator fft fib flat-array hamlet imp-for knuth-bendix lexgen life logic mandelbrot matrix-multiply md5 merge mlyacc model-elimination mpuz nucleic output1 peek psdes-random ratio-regions ray raytrace simple smith-normal-form tailfib tak tensor tsp tyan vector-concat vector-rev vliw wc-input1 wc-scanStream zebra zern
-FPBENCH = barnes-hut fft hamlet mandelbrot matrix-multiply nucleic ray raytrace simple tensor tsp tyan vliw zern
+BENCH := barnes-hut boyer checksum count-graphs DLXSimulator fft fib flat-array hamlet imp-for knuth-bendix lexgen life logic mandelbrot matrix-multiply md5 merge mlyacc model-elimination mpuz nucleic output1 peek psdes-random ratio-regions ray raytrace simple smith-normal-form tailfib tak tensor tsp tyan vector-concat vector-rev vliw wc-input1 wc-scanStream zebra zern
+FPBENCH := barnes-hut fft hamlet mandelbrot matrix-multiply nucleic ray raytrace simple tensor tsp tyan vliw zern
 
-BFLAGS = -mlton "/usr/bin/mlton" -mlton "mlton -optimize-ssa {false,true}"
-BFLAGS = -wiki -mlton "/usr/bin/mlton" -mlkit -mosml -poly -smlnj
-BFLAGS = -mlton "$(BIN)/mlton"
+BFLAGS := -mlton "/usr/bin/mlton" -mlton "mlton -optimize-ssa {false,true}"
+BFLAGS := -wiki -mlton "/usr/bin/mlton" -mlkit -mosml -poly -smlnj
+BFLAGS := -mlton "$(BIN)/mlton"
 
 .PHONY: test
 test: $(NAME)
 	cd tests && ../benchmark $(BFLAGS) $(BENCH)
 
-QBENCH = $(BENCH)
-QBFLAGS = -mlton "mlton{-stable,.cvs.HEAD -detect-overflow {false,true}}"
+QBENCH := $(BENCH)
+QBFLAGS := -mlton "mlton{-stable,.cvs.HEAD -detect-overflow {false,true}}"
 
 .PHONY: qtest
 qtest: $(NAME)

Modified: mlton/branches/on-20050822-x86_64-branch/doc/examples/ffi/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/doc/examples/ffi/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/doc/examples/ffi/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,9 +6,9 @@
  # See the file MLton-LICENSE for details.
  ##
 
-PATH = ../../../build/bin:$(shell echo $$PATH)
+PATH := ../../../build/bin:$(shell echo $$PATH)
 
-mlton = mlton -default-ann 'allowFFI true'
+mlton := mlton -default-ann 'allowFFI true'
 
 .PHONY: all
 all: import import2 export iimport test_quot

Modified: mlton/branches/on-20050822-x86_64-branch/doc/examples/finalizable/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/doc/examples/finalizable/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/doc/examples/finalizable/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -5,9 +5,9 @@
  # See the file MLton-LICENSE for details.
  ##
 
-PATH = ../../../build/bin:$(shell echo $$PATH)
+PATH := ../../../build/bin:$(shell echo $$PATH)
 
-mlton = mlton -default-ann 'allowFFI true'
+mlton := mlton -default-ann 'allowFFI true'
 
 all:
 	$(mlton) finalizable.sml cons.c

Modified: mlton/branches/on-20050822-x86_64-branch/doc/examples/profiling/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/doc/examples/profiling/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/doc/examples/profiling/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,14 +6,14 @@
  # See the file MLton-LICENSE for details.
  ##
 
-mlton = mlton
-mlprof = mlprof
-ALLOC_EX = list-rev
-COUNT_EX = tak
-MULT_EX = fib-tak
-TIME_EX = tak
+mlton := mlton
+mlprof := mlprof
+ALLOC_EX := list-rev
+COUNT_EX := tak
+MULT_EX := fib-tak
+TIME_EX := tak
 
-PATH = ../../../build/bin:$(shell echo $$PATH)
+PATH := ../../../build/bin:$(shell echo $$PATH)
 
 .PHONY: all
 all: profile-time profile-alloc profile-count profile-stack profile-multiple

Modified: mlton/branches/on-20050822-x86_64-branch/doc/examples/save-world/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/doc/examples/save-world/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/doc/examples/save-world/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,9 +6,9 @@
  # See the file MLton-LICENSE for details.
  ##
 
-PATH = ../../../build/bin:$(shell echo $$PATH)
+PATH := ../../../build/bin:$(shell echo $$PATH)
 
-mlton = mlton
+mlton := mlton
 
 all: test
 

Modified: mlton/branches/on-20050822-x86_64-branch/doc/hacker-guide/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/doc/hacker-guide/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/doc/hacker-guide/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,7 +6,7 @@
  # See the file MLton-LICENSE for details.
  ##
 
-TEX_FILES = \
+TEX_FILES := \
 	abstract.tex		\
 	basis-library.tex	\
 	main.tex		\
@@ -16,7 +16,7 @@
 	runtime.tex		\
 	sources.tex		\
 
-FIG_FILES = \
+FIG_FILES := \
 	structure.ps		\
 
 all:	main.ps

Modified: mlton/branches/on-20050822-x86_64-branch/doc/library-guide/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/doc/library-guide/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/doc/library-guide/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,12 +6,12 @@
  # See the file MLton-LICENSE for details.
  ##
 
-TEX_FILES = \
+TEX_FILES := \
 	abstract.tex		\
 	main.tex		\
 	macros.tex		\
 
-FIG_FILES = \
+FIG_FILES := \
 
 all:	main.ps
 

Modified: mlton/branches/on-20050822-x86_64-branch/doc/mlb-formal/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/doc/mlb-formal/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/doc/mlb-formal/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -5,7 +5,7 @@
  # See the file MLton-LICENSE for details.
  ##
 
-TEX_FILES = \
+TEX_FILES := \
 	bib.bib			\
 	mlb-formal.tex
 

Modified: mlton/branches/on-20050822-x86_64-branch/doc/style-guide/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/doc/style-guide/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/doc/style-guide/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,12 +6,12 @@
  # See the file MLton-LICENSE for details.
  ##
 
-TEX_FILES = \
+TEX_FILES := \
 	abstract.tex		\
 	main.tex		\
 	macros.tex		\
 
-FIG_FILES = \
+FIG_FILES := \
 
 all:	main.ps
 

Modified: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml	2006-11-28 22:08:04 UTC (rev 4866)
@@ -21,6 +21,7 @@
     type addr = Ptr.t
     type addr' = addr
 
+(*
     structure DL = DynLinkage
 
     fun main's s = DL.lib_symbol (DL.main_lib, s)
@@ -37,8 +38,8 @@
         let val p_u = _import * : MLton.Pointer.t -> addr -> unit;
         in p_u (DL.addr free_h) a
         end
+*)
 
-(*
     fun sys_malloc (n : Word32.word) = 
         let val w_p = _import "malloc" : Word32.word -> addr;
             val a = w_p n
@@ -49,7 +50,6 @@
         let val p_u = _import "free" : addr -> unit;
         in p_u a
         end
-*)
 
     fun alloc bytes = sys_malloc bytes
     fun free a = sys_free a

Modified: mlton/branches/on-20050822-x86_64-branch/lib/opengl/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/opengl/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/lib/opengl/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -1,11 +1,11 @@
-mlton = mlton
-MLTON_FLAGS = \
+mlton := mlton
+MLTON_FLAGS := \
 	-default-ann 'allowFFI true' \
 	-target-link-opt cygwin '-L/lib/w32api -lglut32 -lglu32 -lopengl32' \
         -target-link-opt darwin '-framework GLUT -framework OpenGL -framework Foundation' \
 	-target-link-opt linux '-lglut -lGLU -lGL'
 
-GL_OBJS  = GL_c.o GLUT_c.o
+GL_OBJS  := GL_c.o GLUT_c.o
 
 %_h.h: %.cm %.sig %.sml
 	$(mlton) $(MLTON_FLAGS) -export-header $@ -stop tc $<

Modified: mlton/branches/on-20050822-x86_64-branch/mllex/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mllex/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/mllex/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,15 +6,15 @@
  # See the file MLton-LICENSE for details.
  ##
 
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET)
-NAME = mllex
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET)
+NAME := mllex
+PATH := $(BIN):$(shell echo $$PATH)
 
 all:	$(NAME)
 

Modified: mlton/branches/on-20050822-x86_64-branch/mlnlffigen/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlnlffigen/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/mlnlffigen/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -5,15 +5,15 @@
  # See the file MLton-LICENSE for details.
  ##
 
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET) -default-ann 'sequenceNonUnit warn'
-NAME = mlnlffigen
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET) -default-ann 'sequenceNonUnit warn'
+NAME := mlnlffigen
+PATH := $(BIN):$(shell echo $$PATH)
 
 all:	$(NAME)
 

Modified: mlton/branches/on-20050822-x86_64-branch/mlprof/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlprof/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/mlprof/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,15 +6,15 @@
  # See the file MLton-LICENSE for details.
  ##
 
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET) -default-ann 'sequenceNonUnit warn' -default-ann 'warnUnused true'
-NAME = mlprof
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET) -default-ann 'sequenceNonUnit warn' -default-ann 'warnUnused true'
+NAME := mlprof
+PATH := $(BIN):$(shell echo $$PATH)
 
 all:	$(NAME)
 

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,38 +6,38 @@
  # See the file MLton-LICENSE for details.
  ##
 
-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
-TARGET = self
-AOUT = mlton-compile
-UP = upgrade-basis.sml
-PATH = $(BIN):$(shell echo $$PATH)
+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
+TARGET := self
+AOUT := mlton-compile
+UP := upgrade-basis.sml
+PATH := $(BIN):$(shell echo $$PATH)
 
-FLAGS = @MLton max-heap 640m ram-slop 0.7 gc-summary $(RUNTIME_ARGS) --
+FLAGS := @MLton max-heap 640m ram-slop 0.7 gc-summary $(RUNTIME_ARGS) --
 
 ifeq (self, $(shell if [ -x "$(BIN)/mlton" ]; then echo self; fi))
   # We're compiling MLton with itself, so don't use any stubs.
-  FILE = mlton.mlb
+  FILE := mlton.mlb
   FLAGS += -default-ann 'sequenceNonUnit warn'
   FLAGS += -default-ann 'warnUnused true'
 else
 ifeq (cygwin, $(HOST_OS))
   # The stubs don't work on Cygwin, since they define spawn in terms of
   # fork, and fork doesn't work on Cygwin.  So, make without the stubs.
-  FILE = mlton.cm
+  FILE := mlton.cm
 else
 ifeq (mingw, $(HOST_OS))
   # Ditto for MinGW.
-  FILE = mlton.cm
+  FILE := mlton.cm
 else
   # We're compiling MLton with an older version of itself, so use the stubs for
   # the MLton structure.
-  FILE = mlton-stubs.cm
+  FILE := mlton-stubs.cm
 endif
 endif
 endif
@@ -54,7 +54,7 @@
 endif
 FLAGS += $(COMPILE_ARGS)
 
-SOURCES =			\
+SOURCES :=			\
 	$(FILE)			\
 	$(UP)			\
 	front-end/ml.lex.sml 	\
@@ -102,7 +102,7 @@
 # Manager (CM) installed.  You may need to replace the following with
 # 'sml-cm'.
 #
-SML	= sml
+SML	:= sml
 
 .PHONY: def-use
 def-use:

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/front-end/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/front-end/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/front-end/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,10 +6,10 @@
  # See the file MLton-LICENSE for details.
  ##
 
-SRC = $(shell cd ../.. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd ../.. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+PATH := $(BIN):$(shell echo $$PATH)
 
 .PHONY: all
 all: ml.lex.sml ml.grm.sig ml.grm.sml mlb.lex.sml mlb.grm.sig mlb.grm.sml

Modified: mlton/branches/on-20050822-x86_64-branch/mlyacc/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlyacc/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/mlyacc/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,15 +6,15 @@
  # See the file MLton-LICENSE for details.
  ##
 
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET)
-NAME = mlyacc
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET)
+NAME := mlyacc
+PATH := $(BIN):$(shell echo $$PATH)
 
 all:	$(NAME)
 

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2006-11-28 22:08:04 UTC (rev 4866)
@@ -6,26 +6,26 @@
  # See the file MLton-LICENSE for details.
  ##
 
-PATH = ../bin:$(shell echo $$PATH)
+PATH := ../bin:$(shell echo $$PATH)
 
-TARGET = self
-TARGET_ARCH = $(shell ../bin/host-arch)
-TARGET_OS = $(shell ../bin/host-os)
-GCC_MAJOR_VERSION =						\
+TARGET := self
+TARGET_ARCH := $(shell ../bin/host-arch)
+TARGET_OS := $(shell ../bin/host-os)
+GCC_MAJOR_VERSION :=						\
 	$(shell gcc -v 2>&1 | grep 'gcc version' | 		\
 		sed 's/.*gcc version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/')
-GCC_MINOR_VERSION =						\
+GCC_MINOR_VERSION :=						\
 	$(shell gcc -v 2>&1 | grep 'gcc version' | 		\
 		sed 's/.*gcc version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/')
-GCC_VERSION = $(GCC_MAJOR_VERSION).$(GCC_MINOR_VERSION)
+GCC_VERSION := $(GCC_MAJOR_VERSION).$(GCC_MINOR_VERSION)
 
-FLAGS = 
-OPTFLAGS = -fomit-frame-pointer
-GCOPTFLAGS = 
-DEBUGFLAGS = 
-WARNFLAGS =
-OPTWARNFLAGS =
-DEBUGWARNFLAGS = 
+FLAGS := 
+OPTFLAGS := -O2 -fomit-frame-pointer
+GCOPTFLAGS := 
+DEBUGFLAGS := 
+WARNFLAGS := 
+OPTWARNFLAGS := 
+DEBUGWARNFLAGS := 
 
 ifeq ($(TARGET_ARCH), x86)
 ifeq ($(findstring $(GCC_MAJOR_VERSION), 3 4),$(GCC_MAJOR_VERSION))
@@ -86,20 +86,20 @@
 endif
 
 ifeq ($(TARGET), self)
-AR = ar rc
-RANLIB = ranlib
+AR := ar rc
+RANLIB := ranlib
 else
-AR = $(TARGET)-ar rc
-RANLIB = $(TARGET)-ranlib
+AR := $(TARGET)-ar rc
+RANLIB := $(TARGET)-ranlib
 FLAGS += -b $(TARGET)
 endif
 
-CC = gcc -std=gnu99
-CFLAGS = -I. -Iplatform $(FLAGS)
-OPTCFLAGS = $(CFLAGS) -O2 $(OPTFLAGS)
-DEBUGCFLAGS = $(CFLAGS) -g2 -O1 -DASSERT=1 $(DEBUGFLAGS)
+CC := gcc -std=gnu99
+CFLAGS := -I. -Iplatform $(FLAGS)
+OPTCFLAGS := $(CFLAGS) $(OPTFLAGS)
+DEBUGCFLAGS := $(CFLAGS) -g2 -O1 -DASSERT=1 $(DEBUGFLAGS)
 GCOPTCFLAGS = $(GCOPTFLAGS)
-WARNCFLAGS  =
+WARNCFLAGS :=
 WARNCFLAGS += -pedantic -Wall 
 ifeq ($(findstring $(GCC_MAJOR_VERSION), 3),$(GCC_MAJOR_VERSION))
 WARNCFLAGS += -W
@@ -142,34 +142,34 @@
 WARNCFLAGS += -Wlong-long
 # WARNCFLAGS += -Wunreachable-code
 WARNCFLAGS += $(WARNFLAGS)
-OPTWARNCFLAGS = $(WARNCFLAGS) -Wdisabled-optimization $(OPTWARNFLAGS)
-DEBUGWARNCFLAGS = $(WARNCFLAGS) $(DEBUGWARNFLAGS)
+OPTWARNCFLAGS := $(WARNCFLAGS) -Wdisabled-optimization $(OPTWARNFLAGS)
+DEBUGWARNCFLAGS := $(WARNCFLAGS) $(DEBUGWARNFLAGS)
 
 # GCC doesn't recognize the %I64 format specifier which means %ll on windows
 ifeq ($(TARGET_OS), mingw)
 WARNCFLAGS += -Wno-format -Wno-missing-format-attribute
 endif
 
-UTILCFILES =							\
+UTILCFILES :=							\
 	$(shell find util -type f | grep '\.c$$')
-UTILHFILES =							\
+UTILHFILES :=							\
 	$(shell find util -type f | grep '\.h$$')
-UTILOFILES = $(foreach f, $(UTILCFILES), $(basename $(f)).o)
+UTILOFILES := $(foreach f, $(UTILCFILES), $(basename $(f)).o)
 
-GCCFILES =							\
+GCCFILES :=							\
 	$(shell find gc -type f | grep '\.c$$')
-GCHFILES =							\
+GCHFILES :=							\
 	$(shell find gc -type f | grep '\.h$$')
 
-BASISHFILES =							\
+BASISHFILES :=							\
 	$(shell find basis -type f | grep '\.h$$')
 
-BYTECFILES =							\
+BYTECFILES :=							\
 	$(shell find bytecode -type f | grep '\.c$$')
-BYTEHFILES =							\
+BYTEHFILES :=							\
 	$(shell find bytecode -type f | grep '\.h$$')
 
-CFILES = 							\
+CFILES := 							\
 	$(UTILCFILES)						\
 	$(shell find basis -type f | grep '\.c$$' | grep -v Real/)	\
 	gc.c							\
@@ -179,7 +179,7 @@
 CFILES += bytecode/interpret.c
 endif
 
-HFILES = 							\
+HFILES := 							\
 	cenv.h                                                  \
 	$(UTILHFILES)						\
 	util.h							\
@@ -193,23 +193,23 @@
 	platform/$(TARGET_ARCH).h				\
 	$(BASISHFILES)
 
-FILES = $(basename $(CFILES))
+FILES := $(basename $(CFILES))
 
 # EXTRA_CFILES is for files that we don't want compiled in the big
 # lump when compiling COMPILE_FAST.
 # Real/*.c can't be there because gcc -O2 messes some of them up.
-EXTRA_CFILES =			\
+EXTRA_CFILES :=			\
 	$(shell find basis/Real -type f | grep '\.c$$')	\
 	platform/$(TARGET_OS).c
 
-EXTRA_FILES = $(basename $(EXTRA_CFILES))
+EXTRA_FILES := $(basename $(EXTRA_CFILES))
 
 ifeq ($(COMPILE_FAST), yes)
-  OBJS = runtime.o
-  DEBUG_OBJS = runtime-gdb.o
+  OBJS := runtime.o
+  DEBUG_OBJS := runtime-gdb.o
 else
-  OBJS = $(foreach f, $(FILES), $(f).o)
-  DEBUG_OBJS = $(foreach f, $(FILES), $(f)-gdb.o)
+  OBJS := $(foreach f, $(FILES), $(f).o)
+  DEBUG_OBJS := $(foreach f, $(FILES), $(f)-gdb.o)
 endif
 
 OBJS += $(foreach f, $(EXTRA_FILES), $(f).o)

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c	2006-11-28 22:08:04 UTC (rev 4866)
@@ -18,7 +18,7 @@
         void *address;
         const struct mach_header *mh;
 
-        _dyld_lookup_and_bind ("_main", &address, 0);
+        _dyld_lookup_and_bind ("_main", &address, NULL);
         mh = _dyld_get_image_header_containing_address (address);
         return (code_pointer)mh;
 }

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c	2006-11-28 19:39:53 UTC (rev 4865)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c	2006-11-28 22:08:04 UTC (rev 4866)
@@ -936,3 +936,91 @@
       fprintf(stderr, "%s: %s: %s\n", logident, severity[priority], msg);
   }
 }
+
+/* ------------------------------------------------- */
+/*                      libdl                        */
+/* ------------------------------------------------- */
+
+static DWORD dlerror_last = ERROR_SUCCESS;
+/* This is for emulating the ugly stateful behavior of dlerror. */
+
+static HMODULE dl_main_module = NULL;
+/* Handle to the main module returned by GetModuleHandle(NULL).  It is
+ * assumed that the main module isn't freed during the lifetime of the
+ * process.
+ */
+
+void *dlopen(const char *filename, int flag_IGNORED) {
+        if (!filename) {
+                if (!dl_main_module)
+                        dl_main_module = GetModuleHandle(NULL);
+
+                if (!dl_main_module)
+                        dlerror_last = GetLastError();
+
+                return dl_main_module;
+        }
+
+        {
+                HMODULE result = LoadLibrary(filename);
+
+                if (!result)
+                        dlerror_last = GetLastError();
+
+                return result;
+        }
+}
+
+const char *dlerror(void) {
+        if (ERROR_SUCCESS == dlerror_last) {
+                return NULL;
+        } else {
+                static char buffer[256];
+
+                if (!FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS |
+                                   FORMAT_MESSAGE_FROM_SYSTEM,
+                                   NULL, dlerror_last, 0,
+                                   buffer, sizeof(buffer),
+                                   NULL))
+                        snprintf(buffer, sizeof(buffer),
+                                 "Failed to format error message");
+
+                dlerror_last = ERROR_SUCCESS;
+
+                return buffer;
+        }
+}
+
+void *dlsym(void *void_hmodule, const char *symbol) {
+        HMODULE hmodule = void_hmodule;
+
+        if (!hmodule) {
+                dlerror_last = ERROR_INVALID_HANDLE;
+                return NULL;
+        }
+
+        {
+                void* result = GetProcAddress(hmodule, symbol);
+
+                if (!result)
+                        dlerror_last = GetLastError();
+
+                return result;
+        }
+}
+
+int dlclose(void *void_hmodule) {
+        HMODULE hmodule = void_hmodule;
+
+        if (!hmodule || hmodule == dl_main_module)
+                return 0;
+
+        {
+                int result = !FreeLibrary(hmodule);
+
+                if (result)
+                        dlerror_last = GetLastError();
+
+                return result;
+        }
+}




More information about the MLton-commit mailing list