summaryrefslogtreecommitdiff
path: root/sysinfo/os
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-24 16:29:50 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:42 -0500
commit781ac1bd0f2df4523b1a715befd1ae63d92afecc (patch)
tree21bdd6bb5942156aa2ef7e08197b51b538236874 /sysinfo/os
parentcc1c9b2fc3a6ff29e89a2673b1a1a4d19558c6d4 (diff)
downloadperk-781ac1bd0f2df4523b1a715befd1ae63d92afecc.tar.bz2
perk-781ac1bd0f2df4523b1a715befd1ae63d92afecc.tar.xz
build system: PE targets: added import library version support.
Diffstat (limited to 'sysinfo/os')
-rw-r--r--sysinfo/os/any-os.mk3
-rw-r--r--sysinfo/os/bsd.mk3
-rw-r--r--sysinfo/os/darwin.mk3
-rw-r--r--sysinfo/os/linux.mk3
-rw-r--r--sysinfo/os/midipix.mk7
-rw-r--r--sysinfo/os/mingw.mk6
-rw-r--r--sysinfo/os/pe.mk48
7 files changed, 58 insertions, 15 deletions
diff --git a/sysinfo/os/any-os.mk b/sysinfo/os/any-os.mk
index c052f31..cf8ec00 100644
--- a/sysinfo/os/any-os.mk
+++ b/sysinfo/os/any-os.mk
@@ -7,5 +7,6 @@ OS_IMPLIB_EXT = .invalid
OS_LIBDEF_EXT = .invalid
OS_ARCHIVE_EXT = .a
OS_SONAME = symlink
+OS_BINFMT = ELF
-.PHONY: $(SHARED_IMPLIB)
+.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK)
diff --git a/sysinfo/os/bsd.mk b/sysinfo/os/bsd.mk
index 694c54f..6e8fac0 100644
--- a/sysinfo/os/bsd.mk
+++ b/sysinfo/os/bsd.mk
@@ -7,5 +7,6 @@ OS_IMPLIB_EXT = .invalid
OS_LIBDEF_EXT = .invalid
OS_ARCHIVE_EXT = .a
OS_SONAME = symlink
+OS_BINFMT = ELF
-.PHONY: $(SHARED_IMPLIB)
+.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK)
diff --git a/sysinfo/os/darwin.mk b/sysinfo/os/darwin.mk
index 7ccdfde..5a0b99e 100644
--- a/sysinfo/os/darwin.mk
+++ b/sysinfo/os/darwin.mk
@@ -7,7 +7,8 @@ OS_IMPLIB_EXT = .invalid
OS_LIBDEF_EXT = .invalid
OS_ARCHIVE_EXT = .a
OS_SONAME = symlink
+OS_BINFMT = MACHO
CFLAGS_OS += -D_DARWIN_C_SOURCE
-.PHONY: $(SHARED_IMPLIB)
+.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK)
diff --git a/sysinfo/os/linux.mk b/sysinfo/os/linux.mk
index e2dcd2e..082026b 100644
--- a/sysinfo/os/linux.mk
+++ b/sysinfo/os/linux.mk
@@ -7,5 +7,6 @@ OS_IMPLIB_EXT = .invalid
OS_LIBDEF_EXT = .invalid
OS_ARCHIVE_EXT = .a
OS_SONAME = symlink
+OS_BINFMT = ELF
-.PHONY: $(SHARED_IMPLIB)
+.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK)
diff --git a/sysinfo/os/midipix.mk b/sysinfo/os/midipix.mk
index 098ac68..d99b249 100644
--- a/sysinfo/os/midipix.mk
+++ b/sysinfo/os/midipix.mk
@@ -7,9 +7,4 @@ OS_IMPLIB_EXT = .lib.a
OS_LIBDEF_EXT = .so.def
OS_ARCHIVE_EXT = .a
OS_SONAME = copy
-
-LDFLAGS_CONFIG += -mout-implib
-
-install-implib: shared-implib
- mkdir -p $(DESTDIR)$(LIBDIR)
- cp $(SHARED_IMPLIB) $(DESTDIR)$(LIBDIR)
+OS_BINFMT = PE \ No newline at end of file
diff --git a/sysinfo/os/mingw.mk b/sysinfo/os/mingw.mk
index a40239f..6ade8d5 100644
--- a/sysinfo/os/mingw.mk
+++ b/sysinfo/os/mingw.mk
@@ -7,10 +7,6 @@ OS_IMPLIB_EXT = .dll.a
OS_LIBDEF_EXT = .def
OS_ARCHIVE_EXT = .a
OS_SONAME = copy
+OS_BINFMT = PE
CFLAGS_PIC =
-LDFLAGS_CONFIG += -Wl,--out-implib,$(SHARED_IMPLIB)
-
-install-implib: shared-implib
- mkdir -p $(DESTDIR)$(LIBDIR)
- cp $(SHARED_IMPLIB) $(DESTDIR)$(LIBDIR)
diff --git a/sysinfo/os/pe.mk b/sysinfo/os/pe.mk
new file mode 100644
index 0000000..0b50df2
--- /dev/null
+++ b/sysinfo/os/pe.mk
@@ -0,0 +1,48 @@
+LDFLAGS_IMPLIB += -Wl,--output-def
+LDFLAGS_IMPLIB += -Wl,$(IMPLIB_DEF)
+
+implib: implib-ver implib-soname implib-solink
+
+implib-ver: shared-lib $(IMPLIB_VER)
+
+implib-soname: shared-lib $(IMPLIB_SONAME)
+
+implib-solink: shared-lib $(IMPLIB_SOLINK)
+
+$(IMPLIB_DEF): shared-lib
+
+$(IMPLIB_VER): $(IMPLIB_DEF)
+ $(DLLTOOL) -l $(IMPLIB_VER) -d $(IMPLIB_DEF) -D $(DSO_VER)
+
+$(IMPLIB_SONAME): $(IMPLIB_DEF)
+ $(DLLTOOL) -l $(IMPLIB_SONAME) -d $(IMPLIB_DEF) -D $(DSO_SONAME)
+
+$(IMPLIB_SOLINK): $(IMPLIB_SONAME)
+ rm -f $(IMPLIB_SOLINK).tmp
+ ln -s $(IMP_SONAME) $(IMPLIB_SOLINK).tmp
+ mv $(IMPLIB_SOLINK).tmp $(IMPLIB_SOLINK)
+
+install-implib: install-implib-ver \
+ install-implib-soname \
+ install-implib-solink
+
+install-implib-ver: implib-ver
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ cp $(IMPLIB_VER) $(DESTDIR)$(LIBDIR)
+
+install-implib-soname: implib-soname
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ cp $(IMPLIB_SONAME) $(DESTDIR)$(LIBDIR)
+
+install-implib-solink: implib-soname
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ rm -f $@.tmp
+ ln -s $(IMP_SONAME) $@.tmp
+ mv $@.tmp $(DESTDIR)$(LIBDIR)/$(IMP_SOLINK)
+
+clean-implib:
+ rm -f $(SHARED_LIB)
+ rm -f $(IMPLIB_DEF)
+ rm -f $(IMPLIB_VER)
+ rm -f $(IMPLIB_SONAME)
+ rm -f $(IMPLIB_SOLINK)