runme.py 716 B

1234567891011121314151617181920212223242526272829
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. """
  4. Create a waf file able to read wscript files ending in ".py"
  5. execute a small test to show that it works
  6. The waf file includes "extpy.py" which performs the required modifications
  7. """
  8. import os, subprocess
  9. up = os.path.dirname
  10. join = os.path.join
  11. cwd = os.getcwd()
  12. extpy = join(cwd, 'extpy.py')
  13. args = 'python waf-light --tools=compat15,%s --prelude=$"\tfrom waflib.extras import extpy\n" ' % extpy
  14. root = up(up(cwd))
  15. subprocess.Popen(args, cwd=root, shell=True).wait()
  16. os.rename(join(root, 'waf'), join(cwd, 'waf.py'))
  17. env = dict(os.environ)
  18. if 'WAFDIR' in env:
  19. del env['WAFDIR']
  20. subprocess.Popen('python waf.py configure', cwd=cwd, shell=True, env=env).wait()