summaryrefslogtreecommitdiffhomepage
path: root/sysinfo/host/host.sh
blob: 1fe25154c8ecd0e9e42cbd99eaa0c30f6350622a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh

error_msg()
{
	echo $@ >&2
}

host_test()
{
	mb_hdrdir=$(pwd)/build
	mkdir -p $mb_hdrdir || exit 2

	if [ x"$mb_compiler" = x ]; then
                echo "config error: compiler not set."
		exit 2
	fi

	$mb_compiler -dM -E - < /dev/null > /dev/null && return 0

	error_msg "config error: invalid compiler."
	exit 2
}


# one: args
for arg ; do
	case "$arg" in
		--help)	usage
			;;
		--compiler=*)
			mb_compiler=${arg#*=}
			;;
		--cflags=*)
			mb_cflags=${arg#*=}
			;;
		*)
			error_msg ${arg#}: "unsupported config argument."
			exit 2
			;;
	esac
done


# two: test
host_test


# all done
exit 0