Blame sysinfo/host/host.sh

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