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
e5efb3
# slibtool now provides a mechanism to specifiy the
e5efb3
# preferred ar(1), as(1), nm(1), and ranlib(1) to be
e5efb3
# invoked by slibtool(1) when used for native builds
e5efb3
# and when no other tool had been specified. These
e5efb3
# configure arguments only affect slibtool's runtime
e5efb3
# tool choices, and the configure arguments below
e5efb3
# accordingly refer to the preferred "host" (rather
e5efb3
# than "native") tools.
e5efb3
e5efb3
_mb_quotes='\"'
e5efb3
8a57c0
for arg ; do
8a57c0
	case "$arg" in
e5efb3
		--with-preferred-host-ar=*)
e5efb3
                        slbt_preferred_host_ar=${_mb_quotes}${arg#*=}${_mb_quotes}
e5efb3
			;;
e5efb3
e5efb3
		--with-preferred-host-as=*)
e5efb3
                        slbt_preferred_host_as=${_mb_quotes}${arg#*=}${_mb_quotes}
e5efb3
			;;
e5efb3
e5efb3
		--with-preferred-host-nm=*)
e5efb3
                        slbt_preferred_host_nm=${_mb_quotes}${arg#*=}${_mb_quotes}
e5efb3
			;;
e5efb3
e5efb3
		--with-preferred-host-ranlib=*)
e5efb3
                        slbt_preferred_host_ranlib=${_mb_quotes}${arg#*=}${_mb_quotes}
e5efb3
			;;
8a57c0
		*)
8a57c0
			error_msg ${arg#}: "unsupported config argument."
8a57c0
			exit 2
8a57c0
	esac
8a57c0
done
8a57c0
8a57c0
8a57c0
cfgdefs_output_custom_defs()
8a57c0
{
e5efb3
	if [ $mb_cfgtest_cfgtype = 'host' ]; then
e5efb3
		cfgtest_cflags_append -DSLBT_PREFERRED_HOST_AR=${slbt_preferred_host_ar:-0}
e5efb3
		cfgtest_cflags_append -DSLBT_PREFERRED_HOST_AS=${slbt_preferred_host_as:-0}
e5efb3
		cfgtest_cflags_append -DSLBT_PREFERRED_HOST_NM=${slbt_preferred_host_nm:-0}
e5efb3
		cfgtest_cflags_append -DSLBT_PREFERRED_HOST_RANLIB=${slbt_preferred_host_ranlib:-0}
e5efb3
	fi
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
# 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
e5efb3
# cfgdefs.in --> cfgdefs.mk
e5efb3
cfgdefs_output_custom_defs
e5efb3
8a57c0
# all done
8a57c0
return 0