summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-19 19:22:35 -0500
committermidipix <writeonce@midipix.org>2018-12-19 22:12:13 -0500
commitbc7614b9705c62b62a356408afa3578d1e519512 (patch)
treead477dc7a4907c7b290e2ac0bb344d508b056c4b /project
parent69ae9e6ecc37fa55449046ceb7fba2eecf21a30b (diff)
downloadsbpython3-bc7614b9705c62b62a356408afa3578d1e519512.tar.bz2
sbpython3-bc7614b9705c62b62a356408afa3578d1e519512.tar.xz
project: custom config: handle all ncurses-related bits at config-time.
Diffstat (limited to 'project')
-rw-r--r--project/config/cfgdefs.sh55
-rw-r--r--project/depends.mk4
2 files changed, 52 insertions, 7 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'
diff --git a/project/depends.mk b/project/depends.mk
index b640a15..6f18d9d 100644
--- a/project/depends.mk
+++ b/project/depends.mk
@@ -1,7 +1,4 @@
# shared extensions: dependency switches
-CFLAGS_NCURSES += -I$(SYSROOT)/usr/local/include/ncurses -I$(SYSROOT)/usr/include/ncurses
-LDFLAGS_NCURSES += -Wl,--as-needed $(LDFLAGS_NCURSES_LIBS) -Wl,--no-as-needed
-
CFLAGS_SQLITE += -I$(SYSROOT)/usr/local/include/sqlite3 -I$(SYSROOT)/usr/include/sqlite3
CFLAGS_SQLITE += -DMODULE_NAME=\"sqlite3\"
CFLAGS_SQLITE += -DSQLITE_OMIT_LOAD_EXTENSION
@@ -19,7 +16,6 @@ LDFLAGS_TCLTK += $(LDFLAGS_TCLTK_LIBS)
# static extensions: dependency switch
LDFLAGS_PYEXT_STATIC += -lssl -lcrypto -lgdbm -lreadline
LDFLAGS_PYEXT_STATIC += -lbz2 -lffi -lintl -llzma -lz
-LDFLAGS_NCURSES_STATIC += $(LDFLAGS_NCURSES)
LDFLAGS_SQLITE_STATIC += $(LDFLAGS_SQLITE)
LDFLAGS_EXPAT_STATIC += $(LDFLAGS_EXPAT)
LDFLAGS_DBM_STATIC += $(LDFLAGS_DBM)