From efb25c01a56ed71c3cc4d699e1eadcf6aa27f8b5 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 11 Oct 1995 03:31:18 +0000 Subject: (rpath): New variable. ($(target)): Use it in link command. ($(libname).so): Likewise. Use $^ instead of $+. --- Makeconf | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makeconf b/Makeconf index 8648d475..15664353 100644 --- a/Makeconf +++ b/Makeconf @@ -159,8 +159,15 @@ libsubst=$(basename ${lib})$(_libext) libsubst-override=${$(notdir $(basename ${lib}))-libsubst} _libsubst=${libsubst$(patsubst %,-override,${libsubst-override})} +# Direct the linker where to find shared objects specified in the +# dependencies of other shared objects it encounters. +rpath := -Wl,-rpath-link=.:$(subst $. ,:,$(dir $(wildcard ../lib*/lib*.so))) + $(target): %: $(_objs) $(OTHERLIBS) - $(CC) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ '-Wl,-(' $(filter %.o,$^) $(foreach lib,$(filter-out %.o,$+),${_libsubst}) '-Wl,-)' + $(CC) $(rpath) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ \ + '-Wl,-(' $(filter %.o,$^) \ + $(foreach lib,$(filter-out %.o,$+),${_libsubst}) \ + '-Wl,-)' ifeq ($(makemode),library) $(libname).a: $(OBJS) @@ -170,7 +177,7 @@ $(libname).a: $(OBJS) $(libname).so: $(patsubst %.o,%_pic.o,$(OBJS)) $(CC) -shared -Wl,-soname=$(libname).so -o $(libname).so \ - $(CFLAGS) $(LDFLAGS) $($@-LDFLAGS) $+ + $(rpath) $(CFLAGS) $(LDFLAGS) $($@-LDFLAGS) $^ endif # Making a snapshot -- cgit v1.2.3