Blame sysinfo/host/host.sh

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