From 9413796b1df2a93d8297a224315a7687abaee749 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 25 Aug 1995 14:25:07 +0000 Subject: ($(libname).so): Use the linker -soname option to specify what library name should be recorded by users. (__libext, __libext-static, _libext): New variables. ($(target): %): Link against the absolute library with the appropiate extension do determine whether shared or not, instead of using -L...-l syntax. --- Makeconf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makeconf b/Makeconf index e9c592ff..52f0a7aa 100644 --- a/Makeconf +++ b/Makeconf @@ -143,8 +143,14 @@ else _objs = $(OBJS) endif +# Determine which sort of library we should link against from whether -static +# is used in LDFLAGS. +__libext=.so +__libext-static=.a +_libext=$(__libext$(findstring -static,$(LDFLAGS) $($@-LDFLAGS))) + $(target): %: $(_objs) $(OTHERLIBS) - $(CC) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ '-Wl,-(' $(filter %.o,$^) $(foreach lib,$(filter-out %.o,$+),-Wl,-L$(dir $(lib)) $(patsubst lib%,-l%,$(notdir $(basename $(lib))))) '-Wl,-)' + $(CC) $(CFLAGS) $($@-CFLAGS) $(LDFLAGS) $($@-LDFLAGS) -o $@ '-Wl,-(' $(filter %.o,$^) $(foreach lib,$(filter-out %.o,$+),$(basename $(lib))$(_libext)) '-Wl,-)' ifeq ($(makemode),library) $(libname).a: $(OBJS) @@ -153,7 +159,7 @@ $(libname).a: $(OBJS) $(RANLIB) $@ $(libname).so: $(patsubst %.o,%_pic.o,$(OBJS)) - $(CC) -shared $(CFLAGS) -o $(libname).so $+ + $(CC) -shared $(CFLAGS) -Wl,-soname=$(libname) -o $(libname).so $+ endif # Making a snapshot -- cgit v1.2.3