[Python-checkins] devinabox: Add a script which will build CPython.
brett.cannon
python-checkins at python.org
Mon Feb 28 23:03:50 CET 2011
brett.cannon pushed 5bbb3ca59d71 to devinabox:
http://hg.python.org/devinabox/rev/5bbb3ca59d71
changeset: 9:5bbb3ca59d71
user: Brett Cannon <brett at python.org>
date: Fri Feb 25 17:44:56 2011 -0800
summary:
Add a script which will build CPython.
files:
build_cpython.py
diff --git a/build_cpython.py b/build_cpython.py
new file mode 100644
--- /dev/null
+++ b/build_cpython.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+"""Build CPython"""
+import multiprocessing
+import os
+import subprocess
+import sys
+
+if sys.platform == 'win32':
+ print("See the devguide's Getting Set Up guide for building under Windows")
+
+directory = 'cpython'
+cwd = os.getcwd()
+os.chdir(directory)
+try:
+ if os.path.isfile('Makefile'):
+ print('Makefile already exists; skipping ./configure')
+ else:
+ subprocess.check_call(['./configure', '--prefix=/dev/null',
+ '--with-pydebug'])
+ make_cmd = ['make', '-s', '-j', str(multiprocessing.cpu_count())]
+ subprocess.call(make_cmd)
+finally:
+ os.chdir(cwd)
--
Repository URL: http://hg.python.org/devinabox
More information about the Python-checkins
mailing list