Fix mod_mongo build when no CFLAGS/CXXFLAGS are set in environment
os.environ['CFLAGS'] raises a KeyError if no CFLAGS variable is set in the environment. So instead we use os.environ.get('CFLAGS','') which will return the empty string in the event no CFLAGS variable is set. The previous problematic pattern originated from the suggested code here for importing the build environment in SCons: http://www.scons.org/wiki/FrequentlyAskedQuestions#Why_doesn.27t_SCons_find_my_compiler.2BAC8-linker.2BAC8-etc..3F_I_can_execute_it_just_fine_from_the_command_line. FS-4746 --resolve
This commit is contained in:
parent
99a8052096
commit
b2714cbc30
|
@ -25,8 +25,8 @@ $(MONGO_CXX_DRIVER_SRC):
|
|||
|
||||
$(LIBMONGOCLIENT_A): $(MONGO_CXX_DRIVER_SRC)
|
||||
(cd $(MONGO_CXX_DRIVER_SRC) && \
|
||||
sed -i SConstruct -e "s/Environment()/Environment(ENV = {'PATH' : os.environ['PATH'],'CFLAGS' : os.environ['CFLAGS'],'CXXFLAGS' : os.environ['CXXFLAGS']})/" && \
|
||||
echo "env.Append(PATH=os.environ['PATH'])" >> SConstruct && \
|
||||
sed -i SConstruct -e "s|Environment()|Environment(ENV = {'PATH' : os.environ.get('PATH','/bin:/usr/bin'),'CFLAGS' : os.environ.get('CFLAGS',''),'CXXFLAGS' : os.environ.get('CXXFLAGS','')})|" && \
|
||||
echo "env.Append(PATH=os.environ.get('PATH','/bin:/usr/bin'))" >> SConstruct && \
|
||||
scons)
|
||||
$(TOUCH_TARGET)
|
||||
|
||||
|
|
Loading…
Reference in New Issue