Reicher82 / python / sbpython3

Forked from python/sbpython3 3 years ago
Clone

Blame project/config/cfghost.sh

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