[SERVER-5614] scons compilation with multiple includes and library pathes Created: 16/Apr/12  Updated: 26/Feb/18  Resolved: 26/Feb/18

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 2.0.2
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Guy Kastenbaum Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Won't Fix Votes: 0
Labels: compilation, scon
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux


Operating System: Linux
Participants:

 Description   

I am compiling mongodb in an environment where I have multiple includes and library pathes.
I had to modify SConstruct to pass these pathes :

before( SConstruct line 253):

if has_option( "libpath" ):
env["LIBPATH"] = [get_option( "cpath" )]

if has_option( "cpppath" ):
env["CPPPATH"] = [get_option( "cpath" )]

after:

if has_option( "cpppath" ):
for x in GetOption( "cpppath" ).split( ":" ):
env.Append( CPPPATH=[ x ] )

if has_option( "libpath" ):
for x in GetOption( "libpath" ).split( ":" ):
env.Append( LIBPATH=[ x ] )

that's all.
It's compiling now with
scons all \
--cpppath=$(echo $CPPFLAGS|sed -e 's/ -I/:/g;s/-I//') \
--libpath=$(echo $LDFLAGS|sed -e 's/ -L/:/g;s/-L//') \

Glad to contribute
Guy



 Comments   
Comment by Guy Kastenbaum [ 17/Apr/12 ]

Oh, doublechecking : maybe you should add these lines before the patch to be a bit cleaner:

env["LIBPATH"] = []
env["CPPPATH"] = []

Generated at Thu Feb 08 03:09:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.