[javascriptlint-commit] SF.net SVN: javascriptlint:[254] trunk
Status: Beta
Brought to you by:
matthiasmiller
|
From: <mat...@us...> - 2009-10-03 16:41:15
|
Revision: 254
http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=254&view=rev
Author: matthiasmiller
Date: 2009-10-03 16:41:05 +0000 (Sat, 03 Oct 2009)
Log Message:
-----------
Automatically run the makefiles from setup.py. (Note that the install is still broken.)
Modified Paths:
--------------
trunk/INSTALL
trunk/Makefile.SpiderMonkey
trunk/setup.py
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2009-10-03 15:45:19 UTC (rev 253)
+++ trunk/INSTALL 2009-10-03 16:41:05 UTC (rev 254)
@@ -9,6 +9,7 @@
on Windows Vista.) Run the commands in that shell.
On all platforms:
- $ make -f Makefile.SpiderMonkey
$ python setup.py build
+To install on Unix:
+ $ sudo python setup.py install
Modified: trunk/Makefile.SpiderMonkey
===================================================================
--- trunk/Makefile.SpiderMonkey 2009-10-03 15:45:19 UTC (rev 253)
+++ trunk/Makefile.SpiderMonkey 2009-10-03 16:41:05 UTC (rev 254)
@@ -1,3 +1,5 @@
+## THIS IS AN INTERNAL MAKEFILE FOR setup.py
+## DO NOT RUN THIS MAKEFILE DIRECTLY.
SPIDERMONKEY_SRC=spidermonkey/src
@@ -3,5 +5,4 @@
# Load the SpiderMonkey config to find the OS define
# Also use this for the SO_SUFFIX
-BUILD_OPT=1
DEPTH=$(SPIDERMONKEY_SRC)
include $(SPIDERMONKEY_SRC)/config.mk
@@ -16,10 +17,6 @@
BUILD_DIR=build/spidermonkey
-# Use a dynamically-created makefile to determine the distutils output dir
-DISTUTILS_DIR_MAKEFILE=$(BUILD_DIR)/Makefile-distutils
-include $(DISTUTILS_DIR_MAKEFILE)
-
ORIG_LIB=$(SPIDERMONKEY_SRC)/$(OBJDIR)/$(JS_LIB)
COPY_LIB=$(BUILD_DIR)/$(JS_LIB)
ORIG_DLL=$(SPIDERMONKEY_SRC)/$(OBJDIR)/js32.dll
@@ -40,23 +37,16 @@
all: $(ALL_TARGETS)
clean:
- make -f Makefile.ref -C $(SPIDERMONKEY_SRC) BUILD_OPT=$(BUILD_OPT) clean
- rm $(ORIG_LIB)
- rm -R $(BUILD_DIR)
+ rm -f $(ORIG_LIB)
+ rm -Rf $(BUILD_DIR)
-$(DISTUTILS_DIR_MAKEFILE): Makefile.SpiderMonkey $(BUILD_DIR)
- python -c "import setup; print 'DISTUTILS_DIR='+setup.get_lib_path()" >> $(DISTUTILS_DIR_MAKEFILE)
-
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(COPY_LIB): $(BUILD_DIR) $(ORIG_LIB)
cp $(ORIG_LIB) $(COPY_LIB)
-$(DISTUTILS_DIR): $(DISTUTILS_DIR_MAKEFILE)
- mkdir -p $(DISTUTILS_DIR)
-
-$(COPY_DLL): $(DISTUTILS_DIR) $(ORIG_LIB)
+$(COPY_DLL): $(ORIG_LIB)
cp $(ORIG_DLL) $(COPY_DLL)
$(OS_HEADER): $(BUILD_DIR)
@@ -65,6 +55,3 @@
$(COPY_JSAUTOCFG_H): $(ORIG_JSAUTOCFG_H)
cp $(ORIG_JSAUTOCFG_H) $(COPY_JSAUTOCFG_H)
-$(ORIG_LIB):
- make -f Makefile.ref -C $(SPIDERMONKEY_SRC) BUILD_OPT=$(BUILD_OPT)
-
Modified: trunk/setup.py
===================================================================
--- trunk/setup.py 2009-10-03 15:45:19 UTC (rev 253)
+++ trunk/setup.py 2009-10-03 16:41:05 UTC (rev 254)
@@ -1,9 +1,35 @@
#!/usr/bin/python
# vim: ts=4 sw=4 expandtab
from distutils.core import setup, Extension
+import distutils.command.build
+import distutils.command.clean
import os
+import subprocess
import sys
+def _runmakefiles(distutils_dir, build_opt=1, args=[]):
+ # First build SpiderMonkey.
+ subprocess.check_call(['make', '-f', 'Makefile.ref', '-C',
+ 'spidermonkey/src', 'BUILD_OPT=%i' % build_opt] + \
+ args)
+
+ # Then copy the files to the build directory.
+ env = dict(os.environ)
+ if distutils_dir:
+ env['DISTUTILS_DIR'] = distutils_dir
+ subprocess.check_call(['make', '-f', 'Makefile.SpiderMonkey',
+ 'BUILD_OPT=%i' % build_opt] + args, env=env)
+
+class _MyBuild(distutils.command.build.build):
+ def run(self):
+ _runmakefiles(self.build_platlib)
+ distutils.command.build.build.run(self)
+
+class _MyClean(distutils.command.clean.clean):
+ def run(self):
+ _runmakefiles(None, args=['clean'])
+ distutils.command.clean.clean.run(self)
+
if __name__ == '__main__':
if os.name == 'nt':
library = 'js32'
@@ -19,6 +45,10 @@
'javascriptlint/pyspidermonkey/nodepos.c'
]
)
+ cmdclass = {
+ 'build': _MyBuild,
+ 'clean': _MyClean,
+ }
args = {}
args.update(
name = 'javascriptlint',
@@ -26,6 +56,7 @@
author = 'Matthias Miller',
author_email = 'in...@ja...',
url = 'http://www.javascriptlint.com/',
+ cmdclass = cmdclass,
description = 'JavaScript Lint',
ext_modules = [pyspidermonkey],
packages = ['javascriptlint', 'javascriptlint.pyjsl'],
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|