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
f8089b
			x86_64-*-linux | x86_64-*-linux-* | x86_64-linux-* )
f8089b
				mb_internal_cfghost=x86_64-linux ;;
f8089b
f8089b
			x86_64-*-midipix | x86_64-*-midipix-* | x86_64-midipix-* )
f8089b
				mb_internal_cfghost=x86_64-midipix ;;
f8089b
f8089b
			* )
f8089b
				mb_internal_cfghost='any-host' ;;
f8089b
		esac
f8089b
	fi
f8089b
f8089b
	if [ $mb_internal_cfgtype = 'target' ]; then
f8089b
		mb_cfghost="$mb_internal_cfghost"
f8089b
	else
f8089b
		mb_native_cc_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"
f8089b
	mb_internal_cfgtype='target'
f8089b
f8089b
	cfghost_internal_test
f8089b
}
f8089b
f8089b
cfghost_set_native_cfghost()
f8089b
{
f8089b
	mb_internal_cchost="$mb_native_cc_host"
f8089b
	mb_internal_cfghost="$mb_native_cc_cfghost"
f8089b
	mb_internal_cfgtype='native'
f8089b
f8089b
	cfghost_internal_test
f8089b
}