From 192c4e57080d122d4c7b161deb021a103a7e3b29 Mon Sep 17 00:00:00 2001 From: Dwight Date: Mon, 9 Feb 2009 17:40:45 -0500 Subject: comments --- client/model.h | 4 ++-- db/jsobj.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/model.h b/client/model.h index 3b565701ff9..3437d3bdd5e 100644 --- a/client/model.h +++ b/client/model.h @@ -25,11 +25,11 @@ namespace mongo { /** Model is a base class for defining objects which are serializable to the Mongo database via the database driver. - *Definition* + Definition Your serializable class should inherit from Model and implement the abstract methods below. - *Loading* + Loading To load, first construct an (empty) object. Then call load(). Do not load an object more than once. */ diff --git a/db/jsobj.h b/db/jsobj.h index b2edb64a2f2..78ea865559e 100644 --- a/db/jsobj.h +++ b/db/jsobj.h @@ -91,8 +91,12 @@ namespace mongo { */ enum BinDataType { Function=1, ByteArray=2, bdtUUID = 3, MD5Type=5, bdtCustom=128 }; - /** Object id's for BSON objects. - When present they should be the first object member added. + /** Object ID type. + BSON objects typically have an _id field for the object id. This field should be the first + member of the object when present. class OID is a special type that is a 12 byte id which + is likely to be unique to the system. You may also use other types for _id's. + When _id field is missing from a BSON object, on an insert the database may insert one + automatically in certain circumstances. */ class OID { union { -- cgit v1.2.1 From 465dac0b1425c66db80641b2b9aed20a552520f5 Mon Sep 17 00:00:00 2001 From: "U-ELIOT-019992DFC\\Administrator" Date: Tue, 10 Feb 2009 10:07:18 -0500 Subject: make windows compile mongod again - strange dep problem still --- SConstruct | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 712e60da88e..4c3d3294ea2 100644 --- a/SConstruct +++ b/SConstruct @@ -130,6 +130,7 @@ nix = False useJavaHome = False linux64 = False darwin = False +windows = False force64 = not GetOption( "force64" ) is None force32 = not GetOption( "force32" ) is None release = not GetOption( "release" ) is None @@ -138,7 +139,10 @@ noOptimization = not GetOption( "noOptimization" ) is None noshell = not GetOption( "noshell" ) is None platform = os.sys.platform -processor = os.uname()[4] +if "uname" in dir(os): + processor = os.uname()[4] +else: + processor = "i386" if force32: processor = "i386" @@ -218,7 +222,15 @@ elif "sunos5" == os.sys.platform: env.Append( CPPDEFINES=[ "__linux__" ] ) elif "win32" == os.sys.platform: + windows = True boostDir = "C:/Program Files/Boost/boost_1_35_0" + + if not os.path.exists( boostDir ): + print( "can't find boost" ) + Exit(1) + + boostLibs = [] + javaHome = findVersion( "C:/Program Files/java/" , [ "jdk" , "jdk1.6.0_10" ] ) winSDKHome = findVersion( "C:/Program Files/Microsoft SDKs/Windows/" , @@ -649,9 +661,13 @@ env.AlwaysBuild( "s3shell" ) def s3dist( env , target , source ): s3push( distFile , "mongo-db" ) -distFile = installDir + ".tgz" env.Append( TARFLAGS=" -z " ) -env.Tar( distFile , installDir ) +if windows: + distFile = installDir + ".zip" + env.Zip( distFile , installDir ) +else: + distFile = installDir + ".tgz" + env.Tar( distFile , installDir ) env.Alias( "dist" , distFile ) env.Alias( "s3dist" , [ "install" , distFile ] , [ s3dist ] ) -- cgit v1.2.1 From 853736071cc020d6ac81fec2059f4373c75ae6a4 Mon Sep 17 00:00:00 2001 From: "U-ELIOT-019992DFC\\Administrator" Date: Tue, 10 Feb 2009 10:48:41 -0500 Subject: include for windows --- client/gridfs.cpp | 5 +++++ tools/Tool.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/client/gridfs.cpp b/client/gridfs.cpp index bd17894f7b2..92e8f79116d 100644 --- a/client/gridfs.cpp +++ b/client/gridfs.cpp @@ -1,9 +1,14 @@ // gridfs.cpp +#include "../stdafx.h" #include #include "gridfs.h" +#if defined(_WIN32) +#include +#endif + #ifndef MIN #define MIN(a,b) ( (a) < (b) ? (a) : (b) ) #endif diff --git a/tools/Tool.h b/tools/Tool.h index 772301fbc29..8f7b2fa76c6 100644 --- a/tools/Tool.h +++ b/tools/Tool.h @@ -6,6 +6,10 @@ #include +#if defined(_WIN32) +#include +#endif + #include "client/dbclient.h" using std::string; -- cgit v1.2.1 From d56a95aa037ed50ce59baf2330fe8ad9b48f700b Mon Sep 17 00:00:00 2001 From: "U-ELIOT-019992DFC\\Administrator" Date: Tue, 10 Feb 2009 10:48:52 -0500 Subject: windows fixes (add .exe to binary names) --- SConstruct | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/SConstruct b/SConstruct index 4c3d3294ea2..0eb23740173 100644 --- a/SConstruct +++ b/SConstruct @@ -260,8 +260,11 @@ elif "win32" == os.sys.platform: return False return True - commonFiles += filter( pcreFilter , Glob( "pcre-7.4/*.c" ) ) - commonFiles += filter( pcreFilter , Glob( "pcre-7.4/*.cc" ) ) + pcreFiles = [] + pcreFiles += filter( pcreFilter , Glob( "pcre-7.4/*.c" ) ) + pcreFiles += filter( pcreFilter , Glob( "pcre-7.4/*.cc" ) ) + commonFiles += pcreFiles + allClientFiles += pcreFiles env.Append( LIBS=Split("ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib" ) ) @@ -473,7 +476,7 @@ env.Program( "mongofiles" , allToolFiles + [ "tools/files.cpp" ] ) env.Program( "mongos" , commonFiles + coreDbFiles + Glob( "dbgrid/*.cpp" ) ) # c++ library -env.Library( "mongoclient" , allClientFiles ) +clientLibName = str( env.Library( "mongoclient" , allClientFiles )[0] ) env.Library( "mongotestfiles" , commonFiles + coreDbFiles + serverOnlyFiles ) clientTests = [] @@ -573,17 +576,23 @@ if distBuild: # binaries -env.Install( installDir + "/bin" , "mongodump" ) -env.Install( installDir + "/bin" , "mongorestore" ) +def installBinary( e , name ): + if windows: + name += ".exe" + env.Install( installDir + "/bin" , name ) -env.Install( installDir + "/bin" , "mongoexport" ) -env.Install( installDir + "/bin" , "mongoimportjson" ) +installBinary( env , "mongodump" ) +installBinary( env , "mongorestore" ) -env.Install( installDir + "/bin" , "mongofiles" ) +installBinary( env , "mongoexport" ) +installBinary( env , "mongoimportjson" ) + +installBinary( env , "mongofiles" ) + +installBinary( env , "mongod" ) -env.Install( installDir + "/bin" , "mongod" ) if not noshell: - env.Install( installDir + "/bin" , "mongo" ) + installBinary( env , "mongo" ) # NOTE: In some cases scons gets confused between installation targets and build # dependencies. Here, we use InstallAs instead of Install to prevent such confusion @@ -594,7 +603,7 @@ for id in [ "", "util/", "db/" , "client/" ]: env.Install( installDir + "/include/mongo/" + id , Glob( id + "*.h" ) ) #lib -env.Install( installDir + "/" + nixLibPrefix, "libmongoclient.a" ) +env.Install( installDir + "/" + nixLibPrefix, clientLibName ) env.Install( installDir + "/" + nixLibPrefix + "/mongo/jars" , Glob( "jars/*" ) ) #final alias @@ -632,7 +641,6 @@ def s3push( localName , remoteName=None , remotePrefix="-latest" , fixName=True import settings s = simples3.S3Bucket( settings.bucket , settings.id , settings.key ) - un = os.uname() if remoteName is None: remoteName = localName -- cgit v1.2.1 From a86d713f233c8f629517acac0668ff99a9c8bb70 Mon Sep 17 00:00:00 2001 From: "U-ELIOT-019992DFC\\Administrator" Date: Tue, 10 Feb 2009 10:54:43 -0500 Subject: binary mode --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 0eb23740173..a7e111cc183 100644 --- a/SConstruct +++ b/SConstruct @@ -657,7 +657,7 @@ def s3push( localName , remoteName=None , remotePrefix="-latest" , fixName=True if platformDir: name = platform + "/" + name - s.put( name , open( localName ).read() , acl="public-read" ); + s.put( name , open( localName , "rb" ).read() , acl="public-read" ); print( "uploaded " + localName + " to http://s3.amazonaws.com/" + s.name + "/" + name ) def s3shellpush( env , target , source ): -- cgit v1.2.1