1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
/*******************************************************************/
/* sbpython3: external configurable build project for Python-3.x. */
/* Copyright (C) 2018 Z. Gilboa */
/* Released under the Standard MIT License; see COPYING.SBPYTHON3.*/
/*******************************************************************/
/*******************************************************************/
/* pyexts.c: a simple development-time utility for generating */
/* make rules for python's extension modules. The utility is */
/* included with the sbpython3 project for reference only. */
/* */
/* cc -std=c99 -D_XOPEN_SOURCE=700 pyexts.c */
/*******************************************************************/
#define PYEXT_LIST(...) (const char *[]){__VA_ARGS__,0}
#define PYEXT_SIMPLE(name,...) {name,PYEXT_LIST(__VA_ARGS__),0,0,0,0}
#define PYEXT_COMMON(name,hvar,lvar,...) {name,PYEXT_LIST(__VA_ARGS__), \
PYEXT_LIST(hvar),0, \
PYEXT_LIST(lvar),0}
#define PYEXT_ALTSTD(name,cstd,...) {name,PYEXT_LIST(__VA_ARGS__), \
0,PYEXT_LIST(cstd),0,0}
struct pyext_meta {
const char * name;
const char ** srcs;
const char ** hdrs;
const char ** cstd;
const char ** vars;
const char ** deps;
};
static const struct pyext_meta pyexts[] = {
PYEXT_SIMPLE("_multibytecodec", "cjkcodecs/multibytecodec"),
PYEXT_SIMPLE("_codecs_cn", "cjkcodecs/_codecs_cn"),
PYEXT_SIMPLE("_codecs_hk", "cjkcodecs/_codecs_hk"),
PYEXT_SIMPLE("_codecs_jp", "cjkcodecs/_codecs_jp"),
PYEXT_SIMPLE("_codecs_kr", "cjkcodecs/_codecs_kr"),
PYEXT_SIMPLE("_codecs_tw", "cjkcodecs/_codecs_tw"),
PYEXT_SIMPLE("_codecs_iso2022", "cjkcodecs/_codecs_iso2022"),
PYEXT_SIMPLE("_asyncio", "_asynciomodule"),
PYEXT_SIMPLE("_bisect", "_bisectmodule"),
PYEXT_SIMPLE("_crypt", "_cryptmodule"),
PYEXT_SIMPLE("_csv", "_csv"),
PYEXT_SIMPLE("_ctypes_test", "_ctypes/_ctypes_test"),
PYEXT_SIMPLE("_datetime", "_datetimemodule"),
PYEXT_SIMPLE("_elementtree", "_elementtree"),
PYEXT_SIMPLE("_heapq", "_heapqmodule"),
PYEXT_SIMPLE("_json", "_json"),
PYEXT_SIMPLE("_md5", "md5module"),
PYEXT_SIMPLE("_opcode", "_opcode"),
PYEXT_SIMPLE("_pickle", "_pickle"),
PYEXT_SIMPLE("_posixsubprocess", "_posixsubprocess"),
PYEXT_SIMPLE("_random", "_randommodule"),
PYEXT_SIMPLE("_sha1", "sha1module"),
PYEXT_SIMPLE("_sha256", "sha256module"),
PYEXT_SIMPLE("_sha3", "_sha3/sha3module"),
PYEXT_SIMPLE("_sha512", "sha512module"),
PYEXT_SIMPLE("_socket", "socketmodule"),
PYEXT_SIMPLE("_struct", "_struct"),
PYEXT_SIMPLE("_testbuffer", "_testbuffer"),
PYEXT_SIMPLE("_testcapi", "_testcapimodule"),
PYEXT_SIMPLE("_testimportmultiple", "_testimportmultiple"),
PYEXT_SIMPLE("_testmultiphase", "_testmultiphase"),
PYEXT_SIMPLE("array", "arraymodule"),
PYEXT_SIMPLE("audioop", "audioop"),
PYEXT_SIMPLE("fcntl", "fcntlmodule"),
PYEXT_SIMPLE("grp", "grpmodule"),
PYEXT_SIMPLE("mmap", "mmapmodule"),
PYEXT_SIMPLE("ossaudiodev", "ossaudiodev"),
PYEXT_SIMPLE("parser", "parsermodule"),
PYEXT_SIMPLE("resource", "resource"),
PYEXT_SIMPLE("select", "selectmodule"),
PYEXT_SIMPLE("spwd", "spwdmodule"),
PYEXT_SIMPLE("syslog", "syslogmodule"),
PYEXT_SIMPLE("termios", "termios"),
PYEXT_SIMPLE("unicodedata", "unicodedata"),
PYEXT_SIMPLE("xxlimited", "xxlimited"),
PYEXT_SIMPLE("_blake2",
"_blake2/blake2module",
"_blake2/blake2b_impl",
"_blake2/blake2s_impl"),
PYEXT_SIMPLE("_lsprof",
"_lsprof",
"rotatingtree"),
PYEXT_SIMPLE("_multiprocessing",
"_multiprocessing/multiprocessing",
"_multiprocessing/semaphore"),
PYEXT_SIMPLE("cmath",
"cmathmodule",
"_math"),
PYEXT_SIMPLE("math",
"mathmodule",
"_math"),
PYEXT_COMMON("_bz2",0,"-lbz2",
"_bz2module"),
PYEXT_COMMON("_ctypes",0,"-lffi",
"_ctypes/_ctypes",
"_ctypes/callbacks",
"_ctypes/callproc",
"_ctypes/stgdict",
"_ctypes/cfield"),
PYEXT_COMMON("_curses",
"$(CFLAGS_NCURSES)",
"$(LDFLAGS_NCURSES)",
"_cursesmodule"),
PYEXT_COMMON("_curses_panel",
"$(CFLAGS_NCURSES)",
"$(LDFLAGS_NCURSES)",
"_curses_panel"),
PYEXT_COMMON("_decimal",
"-I$(SOURCE_DIR)/Modules/_decimal/libmpdec -DUNIVERSAL",
0,
"_decimal/_decimal",
"_decimal/libmpdec/basearith",
"_decimal/libmpdec/constants",
"_decimal/libmpdec/context",
"_decimal/libmpdec/convolute",
"_decimal/libmpdec/crt",
"_decimal/libmpdec/difradix2",
"_decimal/libmpdec/fnt",
"_decimal/libmpdec/fourstep",
"_decimal/libmpdec/io",
"_decimal/libmpdec/memory",
"_decimal/libmpdec/mpdecimal",
"_decimal/libmpdec/numbertheory",
"_decimal/libmpdec/sixstep",
"_decimal/libmpdec/transpose"),
PYEXT_COMMON("_dbm",
"$(CFLAGS_DBM)",
"$(LDFLAGS_DBM)",
"_dbmmodule"),
PYEXT_COMMON("_gdbm",0,"-lgdbm",
"_gdbmmodule"),
PYEXT_COMMON("_hashlib",0,"-lssl -lcrypto",
"_hashopenssl"),
PYEXT_COMMON("_lzma",0,"-llzma",
"_lzmamodule"),
PYEXT_COMMON("_sqlite3",
"$(CFLAGS_SQLITE)",
"$(LDFLAGS_SQLITE)",
"_sqlite/cache",
"_sqlite/connection",
"_sqlite/cursor",
"_sqlite/microprotocols",
"_sqlite/module",
"_sqlite/prepare_protocol",
"_sqlite/row",
"_sqlite/statement",
"_sqlite/util"),
PYEXT_COMMON("_ssl",0,"-lssl -lcrypto",
"_ssl"),
PYEXT_COMMON("_tkinter",
"$(CFLAGS_TCLTK)",
"$(LDFLAGS_TCLTK)",
"_tkinter",
"tkappinit"),
PYEXT_COMMON("binascii",0,"-lz",
"binascii"),
PYEXT_COMMON("pyexpat",0,"-lexpat",
"pyexpat"),
PYEXT_COMMON("readline",0,"-lreadline",
"readline"),
PYEXT_COMMON("zlib",0,"-lz",
"zlibmodule"),
{0,0,0,0,0,0},
};
|