Blame sysinfo/host/host.sh

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