summaryrefslogtreecommitdiffhomepage
path: root/sysinfo/os
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-05-11 00:05:15 -0400
committermidipix <writeonce@midipix.org>2016-05-11 00:14:45 -0400
commita6e0dcb609cefabff2817b2dd7bbc6698c5870d6 (patch)
tree5bf3db2a1b0ad26f773708eb7a79f78b8d2bf9f1 /sysinfo/os
parent3be73d5188b49d43edfc2bd80dca3d06063b34a3 (diff)
downloaddalist-a6e0dcb609cefabff2817b2dd7bbc6698c5870d6.tar.bz2
dalist-a6e0dcb609cefabff2817b2dd7bbc6698c5870d6.tar.xz
build system: upgrade build system, eliminate differences in core definitions.
Prior to this patch, there were several differences between this project's build system and the one from which it was derived (sofort). Although the differences were very minor and for the most part related to this project being part of a free-standing, midipix-specific development framework, they still added an extra maintenance burden, specifically by requiring that common changes be applied via patch(1) rather than git-am(1). Following recent improvements to the common build system, it is now possible to have a free-standing, midipix-specific project without any changes to the core build system files, hence the current upgrade.
Diffstat (limited to 'sysinfo/os')
-rw-r--r--sysinfo/os/any-os.mk4
-rw-r--r--sysinfo/os/bsd.mk20
-rw-r--r--sysinfo/os/darwin.mk22
-rw-r--r--sysinfo/os/elf.mk2
-rw-r--r--sysinfo/os/linux.mk20
-rw-r--r--sysinfo/os/midipix.mk24
-rw-r--r--sysinfo/os/mingw.mk25
-rw-r--r--sysinfo/os/pe.mk70
8 files changed, 131 insertions, 56 deletions
diff --git a/sysinfo/os/any-os.mk b/sysinfo/os/any-os.mk
index 0aa0a75..cf8ec00 100644
--- a/sysinfo/os/any-os.mk
+++ b/sysinfo/os/any-os.mk
@@ -6,5 +6,7 @@ OS_LIB_SUFFIX = .so
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 3fe6711..6e8fac0 100644
--- a/sysinfo/os/bsd.mk
+++ b/sysinfo/os/bsd.mk
@@ -1,10 +1,12 @@
-OS = bsd
-OS_APP_PREFIX =
-OS_APP_SUFFIX =
-OS_LIB_PREFIX = lib
-OS_LIB_SUFFIX = .so
-OS_IMPLIB_EXT = .invalid
-OS_LIBDEF_EXT = .invalid
-OS_ARCHIVE_EXT = .a
+OS = bsd
+OS_APP_PREFIX =
+OS_APP_SUFFIX =
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .so
+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 b27a486..5a0b99e 100644
--- a/sysinfo/os/darwin.mk
+++ b/sysinfo/os/darwin.mk
@@ -1,10 +1,14 @@
-OS = darwin
-OS_APP_PREFIX =
-OS_APP_SUFFIX =
-OS_LIB_PREFIX = lib
-OS_LIB_SUFFIX = .dylib
-OS_IMPLIB_EXT = .invalid
-OS_LIBDEF_EXT = .invalid
-OS_ARCHIVE_EXT = .a
+OS = darwin
+OS_APP_PREFIX =
+OS_APP_SUFFIX =
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .dylib
+OS_IMPLIB_EXT = .invalid
+OS_LIBDEF_EXT = .invalid
+OS_ARCHIVE_EXT = .a
+OS_SONAME = symlink
+OS_BINFMT = MACHO
-.PHONY: $(SHARED_IMPLIB)
+CFLAGS_OS += -D_DARWIN_C_SOURCE
+
+.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK)
diff --git a/sysinfo/os/elf.mk b/sysinfo/os/elf.mk
new file mode 100644
index 0000000..5a3940f
--- /dev/null
+++ b/sysinfo/os/elf.mk
@@ -0,0 +1,2 @@
+LDFLAGS_SHARED += -Wl,-soname
+LDFLAGS_SHARED += -Wl,$(DSO_SONAME)
diff --git a/sysinfo/os/linux.mk b/sysinfo/os/linux.mk
index d6221cf..082026b 100644
--- a/sysinfo/os/linux.mk
+++ b/sysinfo/os/linux.mk
@@ -1,10 +1,12 @@
-OS = linux
-OS_APP_PREFIX =
-OS_APP_SUFFIX =
-OS_LIB_PREFIX = lib
-OS_LIB_SUFFIX = .so
-OS_IMPLIB_EXT = .invalid
-OS_LIBDEF_EXT = .invalid
-OS_ARCHIVE_EXT = .a
+OS = linux
+OS_APP_PREFIX =
+OS_APP_SUFFIX =
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .so
+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 7b7f17a..d99b249 100644
--- a/sysinfo/os/midipix.mk
+++ b/sysinfo/os/midipix.mk
@@ -1,14 +1,10 @@
-OS = midipix
-OS_APP_PREFIX =
-OS_APP_SUFFIX =
-OS_LIB_PREFIX = lib
-OS_LIB_SUFFIX = .so
-OS_IMPLIB_EXT = .lib.a
-OS_LIBDEF_EXT = .so.def
-OS_ARCHIVE_EXT = .a
-
-LDFLAGS_CONFIG += -mout-implib
-
-install-implib: shared-implib
- mkdir -p $(DESTDIR)$(LIBDIR)
- cp $(SHARED_IMPLIB) $(DESTDIR)$(LIBDIR)
+OS = midipix
+OS_APP_PREFIX =
+OS_APP_SUFFIX =
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .so
+OS_IMPLIB_EXT = .lib.a
+OS_LIBDEF_EXT = .so.def
+OS_ARCHIVE_EXT = .a
+OS_SONAME = copy
+OS_BINFMT = PE \ No newline at end of file
diff --git a/sysinfo/os/mingw.mk b/sysinfo/os/mingw.mk
index 1b37dd4..6ade8d5 100644
--- a/sysinfo/os/mingw.mk
+++ b/sysinfo/os/mingw.mk
@@ -1,15 +1,12 @@
-OS = mingw
-OS_APP_PREFIX =
-OS_APP_SUFFIX = .exe
-OS_LIB_PREFIX = lib
-OS_LIB_SUFFIX = .dll
-OS_IMPLIB_EXT = .dll.a
-OS_LIBDEF_EXT = .def
-OS_ARCHIVE_EXT = .a
+OS = mingw
+OS_APP_PREFIX =
+OS_APP_SUFFIX = .exe
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .dll
+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)
+CFLAGS_PIC =
diff --git a/sysinfo/os/pe.mk b/sysinfo/os/pe.mk
new file mode 100644
index 0000000..abc76e8
--- /dev/null
+++ b/sysinfo/os/pe.mk
@@ -0,0 +1,70 @@
+LDFLAGS_IMPLIB += -Wl,--output-def
+LDFLAGS_IMPLIB += -Wl,$(IMPLIB_DEF)
+LDFLAGS_SHARED += $(LDFLAGS_IMPLIB)
+
+LDFLAGS_SHARED += -Wl,-soname
+LDFLAGS_SHARED += -Wl,$(DSO_SONAME)
+
+implib: implib-ver package-implib-soname package-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)
+
+install-implib: install-implib-ver \
+ package-install-implib-soname \
+ package-install-implib-solink
+
+install-implib-ver: implib-ver
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ cp $(IMPLIB_VER) $(DESTDIR)$(LIBDIR)
+
+clean-implib:
+ rm -f $(SHARED_LIB)
+ rm -f $(IMPLIB_DEF)
+ rm -f $(IMPLIB_VER)
+ rm -f $(IMPLIB_SONAME)
+ rm -f $(IMPLIB_SOLINK)
+
+
+ifeq ($(AVOID_VERSION),yes)
+
+package-implib-soname:
+package-implib-solink:
+package-install-implib-soname:
+package-install-implib-solink:
+
+else
+
+package-implib-soname: implib-soname
+package-implib-solink: implib-solink
+package-install-implib-soname: install-implib-soname
+package-install-implib-solink: install-implib-solink
+
+
+$(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-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)
+
+endif