firasuke / cross / slibtool

Forked from cross/slibtool 3 months ago
Clone

Blame project/config/cfgdefs.sh

8a57c0
# in projects where [ $mb_use_custom_cfgdefs = yes ],
8a57c0
# cfgdefs.sh is invoked from within ./configure via
8a57c0
# . $mb_project_dir/project/cfgdefs.sh
8a57c0
8a57c0
# a successful return from cfgdefs.sh will be followed
8a57c0
# by a second invocation of the config_copy() function,
8a57c0
# reflecting any changes to common config variables
8a57c0
# made by cfgdefs.sh.
8a57c0
8a57c0
# finally, cfgdefs.sh may update the contents of the
8a57c0
# config-time generated cfgdefs.mk.
8a57c0
8a57c0
8a57c0
# sofort's config test framework
8a57c0
. "$mb_project_dir/sofort/cfgtest/cfgtest.sh"
8a57c0
8a57c0
8a57c0
for arg ; do
8a57c0
	case "$arg" in
8a57c0
		*)
8a57c0
			error_msg ${arg#}: "unsupported config argument."
8a57c0
			exit 2
8a57c0
	esac
8a57c0
done
8a57c0
8a57c0
8a57c0
cfgdefs_output_custom_defs()
8a57c0
{
8a57c0
	cat "$mb_project_dir/project/config/cfgdefs.in" > cfgdefs.mk
8a57c0
}
8a57c0
8a57c0
8a57c0
cfgdefs_perform_common_tests()
8a57c0
{
8a57c0
	# headers
8a57c0
	cfgtest_header_presence 'sys/syscall.h'
8a57c0
}
8a57c0
8a57c0
8a57c0
cfgdefs_perform_target_tests()
8a57c0
{
8a57c0
	# init
8a57c0
	cfgtest_newline
8a57c0
	cfgtest_host_section
8a57c0
8a57c0
	# common tests
8a57c0
	cfgdefs_perform_common_tests
8a57c0
8a57c0
	# pretty cfgdefs.mk
8a57c0
	cfgtest_newline
8a57c0
}
8a57c0
8a57c0
# cfgdefs.in --> cfgdefs.mk
8a57c0
cfgdefs_output_custom_defs
8a57c0
8a57c0
# strict: some tests might fail
8a57c0
set +e
8a57c0
8a57c0
# target-specific tests
8a57c0
cfgdefs_perform_target_tests
8a57c0
8a57c0
# strict: restore mode
8a57c0
set -e
8a57c0
8a57c0
# all done
8a57c0
return 0