summaryrefslogtreecommitdiff
path: root/project/config/cfgdefs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'project/config/cfgdefs.sh')
-rw-r--r--project/config/cfgdefs.sh55
1 files changed, 52 insertions, 3 deletions
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index f184cb3..492dd3f 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -114,15 +114,56 @@ cfgdefs_perform_common_tests()
cfgtest_cflags_append '-DHAVE_GETRANDOM_SYSCALL'
fi
+ # ncurses
+ cfgtest_newline
+ cfgtest_comment 'ncurses/ncursesw'
+ mb_cfgtest_headers='ncurses.h'
+
+ if [ $mb_cfgtest_cfgtype = 'target' ]; then
+ mb_cfgtest_makevar='CFLAGS_NCURSES'
+ else
+ mb_cfgtest_makevar='NATIVE_CC_CFLAGS'
+ fi
+
+ cfgtest_unit_header_presence 'curses.h'
+ cfgtest_unit_header_presence 'ncurses.h'
+
+ cfgtest_unit_header_presence 'ncurses/panel.h' && mb_panel_wrapper='yes'
+ cfgtest_unit_header_presence 'ncursesw/panel.h' && mb_panel_wrapper='yes'
+
+ if cfgtest_unit_interface_presence 'is_term_resized'; then
+ cfgtest_makevar_append '-DHAVE_CURSES_IS_TERM_RESIZED'
+ fi
+
+ if cfgtest_unit_interface_presence 'resizeterm'; then
+ cfgtest_makevar_append '-DHAVE_CURSES_RESIZETERM'
+ fi
+
+ if cfgtest_unit_interface_presence 'resize_term'; then
+ cfgtest_makevar_append '-DHAVE_CURSES_RESIZE_TERM'
+ fi
+
+ # ncursesw
+ if cfgtest_unit_interface_presence 'mvwget_wch'; then
+ cfgtest_makevar_append '-DHAVE_NCURSESW'
+ fi
+
# ncurses: python refers to members of typedef struct _win_st WINDOW
- cfgtest_cflags_append '-DNCURSES_INTERNALS'
+ cfgtest_makevar_append '-DNCURSES_INTERNALS'
+
+ # <panel.h>
+ if [ -n "$mb_panel_wrapper" ]; then
+ cfgtest_makevar_append '-I$(PROJECT_DIR)/wrappers'
+ unset mb_panel_wrapper
+ fi
# 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"
+ if cfgtest_library_presence $mb_ncurses_tinfo; then
+ mb_ncurses_libs="$mb_ncurses_libs $mb_ncurses_tinfo"
+ fi
}
@@ -138,6 +179,14 @@ cfgdefs_perform_target_tests()
mb_cfgtest_makevar='LDFLAGS_NCURSES_LIBS'
cfgtest_makevar_append $mb_ncurses_libs
+ mb_cfgtest_makevar='LDFLAGS_NCURSES'
+ cfgtest_makevar_append \
+ '-Wl,--as-needed $(LDFLAGS_NCURSES_LIBS)' \
+ '-Wl,--no-as-needed'
+
+ mb_cfgtest_makevar='LDFLAGS_NCURSES_STATIC'
+ cfgtest_makevar_append '$(LDFLAGS_NCURSES)'
+
# ndbm
cfgtest_newline
cfgtest_comment 'ndbm'