Blame sysinfo/host/host.sh

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