summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <erh@erh1.(none)>2009-04-28 08:47:56 -0400
committerEliot Horowitz <erh@erh1.(none)>2009-04-28 08:47:56 -0400
commit3ca02da7e3d97257a7c914f5f2fc20cd8055c36b (patch)
treeba42b3e630db7df739bd4c8bf1da0845a4030392
parent8a5b5607e0da4b5f4c09de1b7622a83a31bb9c05 (diff)
downloadmongo-3ca02da7e3d97257a7c914f5f2fc20cd8055c36b.tar.gz
easier to compile on ubuntu
-rw-r--r--README2
-rw-r--r--SConstruct14
-rw-r--r--scripting/engine_spidermonkey.cpp4
3 files changed, 18 insertions, 2 deletions
diff --git a/README b/README
index 12ca75d8d23..54766bdca2e 100644
--- a/README
+++ b/README
@@ -86,3 +86,5 @@ COMPILING
db\db run
+--- ubuntu ---
+ scons libboost-dev libpcre++-dev libmozjs-dev
diff --git a/SConstruct b/SConstruct
index d16117956ff..902bedef48d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -193,6 +193,7 @@ serverOnlyFiles += [ "scripting/engine.cpp" ]
if usesm:
serverOnlyFiles += [ "scripting/engine_spidermonkey.cpp" ]
+ nojni = True
elif not nojni:
serverOnlyFiles += [ "scripting/engine_java.cpp" ]
else:
@@ -242,7 +243,7 @@ def findVersion( root , choices ):
def choosePathExist( choices , default=None):
for c in choices:
- if os.path.exists( c ):
+ if c != None and os.path.exists( c ):
return c
return default
@@ -428,6 +429,13 @@ def setupBuildInfoFile( outFile ):
setupBuildInfoFile( "buildinfo.cpp" )
+def bigLibString( myenv ):
+ s = str( myenv["LIBS"] )
+ if 'SLIBS' in myenv._dict:
+ s += str( myenv["SLIBS"] )
+ return s
+
+
def doConfigure( myenv , needJava=True , needPcre=True , shell=False ):
conf = Configure(myenv)
myenv["LINKFLAGS_CLEAN"] = list( myenv["LINKFLAGS"] )
@@ -513,7 +521,9 @@ def doConfigure( myenv , needJava=True , needPcre=True , shell=False ):
myenv["_HAVEPCAP"] = myCheckLib( "pcap", staticOnly=release )
if usesm:
- myCheckLib( "js" , True )
+ myCheckLib( [ "js" , "mozjs" ] , True )
+ if bigLibString(myenv).find( "mozjs" ) >= 0:
+ myenv.Append( CPPDEFINES=[ "MOZJS" ] )
if shell:
haveReadLine = False
diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp
index 7c7e86b0818..d6793c779f7 100644
--- a/scripting/engine_spidermonkey.cpp
+++ b/scripting/engine_spidermonkey.cpp
@@ -8,7 +8,11 @@
#define XP_UNIX
#endif
+#ifdef MOZJS
+#include "mozjs/jsapi.h"
+#else
#include "js/jsapi.h"
+#endif
namespace mongo {