From 776ae1fb28c071b452a0a87d4fd8229fd6fe52bc Mon Sep 17 00:00:00 2001 From: Stefan Walter Date: Wed, 10 Dec 2008 08:44:24 +0000 Subject: This patch adds three features to the lang/mlton port: * Support for FreeBSD 6.x * Support for compilation with SML/NJ * Cross-compilation with mingw32 PR: 124061 Submitted by: Timothy Bourke Approved by: maintainer --- lang/mlton/files/upgrade-basis.sml | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lang/mlton/files/upgrade-basis.sml (limited to 'lang/mlton/files/upgrade-basis.sml') diff --git a/lang/mlton/files/upgrade-basis.sml b/lang/mlton/files/upgrade-basis.sml new file mode 100644 index 000000000000..7235efc7d47b --- /dev/null +++ b/lang/mlton/files/upgrade-basis.sml @@ -0,0 +1,68 @@ +structure MLton = + struct + open MLton + + structure Platform = + struct + fun peek (l, f) = List.find f l + fun omap (opt, f) = Option.map f opt + val toLower = String.translate (str o Char.toLower) + + structure Arch = + struct + datatype t = Alpha | AMD64 | ARM | HPPA | IA64 | m68k | + MIPS | PowerPC | S390 | Sparc | X86 + + val all = [(Alpha, "Alpha"), + (AMD64, "AMD64"), + (ARM, "ARM"), + (HPPA, "HPPA"), + (IA64, "IA64"), + (m68k, "m68k"), + (MIPS, "MIPS"), + (PowerPC, "PowerPC"), + (S390, "S390"), + (Sparc, "Sparc"), + (X86, "X86")] + + fun fromString s = + let + val s = toLower s + in + omap (peek (all, fn (_, s') => s = toLower s'), #1) + end + + val host = X86 + + fun toString a = #2 (valOf (peek (all, fn (a', _) => a = a'))) + end + + structure OS = + struct + datatype t = AIX | Cygwin | Darwin | FreeBSD | HPUX | Linux + | MinGW | NetBSD | OpenBSD | Solaris + + val all = [(AIX, "AIX"), + (Cygwin, "Cygwin"), + (Darwin, "Darwin"), + (FreeBSD, "FreeBSD"), + (HPUX, "HPUX"), + (Linux, "Linux"), + (MinGW, "MinGW"), + (NetBSD, "NetBSD"), + (OpenBSD, "OpenBSD"), + (Solaris, "Solaris")] + + fun fromString s = + let + val s = toLower s + in + omap (peek (all, fn (_, s') => s = toLower s'), #1) + end + + val host = FreeBSD + + fun toString a = #2 (valOf (peek (all, fn (a', _) => a = a'))) + end + end + end -- cgit v1.2.3