Blame sysinfo/host/host.sh

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