From 18f499e9b7f486ee4a017d42830fe2b2b6bafc9e Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 2 Dec 2018 17:17:29 -0500 Subject: config: x86_64-linux-musl: further refactor config.mk. --- config/x86_64-linux-musl/config.mk | 63 +++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 25 deletions(-) (limited to 'config') diff --git a/config/x86_64-linux-musl/config.mk b/config/x86_64-linux-musl/config.mk index 9ac2f9d..1226e7e 100644 --- a/config/x86_64-linux-musl/config.mk +++ b/config/x86_64-linux-musl/config.mk @@ -1,31 +1,9 @@ -include $(PROJECT_DIR)/profiles/pyexts/subsets.mk - +# platform PYTHON_PATH = PYTHON_PLATFORM = linux2 -CFLAGS_NCURSES = -I$(SYSROOT)/usr/local/include/ncurses -I$(SYSROOT)/usr/include/ncurses -LDFLAGS_NCURSES = -Wl,--as-needed -lpanelw -lncursesw -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 - -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) - -DYNLOAD_SRCS = \ - Python/dynload_shlib.c \ +# extensions: built-in CONFIG_SRCS = \ Modules/_codecsmodule.c \ Modules/_sre.c \ @@ -39,7 +17,14 @@ CONFIG_SRCS = \ Modules/xxsubtype.c \ Modules/zipimport.c \ -shared-lib: LDFLAGS_CONFIG += -Wl,-no-undefined + +# extensions: dynamic loading +DYNLOAD_SRCS = \ + Python/dynload_shlib.c \ + + +# extensions: desired subsets +include $(PROJECT_DIR)/profiles/pyexts/subsets.mk PYEXT_SHARED = \ $(PYEXT_SUBSET_SHARED_ANYOS_CORE) \ @@ -50,3 +35,31 @@ PYEXT_STATIC = \ $(PYEXT_SUBSET_STATIC_ANYOS_CORE) \ $(PYEXT_SUBSET_STATIC_ANYOS_AUDIO) \ $(PYEXT_SUBSET_STATIC_LINUX_AUDIO) \ + + +# shared extensions: dependency switches +CFLAGS_NCURSES = -I$(SYSROOT)/usr/local/include/ncurses -I$(SYSROOT)/usr/include/ncurses +LDFLAGS_NCURSES = -Wl,--as-needed -lpanelw -lncursesw -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) + + +# strict shared object generation +LDFLAGS_STRICT += -Wl,-no-undefined -- cgit v1.2.3