diff options
author | midipix <writeonce@midipix.org> | 2018-12-14 07:12:25 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-12-18 20:38:37 -0500 |
commit | 5dc983925380bb06a4d6d0d660e2c8b80a71eac4 (patch) | |
tree | 9d911e9c7bbd9c827671c340fb030094036547b5 /sysinfo | |
parent | 44fb9401c79069da6944a85f22e063a116ec73ce (diff) | |
download | sbpython3-5dc983925380bb06a4d6d0d660e2c8b80a71eac4.tar.bz2 sbpython3-5dc983925380bb06a4d6d0d660e2c8b80a71eac4.tar.xz |
build system: created skeleton.
Diffstat (limited to 'sysinfo')
28 files changed, 588 insertions, 0 deletions
diff --git a/sysinfo/compiler/any-compiler.mk b/sysinfo/compiler/any-compiler.mk new file mode 100644 index 0000000..4c98621 --- /dev/null +++ b/sysinfo/compiler/any-compiler.mk @@ -0,0 +1,29 @@ +ifeq ($(CROSS_COMPILE)x,x) + CROSS_HOST = + CROSS_HOST_SPEC = +else + CROSS_HOST = + CROSS_HOST_SPEC = +endif + + +ifeq ($(USER_CC)x,x) + CC = $(NATIVE_CC) $(CROSS_HOST_SPEC) +else + CC = $(USER_CC) $(CROSS_HOST_SPEC) +endif + +ifeq ($(USER_CPP)x,x) + CPP = $(NATIVE_CC) $(CROSS_HOST_SPEC) -E +else + CPP = $(USER_CPP) $(CROSS_HOST_SPEC) -E +endif + +ifeq ($(USER_CXX)x,x) + CXX = $(NATIVE_CC) $(CROSS_HOST_SPEC) -std=c++ +else + CXX = $(USER_CXX) $(CROSS_HOST_SPEC) -std=c++ +endif + + +CFLAGS_PIC = -fPIC diff --git a/sysinfo/compiler/clang.mk b/sysinfo/compiler/clang.mk new file mode 100644 index 0000000..77b4b86 --- /dev/null +++ b/sysinfo/compiler/clang.mk @@ -0,0 +1,31 @@ +ifeq ($(CROSS_COMPILE)x,x) + CROSS_HOST = + CROSS_HOST_SPEC = +else ifeq ($(CROSS_HOST)x,x) + CROSS_HOST = $(HOST) + CROSS_HOST_SPEC = --target=$(HOST) +else + CROSS_HOST_SPEC = --target=$(CROSS_HOST) +endif + + +ifeq ($(USER_CC)x,x) + CC = $(NATIVE_CC) $(CROSS_HOST_SPEC) +else + CC = $(USER_CC) $(CROSS_HOST_SPEC) +endif + +ifeq ($(USER_CPP)x,x) + CPP = $(NATIVE_CC) $(CROSS_HOST_SPEC) -E +else + CPP = $(USER_CPP) $(CROSS_HOST_SPEC) -E +endif + +ifeq ($(USER_CXX)x,x) + CXX = $(NATIVE_CC)++ $(CROSS_HOST_SPEC) +else + CXX = $(USER_CXX) $(CROSS_HOST_SPEC) +endif + + +CFLAGS_PIC = -fPIC diff --git a/sysinfo/compiler/cparser.mk b/sysinfo/compiler/cparser.mk new file mode 100644 index 0000000..6c4dc8e --- /dev/null +++ b/sysinfo/compiler/cparser.mk @@ -0,0 +1,31 @@ +ifeq ($(CROSS_COMPILE)x,x) + CROSS_HOST = + CROSS_HOST_SPEC = +else ifeq ($(CROSS_HOST)x,x) + CROSS_HOST = $(HOST) + CROSS_HOST_SPEC = --target=$(HOST) +else + CROSS_HOST_SPEC = --target=$(CROSS_HOST) +endif + + +ifeq ($(USER_CC)x,x) + CC = $(NATIVE_CC) $(CROSS_HOST_SPEC) -Wno-experimental -integrated-cpp +else + CC = $(USER_CC) $(CROSS_HOST_SPEC) -Wno-experimental -integrated-cpp +endif + +ifeq ($(USER_CPP)x,x) + CPP = $(NATIVE_CC) $(CROSS_HOST_SPEC) -Wno-experimental -integrated-cpp -E +else + CPP = $(USER_CPP) $(CROSS_HOST_SPEC) -Wno-experimental -integrated-cpp -E +endif + +ifeq ($(USER_CXX)x,x) + CXX = $(NATIVE_CC) $(CROSS_HOST_SPEC) -Wno-experimental -integrated-cpp -std=c++ +else + CXX = $(USER_CXX) $(CROSS_HOST_SPEC) -Wno-experimental -integrated-cpp -std=c++ +endif + + +CFLAGS_PIC = -fPIC diff --git a/sysinfo/compiler/gcc.mk b/sysinfo/compiler/gcc.mk new file mode 100644 index 0000000..d14d8dc --- /dev/null +++ b/sysinfo/compiler/gcc.mk @@ -0,0 +1,24 @@ +ifeq ($(USER_CC)x,x) + ifeq ($(CROSS_COMPILE)x,x) + CC = $(CROSS_COMPILE)$(NATIVE_CC) + else + CC = $(CROSS_COMPILE)gcc + endif +else + CC = $(USER_CC) +endif + +ifeq ($(USER_CPP)x,x) + CPP = $(CROSS_COMPILE)cpp +else + CPP = $(USER_CPP) +endif + +ifeq ($(USER_CXX)x,x) + CXX = $(CROSS_COMPILE)c++ +else + CXX = $(USER_CXX) +endif + + +CFLAGS_PIC = -fPIC diff --git a/sysinfo/host/any-host.mk b/sysinfo/host/any-host.mk new file mode 100644 index 0000000..acb606a --- /dev/null +++ b/sysinfo/host/any-host.mk @@ -0,0 +1,7 @@ +include $(PROJECT_DIR)/sysinfo/os/any-os.mk + +ARCH = +HOST_BITS = +HOST_UNDERSCORE = + +CROSS_HOST = $(TARGET) diff --git a/sysinfo/host/host.sh b/sysinfo/host/host.sh new file mode 100755 index 0000000..686edca --- /dev/null +++ b/sysinfo/host/host.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +error_msg() +{ + echo $@ >&2 +} + +host_test() +{ + mb_hdrdir=$(pwd)/build + mkdir -p $mb_hdrdir || exit 2 + + if [ -z "$mb_compiler" ]; then + echo "config error: compiler not set." + exit 2 + fi + + $mb_compiler $mb_cflags -dumpmachine && return 0 + + error_msg "config error: invalid compiler." + exit 2 +} + +# one: args +for arg ; do + case "$arg" in + --help) usage + ;; + --compiler=*) + mb_compiler=${arg#*=} + ;; + --cflags=*) + mb_cflags=${arg#*=} + ;; + *) + error_msg ${arg#}: "unsupported config argument." + exit 2 + ;; + esac +done + + +# two: test +host_test + + +# all done +exit 0 diff --git a/sysinfo/host/i686-nt32-midipix.mk b/sysinfo/host/i686-nt32-midipix.mk new file mode 100644 index 0000000..fd4b8f8 --- /dev/null +++ b/sysinfo/host/i686-nt32-midipix.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/midipix.mk + +ARCH = nt32 +HOST_BITS = 32 +HOST_UNDERSCORE = '_' diff --git a/sysinfo/host/i686-unknown-linux.mk b/sysinfo/host/i686-unknown-linux.mk new file mode 100644 index 0000000..bec437c --- /dev/null +++ b/sysinfo/host/i686-unknown-linux.mk @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000..b18e2e3 --- /dev/null +++ b/sysinfo/host/i686-w64-mingw32.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/mingw.mk + +ARCH = w32 +HOST_BITS = 32 +HOST_UNDERSCORE = '_' diff --git a/sysinfo/host/native.mk b/sysinfo/host/native.mk new file mode 100644 index 0000000..f0cf720 --- /dev/null +++ b/sysinfo/host/native.mk @@ -0,0 +1,45 @@ +include $(PROJECT_DIR)/sysinfo/os/$(NATIVE_OS).mk + +OS = $(NATIVE_OS) +HOST_BITS = $(NATIVE_OS_BITS) +HOST_UNDERSCORE = $(NATIVE_OS_UNDERSCORE) + +ifeq ($(OS),linux) + ifeq ($(HOST_BITS),32) + ARCH = i386 + else ifeq ($(HOST_BITS),64) + ARCH = x86_64 + endif +endif + +ifeq ($(OS),midipix) + ifeq ($(HOST_BITS),32) + ARCH = nt32 + else ifeq ($(HOST_BITS),64) + ARCH = nt64 + endif +endif + +ifeq ($(OS),mingw) + ifeq ($(HOST_BITS),32) + ARCH = w32 + else ifeq ($(HOST_BITS),64) + ARCH = w64 + endif +endif + +ifeq ($(OS),bsd) + ifeq ($(HOST_BITS),32) + ARCH = bsd32 + else ifeq ($(HOST_BITS),64) + ARCH = bsd64 + endif +endif + +ifeq ($(OS),darwin) + ifeq ($(HOST_BITS),32) + ARCH = dw32 + else ifeq ($(HOST_BITS),64) + ARCH = dw64 + endif +endif diff --git a/sysinfo/host/x86_64-nt64-midipix.mk b/sysinfo/host/x86_64-nt64-midipix.mk new file mode 100644 index 0000000..d0e1d52 --- /dev/null +++ b/sysinfo/host/x86_64-nt64-midipix.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/midipix.mk + +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 new file mode 100644 index 0000000..4bd1bff --- /dev/null +++ b/sysinfo/host/x86_64-unknown-linux.mk @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000..a86f9b0 --- /dev/null +++ b/sysinfo/host/x86_64-w64-mingw32.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/mingw.mk + +ARCH = w64 +HOST_BITS = 64 +HOST_UNDERSCORE = '' diff --git a/sysinfo/os/any-os.mk b/sysinfo/os/any-os.mk new file mode 100644 index 0000000..6c5a2af --- /dev/null +++ b/sysinfo/os/any-os.mk @@ -0,0 +1,16 @@ +OS = any-os +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: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK) + +# dso suffix notation +OS_LIB_PREFIXED_SUFFIX = $(OS_LIB_SUFFIX) +OS_LIB_SUFFIXED_SUFFIX = diff --git a/sysinfo/os/bsd.mk b/sysinfo/os/bsd.mk new file mode 100644 index 0000000..67453da --- /dev/null +++ b/sysinfo/os/bsd.mk @@ -0,0 +1,14 @@ +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 + +# dso suffix notation +OS_LIB_PREFIXED_SUFFIX = $(OS_LIB_SUFFIX) +OS_LIB_SUFFIXED_SUFFIX = diff --git a/sysinfo/os/cygwin.mk b/sysinfo/os/cygwin.mk new file mode 100644 index 0000000..290aa0d --- /dev/null +++ b/sysinfo/os/cygwin.mk @@ -0,0 +1,17 @@ +OS = cygwin +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 +OS_IMPLIB_TOOL = dlltool + +CFLAGS_PIC = + +# dso suffix notation +OS_LIB_PREFIXED_SUFFIX = $(OS_LIB_SUFFIX) +OS_LIB_SUFFIXED_SUFFIX = diff --git a/sysinfo/os/darwin.mk b/sysinfo/os/darwin.mk new file mode 100644 index 0000000..abc9bc7 --- /dev/null +++ b/sysinfo/os/darwin.mk @@ -0,0 +1,18 @@ +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 + +CFLAGS_OS += -D_DARWIN_C_SOURCE + +.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK) + +# dso suffix notation +OS_LIB_PREFIXED_SUFFIX = +OS_LIB_SUFFIXED_SUFFIX = $(OS_LIB_SUFFIX) diff --git a/sysinfo/os/elf.mk b/sysinfo/os/elf.mk new file mode 100644 index 0000000..6878c6a --- /dev/null +++ b/sysinfo/os/elf.mk @@ -0,0 +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/linux.mk b/sysinfo/os/linux.mk new file mode 100644 index 0000000..b9a5f5c --- /dev/null +++ b/sysinfo/os/linux.mk @@ -0,0 +1,14 @@ +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 + +# dso suffix notation +OS_LIB_PREFIXED_SUFFIX = $(OS_LIB_SUFFIX) +OS_LIB_SUFFIXED_SUFFIX = diff --git a/sysinfo/os/midipix.mk b/sysinfo/os/midipix.mk new file mode 100644 index 0000000..d23d387 --- /dev/null +++ b/sysinfo/os/midipix.mk @@ -0,0 +1,15 @@ +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 = symlink +OS_BINFMT = PE +OS_IMPLIB_TOOL = mdso + +# dso suffix notation +OS_LIB_PREFIXED_SUFFIX = $(OS_LIB_SUFFIX) +OS_LIB_SUFFIXED_SUFFIX = diff --git a/sysinfo/os/mingw.mk b/sysinfo/os/mingw.mk new file mode 100644 index 0000000..1a352ba --- /dev/null +++ b/sysinfo/os/mingw.mk @@ -0,0 +1,18 @@ +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 +OS_IMPLIB_TOOL = dlltool + +CFLAGS_PIC = +CFLAGS_OS += -U__STRICT_ANSI__ + +# dso suffix notation +OS_LIB_PREFIXED_SUFFIX = $(OS_LIB_SUFFIX) +OS_LIB_SUFFIXED_SUFFIX = diff --git a/sysinfo/os/mingw32.mk b/sysinfo/os/mingw32.mk new file mode 100644 index 0000000..542b6a9 --- /dev/null +++ b/sysinfo/os/mingw32.mk @@ -0,0 +1 @@ +include $(PROJECT_DIR)/sysinfo/os/mingw.mk diff --git a/sysinfo/os/mingw64.mk b/sysinfo/os/mingw64.mk new file mode 100644 index 0000000..542b6a9 --- /dev/null +++ b/sysinfo/os/mingw64.mk @@ -0,0 +1 @@ +include $(PROJECT_DIR)/sysinfo/os/mingw.mk diff --git a/sysinfo/os/msys.mk b/sysinfo/os/msys.mk new file mode 100644 index 0000000..70fcd68 --- /dev/null +++ b/sysinfo/os/msys.mk @@ -0,0 +1,18 @@ +OS = msys +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 +OS_IMPLIB_TOOL = dlltool + +CFLAGS_PIC = +CFLAGS_OS += -U__STRICT_ANSI__ + +# dso suffix notation +OS_LIB_PREFIXED_SUFFIX = $(OS_LIB_SUFFIX) +OS_LIB_SUFFIXED_SUFFIX = diff --git a/sysinfo/os/pe.mk b/sysinfo/os/pe.mk new file mode 100644 index 0000000..6f9e8ef --- /dev/null +++ b/sysinfo/os/pe.mk @@ -0,0 +1,99 @@ +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_SONAME += -Wl,-soname +LDFLAGS_SONAME += -Wl,$(DSO_SONAME) +LDFLAGS_SHARED += $(LDFLAGS_SONAME) + +DSO_LIBPATH ?= loader +PE_SUBSYSTEM ?= windows +LDFLAGS_COMMON += -Wl,--subsystem=$(PE_SUBSYSTEM) + +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 + +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 ($(OS_IMPLIB_TOOL),mdso) + +$(IMPLIB_VER): $(IMPLIB_DEF) + $(MDSO) -m $(HOST_BITS) -i $(IMPLIB_VER) -n $(DSO_VER) -l $(DSO_LIBPATH) $< + +else ifeq ($(OS_IMPLIB_TOOL),dlltool) + +$(IMPLIB_VER): $(IMPLIB_DEF) + $(DLLTOOL) -l $(IMPLIB_VER) -d $(IMPLIB_DEF) -D $(DSO_VER) + +endif + + + +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 + + +ifeq ($(OS_IMPLIB_TOOL),mdso) + +$(IMPLIB_SONAME): $(IMPLIB_DEF) + $(MDSO) -m $(HOST_BITS) -i $(IMPLIB_SONAME) -n $(DSO_SONAME) $(IMPLIB_DEF) + +else ifeq ($(OS_IMPLIB_TOOL),dlltool) + +$(IMPLIB_SONAME): $(IMPLIB_DEF) + $(DLLTOOL) -l $(IMPLIB_SONAME) -d $(IMPLIB_DEF) -D $(DSO_SONAME) + +endif + + +$(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 $(IMPLIB_SOLINK).tmp + ln -s $(IMP_SONAME) $(IMPLIB_SOLINK).tmp + mv $(IMPLIB_SOLINK).tmp $(DESTDIR)$(LIBDIR)/$(IMP_SOLINK) + +endif diff --git a/sysinfo/toolchain/binutils.mk b/sysinfo/toolchain/binutils.mk new file mode 100644 index 0000000..9cb532a --- /dev/null +++ b/sysinfo/toolchain/binutils.mk @@ -0,0 +1,22 @@ +AS = $(CROSS_COMPILE)as +AR = $(CROSS_COMPILE)ar +LD = $(CROSS_COMPILE)ld +NM = $(CROSS_COMPILE)nm +OBJDUMP = $(CROSS_COMPILE)objdump +RANLIB = $(CROSS_COMPILE)ranlib +SIZE = $(CROSS_COMPILE)size +STRIP = $(CROSS_COMPILE)strip +STRINGS = $(CROSS_COMPILE)strings + + +ADDR2LINE = $(CROSS_COMPILE)addr2line +COV = $(CROSS_COMPILE)gcov +CXXFILT = $(CROSS_COMPILE)c++filt +ELFEDIT = $(CROSS_COMPILE)elfedit +OBJCOPY = $(CROSS_COMPILE)objcopy +READELF = $(CROSS_COMPILE)readelf +DLLTOOL = $(CROSS_COMPILE)dlltool +MDSO = $(CROSS_COMPILE)mdso +PERK = $(CROSS_COMPILE)perk +MC = $(CROSS_COMPILE)windmc +RC = $(CROSS_COMPILE)windres diff --git a/sysinfo/toolchain/llvm.mk b/sysinfo/toolchain/llvm.mk new file mode 100644 index 0000000..8082c0a --- /dev/null +++ b/sysinfo/toolchain/llvm.mk @@ -0,0 +1,22 @@ +AS = llvm-mc -filetype=obj +AR = llvm-ar +LD = lld +NM = llvm-nm +OBJDUMP = llvm-objdump +RANLIB = llvm-ranlib +SIZE = llvm-size +STRIP = $(CROSS_COMPILE)strip +STRINGS = $(CROSS_COMPILE)strings + + +ADDR2LINE = $(CROSS_COMPILE)addr2line +COV = $(CROSS_COMPILE)gcov +CXXFILT = $(CROSS_COMPILE)c++filt +ELFEDIT = $(CROSS_COMPILE)elfedit +OBJCOPY = $(CROSS_COMPILE)objcopy +READELF = $(CROSS_COMPILE)readelf +DLLTOOL = $(CROSS_COMPILE)dlltool +MDSO = $(CROSS_COMPILE)mdso +PERK = $(CROSS_COMPILE)perk +MC = $(CROSS_COMPILE)windmc +RC = $(CROSS_COMPILE)windres diff --git a/sysinfo/version.sh b/sysinfo/version.sh new file mode 100755 index 0000000..0b948bc --- /dev/null +++ b/sysinfo/version.sh @@ -0,0 +1,62 @@ +#!/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 +mkdir -p `dirname "$output"` || exit 2 +printf "#define $macro\t\"$gitver\"\n" > "$output" + +# all done +exit 0 |