[m-rev.] diff: fix library Aditi initialization

Simon Taylor stayl at cs.mu.OZ.AU
Wed Aug 15 17:59:59 AEST 2001


Estimated hours taken: 0.2
Branches: main, release

compiler/modules.m:
	Only put the ADITI_DATA lines in the <main_module>.init file
	for a library if `--aditi' is set. This avoids link errors
	where a library which does not use Aditi is used by a program
	which does.

Index: modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.192
diff -u -u -r1.192 modules.m
--- modules.m	2001/08/14 14:00:08	1.192
+++ modules.m	2001/08/15 07:18:55
@@ -3802,9 +3802,17 @@
 	{ string__append(InitFuncName0, "init", InitFuncName) },
 	{ llds_out__make_rl_data_name(Module, RLName) },
 	io__write_strings(DepStream, [
-		"\techo ""INIT ", InitFuncName, """ >> ", InitFileName, "\n",
-		"\techo ""ADITI_DATA ", RLName, """ >> ", InitFileName, "\n"
-	]).
+		"\techo ""INIT ", InitFuncName, """ >> ", InitFileName, "\n"
+	]),
+	globals__io_lookup_bool_option(aditi, Aditi),
+	( { Aditi = yes } ->
+		io__write_strings(DepStream, [
+			"\techo ""ADITI_DATA ", RLName, """ >> ",
+				InitFileName, "\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