summaryrefslogtreecommitdiff
path: root/Makeconf
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-08-25 14:25:07 +0000
committerMiles Bader <miles@gnu.org>1995-08-25 14:25:07 +0000
commit9413796b1df2a93d8297a224315a7687abaee749 (patch)
treecabe571092e474276b970e66d586e520b0ccde30 /Makeconf
parentd742afca0ce88b31016cc835a50ae029d654feaf (diff)
($(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.
Diffstat (limited to 'Makeconf')
-rw-r--r--Makeconf10
1 files 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