Blame sysinfo/host/host.sh

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