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/host/host.sh | |
parent | 44fb9401c79069da6944a85f22e063a116ec73ce (diff) | |
download | sbpython3-5dc983925380bb06a4d6d0d660e2c8b80a71eac4.tar.bz2 sbpython3-5dc983925380bb06a4d6d0d660e2c8b80a71eac4.tar.xz |
build system: created skeleton.
Diffstat (limited to 'sysinfo/host/host.sh')
-rwxr-xr-x | sysinfo/host/host.sh | 48 |
1 files changed, 48 insertions, 0 deletions
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 |