Update to Poly/ML 5.5.1
Contributed by Imre Vadasz on pkgsrc-users (slightly adapted).


Changes in Poly/ML Version 5.5.1

Major New Features and Changes

  * The intermediate code optimiser has been largely rewritten.
    The optimiser now detects various additional cases where a
    closures or tuples can be stored on the stack rather than
    requiring heap storage
  * The match compiler that processes a sequence of patterns in a
    case or fun-binding has been reworked. This now handles
    complex matches that used to result in a code blow-up
  * A"polyc" script has been added to aid compiling and linking
    ML code to produce a stand-alone binary. This is intended as
    an analogue of cc and gcc. The easiest way to build a binary
    is now to put the ML code into a file (foo.ML) with a
    function "main" that is the entry point to the code. Then run
    polyc -o foo foo.ML
    The script takes care of any libraries that may be required.
    It does require that the poly binary and libraries have been
    installed to the location that was specified in the configure
    script.
  * Set the default in the configure script not to build a shared
    library. This can be overidden with --enable-shared. The
    advantage of this is that binaries created from Poly/ML,
    including poly itself, do not require libpolyml at run-time.
  * Additions and changes to the command-line options when
    starting the ML top-level
      + The --eval option can be followed by a string which is
        compiled and executed before the top-level is entered
      + The --script option can be used to allow ML code to be
        run as a script (a "shell script") in Unix. It reads the
        file name given as the last option, skipping the first
        line if it begins #!. Implies -q option. Note: because of
        the way scripts pass their options if used this must be
        the only option. To use ML as a script put the ML code
        into a file, put
        #! /usr/local/bin/poly --script
        as the first line, modifying the path depending on where
        poly is installed, and set the file to have execute
        permission.
      + The -q option now sets the print depth to zero as well as
        suppressing the start-up message
      + The input prompt (> or #) is only produced if the input
        is a terminal. The -i option should be used to cause the
        prompt to be produced if, for example, the input is from
        a pipe.

Minor Additions and Changes

  * The -H option now sets the initial heap size rather than
    being a synonym for --minheap
  * Add large file support
  * When printing the fields a record print them in alphabetical
    order rather than the system order used in the compiler
  * Convert the representation of the statistics to use ASN1
    encoding. This is byte-order and word-length independent and
    allows 32-bit Poly/ML to read the statistics of 64-bit Poly/
    ML on the same machine and vice-versa.
  * Add a substructure Exception to the PolyML structure to hold
    all the functions related to exceptions.
  * The default for --gc-threads is now the number of independent
    physical processors. Hyperthreaded cores are counted as
    single cores rather than dual cores.
  * Improve the GC and allocation code for very large arrays
  * Improve handling of OS.Process.system in Cygwin
  * Improved versions of Word32 and Word64. These are used for
    SystemWord and LargeWord.

Bug Fixes

  * Fix Word32.fromLargeInt which could return values outside the
    range of Word32
  * Fix segfault in PolyML.stackTrace
  * Fix errors in conversion of string to real values
  * Fix segfault when a thread created in foreign code called an
    ML callback
  * Fix profiler which could often report UNKNOWN function
  * Fix bug with overlapped areas in ArraySlice.copy
  * Fix InternalError exception with ML code where a fixed record
    type could not be found
  * Fix bug with equality on BoolVector.vector
  * Raise the correct exception (Size) for negative lengths in
    canInput and inputN
  * Fix Real.fromInt with an argument that was an arbitrary
    precision number in the long form
  * Fix error in the timing information printed with
    PolyML.timing true in Windows.
  * Fix occasional problem with input/output as a result of the
    stream token being represented by an immutable value but then
    being checked for equality
  * Fix bug in X86-64 code-generator with literal constants that
    do not fit in 32-bits. It could result in an "InternalError:
    gen32s: invalid word" exception. Includes regression test.
  * Fix LargWord.fromInt which was wrong for large negative
    values
  * Fix bug in power-of-two function in code-generator. This
    caused an infinite loop with Word.* when multiplying by a
    constant with the highest bit set and not a power of two.
  * Fix bug in structure matching code
  * Use ELF_Rela relocation structures for all relocations in
    X86-64. Some systems e.g. Solaris require this.
Updated lang/polyml to 5.5.1
Use uniform shared library names to avoid packaging list divergence.
This fixes package (and some its dependents) on FreeBSD at least.
DIR is reserved for dirent.h, so use a different type name.
Don't panic about unused functions.
Disable optimisation for disassembler.cpp for Clang, it will eat too
much memory.
LC_CTYPE needs <clocale>
Don't try to optimize some files, clang will require up to 8GB of memory
for tracking all the jumps.
Don't panic about unused functions.
The Clang 3.4RCs started to use slightly more memory when compiling
Calculator.cpp, but it was enough to push it over 2GB. So disable
optimisation for now.
Force explicit bool conversion for C++11 mode.
Require qt4-tools to make cmake happy.
Needs libiconv to build on FreeBSD.
Bump revision as precaution.
Disable optimisations for Clang for the Scribus 1.3.4 import filter.
Fix return type. Bump revision.
g_message is a function in GTK now, so use a different name.
Build expr.c without optimisation for clang.
Build one test case without optimisation to restrict memory use.
Uses deprecated GTK interfaces.
FreeBSD 9 lacks the same set of functions as NetBSD 6.