Commit 26d0d695 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

build: set soname for ELF libraries with versioning

fixes #20
parent 67fa76e1
...@@ -17,7 +17,8 @@ BINEXT := ...@@ -17,7 +17,8 @@ BINEXT :=
PLATFORM = Linux PLATFORM = Linux
ARCH := $(word 1, $(subst -, ,$(shell $(CC) -dumpmachine))) ARCH := $(word 1, $(subst -, ,$(shell $(CC) -dumpmachine)))
# Library versioning flags (platform-specific) # Library versioning flags (platform-specific)
SOVER = comma := ,
SOVER = $(if $(1),-Wl$(comma)-soname$(comma)$(3)$(call SOVER_EXT,$(1)))
# Library versioned extension (platform-specific) # Library versioned extension (platform-specific)
SOVER_EXT = $(LIBEXT).$(1) SOVER_EXT = $(LIBEXT).$(1)
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
...@@ -88,7 +89,7 @@ $(2)/$(1)$(3): $$($(1)_OBJ) $$($(1)_DEPEND) ...@@ -88,7 +89,7 @@ $(2)/$(1)$(3): $$($(1)_OBJ) $$($(1)_DEPEND)
ifeq ($(4),-$(ARTYPE)) ifeq ($(4),-$(ARTYPE))
$(call quiet,AR,$$@) rcs $$@ $$($(1)_OBJ) $(call quiet,AR,$$@) rcs $$@ $$($(1)_OBJ)
else else
$(call quiet,CCLD,$$@) $$($(1)_CFLAGS) $(BUILD_CFLAGS) $$($(1)_OBJ) $(call SOVER,$(7),$(7)) -o $$@ $(4) $$($(1)_LIBS) $(BUILD_LDFLAGS) $$($(1)_LDFLAGS) $(call quiet,CCLD,$$@) $$($(1)_CFLAGS) $(BUILD_CFLAGS) $$($(1)_OBJ) $(call SOVER,$(7),$(7),$(1)) -o $$@ $(4) $$($(1)_LIBS) $(BUILD_LDFLAGS) $$($(1)_LDFLAGS)
endif endif
# Additional rules # Additional rules
$(1)-clean: $(1)-clean:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment