summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeri Harris <keri@gentoo.org>2006-08-12 01:42:13 +0000
committerKeri Harris <keri@gentoo.org>2006-08-12 01:42:13 +0000
commit3ab1d67b548dc533f702364b3c821aecab748a00 (patch)
tree1fc2c6716a276c8b45886f7b5f348e8b50304324 /dev-lang
parentdep fix (diff)
downloadgentoo-2-3ab1d67b548dc533f702364b3c821aecab748a00.tar.gz
gentoo-2-3ab1d67b548dc533f702364b3c821aecab748a00.tar.bz2
gentoo-2-3ab1d67b548dc533f702364b3c821aecab748a00.zip
Add two-stage bootstap support.
(Portage version: 2.1.1_pre4-r4)
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/mercury/ChangeLog10
-rw-r--r--dev-lang/mercury/files/digest-mercury-0.12.2-r36
-rw-r--r--dev-lang/mercury/files/mercury-0.12.2-bootstrap.patch59
-rw-r--r--dev-lang/mercury/files/mercury-0.12.2-libgrades.patch359
-rw-r--r--dev-lang/mercury/files/mercury-0.12.2-portage-r3.patch87
-rw-r--r--dev-lang/mercury/mercury-0.12.2-r3.ebuild93
6 files changed, 613 insertions, 1 deletions
diff --git a/dev-lang/mercury/ChangeLog b/dev-lang/mercury/ChangeLog
index 989938e0f977..35824820891f 100644
--- a/dev-lang/mercury/ChangeLog
+++ b/dev-lang/mercury/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-lang/mercury
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/ChangeLog,v 1.32 2006/06/25 06:49:32 keri Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/ChangeLog,v 1.33 2006/08/12 01:42:13 keri Exp $
+
+*mercury-0.12.2-r3 (12 Aug 2006)
+
+ 12 Aug 2006; Keri Harris <keri@gentoo.org>
+ +files/mercury-0.12.2-bootstrap.patch,
+ +files/mercury-0.12.2-libgrades.patch,
+ +files/mercury-0.12.2-portage-r3.patch, +mercury-0.12.2-r3.ebuild:
+ Add two-stage bootstrap support.
*mercury-0.13.0_beta20060623 (25 Jun 2006)
diff --git a/dev-lang/mercury/files/digest-mercury-0.12.2-r3 b/dev-lang/mercury/files/digest-mercury-0.12.2-r3
new file mode 100644
index 000000000000..44b741b8da2b
--- /dev/null
+++ b/dev-lang/mercury/files/digest-mercury-0.12.2-r3
@@ -0,0 +1,6 @@
+MD5 49796cb9f475a0959d13ec7694777a94 mercury-compiler-0.12.2.tar.gz 15074997
+RMD160 227a3e1796d96ad77324d9f1d39efd6be7fce80e mercury-compiler-0.12.2.tar.gz 15074997
+SHA256 7fa1df8030cdc3d4dc848d102ba64bf23c12004461c985290622b81753b89572 mercury-compiler-0.12.2.tar.gz 15074997
+MD5 46099512bf8b9f1a336759845f2737f7 mercury-tests-0.12.2.tar.gz 897454
+RMD160 e7cf515b0d56aff5432c5ec3e535faa907ce2955 mercury-tests-0.12.2.tar.gz 897454
+SHA256 6d3fd92d11ce2a9ce99cfa35990027557d1c70f00a3417639523b6e27f746280 mercury-tests-0.12.2.tar.gz 897454
diff --git a/dev-lang/mercury/files/mercury-0.12.2-bootstrap.patch b/dev-lang/mercury/files/mercury-0.12.2-bootstrap.patch
new file mode 100644
index 000000000000..444b80d52294
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-0.12.2-bootstrap.patch
@@ -0,0 +1,59 @@
+--- mercury-compiler-0.12.2.orig/configure 2006-01-25 17:24:01.000000000 +1300
++++ mercury-compiler-0.12.2/configure 2006-07-24 20:11:45.000000000 +1200
+@@ -8790,34 +8790,33 @@
+
+ if test "$BEST_GRADE_FOR_COMPILER" != "$BOOTSTRAP_GRADE"; then
+ if test "$BOOTSTRAP_MC" = ""; then
+- GRADE="$BOOTSTRAP_GRADE"
+- { echo "$as_me:$LINENO: WARNING: Mercury compiler not yet installed
+-**** cannot use grade \`$BEST_GRADE_FOR_COMPILER'
+-**** using grade \`$GRADE' to compile the compiler
+-**** after installation is complete you should reinstall
+-**** from scratch so you can use the more efficient
+-**** grade \`$BEST_GRADE_FOR_COMPILER'." >&5
+-echo "$as_me: WARNING: Mercury compiler not yet installed
+-**** cannot use grade \`$BEST_GRADE_FOR_COMPILER'
+-**** using grade \`$GRADE' to compile the compiler
+-**** after installation is complete you should reinstall
+-**** from scratch so you can use the more efficient
+-**** grade \`$BEST_GRADE_FOR_COMPILER'." >&2;}
+-
++ if test "$BOOTSTRAP_STAGE" = "1"; then
++ GRADE="$BOOTSTRAP_GRADE"
++ else
++ GRADE=$BEST_GRADE_FOR_COMPILER
++ find library compiler browser mdbcomp analysis \
++ profiler deep_profiler \
++ -name \*.c -o -name \*.c_date | \
++ xargs rm > /dev/null 2>&1
++ find -name \*.o -o -name \*.a -o -name \*.so | \
++ xargs rm > /dev/null 2>&1
++ rm -f compiler/mercury_compile profiler/mercury_profile
++ fi
+ else
+- GRADE=$BEST_GRADE_FOR_COMPILER
+- echo "using grade \`$GRADE' to compile the compiler
+- compiler and library will be rebuilt with new grade
+- installation may take a long time" 1>&6
+- find library compiler browser mdbcomp analysis \
+- profiler deep_profiler \
+- -name \*.c -o -name \*.c_date | \
+- xargs rm > /dev/null 2>&1
++ if test "$BOOTSTRAP_STAGE" = "1"; then
++ GRADE=$BEST_GRADE_FOR_COMPILER
++ find library compiler browser mdbcomp analysis \
++ profiler deep_profiler \
++ -name \*.c -o -name \*.c_date | \
++ xargs rm > /dev/null 2>&1
++ else
++ GRADE=$BEST_GRADE_FOR_COMPILER
++ fi
+ fi
+ else
+ GRADE=$BEST_GRADE_FOR_COMPILER
+- echo "using grade \`$GRADE' to compile the compiler" 1>&6
+ fi
++echo "using grade \`$GRADE' to compile the compiler" 1>&6
+
+
+ #-----------------------------------------------------------------------------#
diff --git a/dev-lang/mercury/files/mercury-0.12.2-libgrades.patch b/dev-lang/mercury/files/mercury-0.12.2-libgrades.patch
new file mode 100644
index 000000000000..e9cc8caa3ace
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-0.12.2-libgrades.patch
@@ -0,0 +1,359 @@
+--- mercury-compiler-0.12.2.orig/Mmakefile 2005-01-28 20:11:29.000000000 +1300
++++ mercury-compiler-0.12.2/Mmakefile 2006-08-12 09:45:55.000000000 +1200
+@@ -233,6 +233,54 @@
+ mdbcomp browser trace
+ +cd deep_profiler && $(SUBDIR_MMAKE)
+
++libgrades:
++ +for grade in x $(LIBGRADES); do \
++ if [ "$$grade" != "x" -a "$$grade" != "$(GRADE)" ]; then \
++ gc_grade=`scripts/ml --grade $$grade --print-gc-grade`; \
++ TWS=`/bin/pwd`/libgrades/$$grade; \
++ /bin/rm -fr libgrades/$$grade; \
++ mkdir -p libgrades/$$grade; \
++ ( scripts/prepare_tmp_dir_fixed_part $$grade && \
++ scripts/prepare_tmp_dir_grade_part $$grade ) && \
++ ( cd libgrades/$$grade/boehm_gc && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade \
++ WORKSPACE=$$TWS GC_GRADE=$$gc_grade \
++ MERCURY_COMPILER=$$TWS/compiler/mercury_compile \
++ libgrade ) && \
++ ( cd libgrades/$$grade/runtime && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
++ MERCURY_COMPILER=$$TWS/compiler/mercury_compile \
++ libgrade ) && \
++ ( cd libgrades/$$grade/library && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
++ MERCURY_COMPILER=$$TWS/compiler/mercury_compile \
++ depend && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
++ MERCURY_COMPILER=$$TWS/compiler/mercury_compile \
++ libgrade ) && \
++ ( cd libgrades/$$grade/mdbcomp && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
++ MERCURY_COMPILER=$$TWS/compiler/mercury_compile \
++ depend && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
++ MERCURY_COMPILER=$$TWS/compiler/mercury_compile \
++ libgrade ) && \
++ ( cd libgrades/$$grade/browser && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
++ MERCURY_COMPILER=$$TWS/compiler/mercury_compile \
++ depend && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
++ MERCURY_COMPILER=$$TWS/compiler/mercury_compile \
++ libgrade ) && \
++ ( cd libgrades/$$grade/trace && \
++ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
++ MERCURY_COMPILER=$$TWS/compiler/mercury_compile \
++ libgrade ) && \
++ true || \
++ exit 1; \
++ fi; \
++ done
++
+ #-----------------------------------------------------------------------------#
+
+ .PHONY: tags
+@@ -429,28 +477,13 @@
+ @echo
+ @echo "-- Installation complete."
+ @echo
+- @echo "-- Don't forget to add $(INSTALL_BINDIR) to your PATH,"
+- @echo "-- $(INSTALL_MAN_DIR) to your MANPATH,"
+- @echo "-- and $(INSTALL_INFO_DIR) to your INFOPATH,"
+- @if test $(ENABLE_DEEP_PROFILER) != yes || \
+- cmp -s deep_profiler/mdprof_cgi \
+- $(INSTALL_CGI_DIR)/mdprof_cgi; \
+- then true ; else \
+- echo "-- to copy deep_profiler/mdprof_cgi" \
+- "to $(INSTALL_CGI_DIR),"; \
+- fi
+- @echo "-- and to add the following lines to the \`.emacs' file"
+- @echo "-- in your home directory:"
+- @echo " (setq load-path (cons (expand-file-name "
+- @echo " \"$(INSTALL_ELISP_DIR)\") load-path))"
+- @echo " (autoload 'mdb \"gud\" \"Invoke the Mercury debugger\" t)"
+
+ .PHONY: install_main
+ install_main: all \
+ install_scripts install_util install_runtime install_boehm_gc \
+ install_library install_mdbcomp install_browser install_trace \
+ install_compiler install_profiler install_deep_profiler \
+- install_doc install_config
++ install_doc
+
+ .PHONY: install_scripts
+ install_scripts: scripts
+@@ -511,7 +544,7 @@
+ # .trans_opt .trans_opt_date .d .mh .mih .c_date .c .o .pic_o
+
+ .PHONY: install_grades
+-install_grades: all
++install_grades: all libgrades
+ #
+ # Use the newly installed compiler to build the libraries
+ # in various different grades. We need to override MC=mmc
+@@ -519,44 +552,33 @@
+ # runs the newly installed compiler, rather than using the
+ # bootstrap compiler.
+ #
+- /bin/rm -fr tmp_dir
+- scripts/prepare_tmp_dir_fixed_part
+ +for grade in x $(LIBGRADES); do \
+ if [ "$$grade" != "x" -a "$$grade" != "$(GRADE)" ]; then \
+ gc_grade=`scripts/ml --grade $$grade --print-gc-grade`; \
+- TWS=`/bin/pwd`/tmp_dir; \
+- scripts/prepare_tmp_dir_grade_part; \
+- ( cd tmp_dir/boehm_gc && \
++ TWS=`/bin/pwd`/libgrades/$$grade; \
++ ( cd libgrades/$$grade/boehm_gc && \
+ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade \
+ WORKSPACE=$$TWS GC_GRADE=$$gc_grade \
+ install_lib ) && \
+- ( cd tmp_dir/runtime && \
++ ( cd libgrades/$$grade/runtime && \
+ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
+ install_lib ) && \
+- ( cd tmp_dir/library && \
+- $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
+- depend && \
++ ( cd libgrades/$$grade/library && \
+ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
+ install_library ) && \
+- ( cd tmp_dir/mdbcomp && \
+- $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
+- depend && \
++ ( cd libgrades/$$grade/mdbcomp && \
+ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
+ install_library ) && \
+- ( cd tmp_dir/browser && \
+- $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
+- depend && \
++ ( cd libgrades/$$grade/browser && \
+ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
+ install_library ) && \
+- ( cd tmp_dir/trace && \
++ ( cd libgrades/$$grade/trace && \
+ $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade WORKSPACE=$$TWS \
+ install_lib ) && \
+ true || \
+- { echo "To clean up from failed install, remove tmp_dir"; \
+- exit 1; }; \
++ exit 1; \
+ fi; \
+ done
+- if test ! -f .leave_tmp_dir; then rm -fr tmp_dir; fi
+
+ .PHONY: install_split_library
+ install_split_library: scripts dep_library
+--- mercury-compiler-0.12.2.orig/boehm_gc/Mmakefile 2004-10-19 19:01:36.000000000 +1300
++++ mercury-compiler-0.12.2/boehm_gc/Mmakefile 2006-07-29 09:07:33.000000000 +1200
+@@ -90,6 +90,9 @@
+ .PHONY: force
+ force:
+
++.PHONY: libgrade
++libgrade: lib$(GC_GRADE).$A lib$(GC_GRADE).$(EXT_FOR_SHARED_LIB)
++
+ #-----------------------------------------------------------------------------#
+
+ # installation rules
+--- mercury-compiler-0.12.2.orig/browser/Mmakefile 2005-01-28 20:11:37.000000000 +1300
++++ mercury-compiler-0.12.2/browser/Mmakefile 2006-07-29 09:19:39.000000000 +1200
+@@ -180,6 +180,11 @@
+ .PHONY: int3s
+ int3s: $(INT3S_TARGETS)
+
++.PHONY: libgrade
++libgrade: \
++ lib$(BROWSER_LIB_NAME).$A \
++ lib$(BROWSER_LIB_NAME).$(EXT_FOR_SHARED_LIB)
++
+ #-----------------------------------------------------------------------------#
+
+ tags: $(MTAGS) $($(BROWSER_LIB_NAME).ms)
+--- mercury-compiler-0.12.2.orig/library/Mmakefile 2005-05-06 20:01:58.000000000 +1200
++++ mercury-compiler-0.12.2/library/Mmakefile 2006-07-29 10:31:06.000000000 +1200
+@@ -194,6 +194,9 @@
+ trans_opts: $(STD_LIB_NAME).trans_opts
+ $(STD_LIB_NAME).trans_opts: $($(STD_LIB_NAME).trans_opts)
+
++.PHONY: libgrade
++libgrade: lib$(STD_LIB_NAME)
++
+ #-----------------------------------------------------------------------------#
+
+ tags: $(MTAGS) $($(STD_LIB_NAME).ms)
+--- mercury-compiler-0.12.2.orig/mdbcomp/Mmakefile 2005-02-17 19:39:24.000000000 +1300
++++ mercury-compiler-0.12.2/mdbcomp/Mmakefile 2006-07-29 09:18:15.000000000 +1200
+@@ -147,6 +147,13 @@
+ .PHONY: int3s
+ int3s: $(INT3S_TARGETS)
+
++.PHONY: libgrade
++libgrade: \
++ $(mer_mdbcomp.int3s) $(mer_mdbcomp.ints) \
++ lib$(MDBCOMP_LIB_NAME).$A \
++ lib$(MDBCOMP_LIB_NAME).$(EXT_FOR_SHARED_LIB) \
++ all-ints
++
+ #-----------------------------------------------------------------------------#
+
+ tags: $(MTAGS) $($(MDBCOMP_LIB_NAME).ms)
+--- mercury-compiler-0.12.2.orig/runtime/Mmakefile 2005-12-05 16:34:46.000000000 +1300
++++ mercury-compiler-0.12.2/runtime/Mmakefile 2006-07-29 09:11:09.000000000 +1200
+@@ -376,6 +376,9 @@
+ @if test ! -f tags; then echo making tags; \
+ ctags $(CFILES) $(HDRS) $(BODY_HDRS) $(LIB_DLL_H); fi
+
++.PHONY: libgrade
++libgrade: lib$(RT_LIB_NAME).$A lib$(RT_LIB_NAME).$(EXT_FOR_SHARED_LIB)
++
+ #-----------------------------------------------------------------------------#
+
+ # installation rules
+--- mercury-compiler-0.12.2.orig/scripts/prepare_tmp_dir_fixed_part.in 2005-01-28 20:11:59.000000000 +1300
++++ mercury-compiler-0.12.2/scripts/prepare_tmp_dir_fixed_part.in 2006-08-11 21:20:06.000000000 +1200
+@@ -12,18 +12,20 @@
+ fi
+ wd=`/bin/pwd`
+
+-mkdir tmp_dir
+-cp Mmake* tmp_dir
+-cp Mercury.* tmp_dir
+-cp VERSION tmp_dir
+-cp config* tmp_dir
+-cp aclocal.m4 tmp_dir
+-mkdir tmp_dir/scripts
+-cp scripts/* tmp_dir/scripts
+-mkdir tmp_dir/tools
+-cp tools/* tmp_dir/tools
+-$ln_s $wd/compiler tmp_dir
+-$ln_s $wd/analysis tmp_dir
+-$ln_s $wd/robdd tmp_dir
+-$ln_s $wd/util tmp_dir
++libgrade_dir=libgrades/$1
++
++mkdir -p $libgrade_dir
++cp Mmake* $libgrade_dir
++cp Mercury.* $libgrade_dir
++cp VERSION $libgrade_dir
++cp config* $libgrade_dir
++cp aclocal.m4 $libgrade_dir
++mkdir $libgrade_dir/scripts
++cp scripts/* $libgrade_dir/scripts
++mkdir $libgrade_dir/tools
++cp tools/* $libgrade_dir/tools
++$ln_s $wd/compiler $libgrade_dir
++$ln_s $wd/analysis $libgrade_dir
++$ln_s $wd/robdd $libgrade_dir
++$ln_s $wd/util $libgrade_dir
+ exit 0
+--- mercury-compiler-0.12.2.orig/scripts/prepare_tmp_dir_grade_part 2005-01-28 20:11:59.000000000 +1300
++++ mercury-compiler-0.12.2/scripts/prepare_tmp_dir_grade_part 2006-07-29 09:01:18.000000000 +1200
+@@ -5,47 +5,49 @@
+ # Public License - see the file COPYING in the Mercury distribution.
+ #---------------------------------------------------------------------------#
+
+-rm -fr tmp_dir/boehm_gc
+-rm -fr tmp_dir/runtime
+-rm -fr tmp_dir/trace
+-rm -fr tmp_dir/library
+-rm -fr tmp_dir/mdbcomp
+-rm -fr tmp_dir/browser
+-mkdir tmp_dir/boehm_gc
+-mkdir tmp_dir/boehm_gc/Mac_files
+-mkdir tmp_dir/boehm_gc/cord
+-mkdir tmp_dir/boehm_gc/include
+-mkdir tmp_dir/boehm_gc/include/private
+-cp boehm_gc/Makefile* tmp_dir/boehm_gc
+-cp boehm_gc/Mmake* tmp_dir/boehm_gc
+-cp boehm_gc/ac* tmp_dir/boehm_gc
+-cp boehm_gc/*.[chsS] tmp_dir/boehm_gc
+-cp boehm_gc/Mac_files/*.[ch] tmp_dir/boehm_gc/Mac_files
+-cp boehm_gc/cord/*.[ch] tmp_dir/boehm_gc/cord
+-cp boehm_gc/include/*.[ch] tmp_dir/boehm_gc/include
+-cp boehm_gc/include/private/*.[ch] tmp_dir/boehm_gc/include/private
+-mkdir tmp_dir/runtime
+-mkdir tmp_dir/runtime/machdeps
+-cp runtime/Mmake* tmp_dir/runtime
+-cp runtime/*.in tmp_dir/runtime
+-cp runtime/*.[ch] tmp_dir/runtime
+-cp runtime/*.il tmp_dir/runtime
+-cp runtime/machdeps/*.h tmp_dir/runtime/machdeps
+-mkdir tmp_dir/trace
+-cp trace/Mmake* tmp_dir/trace
+-cp trace/*.[ch] tmp_dir/trace
+-mkdir tmp_dir/library
+-cp library/Mmake* tmp_dir/library
+-cp library/Mercury.* tmp_dir/library
+-cp library/print_extra_inits tmp_dir/library
+-cp library/library_strong_name.sn tmp_dir/library
+-cp library/*.m tmp_dir/library
+-mkdir tmp_dir/mdbcomp
+-cp mdbcomp/Mmake* tmp_dir/mdbcomp
+-cp mdbcomp/Mercury.* tmp_dir/mdbcomp
+-cp mdbcomp/*.m tmp_dir/mdbcomp
+-mkdir tmp_dir/browser
+-cp browser/Mmake* tmp_dir/browser
+-cp browser/Mercury.* tmp_dir/browser
+-cp browser/*.m tmp_dir/browser
++libgrade_dir=libgrades/$1
++
++rm -fr $libgrade_dir/boehm_gc
++rm -fr $libgrade_dir/runtime
++rm -fr $libgrade_dir/trace
++rm -fr $libgrade_dir/library
++rm -fr $libgrade_dir/mdbcomp
++rm -fr $libgrade_dir/browser
++mkdir $libgrade_dir/boehm_gc
++mkdir $libgrade_dir/boehm_gc/Mac_files
++mkdir $libgrade_dir/boehm_gc/cord
++mkdir $libgrade_dir/boehm_gc/include
++mkdir $libgrade_dir/boehm_gc/include/private
++cp boehm_gc/Makefile* $libgrade_dir/boehm_gc
++cp boehm_gc/Mmake* $libgrade_dir/boehm_gc
++cp boehm_gc/ac* $libgrade_dir/boehm_gc
++cp boehm_gc/*.[chsS] $libgrade_dir/boehm_gc
++cp boehm_gc/Mac_files/*.[ch] $libgrade_dir/boehm_gc/Mac_files
++cp boehm_gc/cord/*.[ch] $libgrade_dir/boehm_gc/cord
++cp boehm_gc/include/*.[ch] $libgrade_dir/boehm_gc/include
++cp boehm_gc/include/private/*.[ch] $libgrade_dir/boehm_gc/include/private
++mkdir $libgrade_dir/runtime
++mkdir $libgrade_dir/runtime/machdeps
++cp runtime/Mmake* $libgrade_dir/runtime
++cp runtime/*.in $libgrade_dir/runtime
++cp runtime/*.[ch] $libgrade_dir/runtime
++cp runtime/*.il $libgrade_dir/runtime
++cp runtime/machdeps/*.h $libgrade_dir/runtime/machdeps
++mkdir $libgrade_dir/trace
++cp trace/Mmake* $libgrade_dir/trace
++cp trace/*.[ch] $libgrade_dir/trace
++mkdir $libgrade_dir/library
++cp library/Mmake* $libgrade_dir/library
++cp library/Mercury.* $libgrade_dir/library
++cp library/print_extra_inits $libgrade_dir/library
++cp library/library_strong_name.sn $libgrade_dir/library
++cp library/*.m $libgrade_dir/library
++mkdir $libgrade_dir/mdbcomp
++cp mdbcomp/Mmake* $libgrade_dir/mdbcomp
++cp mdbcomp/Mercury.* $libgrade_dir/mdbcomp
++cp mdbcomp/*.m $libgrade_dir/mdbcomp
++mkdir $libgrade_dir/browser
++cp browser/Mmake* $libgrade_dir/browser
++cp browser/Mercury.* $libgrade_dir/browser
++cp browser/*.m $libgrade_dir/browser
+ exit 0
+--- mercury-compiler-0.12.2.orig/trace/Mmakefile 2005-01-28 20:12:05.000000000 +1300
++++ mercury-compiler-0.12.2/trace/Mmakefile 2006-07-29 09:22:09.000000000 +1200
+@@ -179,6 +179,9 @@
+ @if test ! -f tags; then echo making tags; \
+ ctags $(CFILES) $(HDRS) $(RUNTIME_DIR)/*.c $(RUNTIME_DIR)/*.h ; fi
+
++.PHONY: libgrade
++libgrade: lib$(TRACE_LIB_NAME).$A lib$(TRACE_LIB_NAME).$(EXT_FOR_SHARED_LIB)
++
+ #-----------------------------------------------------------------------------#
+
+ # installation rules
diff --git a/dev-lang/mercury/files/mercury-0.12.2-portage-r3.patch b/dev-lang/mercury/files/mercury-0.12.2-portage-r3.patch
new file mode 100644
index 000000000000..d6dca2cea4ca
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-0.12.2-portage-r3.patch
@@ -0,0 +1,87 @@
+--- mercury-compiler-0.12.2.orig/Makefile 2004-11-01 17:46:18.000000000 +1300
++++ mercury-compiler-0.12.2/Makefile 2006-03-18 12:54:23.000000000 +1300
+@@ -26,7 +26,7 @@
+
+ .PHONY: all
+ all:
+- $(MMAKE) MMAKEFLAGS=$(PARALLEL) all 2>&1 | tee make_all.log
++ $(MMAKE) MMAKEFLAGS=$(PARALLEL) all 2>&1 || exit 1
+
+ .PHONY: libmmc
+ libmmc:
+@@ -34,7 +34,7 @@
+
+ .PHONY: install
+ install:
+- $(MMAKE) MMAKEFLAGS=$(PARALLEL) install 2>&1 | tee make_install.log
++ $(MMAKE) MMAKEFLAGS=$(PARALLEL) install 2>&1 || exit 1
+
+ # `mmake clean' has a different meaning to the usual GNU standard `make clean':
+ # it removes the .c files, which makes bootstrapping impossible unless you
+--- mercury-compiler-0.12.2.orig/configure 2006-01-25 17:24:01.000000000 +1300
++++ mercury-compiler-0.12.2/configure 2006-06-08 19:31:53.000000000 +1200
+@@ -8861,7 +8861,7 @@
+ # Check whether --enable-debug-grades or --disable-debug-grades was given.
+ if test "${enable_debug_grades+set}" = set; then
+ enableval="$enable_debug_grades"
+- enable_debug_grades="enableval"
++ enable_debug_grades="$enableval"
+ else
+ enable_debug_grades=yes
+ fi;
+@@ -8948,7 +8948,6 @@
+ enable_trail_grades=no
+ enable_mm_grades=no
+ enable_hlc_prof_grades=no
+- enable_par_grades=no
+ enable_dotnet_grades=no
+ enable_java_grade=no
+ fi
+--- mercury-compiler-0.12.2.orig/runtime/Mmakefile 2005-12-05 16:34:46.000000000 +1300
++++ mercury-compiler-0.12.2/runtime/Mmakefile 2006-06-14 20:52:31.000000000 +1200
+@@ -390,8 +390,6 @@
+ -[ -d $(INSTALL_MODULE_DIR) ] || mkdir -p $(INSTALL_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
+
+ ifeq ($(findstring java,$(GRADE)),java)
+
+@@ -437,7 +435,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
+--- mercury-compiler-0.12.2.orig/scripts/Mmakefile 2005-01-28 20:11:59.000000000 +1300
++++ mercury-compiler-0.12.2/scripts/Mmakefile 2006-06-14 20:51:21.000000000 +1200
+@@ -16,8 +16,7 @@
+
+ SCRIPTS = mmake mmc mdb c2init mgnuc ml mprof mprof_merge_runs \
+ mtags vpath_find mercury_update_interface \
+- mkfifo_using_mknod mercury_cleanup_install canonical_grade \
+- mercury_config mercury.bat prepare_tmp_dir_fixed_part
++ mercury_cleanup_install canonical_grade
+ DEBUGGER_SCRIPTS = mdbrc xul_tree.xsl
+ EMACS_SCRIPTS = gud.el
+
+@@ -58,8 +57,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
+@@ -77,7 +74,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/mercury-0.12.2-r3.ebuild b/dev-lang/mercury/mercury-0.12.2-r3.ebuild
new file mode 100644
index 000000000000..b6ac4732e83a
--- /dev/null
+++ b/dev-lang/mercury/mercury-0.12.2-r3.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/mercury-0.12.2-r3.ebuild,v 1.1 2006/08/12 01:42:13 keri Exp $
+
+inherit eutils
+
+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="ftp://ftp.mercury.cs.mu.oz.au/pub/mercury/${MY_P}.tar.gz
+ ftp://ftp.mercury.cs.mu.oz.au/pub/mercury/mercury-tests-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ppc ~x86"
+
+IUSE="debug minimal readline threads"
+
+DEPEND="readline? ( sys-libs/readline )"
+
+S="${WORKDIR}"/${MY_P}
+TESTDIR="${WORKDIR}"/${PN}-tests-${PV}
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-portage-r3.patch
+ epatch "${FILESDIR}"/${P}-CFLAGS.patch
+ epatch "${FILESDIR}"/${P}-bootstrap.patch
+ epatch "${FILESDIR}"/${P}-LIBDIR.patch
+ epatch "${FILESDIR}"/${P}-libgrades.patch
+ epatch "${FILESDIR}"/${P}-docs.patch
+
+ cd "${TESTDIR}"
+ epatch "${FILESDIR}"/${P}-tests.patch
+ sed -i -e "s:MDB_DOC:${S}/doc/mdb_doc:" mdbrc
+}
+
+src_compile() {
+ local myconf
+ myconf="--disable-dotnet-grades \
+ $(use_enable debug debug-grades) \
+ $(use_enable threads par-grades) \
+ $(use_enable !minimal most-grades) \
+ $(use_with readline) \
+ PACKAGE_VERSION=${PV}"
+
+ einfo "Performing stage 1 bootstrap"
+ econf \
+ ${myconf} \
+ BOOTSTRAP_STAGE="1" \
+ || die "econf stage 1 failed"
+ emake || die "emake stage 1 failed"
+
+ einfo "Performing stage 2 bootstrap"
+ cp "${S}"/compiler/mercury_compile "${S}"/mercury_compile
+ econf \
+ ${myconf} \
+ BOOTSTRAP_STAGE="2" \
+ || die "econf stage 2 failed"
+ emake \
+ MERCURY_COMPILER="${S}"/mercury_compile \
+ || die "emake stage 2 failed"
+
+ einfo "Compiling libgrades"
+ emake \
+ MERCURY_COMPILER="${S}"/compiler/mercury_compile \
+ libgrades || die "emake libgrades failed"
+}
+
+src_test() {
+ cd "${TESTDIR}"
+
+ PATH="${S}"/scripts:"${S}"/util:"${PATH}" \
+ WORKSPACE="${S}" \
+ MERCURY_COMPILER="${S}"/compiler/${PN}_compile \
+ MMAKE_DIR="${S}"/scripts \
+ MERCURY_DEBUGGER_INIT="${TESTDIR}"/mdbrc \
+ mmake || die "mmake test failed"
+}
+
+src_install() {
+ make \
+ 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 || die "make install failed"
+
+ dodoc BUGS HISTORY LIMITATIONS NEWS README README.Java README.Linux README.Linux-Alpha README.Linux-m68k README.Linux-PPC RELEASE_NOTES TODO VERSION WORK_IN_PROGRESS
+}