summaryrefslogtreecommitdiff
path: root/project
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
parent289419ad40fbbfce58001d0564c275905aabfe21 (diff)
downloadsbpython2-3ebdb87e21d25b865e5757d4b30297d02fff177a.tar.bz2
sbpython2-3ebdb87e21d25b865e5757d4b30297d02fff177a.tar.xz
config: handle all dependency-related logic at the project level.
Diffstat (limited to 'project')
-rw-r--r--project/config/cfgdefs.sh38
-rw-r--r--project/depends.mk22
-rw-r--r--project/pycompile.mk2
3 files changed, 60 insertions, 2 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
diff --git a/project/depends.mk b/project/depends.mk
index e69de29..ff056a1 100644
--- a/project/depends.mk
+++ b/project/depends.mk
@@ -0,0 +1,22 @@
+# 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
+LDFLAGS_SQLITE = -lsqlite3
+
+CFLAGS_EXPAT = -DXML_DEV_URANDOM
+LDFLAGS_EXPAT = -lexpat
+
+CFLAGS_DBM = -DHAVE_NDBM_H
+LDFLAGS_DBM = -lgdbm_compat
+
+
+# static extensions: dependency switch
+LDFLAGS_PYEXT_STATIC = -lssl -lcrypto -lreadline -lbz2 -lgdbm -lffi -lintl -lz
+LDFLAGS_NCURSES_STATIC = $(LDFLAGS_NCURSES)
+LDFLAGS_SQLITE_STATIC = $(LDFLAGS_SQLITE)
+LDFLAGS_EXPAT_STATIC = $(LDFLAGS_EXPAT)
+LDFLAGS_DBM_STATIC = $(LDFLAGS_DBM)
diff --git a/project/pycompile.mk b/project/pycompile.mk
index b6b3ff2..20a042f 100644
--- a/project/pycompile.mk
+++ b/project/pycompile.mk
@@ -21,7 +21,7 @@ PYCOMPILE_CFLAGS += -DEXEC_PREFIX=\"$(PYCOMPILE_PREFIX)\"
PYCOMPILE_CFLAGS += -DPYTHONPATH=\"$(PYCOMPILE_PATH)\"
PYCOMPILE_LDFLAGS += -lreadline -lm -lutil -lpthread
-PYCOMPILE_LDFLAGS += $(LDFLAGS_NCURSES_STATIC)
+PYCOMPILE_LDFLAGS += $(PYCOMPILE_NCURSES_LIBS)
PYCOMPILE_LDFLAGS += -lreadline -lm -lutil -lpthread
$(PYCOMPILE_DIR)/tree.tag: