summaryrefslogtreecommitdiff
path: root/project/config
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-10 22:54:57 -0500
committermidipix <writeonce@midipix.org>2018-12-10 22:54:57 -0500
commit3ebdb87e21d25b865e5757d4b30297d02fff177a (patch)
treec84c70bdd5f6d1b5ff1281e9374d98d6cea1bd13 /project/config
parent289419ad40fbbfce58001d0564c275905aabfe21 (diff)
downloadsbpython2-3ebdb87e21d25b865e5757d4b30297d02fff177a.tar.bz2
sbpython2-3ebdb87e21d25b865e5757d4b30297d02fff177a.tar.xz
config: handle all dependency-related logic at the project level.
Diffstat (limited to 'project/config')
-rw-r--r--project/config/cfgdefs.sh38
1 files changed, 37 insertions, 1 deletions
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