Blame sysinfo/host/host.sh

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