diff options
author | midipix <writeonce@midipix.org> | 2016-12-20 20:53:41 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-12-27 04:40:56 -0500 |
commit | 26e14f4143ec690a120e197a3adf547145e4ce59 (patch) | |
tree | e9e8b522de5abb14230c5f8e0825452f0c7ccb4b /sysinfo/host/host.sh | |
parent | 70c49fc4ed3b2c3db68537f828c286241eeeee98 (diff) | |
download | ntux-26e14f4143ec690a120e197a3adf547145e4ce59.tar.bz2 ntux-26e14f4143ec690a120e197a3adf547145e4ce59.tar.xz |
create free-standing, libpsxscl-based project 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..b3975ae --- /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 -dM -E - < /dev/null > /dev/null && 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 |