From 3ebdb87e21d25b865e5757d4b30297d02fff177a Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 10 Dec 2018 22:54:57 -0500 Subject: config: handle all dependency-related logic at the project level. --- project/config/cfgdefs.sh | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'project/config') diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh index a8e4d53..c993def 100644 --- a/project/config/cfgdefs.sh +++ b/project/config/cfgdefs.sh @@ -73,7 +73,26 @@ printf 'void * addr = &X509_NAME_ENTRY_set;' \ >> $mb_pwd/cfgdefs.mk # ncurses: python refers to the internals of typedef struct _win_st WINDOW -printf 'CFLAGS_CONFIG\t\t+= -DNCURSES_INTERNALS' >> $mb_pwd/cfgdefs.mk +printf 'CFLAGS_CONFIG\t\t+= -DNCURSES_INTERNALS\n' >> $mb_pwd/cfgdefs.mk + +# ncurses: tinfo +mb_ncurses_libs="-lpanelw -lncursesw" + +if [ $mb_disable_shared = 'yes' ]; then + printf 'int main(void){return 0;}' \ + | $mb_cfgdefs_cc $mb_cfgdefs_cflags \ + -ltinfo -o a.out -xc - \ + < /dev/null 2>/dev/null \ + && mb_ncurses_libs="$mb_ncurses_libs -ltinfo" +else + $mb_cfgdefs_cc $mb_cfgdefs_cflags \ + -shared -ltinfo -o a.out -xc - \ + < /dev/null 2>/dev/null \ + && mb_ncurses_libs="$mb_ncurses_libs -ltinfo" +fi + +printf 'LDFLAGS_NCURSES_LIBS\t+= %s\n' "$mb_ncurses_libs" \ + >> $mb_pwd/cfgdefs.mk # system tests: (native) pycompile @@ -85,5 +104,22 @@ $mb_native_cc -E -xc - \ printf 'PYCOMPILE_CFLAGS\t+= -DHAVE_NO_STROPTS_H\n' \ >> $mb_pwd/cfgdefs.mk +# ncurses: tinfo +mb_ncurses_libs="-lpanelw -lncursesw" + +printf 'int main(void){return 0;}' \ + | $mb_native_cc \ + -ltinfo -o a.out -xc - \ + < /dev/null 2>/dev/null \ + && mb_ncurses_libs="$mb_ncurses_libs -ltinfo" + +printf 'PYCOMPILE_NCURSES_LIBS\t+= %s\n' "$mb_ncurses_libs" \ + >> $mb_pwd/cfgdefs.mk + + +# clean-up +rm -f a.out + + # all done return 0 -- cgit v1.2.3