Blame sysinfo/host/host.sh

f46039
#!/bin/sh
f46039
f46039
error_msg()
f46039
{
f46039
	echo $@ >&2
f46039
}
f46039
f46039
host_test()
f46039
{
f46039
	mb_hdrdir=$(pwd)/build
f46039
	mkdir -p $mb_hdrdir || exit 2
f46039
f7f42e
	if [ -z "$mb_compiler" ]; then
f46039
                echo "config error: compiler not set."
f46039
		exit 2
f46039
	fi
f46039
c2225d
	$mb_compiler $mb_cflags -dumpmachine && return 0
f46039
f46039
	error_msg "config error: invalid compiler."
f46039
	exit 2
f46039
}
f46039
f46039
# one: args
f46039
for arg ; do
f46039
	case "$arg" in
f46039
		--help)	usage
f46039
			;;
f46039
		--compiler=*)
f46039
			mb_compiler=${arg#*=}
f46039
			;;
f46039
		--cflags=*)
f46039
			mb_cflags=${arg#*=}
f46039
			;;
f46039
		*)
f46039
			error_msg ${arg#}: "unsupported config argument."
f46039
			exit 2
f46039
			;;
f46039
	esac
f46039
done
f46039
f46039
f46039
# two: test
f46039
host_test
f46039
f46039
f46039
# all done
f46039
exit 0