setup.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #@+leo-ver=4
  2. #@+node:@file setup.py
  3. """
  4. Builds bison python module
  5. """
  6. version = "0.1"
  7. from distutils.core import setup
  8. from distutils.extension import Extension
  9. from Pyrex.Distutils import build_ext
  10. import sys
  11. if sys.platform == 'win32':
  12. print "Sorry - no windows support at this time - pybison won't work for you"
  13. #sys.exit(1)
  14. libs = []
  15. extra_link_args = []
  16. bison2pyscript = 'utils/bison2py.py'
  17. bisondynlibModule = "src/c/bisondynlib-win32.c"
  18. elif sys.platform == 'linux2':
  19. libs = ['dl']
  20. extra_link_args = []
  21. bison2pyscript = 'utils/bison2py'
  22. bisondynlibModule = "src/c/bisondynlib-linux.c"
  23. else:
  24. print "Sorry, your platform is presently unsupported"
  25. sys.exit(1)
  26. setup(
  27. name = "bison",
  28. version = version,
  29. description='Python bindings for bison/flex parser engine',
  30. author='David McNab <david@freenet.org.nz>',
  31. url='http://www.freenet.org.nz/python/pybison',
  32. ext_modules=[
  33. Extension("bison_", ["src/pyrex/bison_.pyx", bisondynlibModule],
  34. libraries=libs,
  35. extra_link_args=extra_link_args,
  36. )
  37. ],
  38. packages=[],
  39. package_dir={'': 'src/python'},
  40. py_modules=['bison'],
  41. cmdclass = {'build_ext': build_ext},
  42. scripts=[bison2pyscript],
  43. )
  44. #@-node:@file setup.py
  45. #@-leo