From dc46408138199c27c408664f7da0d09e0cf60a0e Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 15 Dec 2018 18:58:30 -0500 Subject: custom config: refactored target/native tests to reduce code duplicates. --- project/config/cfgdefs.sh | 66 +++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 45 deletions(-) (limited to 'project/config') diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh index ad5e9eb..8b7ac20 100644 --- a/project/config/cfgdefs.sh +++ b/project/config/cfgdefs.sh @@ -76,11 +76,8 @@ cfgdefs_output_custom_defs() } -cfgdefs_perform_target_tests() +cfgdefs_perform_common_tests() { - # init - cfgtest_target_section - # headers cfgtest_header_absence 'stropts.h' cfgtest_header_presence 'endian.h' @@ -107,22 +104,33 @@ cfgdefs_perform_target_tests() mb_cfgtest_headers='sys/sendfile.h' cfgtest_interface_presence 'sendfile' - # openssl - mb_cfgtest_headers='openssl/x509.h' - - cfgtest_interface_presence 'X509_NAME_ENTRY_set' \ - && cfgtest_cflags_append '-DOPENSSL_VERSION_1_1' - # ncurses: python refers to members of typedef struct _win_st WINDOW cfgtest_cflags_append '-DNCURSES_INTERNALS' - # ncurses libs + # ncurses libs (common part) mb_ncurses_libs='-lpanelw -lncursesw' mb_ncurses_tinfo='-ltinfo' cfgtest_library_presence $mb_ncurses_tinfo \ && mb_ncurses_libs="$mb_ncurses_libs $mb_ncurses_tinfo" +} + + +cfgdefs_perform_target_tests() +{ + # init + cfgtest_target_section + + # common tests + cfgdefs_perform_common_tests + # openssl + mb_cfgtest_headers='openssl/x509.h' + + cfgtest_interface_presence 'X509_NAME_ENTRY_set' \ + && cfgtest_cflags_append '-DOPENSSL_VERSION_1_1' + + # ncurses libs mb_cfgtest_makevar='LDFLAGS_NCURSES_LIBS' cfgtest_makevar_append $mb_ncurses_libs @@ -136,42 +144,10 @@ cfgdefs_perform_native_tests() # init cfgtest_native_section - # headers - cfgtest_header_absence 'stropts.h' - cfgtest_header_presence 'endian.h' - cfgtest_header_presence 'net/if.h' - cfgtest_header_presence 'sched.h' - cfgtest_header_presence 'sys/ioctl.h' - cfgtest_header_presence 'sys/sendfile.h' - cfgtest_header_presence 'sys/syscall.h' - cfgtest_header_presence 'sys/sysmacros.h' - cfgtest_header_presence 'sys/uio.h' - cfgtest_header_presence 'sys/xattr.h' - - # interfaces - mb_cfgtest_headers='sys/epoll.h' - cfgtest_interface_presence 'epoll_create1' - - mb_cfgtest_headers='sched.h' - cfgtest_interface_presence 'sched_get_priority_max' - cfgtest_interface_presence 'sched_rr_get_interval' - cfgtest_interface_presence 'sched_setaffinity' - cfgtest_interface_presence 'sched_setparam' - cfgtest_interface_presence 'sched_setscheduler' - - mb_cfgtest_headers='sys/sendfile.h' - cfgtest_interface_presence 'sendfile' - - # ncurses: python refers to members of typedef struct _win_st WINDOW - cfgtest_cflags_append '-DNCURSES_INTERNALS' + # common tests + cfgdefs_perform_common_tests # ncurses libs - mb_ncurses_libs='-lpanelw -lncursesw' - mb_ncurses_tinfo='-ltinfo' - - cfgtest_library_presence $mb_ncurses_tinfo \ - && mb_ncurses_libs="$mb_ncurses_libs $mb_ncurses_tinfo" - cfgtest_ldflags_append $mb_ncurses_libs # pretty cfgdefs.mk -- cgit v1.2.3