bug 583281, r=khuey: njs should get symlinked into objdir
authorDave Herman <dherman@mozilla.com>
Sun, 01 Aug 2010 22:42:41 -0700
changeset 48800 ceb1f5ebe24992f8f499fb9fec7f8f772bb4d020
parent 48799 fd1faf906f0067bbb687189594489a1d62d0366a
child 48801 c3bc61c0f08311e048ead9369aa6e75d3b9f5c3f
push id14825
push userrsayre@mozilla.com
push dateWed, 04 Aug 2010 07:47:43 +0000
treeherdermozilla-central@c761f8e85b8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs583281
milestone2.0b3pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 583281, r=khuey: njs should get symlinked into objdir
js/src/njs
js/src/shell/Makefile.in
js/src/shell/njs
js/src/tests/narcissus.README
--- a/js/src/shell/Makefile.in
+++ b/js/src/shell/Makefile.in
@@ -36,24 +36,26 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 DEPTH		= ..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
+narcissusdir    = $(topsrcdir)/../narcissus
 
 include $(DEPTH)/config/autoconf.mk
 
 PROGRAM         = js$(BIN_SUFFIX)
 CPPSRCS		= \
   js.cpp \
   jsworkers.cpp \
   $(NULL)
+NJS             = njs
 
 DEFINES         += -DEXPORT_JS_API
 
 LIBS      = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX)
 
 LOCAL_INCLUDES += -I$(topsrcdir) -I..
 
 ifdef _MSC_VER
@@ -72,10 +74,15 @@ include $(topsrcdir)/config/rules.mk
 
 ifdef MOZ_SHARK
 CFLAGS += -F/System/Library/PrivateFrameworks
 CXXFLAGS += -F/System/Library/PrivateFrameworks
 LDFLAGS += -F/System/Library/PrivateFrameworks -framework CHUD
 endif
 
 # People expect the js shell to wind up in the top-level JS dir.
+# The njs script expects to be in the same directory as the js shell as well as
+# narcissus/js*.js.
 libs::
 	$(INSTALL) $(IFLAGS2) $(PROGRAM) $(DEPTH)
+	$(NSINSTALL) -D $(DEPTH)/narcissus
+	$(INSTALL) $(IFLAGS2) $(foreach f,$(wildcard $(narcissusdir)/js*.js),"$f") $(DEPTH)/narcissus
+	$(INSTALL) $(IFLAGS2) $(srcdir)/$(NJS) $(DEPTH)
rename from js/src/njs
rename to js/src/shell/njs
--- a/js/src/njs
+++ b/js/src/shell/njs
@@ -1,24 +1,27 @@
 #!/usr/bin/python
 #
 # Narcissus 'shell' for use with jstests.py
-# This must be run from the js/tests directory
+# Expects to be in the same directory as ./js
+# Expects the Narcissus src files to be in ./narcissus/
 
 import os, re, sys
 from subprocess import *
 from optparse import OptionParser
 
-js_cmd="../js"
-NARC_JS_DIR = "../../narcissus/"
-narc_jsdefs = NARC_JS_DIR + "jsdefs.js"
-narc_jslex = NARC_JS_DIR + "jslex.js"
-narc_jsparse = NARC_JS_DIR + "jsparse.js"
-narc_jsexec = NARC_JS_DIR + "jsexec.js"
+THIS_DIR = os.path.dirname(__file__)
+NARC_JS_DIR = os.path.abspath(os.path.join(THIS_DIR, 'narcissus'))
+
+js_cmd = os.path.abspath(os.path.join(THIS_DIR, "js"))
 
+narc_jsdefs = os.path.join(NARC_JS_DIR, "jsdefs.js")
+narc_jslex = os.path.join(NARC_JS_DIR, "jslex.js")
+narc_jsparse = os.path.join(NARC_JS_DIR, "jsparse.js")
+narc_jsexec = os.path.join(NARC_JS_DIR, "jsexec.js")
 
 
 if __name__ == '__main__':
     op = OptionParser(usage='%prog [TEST-SPECS]')
     op.add_option('-f', '--file', dest='js_files', action='append',
             help='JS file to load', metavar='FILE')
     op.add_option('-e', '--expression', dest='js_exps', action='append',
             help='JS expression to evaluate')
--- a/js/src/tests/narcissus.README
+++ b/js/src/tests/narcissus.README
@@ -1,12 +1,12 @@
-To run narcissus with jstests.py, make sure that js/src/njs is executable.
-Then change to the js/src/tests/ directory and run the following command:
+To run narcissus with jstests.py, change to the js/src/tests/ directory and run
+the following command:
 
-  python jstests.py -d -j 4 ../njs -m narcissus.list
+  python jstests.py -d -j 4 $OBJDIR/njs -m narcissus.list
 
 
 The js/src/tests/narcissus directory can be used for any tweaks that might be needed
 to make Narcissus work properly.  Currently, Narcissus is failing a number of
 tests.  narcissus-failures.txt can be used to ignore those tests.
 
-  python jstests.py -d -j 4 ../njs -m narcissus.list -x narcissus-failures.txt
+  python jstests.py -d -j 4 $OBJDIR/njs -m narcissus.list -x narcissus-failures.txt