|
|
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
|
|
|
998eeb |
cfgtest_header_absence 'stropts.h'
|
|
|
998eeb |
cfgtest_header_presence 'endian.h'
|
|
|
998eeb |
cfgtest_header_presence 'net/if.h'
|
|
|
998eeb |
cfgtest_header_presence 'sched.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/ioctl.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/sendfile.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/syscall.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/sysmacros.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/uio.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/xattr.h'
|
|
|
998eeb |
|
|
|
998eeb |
# interfaces
|
|
|
998eeb |
mb_cfgtest_headers='sys/epoll.h'
|
|
|
998eeb |
cfgtest_interface_presence 'epoll_create1'
|
|
|
998eeb |
|
|
|
998eeb |
mb_cfgtest_headers='sched.h'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_get_priority_max'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_rr_get_interval'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_setaffinity'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_setparam'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_setscheduler'
|
|
|
998eeb |
|
|
|
998eeb |
mb_cfgtest_headers='sys/sendfile.h'
|
|
|
998eeb |
cfgtest_interface_presence 'sendfile'
|
|
|
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
|
|
|
998eeb |
cfgtest_header_absence 'stropts.h'
|
|
|
998eeb |
cfgtest_header_presence 'endian.h'
|
|
|
998eeb |
cfgtest_header_presence 'net/if.h'
|
|
|
998eeb |
cfgtest_header_presence 'sched.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/ioctl.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/sendfile.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/syscall.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/sysmacros.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/uio.h'
|
|
|
998eeb |
cfgtest_header_presence 'sys/xattr.h'
|
|
|
998eeb |
|
|
|
998eeb |
# interfaces
|
|
|
998eeb |
mb_cfgtest_headers='sys/epoll.h'
|
|
|
998eeb |
cfgtest_interface_presence 'epoll_create1'
|
|
|
998eeb |
|
|
|
998eeb |
mb_cfgtest_headers='sched.h'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_get_priority_max'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_rr_get_interval'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_setaffinity'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_setparam'
|
|
|
998eeb |
cfgtest_interface_presence 'sched_setscheduler'
|
|
|
998eeb |
|
|
|
998eeb |
mb_cfgtest_headers='sys/sendfile.h'
|
|
|
998eeb |
cfgtest_interface_presence 'sendfile'
|
|
|
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
|