Anonymous avatar 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"]
         )
     ]
 )
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.