changeset 97:409cff0c7afb

Added an experimental setup.py.
author Atul Varma <varmaa@toolness.com>
date Sat, 15 Aug 2009 10:41:24 -0700
parents 3570ab12747b
children 3baa418b7ba8
files .hgignore setup.py
diffstat 2 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sat Aug 15 10:24:17 2009 -0700
+++ b/.hgignore	Sat Aug 15 10:41:24 2009 -0700
@@ -4,4 +4,6 @@
 docs/rendered/.buildinfo
 docs/rendered/.doctrees
 docs/rendered/objects.inv
+spidermonkey
+build
 _doctest_output
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup.py	Sat Aug 15 10:41:24 2009 -0700
@@ -0,0 +1,33 @@
+import os
+import sys
+from distutils.core import setup, Extension
+
+SOURCE_FILES = ['pymonkey.cpp',
+                'utils.cpp',
+                'object.cpp',
+                'function.cpp',
+                'undefined.cpp',
+                'context.cpp',
+                'runtime.cpp']
+
+SPIDERMONKEY_DIR = os.path.abspath(os.path.join('spidermonkey', 'obj'))
+
+if not os.path.exists(SPIDERMONKEY_DIR):
+    print('WARNING: Spidermonkey objdir not found at %s.' % SPIDERMONKEY_DIR)
+    print('Some build tasks may not run properly.\n')
+
+INCLUDE_DIRS = [os.path.join(SPIDERMONKEY_DIR, 'dist', 'include')]
+LIB_DIRS = [os.path.join(SPIDERMONKEY_DIR)]
+
+setup(name='pymonkey',
+      version='0.0.1',
+      description='Access SpiderMonkey from Python',
+      author='Atul Varma',
+      author_email='atul@mozilla.com',
+      url='http://www.toolness.com',
+      ext_modules=[Extension('pymonkey',
+                             SOURCE_FILES,
+                             include_dirs = INCLUDE_DIRS,
+                             library_dirs = LIB_DIRS,
+                             libraries = ['js_static'])]
+     )