Reicher82 / python / sbpython3

Forked from python/sbpython3 3 years ago
Clone

Blame project/config/cfgdefs.sh

f8089b
# in projects where [ $mb_use_custom_cfgdefs = yes ],
f8089b
# cfgdefs.sh is invoked from within ./configure via
f8089b
# . $mb_project_dir/project/cfgdefs.sh
f8089b
f8089b
# a successful return from cfgdefs.sh will be followed
f8089b
# by a second invocation of the config_copy() function,
f8089b
# reflecting any changes to common config variables
f8089b
# made by cfgdefs.sh.
f8089b
f8089b
# finally, cfgdefs.sh may update the contents of the
f8089b
# config-time generated cfgdefs.mk.
f8089b
f8089b
f8089b
# cfgdefs helper functions
f8089b
. "$mb_project_dir/project/config/cfghost.sh"
f8089b
f8089b
f8089b
# sofort's config test framework
f8089b
. "$mb_project_dir/sofort/cfgtest.sh"
f8089b
f8089b
f8089b
for arg ; do
f8089b
	case "$arg" in
f8089b
		*)
f8089b
			error_msg ${arg#}: "unsupported config argument."
f8089b
			exit 2
f8089b
	esac
f8089b
done
f8089b
f8089b
f8089b
cfgdefs_set_cfghost_flavors()
f8089b
{
f8089b
	cfghost_set_target_cfghost
f8089b
	cfghost_set_native_cfghost
f8089b
}
f8089b
f8089b
f8089b
cfgdefs_perform_target_tests()
f8089b
{
f8089b
	# init
f8089b
	cfgtest_target_section
f8089b
f8089b
	# headers
f8089b
	cfgtest_header_absence 'stropts.h'
f8089b
f8089b
	# openssl
f8089b
	mb_cfgtest_headers='openssl/x509.h'
f8089b
f8089b
	cfgtest_interface_presence 'X509_NAME_ENTRY_set' \
f8089b
		&& cfgtest_cflags_append '-DOPENSSL_VERSION_1_1'
f8089b
f8089b
	# ncurses: python refers to members of typedef struct _win_st WINDOW
f8089b
	cfgtest_cflags_append '-DNCURSES_INTERNALS'
f8089b
f8089b
	# ncurses libs
f8089b
	mb_ncurses_libs='-lpanelw -lncursesw'
f8089b
	mb_ncurses_tinfo='-ltinfo'
f8089b
f8089b
	cfgtest_library_presence $mb_ncurses_tinfo \
f8089b
		&& mb_ncurses_libs="$mb_ncurses_libs $mb_ncurses_tinfo"
f8089b
f8089b
	mb_cfgtest_makevar='LDFLAGS_NCURSES_LIBS'
f8089b
	cfgtest_makevar_append $mb_ncurses_libs
f8089b
f8089b
	# pretty cfgdefs.mk
f8089b
	cfgtest_newline
f8089b
}
f8089b
f8089b
f8089b
cfgdefs_perform_native_tests()
f8089b
{
f8089b
	# init
f8089b
	cfgtest_native_section
f8089b
f8089b
	# headers
f8089b
	cfgtest_header_absence 'stropts.h'
f8089b
f8089b
	# ncurses: python refers to members of typedef struct _win_st WINDOW
f8089b
	cfgtest_cflags_append '-DNCURSES_INTERNALS'
f8089b
f8089b
	# ncurses libs
f8089b
	mb_ncurses_libs='-lpanelw -lncursesw'
f8089b
	mb_ncurses_tinfo='-ltinfo'
f8089b
f8089b
	cfgtest_library_presence $mb_ncurses_tinfo \
f8089b
		&& mb_ncurses_libs="$mb_ncurses_libs $mb_ncurses_tinfo"
f8089b
f8089b
	cfgtest_ldflags_append $mb_ncurses_libs
f8089b
f8089b
	# pretty cfgdefs.mk
f8089b
	cfgtest_newline
f8089b
}
f8089b
f8089b
f8089b
# cfghost
f8089b
cfgdefs_set_cfghost_flavors
f8089b
f8089b
# target-specific tests
f8089b
cfgdefs_perform_target_tests
f8089b
f8089b
# native system tests
f8089b
cfgdefs_perform_native_tests
f8089b
f8089b
# all done
f8089b
return 0