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
95aa55
# config-time generated cfgdefs.mk.
d1a04d
2216cf
04aa65
# cfgdefs helper functions
04aa65
. "$mb_project_dir/project/config/cfghost.sh"
04aa65
d1a04d
2216cf
# sofort's config test framework
2216cf
. "$mb_project_dir/sofort/cfgtest.sh"
2216cf
2216cf
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
04aa65
cfgdefs_set_cfghost_flavors()
04aa65
{
04aa65
	cfghost_set_target_cfghost
04aa65
	cfghost_set_native_cfghost
04aa65
}
d1a04d
d1a04d
2216cf
cfgdefs_perform_target_tests()
2216cf
{
2216cf
	# init
2216cf
	cfgtest_target_section
268884
2216cf
	# headers
2216cf
	cfgtest_header_absence 'stropts.h'
268884
2216cf
	# openssl
2216cf
	mb_cfgtest_headers='openssl/x509.h'
268884
2216cf
	cfgtest_interface_presence 'X509_NAME_ENTRY_set' \
2216cf
		&& cfgtest_cflags_append '-DOPENSSL_VERSION_1_1'
dc8af2
2216cf
	# ncurses: python refers to members of typedef struct _win_st WINDOW
2216cf
	cfgtest_cflags_append '-DNCURSES_INTERNALS'
3ebdb8
2216cf
	# ncurses libs
2216cf
	mb_ncurses_libs='-lpanelw -lncursesw'
2216cf
	mb_ncurses_tinfo='-ltinfo'
3ebdb8
2216cf
	cfgtest_library_presence $mb_ncurses_tinfo \
2216cf
		&& mb_ncurses_libs="$mb_ncurses_libs $mb_ncurses_tinfo"
3ebdb8
2216cf
	mb_cfgtest_makevar='LDFLAGS_NCURSES_LIBS'
2216cf
	cfgtest_makevar_append $mb_ncurses_libs
c69aa8
2216cf
	# pretty cfgdefs.mk
2216cf
	cfgtest_newline
2216cf
}
dc8af2
268884
2216cf
cfgdefs_perform_native_tests()
2216cf
{
2216cf
	# init
2216cf
	cfgtest_native_section
268884
2216cf
	# headers
2216cf
	cfgtest_header_absence 'stropts.h'
3ebdb8
2216cf
	# ncurses: python refers to members of typedef struct _win_st WINDOW
2216cf
	cfgtest_cflags_append '-DNCURSES_INTERNALS'
3ebdb8
2216cf
	# ncurses libs
2216cf
	mb_ncurses_libs='-lpanelw -lncursesw'
2216cf
	mb_ncurses_tinfo='-ltinfo'
3ebdb8
2216cf
	cfgtest_library_presence $mb_ncurses_tinfo \
2216cf
		&& mb_ncurses_libs="$mb_ncurses_libs $mb_ncurses_tinfo"
2216cf
2216cf
	cfgtest_ldflags_append $mb_ncurses_libs
2216cf
2216cf
	# pretty cfgdefs.mk
2216cf
	cfgtest_newline
2216cf
}
2216cf
2216cf
2216cf
# cfghost
2216cf
cfgdefs_set_cfghost_flavors
3ebdb8
2216cf
# target-specific tests
2216cf
cfgdefs_perform_target_tests
3ebdb8
2216cf
# native system tests
2216cf
cfgdefs_perform_native_tests
3ebdb8
d1a04d
# all done
d1a04d
return 0