summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-15 18:58:30 -0500
committermidipix <writeonce@midipix.org>2018-12-19 20:16:27 -0500
commitdc46408138199c27c408664f7da0d09e0cf60a0e (patch)
tree1be8c9f048e5ebd36c9119c400be8afc5078f2a9 /project
parent21274e893ed08aefd89a6acbcc4e6690ce6f08d7 (diff)
downloadsbpython2-dc46408138199c27c408664f7da0d09e0cf60a0e.tar.bz2
sbpython2-dc46408138199c27c408664f7da0d09e0cf60a0e.tar.xz
custom config: refactored target/native tests to reduce code duplicates.
Diffstat (limited to 'project')
-rw-r--r--project/config/cfgdefs.sh66
1 files changed, 21 insertions, 45 deletions
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