Blame sysinfo/host/host.sh

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