Blame project/config/cfgdefs.sh

d1a04d
# in projects where [ $mb_use_custom_cfgdefs = yes ],
d1a04d
# cfgdefs.sh is invoked from within ./configure via
d1a04d
# . $mb_project_dir/project/cfgdefs.sh
d1a04d
d1a04d
# a successful return from cfgdefs.sh will be followed
d1a04d
# by a second invocation of the config_copy() function,
d1a04d
# reflecting any changes to common config variables
d1a04d
# made by cfgdefs.sh.
d1a04d
d1a04d
# finally, cfgdefs.sh may update the contents of the
d1a04d
# build-time-generated cfgdefs.mk.
d1a04d
d1a04d
d1a04d
# no custom switches yet
d1a04d
for arg ; do
d1a04d
	case "$arg" in
d1a04d
		*)
d1a04d
			error_msg ${arg#}: "unsupported config argument."
d1a04d
			exit 2
d1a04d
	esac
d1a04d
done
d1a04d
d1a04d
d1a04d
# cfghost: target
d1a04d
if [ -z "$mb_cfghost" ]; then
d1a04d
	case "$mb_cchost" in
d1a04d
		x86_64-*-linux | x86_64-*-linux-* | x86_64-linux-* )
d1a04d
			mb_cfghost=x86_64-linux ;;
d1a04d
d1a04d
		x86_64-*-midipix | x86_64-*-midipix-* | x86_64-midipix-* )
d1a04d
			mb_cfghost=x86_64-midipix ;;
d1a04d
	esac
d1a04d
fi
d1a04d
d1a04d
d1a04d
# cfghost: (native) pycompile
d1a04d
mb_pycompile_cfghost=$($mb_native_cc -dumpmachine)
d1a04d
d1a04d
case "$mb_pycompile_cfghost" in
d1a04d
	x86_64-*-linux | x86_64-*-linux-* | x86_64-linux-* )
d1a04d
		mb_pycompile_cfghost=x86_64-linux ;;
d1a04d
d1a04d
	x86_64-*-midipix | x86_64-*-midipix-* | x86_64-midipix-* )
d1a04d
		mb_pycompile_cfghost=x86_64-midipix ;;
d1a04d
esac
d1a04d
d1a04d
d1a04d
# update cfgdefs.mk
d1a04d
sed -e 's^@pycompile_cfghost@^'"$mb_pycompile_cfghost"'^g' \
d1a04d
	$mb_project_dir/project/config/cfgdefs.in          \
d1a04d
		> $mb_pwd/cfgdefs.mk || exit 2
d1a04d
d1a04d
d1a04d
# all done
d1a04d
return 0