cxx driver - mongodb

100 views
Skip to first unread message

Waitman Gobble

unread,
May 19, 2012, 3:25:14 AM5/19/12
to mongodb-user
Hi,

Please add --cc, --cxx and --clang to SConstruct.

Like the example I have below.

Thanks,

Waitman Gobble
San Jose, California USA



# diff -c SConstruct ../bu-mongo-cxx-driver-nightly/SConstruct
*** SConstruct Fri Apr 13 02:21:05 2012
--- ../bu-mongo-cxx-driver-nightly/SConstruct Sat May 19 00:21:31 2012
***************
*** 13,18 ****
--- 13,24 ----
action="store",
help="comma separated list of add'l paths (--extrapath /opt/foo/,/foo) static linking")

+ AddOption( "--cxx", dest="cxx", type="string", nargs=1, action="store", default="g++",help="use an alternate C++ compiler" )
+
+ AddOption( "--cc", dest="cc", type="string", nargs=1, action="store", default="gcc",help="use an alternate C Compiler" )
+
+ AddOption( "--clang", dest="clang", type="string", nargs=1, action="store", default="1", help="use the clang compiler for C and C++" )
+
AddOption("--prefix",
dest="prefix",
type="string",
***************
*** 30,35 ****
--- 36,42 ----
MSVS_ARCH=None,
PYTHON=sys.executable)

+
def addExtraLibs(s):
for x in s.split(","):
if os.path.exists(x):
***************
*** 39,44 ****
--- 46,61 ----
if GetOption( "extrapath" ) is not None:
addExtraLibs( GetOption( "extrapath" ) )

+ if GetOption( "cxx" ):
+ env["CXX"] = GetOption( "cxx" )
+
+ if GetOption( "cc" ):
+ env["CC"] = GetOption( "cc" )
+
+ if GetOption("clang"):
+ env["CC"] = 'clang'
+ env["CXX"] = 'clang++'
+
env.Prepend(CPPPATH=["$BUILD_DIR", "$BUILD_DIR/mongo"])
env.Append(CPPDEFINES=[ "_SCONS", "MONGO_EXPOSE_MACROS" ])


Jenna

unread,
May 21, 2012, 11:51:33 AM5/21/12
to mongodb-user
Thanks for your post. You can register as a mongodb contributor by
signing the contributor agreement - http://www.10gen.com/contributor -
after which you'll be able to issue pull requests to the appropriate
mongodb github repository.

Waitman Gobble

unread,
May 21, 2012, 12:44:48 PM5/21/12
to mongod...@googlegroups.com
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

ok, cool. thanks!
 
Waitman Gobble
San Jose California USA
 

Waitman Gobble

unread,
May 21, 2012, 11:06:39 PM5/21/12
to mongod...@googlegroups.com
On Mon, May 21, 2012 at 9:44 AM, Waitman Gobble <gobb...@gmail.com> wrote:
On Mon, May 21, 2012 at 8:51 AM, Jenna <jenna.de...@10gen.com> wrote:
Thanks for your post.  You can register as a mongodb contributor by
signing the contributor agreement - http://www.10gen.com/contributor -
after which you'll be able to issue pull requests to the appropriate
mongodb github repository.

 ok, cool. thanks!
 

Hi Jenna,

I was able to get back to this project, I did it a little different than my original change though, decided to change the Scons construction variables based on environment variable existence (ie, CXX, LDFLAGS). This seems to make it a little easier to build on BSD/Unix machines, especially getting though the boost lib check.


for example

# setenv CXX g++46
# setenv LDFLAGS "-L/usr/local/lib/gcc46 -L/usr/local/lib"
# scons

(check config.log)
...
g++46 -o .sconf_temp/conftest_1 -L/usr/local/lib/gcc46 -L/usr/local/lib .sconf_temp/conftest_1.o -lboost_thread
scons: Configure: yes
...


here's the update



Thanks,
Reply all
Reply to author
Forward
0 new messages