Commits

Anonymous committed 91caa12

Added linux detection.

Comments (0)

Files changed (1)

     if not os.path.exists("spidermonkey.c"):
         sys.stderr.write("Pyrex is required for compiliation.")
 
+arch = os.uname()[0].lower()
+jslib = {"darin": "js", "linux": "mozjs"}.get(arch)
+if not jslib:
+    sys.stderr.write("Failed to guess what JavaScript lib you might be using.")
+
 setup(name = "spidermonkey",
     version = "0.0.1a",
     license = "GPL",
         Extension("spidermonkey",
             sources=["spidermonkey.c"],
             extra_compile_args=["-DXP_UNIX", "-DJS_THREADSAFE"],
-            include_dirs=["/usr/include/js", "/usr/local/include/js", "/opt/local/include/js"],
+            include_dirs=["/usr/include/js", "/usr/local/include/js", "/usr/include/mozjs", "/opt/local/include/js"],
             runtime_libraries=["/usr/lib", "/usr/local/lib", "/opt/local/lib"],
-            libraries=["js", "pthread"]
+            libraries=[jslib, "pthread"]
         )
     ]
 )