[m-rev.] diff: fix Mmake.workspace dynamic linking bug
Simon Taylor
stayl at cs.mu.OZ.AU
Thu May 2 18:01:39 AEST 2002
Estimated hours taken: 0.25
Branches: main
Fix a bug in my change to simplify the compiler and library Mmakefiles.
Mmake.workspace:
Mmake.common.in:
Don't pass `-R$(WORKSPACE)/runtime' options to
ml when building the Mercury libraries. The only
`-R' options passed when building the libraries
should point to the final installation directory.
Index: Mmake.workspace
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.workspace,v
retrieving revision 1.2
diff -u -u -r1.2 Mmake.workspace
--- Mmake.workspace 30 Apr 2002 03:40:27 -0000 1.2
+++ Mmake.workspace 2 May 2002 07:54:06 -0000
@@ -12,6 +12,13 @@
# for the Mercury libraries will be included in MLLIBS, otherwise
# `-l' options will be included.
#
+# By default, if LINK_STATIC is unset or set to `no', `-R' options
+# will be passed to ml for each of the directories containing the
+# Mercury libraries. If SET_RPATH is set to `no', these options will
+# not be passed. This is useful for building the Mercury libraries,
+# for which the rpath must be set in each Mmakefile to point to
+# the installed library directory.
+#
# Setting LINK_BOEHM_GC_ONLY to `yes' causes only the boehm_gc directory
# to be included in MLFLAGS, MLLIBS and CFLAGS.
@@ -23,6 +30,7 @@
#-----------------------------------------------------------------------------#
LINK_STATIC ?= no
+SET_RPATH ?= yes
LINK_BOEHM_GC_ONLY ?= no
LINK_RUNTIME_ONLY ?= no
LINK_STDLIB_ONLY ?= no
@@ -132,25 +140,28 @@
else # LINK_STATIC != yes
NON_STATIC_LIBS := $(SHARED_GC_LIBS)
-NON_STATIC_LIB_DIRS := -L$(BOEHM_GC_DIR) -R$(BOEHM_GC_DIR)
+NON_STATIC_LIB_DIRS := -L$(BOEHM_GC_DIR)
ifneq ($(LINK_BOEHM_GC_ONLY),yes)
NON_STATIC_LIBS := -l$(RT_LIB_NAME) $(NON_STATIC_LIBS)
-NON_STATIC_LIB_DIRS := -L$(RUNTIME_DIR) -R$(RUNTIME_DIR) $(NON_STATIC_LIB_DIRS)
+NON_STATIC_LIB_DIRS := -L$(RUNTIME_DIR) $(NON_STATIC_LIB_DIRS)
ifneq ($(LINK_RUNTIME_ONLY),yes)
NON_STATIC_LIBS := -l$(STD_LIB_NAME) $(NON_STATIC_LIBS)
-NON_STATIC_LIB_DIRS := -L$(LIBRARY_DIR) -R$(LIBRARY_DIR) $(NON_STATIC_LIB_DIRS)
+NON_STATIC_LIB_DIRS := -L$(LIBRARY_DIR) $(NON_STATIC_LIB_DIRS)
ifneq ($(LINK_STDLIB_ONLY),yes)
NON_STATIC_LIBS := -l$(TRACE_LIB_NAME) -l$(BROWSER_LIB_NAME) $(NON_STATIC_LIBS)
-NON_STATIC_LIB_DIRS := -L$(TRACE_DIR) -R$(TRACE_DIR) -L$(BROWSER_DIR) \
- -R$(BROWSER_DIR) $(NON_STATIC_LIB_DIRS)
+NON_STATIC_LIB_DIRS := -L$(TRACE_DIR) -L$(BROWSER_DIR) $(NON_STATIC_LIB_DIRS)
endif
endif
endif
MLFLAGS += $(NON_STATIC_LIB_DIRS)
MLLIBS += $(NON_STATIC_LIBS)
-MC_MAKE_FLAGS += $(patsubst -R%,--link-flags -R%,$(NON_STATIC_LIB_DIRS)) \
- $(NON_STATIC_LIBS)
+MC_MAKE_FLAGS += $(NON_STATIC_LIB_DIRS) $(NON_STATIC_LIBS)
+
+ifeq ($(SET_RPATH),yes)
+MLFLAGS += $(NON_STATIC_LIB_DIRS:-L%,-R%)
+MC_MAKE_FLAGS += $(NON_STATIC_LIB_DIRS:-L%,--link-flags -R%)
+endif
endif # LINK_STATIC != yes
Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.62
diff -u -u -r1.62 Mmake.common.in
--- Mmake.common.in 29 Apr 2002 08:21:53 -0000 1.62
+++ Mmake.common.in 2 May 2002 07:35:06 -0000
@@ -19,6 +19,10 @@
include $(MERCURY_DIR)/VERSION
+# The rpath for the libraries needs to be set to the final installation
+# directory, not $(MERCURY_DIR)/runtime etc.
+SET_RPATH=no
+
WORKSPACE=$(MERCURY_DIR)
include $(MERCURY_DIR)/Mmake.workspace
--------------------------------------------------------------------------
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