diff options
Diffstat (limited to 'src/makefiles/Makefile.unixware')
-rw-r--r-- | src/makefiles/Makefile.unixware | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/makefiles/Makefile.unixware b/src/makefiles/Makefile.unixware index 9e4d715932a..76b52a5cd88 100644 --- a/src/makefiles/Makefile.unixware +++ b/src/makefiles/Makefile.unixware @@ -7,9 +7,23 @@ endif ifeq ($(ld_R_works), yes) ifeq ($(with_gnu_ld), yes) - rpath = -Wl,-rpath,$(libdir) + # Convert the list of library search paths into -rpath options + # (i.e. "-LpathA -LpathB" -> ",-rpath,pathA,-rpath,pathB"), adding + # the contents of LD_LIBRARY_PATH if it exists. + tpath1=$(shell echo $(trpath) | sed -e 's/ *-L/,-rpath,/g') +ifdef LD_LIBRARY_PATH + tpath2 = ,-rpath,tpath+=$(shell echo $(LD_LIBRARY_PATH) | sed -e 's/:/,-rpath,/g') +endif + rpath = -Wl,-rpath,$(libdir)$(tpath)$(tpath2) else - rpath = -Wl,-R$(libdir) + # Convert the list of library search paths into a -R option path + # (i.e. "-LpathA -LpathB" -> ":pathA:pathB"), adding the contents of + # LD_LIBRARY_PATH if it exists. + tpath1 = $(shell echo $(trpath) | sed -e 's/ *-L/:/g') +ifdef LD_LIBRARY_PATH + tpath2 = :$(LD_LIBRARY_PATH) +endif + rpath = -Wl,-R$(libdir)$(tpath1)$(tpath2) endif endif shlib_symbolic = -Wl,-Bsymbolic |