Blame sysinfo/host/host.sh

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