summaryrefslogtreecommitdiffstats
path: root/Tools/freeze/makefreeze.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-03-20 17:37:24 (GMT)
committerGuido van Rossum <guido@python.org>1998-03-20 17:37:24 (GMT)
commit78fc3634cbfd65a6be8abfd1b7fc7cbd0ccbfb39 (patch)
tree900727a59c47577d9704abb126496e351be08a8a /Tools/freeze/makefreeze.py
parent11af5a446961aa4f7640196b9f6d6e9b03933d91 (diff)
downloadcpython-78fc3634cbfd65a6be8abfd1b7fc7cbd0ccbfb39.zip
cpython-78fc3634cbfd65a6be8abfd1b7fc7cbd0ccbfb39.tar.gz
cpython-78fc3634cbfd65a6be8abfd1b7fc7cbd0ccbfb39.tar.bz2
Big changes by Mark Hammond to support freezing with DLLs on Windows.
Diffstat (limited to 'Tools/freeze/makefreeze.py')
-rw-r--r--Tools/freeze/makefreeze.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Tools/freeze/makefreeze.py b/Tools/freeze/makefreeze.py
index 88265b0..25c52bc 100644
--- a/Tools/freeze/makefreeze.py
+++ b/Tools/freeze/makefreeze.py
@@ -12,7 +12,9 @@ static struct _frozen _PyImport_FrozenModules[] = {
trailer = """\
{0, 0, 0} /* sentinel */
};
+"""
+default_entry_point = """
int
main(argc, argv)
int argc;
@@ -24,7 +26,8 @@ main(argc, argv)
"""
-def makefreeze(outfp, dict, debug=0):
+def makefreeze(outfp, dict, debug=0, entry_point = None):
+ if entry_point is None: entry_point = default_entry_point
done = []
mods = dict.keys()
mods.sort()
@@ -47,6 +50,8 @@ def makefreeze(outfp, dict, debug=0):
for mod, mangled, size in done:
outfp.write('\t{"%s", M_%s, %d},\n' % (mod, mangled, size))
outfp.write(trailer)
+ outfp.write(entry_point)
+
# Write a C initializer for a module containing the frozen python code.