Blame project/config/cfghost.sh

04aa65
# cfghost.sh: map the target or native hosts, as reported by
04aa65
# the -dumpmachine mechanism of their respective compilers,
04aa65
# to project-specific hosts.
04aa65
04aa65
# internal variables of interest:
04aa65
# mb_internal_cchost:  the host reported by -dumpmachine
04aa65
# mb_internal_cfghost: the unified, project-specific host name
04aa65
# mb_internal_cfgtype: the type of host being test (target/native)
04aa65
04aa65
cfghost_internal_test()
04aa65
{
04aa65
	if [ -z "$mb_internal_cchost" ]; then
04aa65
		error_msg 'cfghost_internal_test(): $mb_internal_cchost is empty.'
04aa65
		exit 2
04aa65
	fi
04aa65
04aa65
	if [ -d "$mb_project_dir/config/$mb_internal_cchost" ]; then
04aa65
		mb_internal_cfghost=$mb_internal_cchost
04aa65
	fi
04aa65
04aa65
	if [ -z $mb_internal_cfghost ]; then
04aa65
		case $mb_internal_cchost in
2e8fd9
			*-linux | *-linux-* )
2e8fd9
				mb_internal_cfghost='linux' ;;
04aa65
2e8fd9
			*-midipix | *-midipix-* )
2e8fd9
				mb_internal_cfghost='midipix' ;;
04aa65
04aa65
			* )
04aa65
				mb_internal_cfghost='any-host' ;;
04aa65
		esac
04aa65
	fi
04aa65
04aa65
	if [ $mb_internal_cfgtype = 'target' ]; then
04aa65
		mb_cfghost="$mb_internal_cfghost"
04aa65
	else
04aa65
		mb_native_cc_cfghost="$mb_internal_cfghost"
04aa65
	fi
04aa65
}
04aa65
04aa65
cfghost_set_target_cfghost()
04aa65
{
04aa65
	mb_internal_cchost="$mb_cchost"
04aa65
	mb_internal_cfghost="$mb_cfghost"
04aa65
	mb_internal_cfgtype='target'
04aa65
04aa65
	cfghost_internal_test
04aa65
}
04aa65
04aa65
cfghost_set_native_cfghost()
04aa65
{
04aa65
	mb_internal_cchost="$mb_native_cc_host"
04aa65
	mb_internal_cfghost="$mb_native_cc_cfghost"
04aa65
	mb_internal_cfgtype='native'
04aa65
04aa65
	cfghost_internal_test
04aa65
}