]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/python/mkconfig
mothra: fix alt display resizing, filter control characters in panel entries, use...
[plan9front.git] / sys / src / cmd / python / mkconfig
1 #!/bin/rc
2
3 cat <<!
4 /* Module configuration */
5
6 /* This file contains the table of built-in modules.
7    See init_builtin() in import.c. */
8
9 #include "Python.h"
10 !
11
12 cat $* | awk '!/^#/ && NF>0 {if(NF==1) fn="init" $1; else fn=$2; printf("extern void %s(void);\n", fn);}' 
13
14 cat <<!
15
16 extern void PyMarshal_Init(void);
17 extern void initimp(void);
18 extern void initgc(void);
19 extern void init_ast(void);
20 extern void init_types(void);
21
22 struct _inittab _PyImport_Inittab[] = {
23
24 !
25
26 cat $* | awk '!/^#/ && NF>0 {if(NF==1) fn="init" $1; else fn=$2; printf("\t{\"%s\", %s},\n", $1, fn);}'
27
28 cat <<!
29
30         /* This module lives in marshal.c */
31         {"marshal", PyMarshal_Init},
32
33         /* This lives in import.c */
34         {"imp", initimp},
35
36         /* This lives in Python/Python-ast.c */
37         {"_ast", init_ast},
38
39         /* This lives in Python/_types.c */
40         {"_types", init_types},
41
42         /* These entries are here for sys.builtin_module_names */
43         {"__main__", NULL},
44         {"__builtin__", NULL},
45         {"sys", NULL},
46         {"exceptions", NULL},
47
48         /* This lives in gcmodule.c */
49         {"gc", initgc},
50
51         /* Sentinel */
52         {0, 0}
53 };
54 !