Index: Portfile
===================================================================
--- Portfile	(revision 98344)
+++ Portfile	(working copy)
@@ -3,7 +3,7 @@
 PortSystem 1.0
 
 name		mercury
-version		11.01
+version             11.07.2
 categories	lang
 maintainers	nomaintainer
 platforms	darwin
@@ -29,124 +29,35 @@
 
 distname	${name}-compiler-${version}
 
-checksums           md5     5d7dc00ab06f87ee5ddfb8dca088be56 \
-                    sha1    508f9fbebdf061f706a44db5c77868cb4e769066 \
-                    rmd160  bee82b6037fa1f14f27b43d6f7d751d232941bc7
+checksums           rmd160  5bad71e0a16289c837b8827f209d78326bdc5528 \
+                    sha256  8afee5732d6d52343fbba8d6b9dd3f87b819673743a408a564eede17956ea659
 
-worksrcdir	${name}-compiler-${version}
-
 depends_lib \
     port:readline
 
-patchfiles \
-    asm.patch \
-    nolibgcc.patch
+#patchfiles \
+#    nolibgcc.patch
 
 post-patch {
     reinplace "s:\*gcc\*:*gcc*|*clang*:" ${worksrcpath}/scripts/ml.in ${worksrcpath}/scripts/mgnuc.in
 }
 
-# Release notes state that gcc-4.0 generates a broken mercury compiler
-# llvm-gcc-4.2 fails to build
-if {${configure.compiler} == "gcc-4.0"} {
-    configure.compiler gcc-4.2
-    if {![file executable ${configure.cc}]} {
-        depends_build-append port:apple-gcc42
-        configure.compiler apple-gcc-4.2
-    }
-} elseif {${configure.compiler} == "llvm-gcc-4.2"} {
-    configure.compiler clang
-}
+# From README.MacOS: "Mercury does NOT work with llvm-gcc."
+# "As llvm-gcc is no longer supported as of version 3.0 of LLVM,
+# we have no intention of ever supporting Mercury with it."
+compiler.blacklist-append llvm-gcc-4.2
 
-# mercury doesn't honor $CFLAGS
-configure.cc ${configure.cc} -std=gnu89
+# From README.MacOS: "Apple gcc 4.0 does not work with Mercury."
+compiler.blacklist-append gcc-4.0
 
-# mercury's bootstrapping doesn't work with DESTDIR, so do it an ugly way...
-configure.pre_args-delete --prefix=${prefix}
-configure.pre_args-append --prefix=${destroot}${prefix}
-destroot.destdir ""
+# From README.MacOS: "Apple gcc 3.3 works with Mercury"
+# We recommend that users of Mac OS X 10.3 and 10.4 use this version."
 
-post-destroot {
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.memprof/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.prof/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.gc.trseg/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.par.gc/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.par.gc/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.par.gc/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.par.gc/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.par.gc/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.par.gc/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/hlc.par.gc/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/hlc.par.gc/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/libgc.dylib ${destroot}${prefix}/lib/mercury/lib/libgc.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/libgc_prof.dylib ${destroot}${prefix}/lib/mercury/lib/libgc_prof.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/libpar_gc.dylib ${destroot}${prefix}/lib/mercury/lib/libpar_gc.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.debug/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.debug/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.debug/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.debug/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.debug/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.debug/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.debug/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.debug/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.debug/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.debug/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.debug/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.debug/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.debug/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.debug/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.decldebug/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.prof/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.prof/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.prof/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.prof/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.prof/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.prof/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.prof/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.prof/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.prof/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.prof/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.prof/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.prof/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.prof/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.prof/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/none.gc.profdeep/libmer_trace.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.par.gc/libmer_browser.dylib ${destroot}${prefix}/lib/mercury/lib/none.par.gc/libmer_browser.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.par.gc/libmer_eventspec.dylib ${destroot}${prefix}/lib/mercury/lib/none.par.gc/libmer_eventspec.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.par.gc/libmer_mdbcomp.dylib ${destroot}${prefix}/lib/mercury/lib/none.par.gc/libmer_mdbcomp.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.par.gc/libmer_rt.dylib ${destroot}${prefix}/lib/mercury/lib/none.par.gc/libmer_rt.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.par.gc/libmer_ssdb.dylib ${destroot}${prefix}/lib/mercury/lib/none.par.gc/libmer_ssdb.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.par.gc/libmer_std.dylib ${destroot}${prefix}/lib/mercury/lib/none.par.gc/libmer_std.dylib"
-    system "install_name_tool -id ${prefix}/lib/mercury/lib/none.par.gc/libmer_trace.dylib ${destroot}${prefix}/lib/mercury/lib/none.par.gc/libmer_trace.dylib"
-
-    file delete ${destroot}${prefix}/var/macports/build
+# https://trac.macports.org/ticket/32542
+if {${configure.compiler} == "apple-gcc-4.2"} {
+    depends_build-append port:apple-gcc42
+    depends_skip_archcheck-append apple-gcc42
 }
+
+# mercury doesn't honor $CFLAGS
+configure.cc ${configure.cc} -std=gnu89
