summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeri Harris <keri@gentoo.org>2010-10-10 05:01:38 +0000
committerKeri Harris <keri@gentoo.org>2010-10-10 05:01:38 +0000
commitf05cda5a3792601555767ab1c4cc7d1682b4ac73 (patch)
tree889fcd1084a7ddeae4f343c069f3726c573a3a06 /dev-lang
parentFix multilib support for mercury runtime (diff)
downloadgentoo-2-f05cda5a3792601555767ab1c4cc7d1682b4ac73.tar.gz
gentoo-2-f05cda5a3792601555767ab1c4cc7d1682b4ac73.tar.bz2
gentoo-2-f05cda5a3792601555767ab1c4cc7d1682b4ac73.zip
Version bump
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/mercury/ChangeLog19
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-boehm_gc.patch133
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-bootstrap-depend.patch43
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-char-det-from-int.patch12
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-default-grade.patch274
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-docs.patch21
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-linker-flags.patch66
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-multilib.patch232
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-no-reconf.patch59
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-sparc-llds-base-grade.patch11
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-tests-sandbox.patch64
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-tests-static-link.patch11
-rw-r--r--dev-lang/mercury/files/mercury-10.04.2-tests-workspace.patch29
-rw-r--r--dev-lang/mercury/mercury-10.04.2.ebuild184
14 files changed, 1157 insertions, 1 deletions
diff --git a/dev-lang/mercury/ChangeLog b/dev-lang/mercury/ChangeLog
index ee3a40c65220..5cceb500a4bc 100644
--- a/dev-lang/mercury/ChangeLog
+++ b/dev-lang/mercury/ChangeLog
@@ -1,6 +1,23 @@
# ChangeLog for dev-lang/mercury
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/ChangeLog,v 1.118 2010/10/10 04:54:08 keri Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/ChangeLog,v 1.119 2010/10/10 05:01:38 keri Exp $
+
+*mercury-10.04.2 (10 Oct 2010)
+
+ 10 Oct 2010; <keri@gentoo.org> +mercury-10.04.2.ebuild,
+ +files/mercury-10.04.2-boehm_gc.patch,
+ +files/mercury-10.04.2-bootstrap-depend.patch,
+ +files/mercury-10.04.2-char-det-from-int.patch,
+ +files/mercury-10.04.2-default-grade.patch,
+ +files/mercury-10.04.2-docs.patch,
+ +files/mercury-10.04.2-linker-flags.patch,
+ +files/mercury-10.04.2-multilib.patch,
+ +files/mercury-10.04.2-no-reconf.patch,
+ +files/mercury-10.04.2-sparc-llds-base-grade.patch,
+ +files/mercury-10.04.2-tests-sandbox.patch,
+ +files/mercury-10.04.2-tests-static-link.patch,
+ +files/mercury-10.04.2-tests-workspace.patch:
+ Version bump
10 Oct 2010; <keri@gentoo.org> files/mercury-10.04.1-linker-flags.patch:
Fix multilib support for mercury runtime
diff --git a/dev-lang/mercury/files/mercury-10.04.2-boehm_gc.patch b/dev-lang/mercury/files/mercury-10.04.2-boehm_gc.patch
new file mode 100644
index 000000000000..5aea83405c2d
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-boehm_gc.patch
@@ -0,0 +1,133 @@
+diff -urN mercury-compiler-10.04.2.orig/boehm_gc/Makefile.direct mercury-compiler-10.04.1/boehm_gc/Makefile.direct
+--- mercury-compiler-10.04.2.orig/boehm_gc/Makefile.direct 2010-02-24 20:04:32.000000000 +1300
++++ mercury-compiler-10.04.2/boehm_gc/Makefile.direct 2010-09-05 09:07:10.000000000 +1200
+@@ -407,6 +407,7 @@
+ ./if_mach SPARC SOLARIS $(CC) -c -o mach_dep2.o $(srcdir)/sparc_mach_dep.S
+ ./if_mach SPARC OPENBSD $(AS) -o mach_dep2.o $(srcdir)/sparc_sunos4_mach_dep.s
+ ./if_mach SPARC NETBSD $(AS) -o mach_dep2.o $(srcdir)/sparc_netbsd_mach_dep.s
++ ./if_mach SPARC LINUX $(CC) -c -o mach_dep2.o $(SPECIALCFLAGS) $(srcdir)/sparc_generic_mach_dep.c
+ ./if_mach SPARC "" $(CC) -c -o mach_dep1.o $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
+ ./if_mach SPARC "" ld -r -o mach_dep.o mach_dep1.o mach_dep2.o
+ ./if_mach IA64 "" as $(AS_ABI_FLAG) -o ia64_save_regs_in_stack.o $(srcdir)/ia64_save_regs_in_stack.s
+diff -urN mercury-compiler-10.04.2.orig/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/sparc.h mercury-compiler-10.04.1/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/sparc.h
+--- mercury-compiler-10.04.2.orig/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/sparc.h 2010-02-23 19:28:41.000000000 +1300
++++ mercury-compiler-10.04.2/boehm_gc/libatomic_ops/src/atomic_ops/sysdeps/gcc/sparc.h 2010-09-05 09:07:10.000000000 +1200
+@@ -39,32 +39,6 @@
+
+ #define AO_HAVE_test_and_set_full
+
+-#ifndef AO_NO_SPARC_V9
+-/* Returns nonzero if the comparison succeeded. */
+-AO_INLINE int
+-AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) {
+- char ret;
+- __asm__ __volatile__ ("membar #StoreLoad | #LoadLoad\n\t"
+-# if defined(__arch64__)
+- "casx [%2],%0,%1\n\t"
+-# else
+- "cas [%2],%0,%1\n\t" /* 32-bit version */
+-# endif
+- "membar #StoreLoad | #StoreStore\n\t"
+- "cmp %0,%1\n\t"
+- "be,a 0f\n\t"
+- "mov 1,%0\n\t"/* one insn after branch always executed */
+- "clr %0\n\t"
+- "0:\n\t"
+- : "=r" (ret), "+r" (new_val)
+- : "r" (addr), "0" (old)
+- : "memory", "cc");
+- return (int)ret;
+-}
+-
+-#define AO_HAVE_compare_and_swap_full
+-#endif /* AO_NO_SPARC_V9 */
+-
+ /* FIXME: This needs to be extended for SPARC v8 and v9. */
+ /* SPARC V8 also has swap. V9 has CAS. */
+ /* There are barriers like membar #LoadStore. */
+diff -urN mercury-compiler-10.04.2.orig/boehm_gc/sparc_generic_mach_dep.c mercury-compiler-10.04.1/boehm_gc/sparc_generic_mach_dep.c
+--- mercury-compiler-10.04.2.orig/boehm_gc/sparc_generic_mach_dep.c 1970-01-01 12:00:00.000000000 +1200
++++ mercury-compiler-10.04.2/boehm_gc/sparc_generic_mach_dep.c 2010-09-05 09:07:10.000000000 +1200
+@@ -0,0 +1,82 @@
++# include "private/gc_priv.h"
++
++/* On register window machines, we need a way to force registers into */
++/* the stack. Return sp. */
++# ifdef SPARC
++ asm(" .seg \"text\"");
++# if defined(SVR4) || defined(NETBSD) || defined(FREEBSD)
++ asm(" .globl GC_save_regs_in_stack");
++ asm("GC_save_regs_in_stack:");
++ asm(" .type GC_save_regs_in_stack,#function");
++# else
++ asm(" .globl _GC_save_regs_in_stack");
++ asm("_GC_save_regs_in_stack:");
++# endif
++# if defined(__arch64__) || defined(__sparcv9)
++ asm(" save %sp,-128,%sp");
++ asm(" flushw");
++ asm(" ret");
++ asm(" restore %sp,2047+128,%o0");
++# else
++ asm(" ta 0x3 ! ST_FLUSH_WINDOWS");
++ asm(" retl");
++ asm(" mov %sp,%o0");
++# endif
++# ifdef SVR4
++ asm(" .GC_save_regs_in_stack_end:");
++ asm(" .size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack");
++# endif
++# ifdef LINT
++ word GC_save_regs_in_stack() { return(0 /* sp really */);}
++# endif
++# endif
++
++/* GC_clear_stack_inner(arg, limit) clears stack area up to limit and */
++/* returns arg. Stack clearing is crucial on SPARC, so we supply */
++/* an assembly version that's more careful. Assumes limit is hotter */
++/* than sp, and limit is 8 byte aligned. */
++#if defined(ASM_CLEAR_CODE)
++# ifdef SUNOS4
++ asm(".globl _GC_clear_stack_inner");
++ asm("_GC_clear_stack_inner:");
++# else
++ asm(".globl GC_clear_stack_inner");
++ asm("GC_clear_stack_inner:");
++ asm(".type GC_save_regs_in_stack,#function");
++# endif
++#if defined(__arch64__) || defined(__sparcv9)
++ asm("mov %sp,%o2"); /* Save sp */
++ asm("add %sp,2047-8,%o3"); /* p = sp+bias-8 */
++ asm("add %o1,-2047-192,%sp"); /* Move sp out of the way, */
++ /* so that traps still work. */
++ /* Includes some extra words */
++ /* so we can be sloppy below. */
++ asm("loop:");
++ asm("stx %g0,[%o3]"); /* *(long *)p = 0 */
++ asm("cmp %o3,%o1");
++ asm("bgu,pt %xcc, loop"); /* if (p > limit) goto loop */
++ asm("add %o3,-8,%o3"); /* p -= 8 (delay slot) */
++ asm("retl");
++ asm("mov %o2,%sp"); /* Restore sp., delay slot */
++#else
++ asm("mov %sp,%o2"); /* Save sp */
++ asm("add %sp,-8,%o3"); /* p = sp-8 */
++ asm("clr %g1"); /* [g0,g1] = 0 */
++ asm("add %o1,-0x60,%sp"); /* Move sp out of the way, */
++ /* so that traps still work. */
++ /* Includes some extra words */
++ /* so we can be sloppy below. */
++ asm("loop:");
++ asm("std %g0,[%o3]"); /* *(long long *)p = 0 */
++ asm("cmp %o3,%o1");
++ asm("bgu loop "); /* if (p > limit) goto loop */
++ asm("add %o3,-8,%o3"); /* p -= 8 (delay slot) */
++ asm("retl");
++ asm("mov %o2,%sp"); /* Restore sp., delay slot */
++#endif /* old SPARC */
++ /* First argument = %o0 = return value */
++# ifdef SVR4
++ asm(" .GC_clear_stack_inner_end:");
++ asm(" .size GC_clear_stack_inner,.GC_clear_stack_inner_end-GC_clear_stack_inner");
++# endif
++#endif
diff --git a/dev-lang/mercury/files/mercury-10.04.2-bootstrap-depend.patch b/dev-lang/mercury/files/mercury-10.04.2-bootstrap-depend.patch
new file mode 100644
index 000000000000..c4e5d89e5c75
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-bootstrap-depend.patch
@@ -0,0 +1,43 @@
+--- mercury-compiler-10.04.2.orig/Mmakefile 2009-10-20 17:07:24.000000000 +1300
++++ mercury-compiler-10.04.2/Mmakefile 2010-10-10 10:05:55.000000000 +1300
+@@ -167,6 +167,13 @@
+ library/$(deps_subdir)$(STD_LIB_NAME).dep
+ +cd deep_profiler && $(SUBDIR_MMAKE) depend
+
++.PHONY: bootstrap_depend
++ifeq ("$(BOOTSTRAP_MC)","")
++bootstrap_depend:
++else
++bootstrap_depend: depend
++endif
++
+ # depend_library MUST be done before depend_compiler and depend_profiler
+
+ .PHONY: depend
+--- mercury-compiler-10.04.2.orig/Mmake.common.in 2009-10-10 23:44:13.000000000 +1300
++++ mercury-compiler-10.04.2/Mmake.common.in 2010-10-10 10:21:52.000000000 +1300
+@@ -30,6 +30,7 @@
+
+ # Specify the Mercury compiler to use for bootstrapping.
+ MC = @BOOTSTRAP_MC_COMPILER@
++BOOTSTRAP_MC = @BOOTSTRAP_MC@
+
+ # Specify the compilation model to use for compiling the compiler.
+ GRADE = @GRADE@
+--- mercury-compiler-10.04.2.orig/configure.in 2010-08-23 23:04:53.000000000 +1200
++++ mercury-compiler-10.04.2/configure.in 2010-10-10 11:42:43.000000000 +1300
+@@ -4426,11 +4426,11 @@
+ #-----------------------------------------------------------------------------#
+
+ if test "$BOOTSTRAP_MC" = ""; then
+- BOOTSTRAP_MC=mmc
++ BOOTSTRAP_MC_COMPILER=mmc
++else
++ BOOTSTRAP_MC_COMPILER="$BOOTSTRAP_MC"
+ fi
+-BOOTSTRAP_MC_COMPILER="$BOOTSTRAP_MC"
+ BOOTSTRAP_MC_ARGS="$HAVE_BOXED_FLOATS --conf-low-tag-bits $LOW_TAG_BITS --bits-per-word $BITS_PER_WORD --bytes-per-word $BYTES_PER_WORD"
+-BOOTSTRAP_MC="$BOOTSTRAP_MC_COMPILER $BOOTSTRAP_MC_ARGS"
+ AC_SUBST(BOOTSTRAP_MC_COMPILER)
+ AC_SUBST(BOOTSTRAP_MC_ARGS)
+ AC_SUBST(BOOTSTRAP_MC)
diff --git a/dev-lang/mercury/files/mercury-10.04.2-char-det-from-int.patch b/dev-lang/mercury/files/mercury-10.04.2-char-det-from-int.patch
new file mode 100644
index 000000000000..6136ec3ab501
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-char-det-from-int.patch
@@ -0,0 +1,12 @@
+--- mercury-compiler-10.04.2.orig/configure.in 2010-08-23 23:04:53.000000000 +1200
++++ mercury-compiler-10.04.2/configure.in 2010-10-10 11:39:59.000000000 +1300
+@@ -309,7 +309,8 @@
+ Version >= 8,
+ ac(2) ^ elem(3, 5) = 17,
+ (1 .. 2) = [[1, 2]],
+- Global = 561
++ Global = 561,
++ char.det_from_int(255) = '\xFF\'
+ ->
+ trace [[io(!S)]] (
+ io.print("Hello, world\n", !S)
diff --git a/dev-lang/mercury/files/mercury-10.04.2-default-grade.patch b/dev-lang/mercury/files/mercury-10.04.2-default-grade.patch
new file mode 100644
index 000000000000..e507e05a1aba
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-default-grade.patch
@@ -0,0 +1,274 @@
+diff -ur mercury-compiler-10.04.2.orig/Makefile mercury-compiler-10.04.1/Makefile
+--- mercury-compiler-10.04.2.orig/Makefile 2010-07-12 04:31:01.000000000 +1200
++++ mercury-compiler-10.04.2/Makefile 2010-09-05 09:02:03.000000000 +1200
+@@ -69,6 +69,6 @@
+ $(MMAKE) uninstall
+
+ .DEFAULT:
+- $(MMAKE) $@
++ $(MMAKE) MMAKEFLAGS=$(PARALLEL) $@
+
+ #-----------------------------------------------------------------------------#
+diff -ur mercury-compiler-10.04.2.orig/Mmakefile mercury-compiler-10.04.1/Mmakefile
+--- mercury-compiler-10.04.2.orig/Mmakefile 2009-10-20 17:07:24.000000000 +1300
++++ mercury-compiler-10.04.2/Mmakefile 2010-09-05 09:02:03.000000000 +1200
+@@ -286,6 +286,47 @@
+ mdbcomp browser ssdb trace
+ +cd deep_profiler && $(SUBDIR_MMAKE)
+
++.PHONY: default_grade
++default_grade:
++ +if test "$(DEFAULT_GRADE)" != "$(GRADE)"; then \
++ gc_grade=`scripts/ml --grade $(DEFAULT_GRADE) --print-gc-grade`; \
++ IWS=`/bin/pwd`/install_grade_dir.$(DEFAULT_GRADE); \
++ ( \
++ scripts/prepare_install_dir $${IWS} && \
++ ( cd $${IWS}/boehm_gc && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ GC_GRADE=$${gc_grade} libgrade ) && \
++ ( cd $${IWS}/runtime && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ libgrade ) && \
++ ( cd $${IWS}/library && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ depend && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ libgrade ) && \
++ ( cd $${IWS}/mdbcomp && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ depend && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ libgrade ) && \
++ ( cd $${IWS}/browser && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ depend && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ libgrade ) && \
++ ( cd $${IWS}/ssdb && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ depend && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ libgrade ) && \
++ ( cd $${IWS}/trace && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$(DEFAULT_GRADE) WORKSPACE=$${IWS} \
++ libgrade ) && \
++ true \
++ ) || \
++ { exit 1; }; \
++ fi;
++
+ #-----------------------------------------------------------------------------#
+
+ .PHONY: tags
+diff -ur mercury-compiler-10.04.2.orig/boehm_gc/Mmakefile mercury-compiler-10.04.1/boehm_gc/Mmakefile
+--- mercury-compiler-10.04.2.orig/boehm_gc/Mmakefile 2010-02-27 02:16:44.000000000 +1300
++++ mercury-compiler-10.04.2/boehm_gc/Mmakefile 2010-09-05 09:02:03.000000000 +1200
+@@ -176,6 +176,9 @@
+
+ # No need to install the Boehm collector for grades which don't use it.
+
++.PHONY: libgrade
++libgrade:
++
+ .PHONY: install_headers
+ install_headers:
+
+@@ -187,6 +190,9 @@
+
+ else
+
++.PHONY: libgrade
++libgrade: lib$(GC_GRADE).$A lib$(GC_GRADE).$(EXT_FOR_SHARED_LIB)
++
+ .PHONY: install_headers
+ install_headers: install_dirs
+ cp $(HEADERS) $(INSTALL_INC_DIR)
+diff -ur mercury-compiler-10.04.2.orig/browser/Mmakefile mercury-compiler-10.04.1/browser/Mmakefile
+--- mercury-compiler-10.04.2.orig/browser/Mmakefile 2010-05-10 18:31:55.000000000 +1200
++++ mercury-compiler-10.04.2/browser/Mmakefile 2010-09-05 09:02:03.000000000 +1200
+@@ -256,16 +256,28 @@
+
+ # there is no browser in the .NET or Erlang backends
+
++.PHONY: libgrade
++libgrade:
++
+ .PHONY: install_library
+ install_library:
+
+ else ifneq (,$(findstring java,$(GRADE)))
+
++.PHONY: libgrade
++libgrade:
++
+ .PHONY: install_library
+ install_library: lib$(BROWSER_LIB_NAME).install
+
+ else
+
++.PHONY: libgrade
++libgrade: \
++ lib$(BROWSER_LIB_NAME).$A \
++ lib$(BROWSER_LIB_NAME).$(EXT_FOR_SHARED_LIB) \
++ all-ints
++
+ .PHONY: install_library
+ install_library: \
+ lib$(BROWSER_LIB_NAME).install_library \
+diff -ur mercury-compiler-10.04.2.orig/library/Mmakefile mercury-compiler-10.04.1/library/Mmakefile
+--- mercury-compiler-10.04.2.orig/library/Mmakefile 2010-05-20 21:29:30.000000000 +1200
++++ mercury-compiler-10.04.2/library/Mmakefile 2010-09-05 09:02:03.000000000 +1200
+@@ -493,6 +493,9 @@
+
+ # XXX some modules in the browser directory need library.int3
+
++.PHONY: libgrade
++libgrade: mercury.dll
++
+ .PHONY: install_library
+ install_library: mercury.dll install_grade_dirs install_gac \
+ install_strong_name lib$(STD_LIB_NAME).install_grade_hdrs \
+@@ -531,6 +534,9 @@
+
+ else
+
++.PHONY: libgrade
++libgrade: lib$(STD_LIB_NAME)
++
+ # we depend on lib$(STD_LIB_NAME) because lib$(STD_LIB_NAME).install_library
+ # doesn't make library.int3, but some modules in the browser directory need it.
+
+@@ -541,6 +547,9 @@
+
+ else #ifneq ($(MMAKE_USE_MMC_MAKE),yes)
+
++.PHONY: libgrade
++libgrade: lib$(STD_LIB_NAME) all-ints
++
+ .PHONY: install_mercury
+ install_mercury: install_library
+
+diff -ur mercury-compiler-10.04.2.orig/mdbcomp/Mmakefile mercury-compiler-10.04.1/mdbcomp/Mmakefile
+--- mercury-compiler-10.04.2.orig/mdbcomp/Mmakefile 2010-05-10 18:32:00.000000000 +1200
++++ mercury-compiler-10.04.2/mdbcomp/Mmakefile 2010-09-05 09:02:03.000000000 +1200
+@@ -215,16 +215,28 @@
+
+ # there is no debugger in the .NET or Erlang backends
+
++.PHONY: libgrade
++libgrade:
++
+ .PHONY: install_library
+ install_library:
+
+ else ifneq (,$(findstring java,$(GRADE)))
+
++.PHONY: libgrade
++libgrade:
++
+ .PHONY: install_library
+ install_library: lib$(MDBCOMP_LIB_NAME).install
+
+ else
+
++.PHONY: libgrade
++libgrade: \
++ lib$(MDBCOMP_LIB_NAME).$A \
++ lib$(MDBCOMP_LIB_NAME).$(EXT_FOR_SHARED_LIB) \
++ all-ints
++
+ .PHONY: install_library
+ install_library: \
+ lib$(MDBCOMP_LIB_NAME).install_library \
+diff -ur mercury-compiler-10.04.2.orig/runtime/Mmakefile mercury-compiler-10.04.1/runtime/Mmakefile
+--- mercury-compiler-10.04.2.orig/runtime/Mmakefile 2010-07-16 03:24:52.000000000 +1200
++++ mercury-compiler-10.04.2/runtime/Mmakefile 2010-09-05 09:02:03.000000000 +1200
+@@ -466,6 +466,9 @@
+ # mercury/library/Mmakefile.)
+ # (Runtime support for the Erlang backend is in the library directory.)
+
++.PHONY: libgrade
++libgrade:
++
+ .PHONY: install_headers
+ install_headers:
+
+@@ -478,6 +481,9 @@
+ else
+ ifeq ($(findstring il,$(GRADE)),il)
+
++.PHONY: libgrade
++libgrade: $(DOTNET_DLLS)
++
+ .PHONY: install_headers
+ install_headers:
+
+@@ -492,6 +498,9 @@
+
+ else
+
++.PHONY: libgrade
++libgrade: lib$(RT_LIB_NAME).$A lib$(RT_LIB_NAME).$(EXT_FOR_SHARED_LIB)
++
+ # mercury_conf.h needs to be in a separate directory so it can be
+ # overridden by a different configuration.
+ .PHONY: install_headers
+diff -ur mercury-compiler-10.04.2.orig/ssdb/Mmakefile mercury-compiler-10.04.1/ssdb/Mmakefile
+--- mercury-compiler-10.04.2.orig/ssdb/Mmakefile 2010-05-10 18:32:00.000000000 +1200
++++ mercury-compiler-10.04.2/ssdb/Mmakefile 2010-09-05 09:02:03.000000000 +1200
+@@ -250,16 +250,28 @@
+
+ # there is no ssdb in the .NET or Erlang backends
+
++.PHONY: libgrade
++libgrade:
++
+ .PHONY: install_library
+ install_library:
+
+ else ifneq (,$(findstring java,$(GRADE)))
+
++.PHONY: libgrade
++libgrade:
++
+ .PHONY: install_library
+ install_library: lib$(SSDB_LIB_NAME).install
+
+ else
+
++.PHONY: libgrade
++libgrade: \
++ lib$(SSDB_LIB_NAME).$A \
++ lib$(SSDB_LIB_NAME).$(EXT_FOR_SHARED_LIB) \
++ all-ints
++
+ .PHONY: install_library
+ install_library: \
+ lib$(SSDB_LIB_NAME).install_library \
+diff -ur mercury-compiler-10.04.2.orig/trace/Mmakefile mercury-compiler-10.04.1/trace/Mmakefile
+--- mercury-compiler-10.04.2.orig/trace/Mmakefile 2008-07-30 05:58:58.000000000 +1200
++++ mercury-compiler-10.04.2/trace/Mmakefile 2010-09-05 09:02:03.000000000 +1200
+@@ -324,6 +324,9 @@
+
+ # there is no tracing in the .NET, Java, Erlang backends
+
++.PHONY: libgrade
++libgrade:
++
+ .PHONY: install_headers
+ install_headers:
+
+@@ -332,6 +335,13 @@
+
+ else
+
++.PHONY: libgrade
++libgrade: \
++ lib$(TRACE_LIB_NAME).$A \
++ lib$(TRACE_LIB_NAME).$(EXT_FOR_SHARED_LIB) \
++ lib$(EVENTSPEC_LIB_NAME).$A \
++ lib$(EVENTSPEC_LIB_NAME).$(EXT_FOR_SHARED_LIB)
++
+ .PHONY: install_headers
+ install_headers: $(HDRS) $(LIB_GLOBALS_H)
+ cp `vpath_find $(HDRS) $(LIB_GLOBALS_H)` $(INSTALL_INC_DIR)
diff --git a/dev-lang/mercury/files/mercury-10.04.2-docs.patch b/dev-lang/mercury/files/mercury-10.04.2-docs.patch
new file mode 100644
index 000000000000..83aeb51981a9
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-docs.patch
@@ -0,0 +1,21 @@
+diff -ur mercury-compiler-10.04.2.orig/doc/Mmakefile mercury-compiler-10.04.1/doc/Mmakefile
+--- mercury-compiler-10.04.2.orig/doc/Mmakefile 2010-07-07 01:42:07.000000000 +1200
++++ mercury-compiler-10.04.2/doc/Mmakefile 2010-09-05 09:13:40.000000000 +1200
+@@ -120,7 +120,7 @@
+ # formatted versions of the man pages.
+ # But it might make sense to add them.
+ .PHONY: all
+-all: $(INFOPAGES) $(DVI) $(HTML) manpages $(MDB_DOC)
++all: $(INFOPAGES) $(HTML) manpages $(MDB_DOC)
+ #all: ps pdf text formatted_manpages
+
+ #-----------------------------------------------------------------------------#
+@@ -351,7 +351,7 @@
+ # versions of the documentation. If they are added they should
+ # be installed here.
+ .PHONY: install
+-install: install_info install_html install_dvi install_manpages \
++install: install_info install_html install_manpages \
+ install_mdb_doc
+ # install_text install_ps
+
diff --git a/dev-lang/mercury/files/mercury-10.04.2-linker-flags.patch b/dev-lang/mercury/files/mercury-10.04.2-linker-flags.patch
new file mode 100644
index 000000000000..521914121e45
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-linker-flags.patch
@@ -0,0 +1,66 @@
+diff -ur mercury-compiler-10.04.2.orig/boehm_gc/Makefile.direct mercury-compiler-10.04.2/boehm_gc/Makefile.direct
+--- mercury-compiler-10.04.2.orig/boehm_gc/Makefile.direct 2010-02-24 20:04:32.000000000 +1300
++++ mercury-compiler-10.04.2/boehm_gc/Makefile.direct 2010-10-10 17:46:02.000000000 +1300
+@@ -351,7 +351,7 @@
+ -ldl `./threadlibs`
+ ./if_not_there on_sparc_sunos5_so $(MAKE) dyn_load.o
+ ./if_not_there on_sparc_sunos5_so \
+- $(LINK_SHARED_OBJ) -o lib$(GC_GRADE).so $(OBJS) dyn_load.o -lc
++ $(LINK_SHARED_OBJ) -o lib$(GC_GRADE).so $(OBJS) dyn_load.o -lc $(EXTRA_LDFLAGS)
+
+ # Darwin shared library version of the gc.
+ lib$(GC_GRADE).dylib: $(OBJS) $(UTILS)
+diff -ur mercury-compiler-10.04.2.orig/runtime/Mmakefile mercury-compiler-10.04.2/runtime/Mmakefile
+--- mercury-compiler-10.04.2.orig/runtime/Mmakefile 2010-07-16 03:24:52.000000000 +1200
++++ mercury-compiler-10.04.2/runtime/Mmakefile 2010-10-10 17:48:34.000000000 +1300
+@@ -387,7 +387,7 @@
+ $(LINK_SHARED_OBJ) $(ERROR_UNDEFINED) \
+ -o lib$(RT_LIB_NAME).so $(PIC_OBJS) \
+ $(SHLIB_RPATH_OPT)$(FINAL_INSTALL_MERC_GC_LIB_DIR) \
+- $(LDFLAGS) $(LDLIBS) $(THREADLIBS) \
++ $(ALL_LDFLAGS) $(LDLIBS) $(THREADLIBS) \
+ $(SHARED_LIBS)
+
+ # For Darwin we should pass the -install_name option.
+diff -ur mercury-compiler-10.04.2.orig/trace/Mmakefile mercury-compiler-10.04.2/trace/Mmakefile
+--- mercury-compiler-10.04.2.orig/trace/Mmakefile 2008-07-30 05:58:58.000000000 +1200
++++ mercury-compiler-10.04.2/trace/Mmakefile 2010-10-10 17:49:27.000000000 +1300
+@@ -273,6 +273,7 @@
+ $(LINK_SHARED_OBJ) $(ERROR_UNDEFINED) \
+ -o lib$(TRACE_LIB_NAME).so $(TRACE_PIC_OBJS) \
+ $(RPATH_1)$(RPATH_2) \
++ $(ALL_LDFLAGS) \
+ $(TRACE_LDFLAGS) $(TRACE_LDLIBS) $(THREADLIBS) \
+ $(SHARED_LIBS)
+
+@@ -280,6 +281,7 @@
+ $(LINK_SHARED_OBJ) $(ERROR_UNDEFINED) \
+ -o lib$(EVENTSPEC_LIB_NAME).so $(EVENTSPEC_PIC_OBJS) \
+ $(RPATH_1)$(RPATH_2) \
++ $(ALL_LDFLAGS) \
+ $(EVENTSPEC_LDFLAGS) $(EVENTSPEC_LDLIBS) $(THREADLIBS) \
+ $(SHARED_LIBS)
+
+diff -ur mercury-compiler-10.04.2.orig/util/Mmakefile mercury-compiler-10.04.2/util/Mmakefile
+--- mercury-compiler-10.04.2.orig/util/Mmakefile 2010-07-12 04:31:03.000000000 +1200
++++ mercury-compiler-10.04.2/util/Mmakefile 2010-10-10 17:50:21.000000000 +1300
+@@ -41,16 +41,16 @@
+
+ .c:
+ $(MGNUC) --no-mercury-stdlib-dir \
+- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ $< $(GETOPT_SRC)
++ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ $< $(GETOPT_SRC)
+
+ mkinit: mkinit.c mkinit_common.c mkinit_common.h
+ $(MGNUC) --no-mercury-stdlib-dir \
+- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ \
++ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ \
+ mkinit.c mkinit_common.c $(GETOPT_SRC)
+
+ mkinit_erl: mkinit_erl.c mkinit_common.c mkinit_common.h
+ $(MGNUC) --no-mercury-stdlib-dir \
+- $(GRADEFLAGS) $(ALL_MGNUCFLAGS) -o $@ \
++ $(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ \
+ mkinit_erl.c mkinit_common.c $(GETOPT_SRC)
+
+ tags:
diff --git a/dev-lang/mercury/files/mercury-10.04.2-multilib.patch b/dev-lang/mercury/files/mercury-10.04.2-multilib.patch
new file mode 100644
index 000000000000..1c22c82415c5
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-multilib.patch
@@ -0,0 +1,232 @@
+diff -ur mercury-compiler-10.04.2.orig/compiler/file_util.m mercury-compiler-10.04.2/compiler/file_util.m
+--- mercury-compiler-10.04.2.orig/compiler/file_util.m 2009-10-14 18:28:32.000000000 +1300
++++ mercury-compiler-10.04.2/compiler/file_util.m 2010-10-10 17:25:54.000000000 +1300
+@@ -261,7 +261,7 @@
+ ( InstallNamePath0 = "" ->
+ globals.lookup_string_option(Globals, install_prefix, InstallPrefix),
+ grade_directory_component(Globals, GradeDir),
+- InstallNamePath = InstallPrefix / "lib" / "mercury" / "lib" / GradeDir
++ InstallNamePath = InstallPrefix / "@libdir@" / "mercury" / "lib" / GradeDir
+ ;
+ InstallNamePath = InstallNamePath0
+ ),
+diff -ur mercury-compiler-10.04.2.orig/compiler/libs.file_util.c mercury-compiler-10.04.2/compiler/libs.file_util.c
+--- mercury-compiler-10.04.2.orig/compiler/libs.file_util.c 2010-10-04 23:20:31.000000000 +1300
++++ mercury-compiler-10.04.2/compiler/libs.file_util.c 2010-10-10 17:27:26.000000000 +1300
+@@ -856,7 +856,7 @@
+ MR_tempr1 = MR_sv(1);
+ MR_sv(1) = MR_r1;
+ MR_r1 = MR_tempr1;
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ }
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ libs__file_util__get_install_name_option_3_0_i8);
+diff -ur mercury-compiler-10.04.2.orig/compiler/make.program_target.c mercury-compiler-10.04.2/compiler/make.program_target.c
+--- mercury-compiler-10.04.2.orig/compiler/make.program_target.c 2010-10-04 23:23:09.000000000 +1300
++++ mercury-compiler-10.04.2/compiler/make.program_target.c 2010-10-10 17:33:27.000000000 +1300
+@@ -5422,7 +5422,7 @@
+ make__program_target__install_grade_init_6_0_i2);
+ MR_def_label(make__program_target__install_grade_init_6_0,2)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_grade_init_6_0_i3);
+ MR_def_label(make__program_target__install_grade_init_6_0,3)
+@@ -5873,7 +5873,7 @@
+ make__program_target__make_grade_install_dirs_6_0_i2);
+ MR_def_label(make__program_target__make_grade_install_dirs_6_0,2)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__make_grade_install_dirs_6_0_i3);
+ MR_def_label(make__program_target__make_grade_install_dirs_6_0,3)
+@@ -6318,7 +6318,7 @@
+ MR_GOTO_LAB(make__program_target__install_library_grade_files_10_0_i11);
+ }
+ MR_r1 = MR_sv(10);
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_library_grade_files_10_0_i14);
+ MR_def_label(make__program_target__install_library_grade_files_10_0,14)
+@@ -6382,7 +6382,7 @@
+ MR_GOTO_LAB(make__program_target__install_library_grade_files_10_0_i20);
+ }
+ MR_r1 = MR_sv(10);
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_library_grade_files_10_0_i23);
+ MR_def_label(make__program_target__install_library_grade_files_10_0,23)
+@@ -6448,7 +6448,7 @@
+ MR_def_label(make__program_target__install_library_grade_files_10_0,20)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+ MR_r1 = MR_sv(10);
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_library_grade_files_10_0_i30);
+ MR_def_label(make__program_target__install_library_grade_files_10_0,30)
+@@ -6585,7 +6585,7 @@
+ make__program_target__make_install_dirs_5_0_i2);
+ MR_def_label(make__program_target__make_install_dirs_5_0,2)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__make_install_dirs_5_0_i3);
+ MR_def_label(make__program_target__make_install_dirs_5_0,3)
+@@ -6806,7 +6806,7 @@
+ make__program_target__install_library_7_0_i11);
+ MR_def_label(make__program_target__install_library_7_0,11)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_library_7_0_i12);
+ MR_def_label(make__program_target__install_library_7_0,12)
+@@ -10596,7 +10596,7 @@
+ make__program_target__install_ints_and_headers_8_0_i13);
+ MR_def_label(make__program_target__install_ints_and_headers_8_0,13)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_ints_and_headers_8_0_i14);
+ MR_def_label(make__program_target__install_ints_and_headers_8_0,14)
+@@ -11222,7 +11222,7 @@
+ make__program_target__install_grade_ints_and_headers_9_0_i5);
+ MR_def_label(make__program_target__install_grade_ints_and_headers_9_0,5)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_grade_ints_and_headers_9_0_i6);
+ MR_def_label(make__program_target__install_grade_ints_and_headers_9_0,6)
+diff -ur mercury-compiler-10.04.2.orig/compiler/make.program_target.m mercury-compiler-10.04.2/compiler/make.program_target.m
+--- mercury-compiler-10.04.2.orig/compiler/make.program_target.m 2010-05-20 21:29:30.000000000 +1200
++++ mercury-compiler-10.04.2/compiler/make.program_target.m 2010-10-10 17:37:09.000000000 +1300
+@@ -1370,7 +1370,7 @@
+ ),
+
+ globals.lookup_string_option(Globals, install_prefix, Prefix),
+- LibDir = Prefix/"lib"/"mercury",
++ LibDir = Prefix/"@libdir@"/"mercury",
+ list.map_foldl(
+ install_subdir_file(Globals, SubdirLinkSucceeded, LibDir/"ints",
+ ModuleName),
+@@ -1424,7 +1424,7 @@
+ globals.lookup_accumulating_option(Globals, extra_library_header,
+ ExtraHdrs),
+ globals.lookup_string_option(Globals, install_prefix, Prefix),
+- IncDir = Prefix / "lib" / "mercury" / "inc",
++ IncDir = Prefix / "@libdir@" / "mercury" / "inc",
+ list.foldl2(install_extra_header(Globals, IncDir), ExtraHdrs,
+ yes, ExtraHdrsSucceeded, !IO).
+
+@@ -1572,19 +1572,19 @@
+ globals.lookup_string_option(Globals, install_prefix, Prefix),
+
+ ( string.prefix(GradeDir, "java") ->
+- GradeLibDir = Prefix/"lib"/"mercury"/"lib"/GradeDir,
++ GradeLibDir = Prefix/"@libdir@"/"mercury"/"lib"/GradeDir,
+ install_file(Globals, JarFileName, GradeLibDir, LibsSucceeded,
+ !IO),
+ InitSucceeded = yes
+ ; string.prefix(GradeDir, "erlang") ->
+- GradeLibDir = Prefix/"lib"/"mercury"/"lib"/GradeDir,
++ GradeLibDir = Prefix/"@libdir@"/"mercury"/"lib"/GradeDir,
+ % Our "Erlang archives" are actually directories.
+ install_directory(Globals, ErlangArchiveFileName, GradeLibDir,
+ LibsSucceeded, !IO),
+ install_grade_init(Globals, GradeDir, ModuleName, InitSucceeded,
+ !IO)
+ ;
+- GradeLibDir = Prefix/"lib"/"mercury"/"lib"/GradeDir,
++ GradeLibDir = Prefix/"@libdir@"/"mercury"/"lib"/GradeDir,
+ maybe_install_library_file(Globals, "static", LibFileName,
+ GradeLibDir, LibSuccess, !IO),
+ ( LibFileName = SharedLibFileName ->
+@@ -1615,7 +1615,7 @@
+
+ install_grade_init(Globals, GradeDir, ModuleName, Succeeded, !IO) :-
+ globals.lookup_string_option(Globals, install_prefix, Prefix),
+- GradeModulesDir = Prefix / "lib" / "mercury" / "modules" / GradeDir,
++ GradeModulesDir = Prefix / "@libdir@" / "mercury" / "modules" / GradeDir,
+ module_name_to_file_name(Globals, ModuleName, ".init", do_not_create_dirs,
+ InitFileName, !IO),
+ install_file(Globals, InitFileName, GradeModulesDir, Succeeded, !IO).
+@@ -1632,7 +1632,7 @@
+ (
+ MaybeImports = yes(Imports),
+ globals.lookup_string_option(Globals, install_prefix, Prefix),
+- LibDir = Prefix/"lib"/"mercury",
++ LibDir = Prefix/"@libdir@"/"mercury",
+
+ globals.get_target(Globals, Target),
+ globals.lookup_bool_option(Globals, highlevel_code, HighLevelCode),
+@@ -1784,7 +1784,7 @@
+
+ make_install_dirs(Globals, Result, LinkResult, !IO) :-
+ globals.lookup_string_option(Globals, install_prefix, Prefix),
+- LibDir = Prefix/"lib"/"mercury",
++ LibDir = Prefix/"@libdir@"/"mercury",
+ make_directory(LibDir/"inc", Result1, !IO),
+ make_directory(LibDir/"modules", Result2, !IO),
+
+@@ -1815,7 +1815,7 @@
+
+ make_grade_install_dirs(Globals, Grade, Result, LinkResult, !IO) :-
+ globals.lookup_string_option(Globals, install_prefix, Prefix),
+- LibDir = Prefix/"lib"/"mercury",
++ LibDir = Prefix/"@libdir@"/"mercury",
+
+ GradeIntsSubdir = LibDir/"ints"/Grade/"Mercury",
+ make_directory(GradeIntsSubdir, Result1, !IO),
+diff -ur mercury-compiler-10.04.2.orig/library/Mmakefile mercury-compiler-10.04.2/library/Mmakefile
+--- mercury-compiler-10.04.2.orig/library/Mmakefile 2010-05-20 21:29:30.000000000 +1200
++++ mercury-compiler-10.04.2/library/Mmakefile 2010-10-10 17:38:55.000000000 +1300
+@@ -268,8 +268,8 @@
+ [ -d jmercury/runtime ] || cp -r ../java/runtime jmercury
+
+ install_mer_rt: $(RT_LIB_NAME).jar
+- mkdir -p $(INSTALL_PREFIX)/lib/mercury/lib/$(GRADE)
+- cp $(RT_LIB_NAME).jar $(INSTALL_PREFIX)/lib/mercury/lib/$(GRADE)
++ mkdir -p $(INSTALL_LIBDIR)/lib/$(GRADE)
++ cp $(RT_LIB_NAME).jar $(INSTALL_LIBDIR)/lib/$(GRADE)
+
+ else
+
+diff -ur mercury-compiler-10.04.2.orig/scripts/Mmake.vars.in mercury-compiler-10.04.2/scripts/Mmake.vars.in
+--- mercury-compiler-10.04.2.orig/scripts/Mmake.vars.in 2010-05-20 21:29:31.000000000 +1200
++++ mercury-compiler-10.04.2/scripts/Mmake.vars.in 2010-10-10 17:40:53.000000000 +1300
+@@ -688,17 +688,17 @@
+ INSTALL_PREFIX = @prefix@
+ FINAL_INSTALL_PREFIX = @prefix@
+ INSTALL_BINDIR = $(INSTALL_PREFIX)/bin
+-INSTALL_LIBDIR = $(INSTALL_PREFIX)/lib/mercury
+-FINAL_INSTALL_LIBDIR = $(FINAL_INSTALL_PREFIX)/lib/mercury
++INSTALL_LIBDIR = $(INSTALL_PREFIX)/@libdir@/mercury
++FINAL_INSTALL_LIBDIR = $(FINAL_INSTALL_PREFIX)/@libdir@/mercury
+ INSTALL_INFO_DIR = $(INSTALL_PREFIX)/info
+-INSTALL_DVI_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
+-INSTALL_TEXT_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
+-INSTALL_PS_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
+-INSTALL_PDF_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
++INSTALL_DVI_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/doc
++INSTALL_TEXT_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/doc
++INSTALL_PS_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/doc
++INSTALL_PDF_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/doc
+ INSTALL_MAN_DIR = $(INSTALL_PREFIX)/man
+-INSTALL_HTML_DIR = $(INSTALL_PREFIX)/lib/mercury/html
+-INSTALL_MDB_DOC_DIR = $(INSTALL_PREFIX)/lib/mercury/mdb
+-INSTALL_ELISP_DIR = $(INSTALL_PREFIX)/lib/mercury/elisp
++INSTALL_HTML_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/html
++INSTALL_MDB_DOC_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/mdb
++INSTALL_ELISP_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/elisp
+ INSTALL_CGI_DIR = @CGIDIR@
+
+ # You should not need to override anything below here
diff --git a/dev-lang/mercury/files/mercury-10.04.2-no-reconf.patch b/dev-lang/mercury/files/mercury-10.04.2-no-reconf.patch
new file mode 100644
index 000000000000..166a2bcc44c3
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-no-reconf.patch
@@ -0,0 +1,59 @@
+diff -ur mercury-compiler-10.04.2.orig/runtime/Mmakefile mercury-compiler-10.04.1/runtime/Mmakefile
+--- mercury-compiler-10.04.2.orig/runtime/Mmakefile 2010-07-16 03:24:52.000000000 +1200
++++ mercury-compiler-10.04.2/runtime/Mmakefile 2010-09-05 09:15:31.000000000 +1200
+@@ -455,8 +455,6 @@
+ mkdir -p $(INSTALL_GRADE_MODULE_DIR)
+ -[ -d $(INSTALL_MERC_LIB_DIR) ] || mkdir -p $(INSTALL_MERC_LIB_DIR)
+ -[ -d $(INSTALL_CONF_DIR) ] || mkdir -p $(INSTALL_CONF_DIR)
+- -[ -d $(INSTALL_RECONF_DIR)/runtime ] || \
+- mkdir -p $(INSTALL_RECONF_DIR)/runtime
+
+ ifneq "$(filter java% erlang%,$(GRADE))" ""
+
+@@ -502,7 +500,6 @@
+ rm -f $(INSTALL_INC_DIR)/mercury_conf.h
+ cp `vpath_find mercury_conf.h` $(INSTALL_CONF_DIR)
+ -chmod u+w $(INSTALL_CONF_DIR)/mercury_conf.h
+- cp `vpath_find mercury_conf.h.in` $(INSTALL_RECONF_DIR)/runtime
+ cp `vpath_find $(MACHHDRS)` $(INSTALL_INC_DIR)/machdeps
+
+ .PHONY: install_init
+diff -ur mercury-compiler-10.04.2.orig/scripts/Mmakefile mercury-compiler-10.04.1/scripts/Mmakefile
+--- mercury-compiler-10.04.2.orig/scripts/Mmakefile 2009-09-02 11:54:38.000000000 +1200
++++ mercury-compiler-10.04.2/scripts/Mmakefile 2010-09-05 09:15:31.000000000 +1200
+@@ -24,17 +24,13 @@
+ canonical_grade \
+ mdb \
+ mdprof \
+- mercury.bat \
+- mercury_config \
+ mercury_update_interface \
+ mgnuc \
+- mkfifo_using_mknod \
+ ml \
+ mmake \
+ mmc \
+ mprof \
+- mtags \
+- prepare_install_dir
++ mtags
+
+ SCRIPTS = $(NONCONF_SCRIPTS) $(CONF_SCRIPTS)
+
+@@ -113,8 +109,6 @@
+ [ -d $(INSTALL_LIBDIR)/mdb ] || mkdir -p $(INSTALL_LIBDIR)/mdb
+ [ -d $(INSTALL_CONF_DIR) ] || mkdir -p $(INSTALL_CONF_DIR)
+ [ -d $(INSTALL_ELISP_DIR) ] || mkdir -p $(INSTALL_ELISP_DIR)
+- [ -d $(INSTALL_RECONF_DIR)/scripts ] || \
+- mkdir -p $(INSTALL_RECONF_DIR)/scripts
+
+ .PHONY: install_mmake
+ install_mmake: Mmake.vars Mmake.rules install_dirs
+@@ -132,7 +126,6 @@
+ -for file in $(SCRIPTS); do \
+ chmod u+w $(INSTALL_BINDIR)/$$file ;\
+ done
+- cp *.in *.sh-subr $(SCRIPTS) $(INSTALL_RECONF_DIR)/scripts
+ -rm -f $(INSTALL_BINDIR)/mmake.old
+
+ .PHONY: install_config
diff --git a/dev-lang/mercury/files/mercury-10.04.2-sparc-llds-base-grade.patch b/dev-lang/mercury/files/mercury-10.04.2-sparc-llds-base-grade.patch
new file mode 100644
index 000000000000..7f1d0ce0597a
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-sparc-llds-base-grade.patch
@@ -0,0 +1,11 @@
+--- mercury-compiler-10.04.2.orig/configure.in 2010-08-23 23:04:53.000000000 +1200
++++ mercury-compiler-10.04.2/configure.in 2010-10-10 11:45:32.000000000 +1300
+@@ -3079,7 +3079,7 @@
+ # The asm_fast and reg grades also do not currently work on Linux/PPC.
+ #
+ case "$host" in
+- i*86*apple*darwin*|x86_64*apple*darwin*|powerpc*-linux-gnu)
++ i*86*apple*darwin*|x86_64*apple*darwin*|powerpc*-linux-gnu|sparc*-linux-gnu)
+ BEST_LLDS_BASE_GRADE=none
+ ;;
+ esac
diff --git a/dev-lang/mercury/files/mercury-10.04.2-tests-sandbox.patch b/dev-lang/mercury/files/mercury-10.04.2-tests-sandbox.patch
new file mode 100644
index 000000000000..828ea4d5566d
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-tests-sandbox.patch
@@ -0,0 +1,64 @@
+diff -ur mercury-tests-10.04.2.orig/hard_coded/dir_test.exp mercury-tests-10.04.1/hard_coded/dir_test.exp
+--- mercury-tests-10.04.2.orig/hard_coded/dir_test.exp 2007-09-21 15:21:35.000000000 +1200
++++ mercury-tests-10.04.2/hard_coded/dir_test.exp 2010-09-05 09:40:36.000000000 +1200
+@@ -130,7 +130,6 @@
+ "foo"/"bar/baz" = "foo\bar\baz".
+ "foo/"/"bar/baz" = "foo\bar\baz".
+ checking whether `unwritable' is readable...ok
+-unwritable file found to be unwritable
+ current_directory succeeded: hard_coded
+ make_directory succeeded
+ make_directory succeeded
+diff -ur mercury-tests-10.04.2.orig/hard_coded/dir_test.exp2 mercury-tests-10.04.1/hard_coded/dir_test.exp2
+--- mercury-tests-10.04.2.orig/hard_coded/dir_test.exp2 2007-10-01 18:40:43.000000000 +1300
++++ mercury-tests-10.04.2/hard_coded/dir_test.exp2 2010-09-05 09:40:36.000000000 +1200
+@@ -127,7 +127,6 @@
+ "foo"/"bar/baz" = "foo/bar/baz".
+ "foo/"/"bar/baz" = "foo/bar/baz".
+ checking whether `unwritable' is readable...ok
+-unwritable file found to be unwritable
+ current_directory succeeded: hard_coded
+ make_directory succeeded
+ make_directory succeeded
+diff -ur mercury-tests-10.04.2.orig/hard_coded/dir_test.exp3 mercury-tests-10.04.1/hard_coded/dir_test.exp3
+--- mercury-tests-10.04.2.orig/hard_coded/dir_test.exp3 2007-10-01 18:40:43.000000000 +1300
++++ mercury-tests-10.04.2/hard_coded/dir_test.exp3 2010-09-05 09:40:36.000000000 +1200
+@@ -130,7 +130,6 @@
+ "foo"/"bar/baz" = "foo/bar/baz".
+ "foo/"/"bar/baz" = "foo/bar/baz".
+ checking whether `unwritable' is readable...ok
+-unwritable file found to be unwritable
+ current_directory succeeded: hard_coded
+ make_directory succeeded
+ make_directory succeeded
+diff -ur mercury-tests-10.04.2.orig/hard_coded/dir_test.exp4 mercury-tests-10.04.1/hard_coded/dir_test.exp4
+--- mercury-tests-10.04.2.orig/hard_coded/dir_test.exp4 2010-03-04 13:39:48.000000000 +1300
++++ mercury-tests-10.04.2/hard_coded/dir_test.exp4 2010-09-05 09:40:36.000000000 +1200
+@@ -127,7 +127,6 @@
+ "foo"/"bar/baz" = "foo/bar/baz".
+ "foo/"/"bar/baz" = "foo/bar/baz".
+ checking whether `unwritable' is readable...ok
+-unwritable file found to be unwritable
+ current_directory succeeded: hard_coded
+ make_directory succeeded
+ make_directory succeeded
+diff -ur mercury-tests-10.04.2.orig/hard_coded/dir_test.m mercury-tests-10.04.1/hard_coded/dir_test.m
+--- mercury-tests-10.04.2.orig/hard_coded/dir_test.m 2010-02-09 16:39:39.000000000 +1300
++++ mercury-tests-10.04.2/hard_coded/dir_test.m 2010-09-05 09:40:36.000000000 +1200
+@@ -50,16 +50,6 @@
+ io__write(ReadResult),
+ io__nl,
+
+- io__check_file_accessibility("unwritable",
+- [read, write], WriteResult),
+- ( { WriteResult = ok } ->
+- io__write_string(
+- "Error: unwritable file found to be writable\n")
+- ;
+- io__write_string(
+- "unwritable file found to be unwritable\n")
+- ),
+-
+ % Execute permissions are not handled correctly on all platforms so
+ % just check that it doesn't crash.
+ io__check_file_accessibility("unwritable",
diff --git a/dev-lang/mercury/files/mercury-10.04.2-tests-static-link.patch b/dev-lang/mercury/files/mercury-10.04.2-tests-static-link.patch
new file mode 100644
index 000000000000..ec9b6b9672e3
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-tests-static-link.patch
@@ -0,0 +1,11 @@
+--- mercury-tests-10.04.2.orig/hard_coded/Mmakefile 2010-05-03 22:27:02.000000000 +1200
++++ mercury-tests-10.04.2/hard_coded/Mmakefile 2010-07-28 20:17:50.000000000 +1200
+@@ -677,7 +677,7 @@
+ PROGS = $(ORDINARY_PROGS) $(PROF_PROGS) $(BROKEN_FOR_LCC_PROGS) \
+ $(CLOSURE_LAYOUT_PROGS) $(NON_PROFDEEP_PROGS) \
+ $(BACKEND_PROGS) $(NONDET_C_PROGS) \
+- $(C_AND_GC_ONLY_PROGS) $(STATIC_LINK_PROGS) \
++ $(C_AND_GC_ONLY_PROGS) \
+ $(CHAR_REP_PROGS) $(C_ONLY_PROGS) \
+ $(DOTNET_PROGS) $(JAVA_PROGS) $(SOLVER_PROGS) \
+ $(TRAILED_PROGS) $(MUTABLE_PROGS) $(TRACE_GOAL_ENV_PROGS) \
diff --git a/dev-lang/mercury/files/mercury-10.04.2-tests-workspace.patch b/dev-lang/mercury/files/mercury-10.04.2-tests-workspace.patch
new file mode 100644
index 000000000000..225497f4ce4e
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04.2-tests-workspace.patch
@@ -0,0 +1,29 @@
+--- mercury-tests-10.04.2.orig/Mmake.common 2010-02-15 19:49:51.000000000 +1300
++++ mercury-tests-10.04.2/Mmake.common 2010-09-05 09:34:38.000000000 +1200
+@@ -79,8 +79,8 @@
+ -include $(TESTS_DIR)/Mmake.params
+
+ MCFLAGS += --flags $(TESTS_DIR)/TESTS_FLAGS
+-ifdef WORKSPACE_FLAGS
+-MCFLAGS += --flags $(TESTS_DIR)/WS_FLAGS
++ifdef WORKSPACE
++MCFLAGS += --flags $(TESTS_DIR)/WS_FLAGS.ws
+ endif
+
+ # Avoid trying to make this file with `mmc --make' if it doesn't exist.
+--- mercury-compiler-10.04.2.orig/configure.in 2010-08-23 23:04:53.000000000 +1200
++++ mercury-compiler-10.04.2/configure.in 2010-10-10 11:49:06.000000000 +1300
+@@ -5048,10 +5048,10 @@
+ test_flags="tests/TESTS_FLAGS"
+ test_mdbrc="tests/mdbrc"
+ else
+- if test -e ../tests/TESTS_FLAGS.in
++ if test -e ../mercury-tests-10.04.2/TESTS_FLAGS.in
+ then
+- test_flags="../tests/TESTS_FLAGS"
+- test_mdbrc="../tests/mdbrc"
++ test_flags="../mercury-tests-10.04.2/TESTS_FLAGS"
++ test_mdbrc="../mercury-tests-10.04.2/mdbrc"
+ else
+ test_flags=""
+ test_mdbrc=""
diff --git a/dev-lang/mercury/mercury-10.04.2.ebuild b/dev-lang/mercury/mercury-10.04.2.ebuild
new file mode 100644
index 000000000000..f349bbe30627
--- /dev/null
+++ b/dev-lang/mercury/mercury-10.04.2.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/mercury-10.04.2.ebuild,v 1.1 2010/10/10 05:01:38 keri Exp $
+
+inherit autotools elisp-common eutils flag-o-matic java-pkg-opt-2 multilib
+
+MY_P=${PN}-compiler-${PV}
+
+DESCRIPTION="Mercury is a modern general-purpose logic/functional programming language"
+HOMEPAGE="http://www.cs.mu.oz.au/research/mercury/index.html"
+SRC_URI="http://www.mercury.cs.mu.oz.au/download/files/${MY_P}.tar.gz
+ test? ( http://www.mercury.cs.mu.oz.au/download/files/mercury-tests-${PV}.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE="debug emacs erlang java minimal readline test threads"
+
+DEPEND="!dev-libs/mpatrol
+ !dev-util/mono-debugger
+ readline? ( sys-libs/readline )
+ erlang? ( dev-lang/erlang )
+ java? ( >=virtual/jdk-1.5 )"
+
+RDEPEND="${DEPEND}
+ emacs? ( virtual/emacs )"
+
+S="${WORKDIR}"/${MY_P}
+TESTDIR="${WORKDIR}"/${PN}-tests-${PV}
+
+SITEFILE=50${PN}-gentoo.el
+
+src_unpack() {
+ unpack ${A}
+
+ epatch "${FILESDIR}"/${P}-multilib.patch
+ epatch "${FILESDIR}"/${P}-linker-flags.patch
+ epatch "${FILESDIR}"/${P}-bootstrap-depend.patch
+ epatch "${FILESDIR}"/${P}-default-grade.patch
+ epatch "${FILESDIR}"/${P}-boehm_gc.patch
+ epatch "${FILESDIR}"/${P}-sparc-llds-base-grade.patch
+ epatch "${FILESDIR}"/${P}-char-det-from-int.patch
+ epatch "${FILESDIR}"/${P}-docs.patch
+ epatch "${FILESDIR}"/${P}-no-reconf.patch
+
+ sed -i -e "s/@libdir@/$(get_libdir)/" \
+ "${S}"/compiler/file_util.m \
+ "${S}"/compiler/libs.file_util.c \
+ "${S}"/compiler/make.program_target.m \
+ "${S}"/compiler/make.program_target.c \
+ "${S}"/scripts/Mmake.vars.in
+
+ touch "${S}"/compiler/*.date
+ touch "${S}"/compiler/*.date0
+ touch "${S}"/compiler/*.date3
+ touch "${S}"/compiler/*.int
+ touch "${S}"/compiler/*.int0
+ touch "${S}"/compiler/*.int2
+ touch "${S}"/compiler/*.int3
+ touch "${S}"/compiler/*.c_date
+ touch "${S}"/compiler/*.c
+
+ if use test; then
+ epatch "${FILESDIR}"/${P}-tests-workspace.patch
+ epatch "${FILESDIR}"/${P}-tests-sandbox.patch
+ epatch "${FILESDIR}"/${P}-tests-static-link.patch
+ fi
+
+ cd "${S}"
+ eautoreconf
+}
+
+src_compile() {
+ strip-flags
+
+ local myconf
+ myconf="--libdir=/usr/$(get_libdir) \
+ --disable-gcc-back-end \
+ --disable-deep-profiler \
+ --disable-dotnet-grades \
+ $(use_enable erlang erlang-grade) \
+ $(use_enable java java-grade) \
+ $(use_enable debug debug-grades) \
+ $(use_enable threads par-grades) \
+ $(use_enable !minimal most-grades) \
+ $(use_with readline)"
+
+ econf \
+ ${myconf} \
+ || die "econf failed"
+
+ emake \
+ PARALLEL=${MAKEOPTS} \
+ bootstrap_depend || die "emake depend failed"
+
+ emake \
+ PARALLEL=${MAKEOPTS} \
+ EXTRA_MLFLAGS=--no-strip \
+ EXTRA_LDFLAGS="${LDFLAGS}" \
+ EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
+ || die "emake failed"
+
+ emake \
+ PARALLEL=${MAKEOPTS} \
+ EXTRA_MLFLAGS=--no-strip \
+ EXTRA_LDFLAGS="${LDFLAGS}" \
+ EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
+ MERCURY_COMPILER="${S}"/compiler/mercury_compile \
+ default_grade || die "emake default_grade failed"
+}
+
+src_test() {
+ TEST_GRADE=`scripts/ml --print-grade`
+ if [ -d "${S}"/install_grade_dir.${TEST_GRADE} ] ; then
+ TWS="${S}"/install_grade_dir.${TEST_GRADE}
+ cp browser/mer_browser.init "${TWS}"/browser/
+ cp mdbcomp/mer_mdbcomp.init "${TWS}"/mdbcomp/
+ cp runtime/mer_rt.init "${TWS}"/runtime/
+ cp ssdb/mer_ssdb.init "${TWS}"/ssdb/
+ else
+ TWS="${S}"
+ fi
+
+ cd "${TESTDIR}"
+ sed -i -e "s:@WORKSPACE@:${TWS}:" WS_FLAGS.ws
+
+ PATH="${TWS}"/scripts:"${TWS}"/util:"${TWS}"/slice:"${PATH}" \
+ TERM="" \
+ WORKSPACE="${TWS}" \
+ MERCURY_COMPILER="${TWS}"/compiler/mercury_compile \
+ MERCURY_CONFIG_DIR="${TWS}" \
+ MMAKE_DIR="${TWS}"/scripts \
+ MERCURY_SUPPRESS_STACK_TRACE=yes \
+ GRADE=${TEST_GRADE} \
+ MERCURY_ALL_LOCAL_C_INCL_DIRS=" -I${TWS}/boehm_gc \
+ -I${TWS}/boehm_gc/include \
+ -I${TWS}/runtime \
+ -I${TWS}/library \
+ -I${TWS}/mdbcomp \
+ -I${TWS}/browser \
+ -I${TWS}/trace" \
+ mmake || die "mmake test failed"
+}
+
+src_install() {
+ emake \
+ PARALLEL=${MAKEOPTS} \
+ EXTRA_LDFLAGS="${LDFLAGS}" \
+ EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
+ MERCURY_COMPILER="${S}"/compiler/mercury_compile \
+ INSTALL_PREFIX="${D}"/usr \
+ INSTALL_MAN_DIR="${D}"/usr/share/man \
+ INSTALL_INFO_DIR="${D}"/usr/share/info \
+ INSTALL_HTML_DIR="${D}"/usr/share/doc/${PF}/html \
+ INSTALL_ELISP_DIR="${D}/${SITELISP}"/${PN} \
+ install || die "make install failed"
+
+ if use emacs; then
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
+ || die "elisp-site-file-install failed"
+ fi
+
+ dodoc \
+ BUGS HISTORY LIMITATIONS NEWS README README.Linux \
+ README.Linux-Alpha README.Linux-m68k README.Linux-PPC \
+ RELEASE_NOTES TODO VERSION WORK_IN_PROGRESS
+
+ if use erlang; then
+ dodoc README.Erlang
+ fi
+
+ if use java; then
+ dodoc README.Java
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}