mongodb-2.4.4-fix-sharedclient.patch 5.37 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
index c026ce9..bbd900c 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
@@ -452,7 +452,7 @@
 env.Library('stacktrace', 'util/stacktrace.cpp')
 
 env.Program('lame_stacktrace_test', 'util/lame_stacktrace_test.cpp',
-            LIBDEPS=['stacktrace',
+            LIBDEPS=['stacktrace', 'foundation', 'mongocommon', 'alltools',
                      '$BUILD_DIR/mongo/base/base'])
 
 serverOnlyFiles += mmapFiles
@@ -654,10 +654,6 @@
                                        "defaultversion",
                                        "gridfs",
                                        "notmongodormongos"])
-env.Library("allclient", "client/clientOnly.cpp", LIBDEPS=["clientandshell"])
-
-if has_option( "sharedclient" ):
-    sharedClientLibName = str( env.SharedLibrary( "mongoclient", [], LIBDEPS=["allclient"] )[0] )
 
 # dbtests test binary
 env.StaticLibrary('testframework', ['dbtests/framework.cpp'], LIBDEPS=['unittest/unittest'])
@@ -806,12 +802,6 @@
         env.Install( "$INSTALL_DIR/include/" + id, Glob( id + "*.h" ) )
         env.Install( "$INSTALL_DIR/include/" + id, Glob( id + "*.hpp" ) )
 
-#lib
-if installSetup.libraries:
-    env.Install('$INSTALL_DIR/$NIX_LIB_DIR', '#${LIBPREFIX}mongoclient${LIBSUFFIX}')
-    if has_option( "sharedclient" ):
-        env.Install( "$INSTALL_DIR/$NIX_LIB_DIR",  '#${SHLIBPREFIX}mongoclient${SHLIBSUFFIX}')
-
 # Stage the top-level mongodb banners
 distsrc = env.Dir('#distsrc')
 env.Append(MODULE_BANNERS = [distsrc.File('README'),
@@ -842,8 +832,8 @@
     '#/${SERVER_ARCHIVE}',
     ['#buildscripts/make_archive.py'] + env["MODULE_BANNERS"] + distBinaries,
     ' '.join(['$PYTHON ${SOURCES[0]} -o $TARGET'] + module_banner_transforms + [
-            '--transform ${str(Dir(BUILD_DIR))}/mongo/stripped=$SERVER_DIST_BASENAME/bin',
-            '--transform ${str(Dir(BUILD_DIR))}/mongo=$SERVER_DIST_BASENAME/bin',
+            '--transform "${str(Dir(BUILD_DIR))}/mongo/stripped=$SERVER_DIST_BASENAME/bin"',
+            '--transform "${str(Dir(BUILD_DIR))}/mongo=$SERVER_DIST_BASENAME/bin"',
             '${TEMPFILE(SOURCES[1:])}']))
 
 #final alias
diff --git a/src/SConscript.client b/src/SConscript.client
index b88a54f..a15bbb3 100644
--- a/src/SConscript.client
+++ b/src/SConscript.client
@@ -4,6 +4,7 @@
 # programs.
 
 Import('env clientEnv')
+Import("has_option")
 
 env.Command(['mongo/base/error_codes.h', 'mongo/base/error_codes.cpp',],
             ['mongo/base/generate_error_codes.py', 'mongo/base/error_codes.err'],
@@ -36,7 +37,6 @@ clientSourceBasic = [
     'mongo/client/dbclient.cpp',
     'mongo/client/dbclient_rs.cpp',
     'mongo/client/dbclientcursor.cpp',
-    'mongo/client/distlock.cpp',
     'mongo/client/gridfs.cpp',
     'mongo/client/model.cpp',
     'mongo/client/sasl_client_authenticate.cpp',
@@ -83,7 +83,6 @@ clientSourceBasic = [
     'mongo/util/timer.cpp',
     'mongo/util/trace.cpp',
     'mongo/util/util.cpp',
-    'mongo/util/version.cpp',
     ]
 
 clientSourceSasl = ['mongo/client/sasl_client_authenticate_impl.cpp',
@@ -93,6 +92,7 @@ clientSourceAll = clientSourceBasic + clientSourceSasl
 
 if env['MONGO_BUILD_SASL_CLIENT']:
     clientSource = clientSourceAll
+    env.Append(LIBS="sasl2")
 else:
     clientSource = clientSourceBasic
 
@@ -133,16 +133,18 @@ for path in clientHeaderDirectories:
     clientHeaders.extend(Glob('mongo/%s/*.h' % path))
     clientHeaders.extend(Glob('mongo/%s/*.hpp' % path))
 
-mongoclient_lib = env.Library('mongoclient', clientSource),
-mongoclient_install = env.Install('#/', [
-        mongoclient_lib,
-        #env.SharedLibrary('mongoclient', clientSource),
-        ])
+
+mongoclient_libs = [ env.Library('mongoclient', clientSource) ]
+if has_option( "sharedclient" ):
+   mongoclient_libs.append( env.SharedLibrary('mongoclient', clientSource) )
+
+mongoclient_install = env.Install('#/', mongoclient_libs)
+
 env.Alias('mongoclient', mongoclient_install)
 
 clientTests = clientEnv.Install('#/', [
         clientEnv.Program(target,
-                          [source, mongoclient_lib]) for (target, source) in exampleSourceMap])
+                          [source, mongoclient_libs[-1]]) for (target, source) in exampleSourceMap])
 
 clientTests.append(
     clientEnv.Install('#/', clientEnv.Program('bsondemo', 'mongo/bson/bsondemo/bsondemo.cpp')))
@@ -168,16 +170,18 @@
                  'mongo/bson/bsondemo/bsondemo.cpp',
                  ],
                 '${PYTHON} ${SOURCES[0]} -o $TARGET '
-                '--transform ${str(Dir(BUILD_DIR))}/client_build=$CLIENT_DIST_BASENAME/src '
-                '--transform ${str(Dir(BUILD_DIR))}=$CLIENT_DIST_BASENAME/src '
-                '--transform distsrc/client=$CLIENT_DIST_BASENAME '
-                '--transform =$CLIENT_DIST_BASENAME/ '
+                '--transform "${str(Dir(BUILD_DIR))}/client_build=$CLIENT_DIST_BASENAME/src" '
+                '--transform "${str(Dir(BUILD_DIR))}=$CLIENT_DIST_BASENAME/src" '
+                '--transform "distsrc/client=$CLIENT_DIST_BASENAME" '
+                '--transform "=$CLIENT_DIST_BASENAME/" '
                 '${TEMPFILE(SOURCES[1:])}'))
 
 # install
 prefix = GetOption("prefix")
 
 env.Install(prefix + "/lib", '${LIBPREFIX}mongoclient${LIBSUFFIX}')
+if has_option( "sharedclient" ):
+   env.Install(prefix + "/lib", '${SHLIBPREFIX}mongoclient${SHLIBSUFFIX}')
 
 for x in clientHeaderDirectories:
     inst = env.Install(prefix + "/include/mongo/" + x,