Blame project/variants/3.6.3/pyexts.h

feb6bd
/*******************************************************************/
feb6bd
/*  sbpython3: external configurable build project for Python-3.x. */
feb6bd
/*  Copyright (C) 2018  Z. Gilboa                                  */
feb6bd
/*  Released under the Standard MIT License; see COPYING.SBPYTHON3.*/
feb6bd
/*******************************************************************/
feb6bd
feb6bd
/*******************************************************************/
feb6bd
/* pyexts.c: a simple development-time utility for generating      */
feb6bd
/* make rules for python's extension modules. The utility is       */
feb6bd
/* included with the sbpython3 project for reference only.         */
feb6bd
/*                                                                 */
feb6bd
/* cc -std=c99 -D_XOPEN_SOURCE=700 pyexts.c                        */
feb6bd
/*******************************************************************/
feb6bd
feb6bd
#define PYEXT_LIST(...)                   (const char *[]){__VA_ARGS__,0}
feb6bd
#define PYEXT_SIMPLE(name,...)            {name,PYEXT_LIST(__VA_ARGS__),0,0,0,0}
feb6bd
feb6bd
#define PYEXT_COMMON(name,hvar,lvar,...)  {name,PYEXT_LIST(__VA_ARGS__), \
feb6bd
                                           PYEXT_LIST(hvar),0,           \
feb6bd
                                           PYEXT_LIST(lvar),0}
feb6bd
feb6bd
#define PYEXT_ALTSTD(name,cstd,...)       {name,PYEXT_LIST(__VA_ARGS__), \
feb6bd
                                           0,PYEXT_LIST(cstd),0,0}
