diff options
author | midipix <writeonce@midipix.org> | 2016-05-10 22:30:10 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-05-14 07:18:24 -0400 |
commit | 55102473ca45f7fef3f5d43caa783cd741f446d0 (patch) | |
tree | 0c71d9d6425507196716ee740541d84eb6f98fcb /sysinfo | |
parent | f62cf86981025d5fb6f49b19db8153722c954f13 (diff) | |
download | ntapi-55102473ca45f7fef3f5d43caa783cd741f446d0.tar.bz2 ntapi-55102473ca45f7fef3f5d43caa783cd741f446d0.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')
-rwxr-xr-x | sysinfo/host/host.sh | 1 | ||||
-rw-r--r-- | sysinfo/host/i686-nt32-midipix.mk | 4 | ||||
-rw-r--r-- | sysinfo/host/i686-unknown-linux.mk | 5 | ||||
-rw-r--r-- | sysinfo/host/i686-w64-mingw32.mk | 4 | ||||
-rw-r--r-- | sysinfo/host/native.mk | 4 | ||||
-rw-r--r-- | sysinfo/host/x86_64-nt64-midipix.mk | 4 | ||||
-rw-r--r-- | sysinfo/host/x86_64-unknown-linux.mk | 5 | ||||
-rw-r--r-- | sysinfo/host/x86_64-w64-mingw32.mk | 4 | ||||
-rw-r--r-- | sysinfo/os/any-os.mk | 4 | ||||
-rw-r--r-- | sysinfo/os/bsd.mk | 10 | ||||
-rw-r--r-- | sysinfo/os/darwin.mk | 10 | ||||
-rw-r--r-- | sysinfo/os/elf.mk | 2 | ||||
-rw-r--r-- | sysinfo/os/linux.mk | 10 | ||||
-rw-r--r-- | sysinfo/os/midipix.mk | 22 | ||||
-rw-r--r-- | sysinfo/os/mingw.mk | 24 | ||||
-rw-r--r-- | sysinfo/os/pe.mk | 70 | ||||
-rw-r--r-- | sysinfo/toolchain/binutils.mk | 1 | ||||
-rw-r--r-- | sysinfo/toolchain/llvm.mk | 1 | ||||
-rwxr-xr-x | sysinfo/version.sh | 61 |
19 files changed, 169 insertions, 77 deletions
diff --git a/sysinfo/host/host.sh b/sysinfo/host/host.sh index 9caa07b..b3975ae 100755 --- a/sysinfo/host/host.sh +++ b/sysinfo/host/host.sh @@ -21,7 +21,6 @@ host_test() exit 2 } - # one: args for arg ; do case "$arg" in diff --git a/sysinfo/host/i686-nt32-midipix.mk b/sysinfo/host/i686-nt32-midipix.mk index df3185b..fd4b8f8 100644 --- a/sysinfo/host/i686-nt32-midipix.mk +++ b/sysinfo/host/i686-nt32-midipix.mk @@ -1,5 +1,5 @@ include $(PROJECT_DIR)/sysinfo/os/midipix.mk -ARCH = nt32 -HOST_BITS = 32 +ARCH = nt32 +HOST_BITS = 32 HOST_UNDERSCORE = '_' diff --git a/sysinfo/host/i686-unknown-linux.mk b/sysinfo/host/i686-unknown-linux.mk deleted file mode 100644 index 79d497b..0000000 --- a/sysinfo/host/i686-unknown-linux.mk +++ /dev/null @@ -1,5 +0,0 @@ -include $(PROJECT_DIR)/sysinfo/os/linux.mk - -ARCH = i386 -HOST_BITS = 32 -HOST_UNDERSCORE = '_' diff --git a/sysinfo/host/i686-w64-mingw32.mk b/sysinfo/host/i686-w64-mingw32.mk index b8ba461..b18e2e3 100644 --- a/sysinfo/host/i686-w64-mingw32.mk +++ b/sysinfo/host/i686-w64-mingw32.mk @@ -1,5 +1,5 @@ include $(PROJECT_DIR)/sysinfo/os/mingw.mk -ARCH = w32 -HOST_BITS = 32 +ARCH = w32 +HOST_BITS = 32 HOST_UNDERSCORE = '_' diff --git a/sysinfo/host/native.mk b/sysinfo/host/native.mk index 08b02b6..f0cf720 100644 --- a/sysinfo/host/native.mk +++ b/sysinfo/host/native.mk @@ -1,7 +1,7 @@ include $(PROJECT_DIR)/sysinfo/os/$(NATIVE_OS).mk -OS = $(NATIVE_OS) -HOST_BITS = $(NATIVE_OS_BITS) +OS = $(NATIVE_OS) +HOST_BITS = $(NATIVE_OS_BITS) HOST_UNDERSCORE = $(NATIVE_OS_UNDERSCORE) ifeq ($(OS),linux) diff --git a/sysinfo/host/x86_64-nt64-midipix.mk b/sysinfo/host/x86_64-nt64-midipix.mk index fef6345..d0e1d52 100644 --- a/sysinfo/host/x86_64-nt64-midipix.mk +++ b/sysinfo/host/x86_64-nt64-midipix.mk @@ -1,5 +1,5 @@ include $(PROJECT_DIR)/sysinfo/os/midipix.mk -ARCH = nt64 -HOST_BITS = 64 +ARCH = nt64 +HOST_BITS = 64 HOST_UNDERSCORE = '' diff --git a/sysinfo/host/x86_64-unknown-linux.mk b/sysinfo/host/x86_64-unknown-linux.mk deleted file mode 100644 index 76afb56..0000000 --- a/sysinfo/host/x86_64-unknown-linux.mk +++ /dev/null @@ -1,5 +0,0 @@ -include $(PROJECT_DIR)/sysinfo/os/linux.mk - -ARCH = x86_64 -HOST_BITS = 64 -HOST_UNDERSCORE = '' diff --git a/sysinfo/host/x86_64-w64-mingw32.mk b/sysinfo/host/x86_64-w64-mingw32.mk index 7cded15..a86f9b0 100644 --- a/sysinfo/host/x86_64-w64-mingw32.mk +++ b/sysinfo/host/x86_64-w64-mingw32.mk @@ -1,5 +1,5 @@ include $(PROJECT_DIR)/sysinfo/os/mingw.mk -ARCH = w64 -HOST_BITS = 64 +ARCH = w64 +HOST_BITS = 64 HOST_UNDERSCORE = '' 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 deleted file mode 100644 index 3fe6711..0000000 --- a/sysinfo/os/bsd.mk +++ /dev/null @@ -1,10 +0,0 @@ -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 - -.PHONY: $(SHARED_IMPLIB) diff --git a/sysinfo/os/darwin.mk b/sysinfo/os/darwin.mk deleted file mode 100644 index b27a486..0000000 --- a/sysinfo/os/darwin.mk +++ /dev/null @@ -1,10 +0,0 @@ -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 - -.PHONY: $(SHARED_IMPLIB) 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 deleted file mode 100644 index d6221cf..0000000 --- a/sysinfo/os/linux.mk +++ /dev/null @@ -1,10 +0,0 @@ -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 - -.PHONY: $(SHARED_IMPLIB) diff --git a/sysinfo/os/midipix.mk b/sysinfo/os/midipix.mk index 4b5a608..d99b249 100644 --- a/sysinfo/os/midipix.mk +++ b/sysinfo/os/midipix.mk @@ -1,12 +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 - -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 085d1be..6ade8d5 100644 --- a/sysinfo/os/mingw.mk +++ b/sysinfo/os/mingw.mk @@ -1,14 +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 = - -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 diff --git a/sysinfo/toolchain/binutils.mk b/sysinfo/toolchain/binutils.mk index a29ac0c..3232915 100644 --- a/sysinfo/toolchain/binutils.mk +++ b/sysinfo/toolchain/binutils.mk @@ -15,3 +15,4 @@ CXXFILT = $(CROSS_COMPILE)c++filt ELFEDIT = $(CROSS_COMPILE)elfedit OBJCOPY = $(CROSS_COMPILE)objcopy READELF = $(CROSS_COMPILE)readelf +DLLTOOL = $(CROSS_COMPILE)dlltool diff --git a/sysinfo/toolchain/llvm.mk b/sysinfo/toolchain/llvm.mk index 3c805a8..65b5396 100644 --- a/sysinfo/toolchain/llvm.mk +++ b/sysinfo/toolchain/llvm.mk @@ -15,3 +15,4 @@ CXXFILT = $(CROSS_COMPILE)c++filt ELFEDIT = $(CROSS_COMPILE)elfedit OBJCOPY = $(CROSS_COMPILE)objcopy READELF = $(CROSS_COMPILE)readelf +DLLTOOL = $(CROSS_COMPILE)dlltool diff --git a/sysinfo/version.sh b/sysinfo/version.sh new file mode 100755 index 0000000..8157765 --- /dev/null +++ b/sysinfo/version.sh @@ -0,0 +1,61 @@ +#!/bin/sh + +usage() +{ +cat << EOF >&2 + +Usage: + -h show this HELP message + -s SRCDIR set source directory + -o OUTPUT set output header + -p PREFIX set macro prefix + +EOF +exit 1 +} + + +# one +workdir=$(pwd) +srcdir= +output= +prefix= + + +while getopts "hs:o:p:" opt; do + case $opt in + h) + usage + ;; + s) + srcdir="$OPTARG" + ;; + o) + output="$OPTARG" + ;; + p) + prefix="$OPTARG" + ;; + \?) + printf "Invalid option: -%s" "$OPTARG" >&2 + usage + ;; + esac +done + + +# two +if [ -z "$srcdir" ] || [ -z "$output" ] || [ -z "$prefix" ]; then + usage +fi + +cd "$srcdir" || exit 2 + +gitver=`git rev-parse --verify HEAD 2>/dev/null` || gitver="unknown" +macro=`echo "$prefix"_GIT_VERSION | tr '[:lower:]' '[:upper:]'` + +cd "$workdir" || exit 2 +printf "#define $macro\t\"$gitver\"\n" > "$output" + +# all done +exit 0 |