[m-rev.] for review: fix problems with mmake --use-mmc-make on x86

Peter Wang wangp at students.cs.mu.OZ.AU
Thu Jan 12 16:35:56 AEDT 2006


Estimated hours taken: 3
Branches: main

This fixes some problems with building everything with `mmake --use-mmc-make'
on x86, or possibly any platform where shared libraries are supported.

Mmake.workspace:
	Add "--mercury-linkage static" or "--mercury-linkage shared" to
	`MCFLAGS' depending on whether the `LINK_STATIC' makefile variable is
	yes or no.

analysis/ANALYSIS_FLAGS.in:
	Add -L<dir> options so that the analysis library can find the boehm_gc,
	runtime and standard library files when built in shared linking mode.

browser/Mercury.options:
	Work around a problem with per-file variables and `mmake
	--use-mmc-make'.

compiler/COMP_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
	Remove "--linkage shared" from these files.  The Mmakefiles in these
	directories have "LINK_STATIC=yes" set.  This was causing a link error
	where the object files where being built with PIC but expected to
	link against lib*.a files.

Index: Mmake.workspace
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.workspace,v
retrieving revision 1.20
diff -u -r1.20 Mmake.workspace
--- Mmake.workspace	19 Sep 2005 08:06:43 -0000	1.20
+++ Mmake.workspace	12 Jan 2006 05:04:39 -0000
@@ -198,6 +198,8 @@
 MLOBJS += $(STATIC_TRACE_LIBS) $(STATIC_STD_LIBS) \
 		$(STATIC_RT_LIBS) $(STATIC_GC_LIBS)
 
+MCFLAGS += --mercury-linkage static
+
 else # LINK_STATIC != yes
 
 LINK_RT_LIB_OPTS=
@@ -225,6 +227,8 @@
 # MCFLAGS    += $(LIB_DIR_OPTS)
 MLLIBS       += $(LINK_LIB_OPTS)
 
+MCFLAGS      += --mercury-linkage shared
+
 ifeq ($(SET_RPATH),yes)
 MLFLAGS += $(LIB_DIR_OPTS:-L%=-R%)
 MCFLAGS += --flags RPATH
Index: analysis/ANALYSIS_FLAGS.in
===================================================================
RCS file: /home/mercury1/repository/mercury/analysis/ANALYSIS_FLAGS.in,v
retrieving revision 1.1
diff -u -r1.1 ANALYSIS_FLAGS.in
--- analysis/ANALYSIS_FLAGS.in	6 May 2005 08:42:04 -0000	1.1
+++ analysis/ANALYSIS_FLAGS.in	12 Jan 2006 04:28:33 -0000
@@ -17,4 +17,7 @@
 --c-include-directory ../browser/Mercury/mihs
 --c-include-directory ../trace
 --c-include-directory ../analysis
+-L../boehm_gc
+-L../runtime
+-L../library
 --config-file ../scripts/Mercury.config.bootstrap
Index: browser/Mercury.options
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/Mercury.options,v
retrieving revision 1.10
diff -u -r1.10 Mercury.options
--- browser/Mercury.options	17 Oct 2005 08:49:12 -0000	1.10
+++ browser/Mercury.options	12 Jan 2006 05:16:40 -0000
@@ -19,5 +19,10 @@
 MCFLAGS-mdb.declarative_analyser = --no-optimize-unused-args
 MCFLAGS-mdb.declarative_execution = --no-optimize-unused-args
 
+# XXX This line is needed so that `mmake --use-mmc-make libmer_browser'
+# passes `-lmer_mdbcomp' to `mmc --make' in the MLLIBS variable.
+EXTRA_LIBRARIES-libmer_browser = mer_mdbcomp
+
+# Whereas these lines are needed for plain `mmake'.
 EXTRA_LIBRARIES-libmer_browser.so = mer_mdbcomp
 EXTRA_LIBRARIES-libmer_browser.dylib = mer_mdbcomp
Index: compiler/COMP_FLAGS.in
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/COMP_FLAGS.in,v
retrieving revision 1.1
diff -u -r1.1 COMP_FLAGS.in
--- compiler/COMP_FLAGS.in	6 May 2005 08:42:09 -0000	1.1
+++ compiler/COMP_FLAGS.in	12 Jan 2006 05:11:09 -0000
@@ -19,5 +19,4 @@
 --c-include-directory ../trace
 --c-include-directory ../analysis
 --no-main
---linkage shared
 --config-file ../scripts/Mercury.config.bootstrap
Index: profiler/PROF_FLAGS.in
===================================================================
RCS file: /home/mercury1/repository/mercury/profiler/PROF_FLAGS.in,v
retrieving revision 1.1
diff -u -r1.1 PROF_FLAGS.in
--- profiler/PROF_FLAGS.in	6 May 2005 08:42:20 -0000	1.1
+++ profiler/PROF_FLAGS.in	12 Jan 2006 05:12:53 -0000
@@ -16,5 +16,4 @@
 --c-include-directory ../browser
 --c-include-directory ../browser/Mercury/mihs
 --c-include-directory ../trace
---linkage shared
 --config-file ../scripts/Mercury.config.bootstrap
Index: slice/SLICE_FLAGS.in
===================================================================
RCS file: /home/mercury1/repository/mercury/slice/SLICE_FLAGS.in,v
retrieving revision 1.1
diff -u -r1.1 SLICE_FLAGS.in
--- slice/SLICE_FLAGS.in	6 May 2005 08:42:28 -0000	1.1
+++ slice/SLICE_FLAGS.in	12 Jan 2006 05:10:33 -0000
@@ -16,5 +16,4 @@
 --c-include-directory ../browser
 --c-include-directory ../browser/Mercury/mihs
 --c-include-directory ../trace
---linkage shared
 --config-file ../scripts/Mercury.config.bootstrap
--------------------------------------------------------------------------
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