feb6bd
feb6bd
struct pyext_meta {
feb6bd
	const char *	name;
feb6bd
	const char **	srcs;
feb6bd
	const char **	hdrs;
feb6bd
	const char **	cstd;
feb6bd
	const char **	vars;
feb6bd
	const char **	deps;
feb6bd
};
feb6bd
feb6bd
static const struct pyext_meta pyexts[] = {
feb6bd
	PYEXT_SIMPLE("_multibytecodec",     "cjkcodecs/multibytecodec"),
feb6bd
	PYEXT_SIMPLE("_codecs_cn",          "cjkcodecs/_codecs_cn"),
feb6bd
	PYEXT_SIMPLE("_codecs_hk",          "cjkcodecs/_codecs_hk"),
feb6bd
	PYEXT_SIMPLE("_codecs_jp",          "cjkcodecs/_codecs_jp"),
feb6bd
	PYEXT_SIMPLE("_codecs_kr",          "cjkcodecs/_codecs_kr"),
feb6bd
	PYEXT_SIMPLE("_codecs_tw",          "cjkcodecs/_codecs_tw"),
feb6bd
	PYEXT_SIMPLE("_codecs_iso2022",     "cjkcodecs/_codecs_iso2022"),
feb6bd
feb6bd
	PYEXT_SIMPLE("_asyncio",            "_asynciomodule"),
feb6bd
	PYEXT_SIMPLE("_bisect",             "_bisectmodule"),
feb6bd
	PYEXT_SIMPLE("_crypt",              "_cryptmodule"),
feb6bd
	PYEXT_SIMPLE("_csv",                "_csv"),
feb6bd
	PYEXT_SIMPLE("_ctypes_test",        "_ctypes/_ctypes_test"),
feb6bd
	PYEXT_SIMPLE("_datetime",           "_datetimemodule"),
feb6bd
	PYEXT_SIMPLE("_elementtree",        "_elementtree"),
feb6bd
	PYEXT_SIMPLE("_heapq",              "_heapqmodule"),
feb6bd
	PYEXT_SIMPLE("_json",               "_json"),
feb6bd
	PYEXT_SIMPLE("_md5",                "md5module"),
feb6bd
	PYEXT_SIMPLE("_opcode",             "_opcode"),
feb6bd
	PYEXT_SIMPLE("_pickle",             "_pickle"),
feb6bd
	PYEXT_SIMPLE("_posixsubprocess",    "_posixsubprocess"),
feb6bd
	PYEXT_SIMPLE("_random",             "_randommodule"),
feb6bd
	PYEXT_SIMPLE("_sha1",               "sha1module"),
feb6bd
	PYEXT_SIMPLE("_sha256",             "sha256module"),
feb6bd
	PYEXT_SIMPLE("_sha3",               "_sha3/sha3module"),
feb6bd
	PYEXT_SIMPLE("_sha512",             "sha512module"),
feb6bd
	PYEXT_SIMPLE("_socket",             "socketmodule"),
feb6bd
	PYEXT_SIMPLE("_struct",             "_struct"),
feb6bd
	PYEXT_SIMPLE("_testbuffer",         "_testbuffer"),
feb6bd
	PYEXT_SIMPLE("_testcapi",           "_testcapimodule"),
feb6bd
	PYEXT_SIMPLE("_testimportmultiple", "_testimportmultiple"),
feb6bd
	PYEXT_SIMPLE("_testmultiphase",     "_testmultiphase"),
feb6bd
feb6bd
feb6bd
feb6bd
	PYEXT_SIMPLE("array",               "arraymodule"),
feb6bd
	PYEXT_SIMPLE("audioop",             "audioop"),
feb6bd
	PYEXT_SIMPLE("fcntl",               "fcntlmodule"),
feb6bd
	PYEXT_SIMPLE("grp",                 "grpmodule"),
feb6bd
	PYEXT_SIMPLE("mmap",                "mmapmodule"),
feb6bd
	PYEXT_SIMPLE("ossaudiodev",         "ossaudiodev"),
feb6bd
	PYEXT_SIMPLE("parser",              "parsermodule"),
feb6bd
	PYEXT_SIMPLE("resource",            "resource"),
feb6bd
	PYEXT_SIMPLE("select",              "selectmodule"),
feb6bd
	PYEXT_SIMPLE("spwd",                "spwdmodule"),
feb6bd
	PYEXT_SIMPLE("syslog",              "syslogmodule"),
feb6bd
	PYEXT_SIMPLE("termios",             "termios"),
feb6bd
	PYEXT_SIMPLE("unicodedata",         "unicodedata"),
feb6bd
	PYEXT_SIMPLE("xxlimited",           "xxlimited"),
feb6bd
feb6bd
	PYEXT_SIMPLE("_blake2",
feb6bd
	             "_blake2/blake2module",
feb6bd
	             "_blake2/blake2b_impl",
feb6bd
	             "_blake2/blake2s_impl"),
feb6bd
feb6bd
	PYEXT_SIMPLE("_lsprof",
feb6bd
	             "_lsprof",
feb6bd
	             "rotatingtree"),
feb6bd
feb6bd
	PYEXT_SIMPLE("_multiprocessing",
feb6bd
	             "_multiprocessing/multiprocessing",
feb6bd
	             "_multiprocessing/semaphore"),
feb6bd
feb6bd
	PYEXT_SIMPLE("cmath",
feb6bd
	             "cmathmodule",
feb6bd
	             "_math"),
feb6bd
feb6bd
	PYEXT_SIMPLE("math",
feb6bd
	             "mathmodule",
feb6bd
	             "_math"),
feb6bd
feb6bd
	PYEXT_COMMON("_bz2",0,"-lbz2",
feb6bd
	             "_bz2module"),
feb6bd
feb6bd
	PYEXT_COMMON("_ctypes",0,"-lffi",
feb6bd
	             "_ctypes/_ctypes",
feb6bd
	             "_ctypes/callbacks",
feb6bd
	             "_ctypes/callproc",
feb6bd
	             "_ctypes/stgdict",
feb6bd
	             "_ctypes/cfield"),
feb6bd
feb6bd
	PYEXT_COMMON("_curses",
feb6bd
	             "$(CFLAGS_NCURSES)",
feb6bd
	             "$(LDFLAGS_NCURSES)",
feb6bd
	             "_cursesmodule"),
feb6bd
feb6bd
	PYEXT_COMMON("_curses_panel",
feb6bd
	             "$(CFLAGS_NCURSES)",
feb6bd
	             "$(LDFLAGS_NCURSES)",
feb6bd
	             "_curses_panel"),
feb6bd
feb6bd
	PYEXT_COMMON("_decimal",
feb6bd
	             "-I$(SOURCE_DIR)/Modules/_decimal/libmpdec -DUNIVERSAL",
feb6bd
                     0,
feb6bd
	             "_decimal/_decimal",
feb6bd
	             "_decimal/libmpdec/basearith",
feb6bd
	             "_decimal/libmpdec/constants",
feb6bd
	             "_decimal/libmpdec/context",
feb6bd
	             "_decimal/libmpdec/convolute",
feb6bd
	             "_decimal/libmpdec/crt",
feb6bd
	             "_decimal/libmpdec/difradix2",
feb6bd
	             "_decimal/libmpdec/fnt",
feb6bd
	             "_decimal/libmpdec/fourstep",
feb6bd
	             "_decimal/libmpdec/io",
feb6bd
	             "_decimal/libmpdec/memory",
feb6bd
	             "_decimal/libmpdec/mpdecimal",
feb6bd
	             "_decimal/libmpdec/numbertheory",
feb6bd
	             "_decimal/libmpdec/sixstep",
feb6bd
	             "_decimal/libmpdec/transpose"),
feb6bd
feb6bd
	PYEXT_COMMON("_dbm",
feb6bd
	             "$(CFLAGS_DBM)",
feb6bd
	             "$(LDFLAGS_DBM)",
feb6bd
	             "_dbmmodule"),
feb6bd
feb6bd
	PYEXT_COMMON("_gdbm",0,"-lgdbm",
feb6bd
	             "_gdbmmodule"),
feb6bd
feb6bd
	PYEXT_COMMON("_hashlib",0,"-lssl -lcrypto",
feb6bd
	             "_hashopenssl"),
feb6bd
feb6bd
	PYEXT_COMMON("_lzma",0,"-llzma",
feb6bd
	             "_lzmamodule"),
feb6bd
feb6bd
	PYEXT_COMMON("_sqlite3",
feb6bd
	             "$(CFLAGS_SQLITE)",
feb6bd
	             "$(LDFLAGS_SQLITE)",
feb6bd
	             "_sqlite/cache",
feb6bd
	             "_sqlite/connection",
feb6bd
	             "_sqlite/cursor",
feb6bd
	             "_sqlite/microprotocols",
feb6bd
	             "_sqlite/module",
feb6bd
	             "_sqlite/prepare_protocol",
feb6bd
	             "_sqlite/row",
feb6bd
	             "_sqlite/statement",
feb6bd
	             "_sqlite/util"),
feb6bd
feb6bd
	PYEXT_COMMON("_ssl",0,"-lssl -lcrypto",
feb6bd
	             "_ssl"),
feb6bd
feb6bd
	PYEXT_COMMON("_tkinter",
feb6bd
	             "$(CFLAGS_TCLTK)",
feb6bd
	             "$(LDFLAGS_TCLTK)",
feb6bd
	             "_tkinter",
feb6bd
	             "tkappinit"),
feb6bd
feb6bd
	PYEXT_COMMON("binascii",0,"-lz",
feb6bd
	             "binascii"),
feb6bd
feb6bd
	PYEXT_COMMON("pyexpat",0,"-lexpat",
feb6bd
	             "pyexpat"),
feb6bd
feb6bd
	PYEXT_COMMON("readline",0,"-lreadline",
feb6bd
	             "readline"),
feb6bd
feb6bd
	PYEXT_COMMON("zlib",0,"-lz",
feb6bd
	             "zlibmodule"),
feb6bd
feb6bd
	{0,0,0,0,0,0},
feb6bd
};