ref: 0e6e44b06400e320145eb5115edce054cfd26d1f
dir: /sys/src/cmd/python/mkconfig/
#!/bin/rc cat <<! /* Module configuration */ /* This file contains the table of built-in modules. See init_builtin() in import.c. */ #include "Python.h" ! cat $* | awk '!/^#/ && NF>0 {if(NF==1) fn="init" $1; else fn=$2; printf("extern void %s(void);\n", fn);}' cat <<! extern void PyMarshal_Init(void); extern void initimp(void); extern void initgc(void); extern void init_ast(void); extern void init_types(void); struct _inittab _PyImport_Inittab[] = { ! cat $* | awk '!/^#/ && NF>0 {if(NF==1) fn="init" $1; else fn=$2; printf("\t{\"%s\", %s},\n", $1, fn);}' cat <<! /* This module lives in marshal.c */ {"marshal", PyMarshal_Init}, /* This lives in import.c */ {"imp", initimp}, /* This lives in Python/Python-ast.c */ {"_ast", init_ast}, /* This lives in Python/_types.c */ {"_types", init_types}, /* These entries are here for sys.builtin_module_names */ {"__main__", NULL}, {"__builtin__", NULL}, {"sys", NULL}, {"exceptions", NULL}, /* This lives in gcmodule.c */ {"gc", initgc}, /* Sentinel */ {0, 0} }; !