[m-rev.] diff: fix circular dependency on mercury.dll
Peter Ross
peter.ross at miscrit.be
Wed Jul 18 21:00:11 AEST 2001
Hi,
===================================================================
Estimated hours taken: 0.25
Branches: main
Fix a bug where we introduced a circular dependency on mercury.dll in
the mercury std library mmake rules.
modules.m:
When building the dll dependency list special case the case where we
are building a module with the name of a file in the mercury std
library.
Index: modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.176
diff -u -r1.176 modules.m
--- modules.m 18 Jul 2001 10:28:18 -0000 1.176
+++ modules.m 18 Jul 2001 10:56:58 -0000
@@ -2074,7 +2074,8 @@
io__write_strings(DepStream, [
ForeignDllFileName, " : ", DllFileName]),
- write_dll_dependencies_list(AllDeps, DepStream),
+ write_dll_dependencies_list(ModuleName,
+ AllDeps, DepStream),
io__nl(DepStream),
io__write_strings(DepStream, [
@@ -3820,19 +3821,29 @@
io__write_string(DepStream, FileName),
write_dependencies_list(Modules, Suffix, DepStream).
-:- pred write_dll_dependencies_list(list(module_name), io__output_stream,
- io__state, io__state).
-:- mode write_dll_dependencies_list(in, in, di, uo) is det.
-
-write_dll_dependencies_list(Modules0, DepStream) -->
- { F = (func(M) =
- ( if M = unqualified(S), mercury_std_library_module(S) then
- unqualified("mercury")
- else
- M
- )
- )},
- { Modules = list__remove_dups(list__map(F, Modules0)) },
+:- pred write_dll_dependencies_list(module_name,
+ list(module_name), io__output_stream, io__state, io__state).
+:- mode write_dll_dependencies_list(in, in, in, di, uo) is det.
+
+write_dll_dependencies_list(Module, Modules0, DepStream) -->
+ % If we are not compiling a module in the mercury
+ % std library then replace all the std library dlls with
+ % one reference to mercury.dll.
+ { Module = unqualified(Str), mercury_std_library_module(Str) ->
+ Modules = Modules0
+ ;
+ F = (func(M) =
+ ( if
+ M = unqualified(S),
+ mercury_std_library_module(S)
+ then
+ unqualified("mercury")
+ else
+ M
+ )
+ ),
+ Modules = list__remove_dups(list__map(F, Modules0))
+ },
list__foldl(write_dll_dependency(DepStream), Modules).
:- pred write_dll_dependency(io__output_stream, module_name,
--------------------------------------------------------------------------
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