[m-rev.] diff: GCC back-end: fix problem with `mmake install'

Fergus Henderson fjh at cs.mu.OZ.AU
Sat May 12 15:03:16 AEST 2001


Estimated hours taken: 1
Branches: main

Fix a bug in the add Mmake support for the GCC back-end
that caused problems when installing the standard library
with `--target asm'.

compiler/modules.m:
	Change write_compact_dependencies_list so that it does the right
	thing for header files for standard modules in MLDS grades,
	i.e. doesn't omit the "mercury." prefixes.

library/Mmakefile:
	Delete a work-around for the above-mentioned problem, because
	the problem is now fixed.  The work-around caused problems,
	because it only worked for --target c, not for --target asm.

Workspace: /home/hg/fjh/gcc-cvs/gcc/mercury
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.163
diff -u -d -r1.163 modules.m
--- compiler/modules.m	2001/05/11 13:28:28	1.163
+++ compiler/modules.m	2001/05/12 04:50:59
@@ -3479,19 +3479,31 @@
 	maybe(pair(string)), io__output_stream, io__state, io__state).
 :- mode write_compact_dependencies_list(in, in, in, in, in, di, uo) is det.
 
-write_compact_dependencies_list(Modules, _Prefix, Suffix, no, DepStream) -->
-	write_dependencies_list(Modules, Suffix, DepStream).
-write_compact_dependencies_list(_Modules, Prefix, Suffix,
-		yes(VarName - OldSuffix), DepStream) -->
-	io__write_string(DepStream, "$("),
-	io__write_string(DepStream, VarName),
-	io__write_string(DepStream, ":%"),
-	io__write_string(DepStream, OldSuffix),
-	io__write_string(DepStream, "="),
-	io__write_string(DepStream, Prefix),
-	io__write_string(DepStream, "%"),
-	io__write_string(DepStream, Suffix),
-	io__write_string(DepStream, ")").
+write_compact_dependencies_list(Modules, Prefix, Suffix, Basis, DepStream) -->
+	(
+		{ Basis = yes(VarName - OldSuffix) },
+		% Don't use the compact dependency lists for names of header
+		% files for modules in the standard library, because it
+		% doesn't take into account the "mercury." prefix
+		% that gets added to those header file names in MLDS grades.
+		\+ {
+			(Suffix = ".h" ; Suffix = ".h.tmp"),
+			list__member(unqualified(StdLibModule), Modules),
+			mercury_std_library_module(StdLibModule)
+		}
+	->
+		io__write_string(DepStream, "$("),
+		io__write_string(DepStream, VarName),
+		io__write_string(DepStream, ":%"),
+		io__write_string(DepStream, OldSuffix),
+		io__write_string(DepStream, "="),
+		io__write_string(DepStream, Prefix),
+		io__write_string(DepStream, "%"),
+		io__write_string(DepStream, Suffix),
+		io__write_string(DepStream, ")")
+	;
+		write_dependencies_list(Modules, Suffix, DepStream)
+	).
 
 :- pred write_compact_dependencies_separator(maybe(pair(string)),
 	io__output_stream, io__state, io__state).
Index: library/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/library/Mmakefile,v
retrieving revision 1.62
diff -u -d -r1.62 Mmakefile
--- library/Mmakefile	2001/05/02 16:13:24	1.62
+++ library/Mmakefile	2001/05/11 13:28:51
@@ -105,17 +105,6 @@
 
 #-----------------------------------------------------------------------------#
 
-# We need to override library.hs manually here, since the default
-# definition of library.hs does not include the `mercury.' prefix.
-# (We could modify compiler/modules.m to generate it correctly,
-# but it's easier to just manually override it here.)
-# This definition is only correct for MLDS grades, but fortunately
-# it is also only used for MLDS grades.
-
-library.hs = $(library.mods:%=mercury.%.h)
-
-#-----------------------------------------------------------------------------#
-
 # Stuff for Windows DLLS using gnu-win32
 
 ifeq ($(USE_DLLS),yes)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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