[pypy-svn] r44051 - pypy/dist/pypy/rpython/rctypes/tool

gotcha at codespeak.net gotcha at codespeak.net
Wed Jun 6 11:38:31 CEST 2007


Author: gotcha
Date: Wed Jun  6 11:38:30 2007
New Revision: 44051

Modified:
   pypy/dist/pypy/rpython/rctypes/tool/compilemodule.py
Log:
allow to compile modules elsewhere than in pypy.module

Modified: pypy/dist/pypy/rpython/rctypes/tool/compilemodule.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/tool/compilemodule.py	(original)
+++ pypy/dist/pypy/rpython/rctypes/tool/compilemodule.py	Wed Jun  6 11:38:30 2007
@@ -72,10 +72,15 @@
     return driver.cbuilder.c_ext_module
 
 def main(argv):
-    if len(argv) != 2:
+    argvCount = len(argv)
+    if argvCount < 2 or argvCount > 4:
         print >> sys.stderr, __doc__
         sys.exit(2)
-    c_ext_module = compilemodule(argv[1], interactive=True)
+    elif len(argv) == 2:
+        c_ext_module = compilemodule(argv[1], interactive=True)
+    elif len(argv) == 3:
+        basepath = argv[2]
+        c_ext_module = compilemodule(argv[1], interactive=True, basepath=basepath)
     print 'Created %r.' % (c_ext_module.__file__,)
 
 



More information about the Pypy-commit mailing list