summaryrefslogtreecommitdiff
path: root/sysinfo/os
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-11-25 05:05:44 -0500
committermidipix <writeonce@midipix.org>2018-11-25 09:17:30 -0500
commitf470d1f3ab5d30cb291b7745dde4f82aefe18cbb (patch)
tree4914f66fdd38fcc8f2a8b5073009ba79b99d2562 /sysinfo/os
parent2ce5e6e859a70e6b95e987c81ace3c042f1fae21 (diff)
downloadbcparser-f470d1f3ab5d30cb291b7745dde4f82aefe18cbb.tar.bz2
bcparser-f470d1f3ab5d30cb291b7745dde4f82aefe18cbb.tar.xz
build system: PE, ELF: defined DSO_REF_VER, DSO_REF_SONAME, DSO_REF_SOLINK.
These definitions come in handy when a project generates alongside its ``primary shared library'' one or more ``extension libraries'' that depend on it. When the rules for generating extension libraries use the $^ directive, the above dependency must be declared in a target-aware manner. In most cases, one would want to express this dependency by way of $(DSO_REF_SONAME), thereby pulling in lib/libfoo.so.$(MAJOR) on ELF targets, lib/libfoo.$(MAJOR).lib.a on midipix targets, and lib/libfoo.$(MAJOR).dll.a on win32 targets.
Diffstat (limited to 'sysinfo/os')
-rw-r--r--sysinfo/os/elf.mk4
-rw-r--r--sysinfo/os/pe.mk4
2 files changed, 8 insertions, 0 deletions
diff --git a/sysinfo/os/elf.mk b/sysinfo/os/elf.mk
index 5a3940f..6878c6a 100644
--- a/sysinfo/os/elf.mk
+++ b/sysinfo/os/elf.mk
@@ -1,2 +1,6 @@
+DSO_REF_VER = $(SHARED_LIB)
+DSO_REF_SONAME = $(SHARED_SONAME)
+DSO_REF_SOLINK = $(SHARED_SOLINK)
+
LDFLAGS_SHARED += -Wl,-soname
LDFLAGS_SHARED += -Wl,$(DSO_SONAME)
diff --git a/sysinfo/os/pe.mk b/sysinfo/os/pe.mk
index e8e1759..c3c5ba0 100644
--- a/sysinfo/os/pe.mk
+++ b/sysinfo/os/pe.mk
@@ -1,3 +1,7 @@
+DSO_REF_VER = $(IMPLIB_VER)
+DSO_REF_SONAME = $(IMPLIB_SONAME)
+DSO_REF_SOLINK = $(IMPLIB_SOLINK)
+
LDFLAGS_IMPLIB += -Wl,--output-def
LDFLAGS_IMPLIB += -Wl,$(IMPLIB_DEF)
LDFLAGS_SHARED += $(LDFLAGS_IMPLIB)