[m-rev.] diff: commit recent bug fixes on the release branch

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Jan 18 16:36:24 AEDT 2006


Estimated hours taken: 1
Branches: release

Merge some recent changes on the main branch onto the release branch (
most of these are bug fixes to mmc --make by Peter Wang).

compiler/Mercury.options:
	Fix a typo: s/MCFLAGS/MGFLAGS/.

compiler/compile_target_code.m:
	Avoid a problem where trying to copy/create a symlink to a file
	fails because a file of the same name already exists.

compiler/make.program_target.m:
	Prevent mmc --make from attempting to build shared libraries if
	they unsupported on the current architecture.

	Fix a typo that meant .mih files were being installed in the
	wrong directory.

Mmake.common.in:
compiler/export.m:
	Use _MH as the suffix for the header guard macros for .mh files
	in order to avoid potential conflicts.

library/io.m:
	Add the can_pass_as_mercury_type attribute to some foreign types.

compiler/handle_options.m:
	Disable smart-recompilation when build the source file mapping.
	This avoids a spurious warning.

	Update the year in the copyright messages.

scripts/Mercury.config.in:
	Fix a reference to a non-existent variable.

doc/reference_manual.texi:
doc/user_guide.texi:
profiler/mercury_profile.m:
trace/mercury_trace_internal.c:
	Update the year in the copyright messages.

Julien.

Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.81.2.1
diff -u -r1.81.2.1 Mmake.common.in
--- Mmake.common.in	16 Aug 2005 15:57:38 -0000	1.81.2.1
+++ Mmake.common.in	18 Jan 2006 04:09:41 -0000
@@ -384,8 +384,8 @@
 #
 # The two rules should differ only in the filenames they use and in the fact
 # that the automatically created header file for module x is allowed to have
-# two macros, X_H and X_DECL_GUARD over and above what HEADER_CLEAN_FILTER
-# allows.
+# three macros, X_H, X_MH and X_DECL_GUARD over and above what
+# HEADER_CLEAN_FILTER allows.
 #
 # XXX We should consider deleting the special handling of these macros, and
 # requiring instead that the compiler put MERCURY_ prefixes in front of them,
@@ -422,6 +422,7 @@
 		-E $*.check_mhdr.c -nostdinc -dN \
 		2> /dev/null | $(AWK) '/[ \t]*#define/ { print $$2; }' | \
 		grep -v -e `echo $(subst .check.mmacros,,$@) | tr '[a-z]' '[A-Z]'`_H | \
+		grep -v -e `echo $(subst .check.mmacros,,$@) | tr '[a-z]' '[A-Z]'`_MH | \
 		grep -v -e `echo $(subst .check.mmacros,,$@) | tr '[a-z]' '[A-Z]'`_DECL_GUARD | \
 		$(HEADER_CLEAN_FILTER) | sort -u > $*.mactual
 	@comm -1 -3 $*.mbase $*.mactual > $@
Index: compiler/Mercury.options
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Mercury.options,v
retrieving revision 1.12.2.2
diff -u -r1.12.2.2 Mercury.options
--- compiler/Mercury.options	14 Apr 2005 03:42:32 -0000	1.12.2.2
+++ compiler/Mercury.options	18 Jan 2006 03:50:17 -0000
@@ -32,7 +32,7 @@
 MGNUCFLAGS-make.program_target = --no-ansi

 MCFLAGS-libs.process_util = --no-ansi-c
-MGFLAGS-make.module_dep_file = --no-ansi-c
+MCFLAGS-make.module_dep_file = --no-ansi-c
 MCFLAGS-make.module_target = --no-ansi-c
 MCFLAGS-make.program_target = --no-ansi-c

Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.65.2.2
diff -u -r1.65.2.2 compile_target_code.m
--- compiler/compile_target_code.m	20 Nov 2005 23:06:10 -0000	1.65.2.2
+++ compiler/compile_target_code.m	18 Jan 2006 03:53:31 -0000
@@ -1382,6 +1382,7 @@
 		globals__io_set_option(use_grade_subdirs, bool(yes), !IO),

 		io__set_output_stream(ErrorStream, OutputStream, !IO),
+		io__remove_file(UserDirFileName, _, !IO),
 		make_symlink_or_copy_file(OutputFileName, UserDirFileName,
 			Succeeded, !IO),
 		io__set_output_stream(OutputStream, _, !IO)
Index: compiler/export.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/export.m,v
retrieving revision 1.82
diff -u -r1.82 export.m
--- compiler/export.m	19 Jan 2005 03:10:32 -0000	1.82
+++ compiler/export.m	18 Jan 2006 04:03:14 -0000
@@ -625,7 +625,7 @@
 			"*/\n"], !IO),
 		MangledModuleName = sym_name_mangle(ModuleName),
 		string__to_upper(MangledModuleName, UppercaseModuleName),
-		string__append(UppercaseModuleName, "_H", GuardMacroName),
+		string__append(UppercaseModuleName, "_MH", GuardMacroName),
 		io__write_strings([
 			"#ifndef ", GuardMacroName, "\n",
 			"#define ", GuardMacroName, "\n",
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.216.2.1
diff -u -r1.216.2.1 handle_options.m
--- compiler/handle_options.m	14 Feb 2005 02:28:51 -0000	1.216.2.1
+++ compiler/handle_options.m	18 Jan 2006 04:52:45 -0000
@@ -624,6 +624,8 @@
 	% which either do not produce a compiled output file or
 	% for which smart recompilation will not work.
 	%
+	option_implies(generate_source_file_mapping, smart_recompilation,
+		bool(no)),
 	option_implies(generate_dependencies, smart_recompilation, bool(no)),
 	option_implies(convert_to_mercury, smart_recompilation, bool(no)),
 	option_implies(make_private_interface, smart_recompilation, bool(no)),
@@ -1539,7 +1541,7 @@
 	library__version(Version),
 	io__write_strings([
 		"Mercury Compiler, version ", Version, "\n",
-		"Copyright (C) 1993-2005 The University of Melbourne\n"
+		"Copyright (C) 1993-2006 The University of Melbourne\n"
 	], !IO).

 usage(!IO) :-
@@ -1563,7 +1565,7 @@
 	% usage message, but there is no simple way to avoid that.
 	library__version(Version),
  	io__write_strings(["Mercury Compiler, version ", Version, "\n"], !IO),
- 	io__write_string("Copyright (C) 1993-2005 " ++
+ 	io__write_string("Copyright (C) 1993-2006 " ++
 		"The University of Melbourne\n", !IO),
 	io__write_string("Usage: mmc [<options>] <arguments>\n", !IO),
 	io__write_string("Arguments:\n", !IO),
Index: compiler/make.program_target.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make.program_target.m,v
retrieving revision 1.28
diff -u -r1.28 make.program_target.m
--- compiler/make.program_target.m	20 Jul 2004 04:41:01 -0000	1.28
+++ compiler/make.program_target.m	18 Jan 2006 04:44:24 -0000
@@ -539,11 +539,21 @@
 				make_linked_target(MainModuleName -
 					static_library, StaticSucceeded,
 					!Info, !IO),
+				shared_libraries_supported(
+					SharedLibsSupported, !IO),
 				(
 					StaticSucceeded = yes,
-					make_linked_target(MainModuleName -
-						shared_library, Succeeded,
-						!Info, !IO)
+					(
+						SharedLibsSupported = yes,
+						make_linked_target(
+						    MainModuleName -
+						    shared_library,
+						    Succeeded,
+						    !Info, !IO)
+					;
+						SharedLibsSupported = no,
+						Succeeded = yes
+					)
 				;
 					StaticSucceeded = no,
 					Succeeded = no
@@ -569,6 +579,14 @@
 		)
 	).

+:- pred shared_libraries_supported(bool::out, io::di, io::uo) is det.
+
+shared_libraries_supported(Supported, !IO) :-
+	globals__io_lookup_string_option(library_extension, LibExt, !IO),
+	globals__io_lookup_string_option(shared_library_extension,
+		SharedLibExt, !IO),
+	Supported = ( if LibExt \= SharedLibExt then yes else no ).
+
 %-----------------------------------------------------------------------------%

 :- pred install_library(module_name::in, bool::out,
@@ -842,7 +860,7 @@

 			% This is needed so that the file will be
 			% found in Mmake's VPATH.
-			IntDir = LibDir/"int",
+			IntDir = LibDir/"ints",
 			install_subdir_file(LinkSucceeded, IntDir,
 				ModuleName, "mih", HeaderSucceded2, !IO),

Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.315.2.7
diff -u -r1.315.2.7 modules.m
--- compiler/modules.m	3 Oct 2005 04:24:30 -0000	1.315.2.7
+++ compiler/modules.m	18 Jan 2006 04:12:51 -0000
@@ -1133,7 +1133,9 @@
         io__write_string("' to `", !IO),
         io__write_string(DestinationFileName, !IO),
         io__write_string("': ", !IO),
-        io__write_string(io__error_message(Error), !IO)
+        io__write_string(io__error_message(Error), !IO),
+        io__nl(!IO),
+        io__flush_output(!IO)
     ).

 :- pred make_file_name(dir_name::in, bool::in, bool::in, file_name::in,
Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.307.2.5
diff -u -r1.307.2.5 reference_manual.texi
--- doc/reference_manual.texi	6 Oct 2005 07:59:24 -0000	1.307.2.5
+++ doc/reference_manual.texi	18 Jan 2006 04:53:07 -0000
@@ -17,7 +17,7 @@
 @ifnottex
 This file documents the Mercury programming language, version <VERSION>.

-Copyright (C) 1995-2005 The University of Melbourne.
+Copyright (C) 1995-2006 The University of Melbourne.

 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
@@ -53,7 +53,7 @@
 @author Ralph Becket
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1995--2005 The University of Melbourne.
+Copyright @copyright{} 1995--2006 The University of Melbourne.

 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.414.2.8
diff -u -r1.414.2.8 user_guide.texi
--- doc/user_guide.texi	27 Jul 2005 06:23:16 -0000	1.414.2.8
+++ doc/user_guide.texi	18 Jan 2006 04:53:18 -0000
@@ -44,7 +44,7 @@
 @ifnottex
 This file documents the Mercury implementation, version <VERSION>.

-Copyright (C) 1995-2005 The University of Melbourne.
+Copyright (C) 1995-2006 The University of Melbourne.

 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
@@ -78,7 +78,7 @@
 @author Ian MacLarty
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1995--2005 The University of Melbourne.
+Copyright @copyright{} 1995--2006 The University of Melbourne.

 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.327.2.3
diff -u -r1.327.2.3 io.m
--- library/io.m	20 Nov 2005 23:06:12 -0000	1.327.2.3
+++ library/io.m	18 Jan 2006 04:24:51 -0000
@@ -1656,7 +1656,8 @@
 :- type io__binary_stream ==	io__stream.

 :- type io__stream --->		io__stream(c_pointer).
-:- pragma foreign_type("C", io__stream, "MercuryFilePtr").
+:- pragma foreign_type("C", io__stream, "MercuryFilePtr",
+	[can_pass_as_mercury_type]).
 :- pragma foreign_type("il", io__stream,
 	"class [mercury]mercury.io__csharp_code.MR_MercuryFileStruct").
 :- pragma foreign_type("Java", io__stream, "mercury.io.MR_MercuryFileStruct").
@@ -3185,7 +3186,7 @@
 % Buffer sizes are measured in Chars.

 :- type buffer.
-:- pragma foreign_type(c, buffer, "MR_Char *").
+:- pragma foreign_type(c, buffer, "MR_Char *", [can_pass_as_mercury_type]).

 	% XXX It would be better to use a char_array (e.g. defined as char[] in
 	% C#) type rather than array(char).  This is because on the Java and IL
Index: profiler/mercury_profile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/profiler/mercury_profile.m,v
retrieving revision 1.29
diff -u -r1.29 mercury_profile.m
--- profiler/mercury_profile.m	5 Jan 2005 05:09:35 -0000	1.29
+++ profiler/mercury_profile.m	18 Jan 2006 04:53:39 -0000
@@ -93,7 +93,7 @@
 	library__version(Version),
         io__write_strings(StdErr, [
 		"Mercury Profiler, version ", Version, "\n",
-		"Copyright (C) 1995-2005 The University of Melbourne\n",
+		"Copyright (C) 1995-2006 The University of Melbourne\n",
         	"Usage: ", ProgName, " [<options>] [<files>]\n",
         	"Use `", ProgName, " --help' for more information.\n"
 		], !IO).
@@ -105,7 +105,7 @@
 	library__version(Version),
         io__write_strings([
 	"Mercury Profiler, version ", Version, "\n",
-	"Copyright (C) 1995-2005 The University of Melbourne\n\n",
+	"Copyright (C) 1995-2006 The University of Melbourne\n\n",
        	"Usage: ", ProgName, "[<options>] [<files>]\n",
 	"\n",
 	"Description:\n",
Index: scripts/Mercury.config.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mercury.config.in,v
retrieving revision 1.10
diff -u -r1.10 Mercury.config.in
--- scripts/Mercury.config.in	19 Oct 2004 06:01:38 -0000	1.10
+++ scripts/Mercury.config.in	18 Jan 2006 04:01:22 -0000
@@ -99,7 +99,7 @@
 		--linker-allow-undefined-flag "@ALLOW_UNDEFINED@" \
 		--linker-error-undefined-flag "@ERROR_UNDEFINED@" \
 		--fullarch "@FULLARCH@" \
-		--install-prefix "@INSTALL_PREFIX@" \
+		--install-prefix "@prefix@" \
 		--num-real-r-regs "@NUM_REAL_R_REGS@" \
 		--num-real-r-temps "@NUM_REAL_R_TEMPS@" \
 		--conf-low-tag-bits "@LOW_TAG_BITS@" \
Index: trace/mercury_trace_internal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.190.2.2
diff -u -r1.190.2.2 mercury_trace_internal.c
--- trace/mercury_trace_internal.c	8 Feb 2005 06:18:40 -0000	1.190.2.2
+++ trace/mercury_trace_internal.c	18 Jan 2006 04:53:55 -0000
@@ -812,7 +812,7 @@

 static const char MR_trace_banner[] =
 "Melbourne Mercury Debugger, mdb version %s.\n\
-Copyright 1998-2005 The University of Melbourne, Australia.\n\
+Copyright 1998-2006 The University of Melbourne, Australia.\n\
 mdb is free software, covered by the GNU General Public License.\n\
 There is absolutely no warranty for mdb.\n";

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list