1 Star 0 Fork 624

york yuan/SequoiaDB

forked from SequoiaDB/SequoiaDB 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
SConstruct 22.71 KB
一键复制 编辑 原始数据 按行查看 历史
Tao Wang 提交于 2014-12-17 16:56 . Revision: 16585
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
# -*- mode: python; -*-
# build file for SequoiaDB
# this requires scons
# you can get from http://www.scons.org
# then just type scons
# some common tasks
# build 64-bit mac and pushing to s3
# scons --64 s3dist
# This file, SConstruct, configures the build environment, and then delegates to
# several, subordinate SConscript files, which describe specific build rules.
EnsureSConsVersion( 1, 1, 0 )
import platform
import os
import sys
import imp
import types
import re
import shutil
import urllib
import urllib2
import stat
from os.path import join, dirname, abspath
import libdeps
root_dir = dirname(File('SConstruct').rfile().abspath)
db_dir = join(root_dir,'SequoiaDB')
engine_dir = join(db_dir,'engine')
thirdparty_dir = join(root_dir, 'thirdparty')
boost_dir = join(thirdparty_dir, 'boost')
boost_lib_dir = join(boost_dir, 'lib')
parser_dir = join(thirdparty_dir, 'parser' )
sm_dir = join(parser_dir, 'sm')
js_dir = join(sm_dir, 'js')
pcre_dir = join(engine_dir,'pcre')
ssh2_dir = join(engine_dir,'ssh2')
crypto_dir = join(thirdparty_dir, 'crypto')
ssl_dir = join(crypto_dir, 'openssl-1.0.1c')
gtest_dir = join(engine_dir,'gtest')
ncursesinclude_dir = join(engine_dir, 'ncurses/include')
driver_dir = join(db_dir,'driver')
java_dir = join(root_dir,'java')
# --- options ----
options = {}
options_topass = {}
def GuessOS():
id = platform.system()
if id == 'Linux':
return 'linux'
elif id == 'Windows' or id == 'Microsoft':
return 'win32'
else:
return None
def GuessArch():
id = platform.machine()
id = id.lower()
if (not id) or (not re.match('(x|i[3-6])86$', id) is None):
return 'ia32'
elif id == 'i86pc':
return 'ia32'
elif id == 'x86_64':
return 'ia64'
elif id == 'amd64':
return 'ia64'
elif id == 'ppc64':
return 'ppc64'
else:
return None
# guess the operating system and architecture
guess_os = GuessOS()
guess_arch = GuessArch()
# helper function, add options
# name: name of the parameter
# nargs: number of args for the parameter
# contibutesToVariantDir: whether the param is part of variant dir
def add_option( name, help , nargs , contibutesToVariantDir , dest=None ):
if dest is None:
dest = name
AddOption( "--" + name ,
dest=dest,
type="string",
nargs=nargs,
action="store",
help=help )
options[name] = { "help" : help ,
"nargs" : nargs ,
"contibutesToVariantDir" : contibutesToVariantDir ,
"dest" : dest }
def get_option( name ):
return GetOption( name )
def _has_option( name ):
x = get_option( name )
if x is None:
return False
if x == False:
return False
if x == "":
return False
return True
def has_option( name ):
x = _has_option(name)
if name not in options_topass:
# if someone already set this, don't overwrite
options_topass[name] = x
return x
def get_variant_dir():
a = []
for name in options:
o = options[name]
if not has_option( o["dest"] ):
continue
# let's skip the param if it's not part of variant dir
if not o["contibutesToVariantDir"]:
continue
if o["nargs"] == 0:
a.append( name )
else:
x = get_option( name )
x = re.sub( "[,\\\\/]" , "_" , x )
a.append( name + "_" + x )
s = "#build/${PYSYSPLATFORM}/"
if len(a) > 0:
a.sort()
s += "/".join( a ) + "/"
else:
s += "normal/"
return s
# build options
add_option( "all", "build engine/tools/testcases/shell/client/fmp", 0, False)
add_option( "engine", "build engine", 0, False)
add_option( "tool", "build tools", 0, False)
add_option( "testcase", "build testcases", 0, False)
add_option( "shell", "build shell", 0, False)
add_option( "client", "build C/C++ clients", 0, False)
add_option( "fmp", "build fmp", 0, False)
# language could be en or cn
add_option( "language" , "description language" , 1 , False )
# linking options
add_option( "release" , "release build" , 0 , True )
# dev options
add_option( "dd", "debug build no optimization" , 0 , True , "debugBuild" )
add_option( "noscreenout", "do not send anything to screen", 0, True )
# don't run configure if user calls --help
if GetOption('help'):
Return()
# --- environment setup ---
variantDir = get_variant_dir()
clientCppVariantDir = variantDir + "clientcpp"
clientCVariantDir = variantDir + "clientc"
shellVariantDir = variantDir + "shell"
toolVariantDir = variantDir + "tool"
fmpVariantDir = variantDir + "fmp"
driverDir = variantDir + "driver"
def printLocalInfo():
import sys, SCons
print( "scons version: " + SCons.__version__ )
print( "python version: " + " ".join( [ `i` for i in sys.version_info ] ) )
printLocalInfo()
boostLibs = [ "thread" , "filesystem", "program_options", "system" ]
nix = False
linux = False
linux64 = False
windows = False
release = True
debugBuild = False
release = has_option( "release" )
# get whether we are using debug build
debugBuild = has_option( "debugBuild" )
# if neither release/debugBuild specified, by default using release
# if both release/debugBuild specified, by defaul use debugBuild
if not release and not debugBuild:
release = True
debugBuild = False
elif release and debugBuild:
release = False
debugBuild = True
env = Environment( BUILD_DIR=variantDir,
tools=["default", "gch", "mergelib" ],
PYSYSPLATFORM=os.sys.platform,
)
libdeps.setup_environment( env )
if env['PYSYSPLATFORM'] == 'linux3':
env['PYSYSPLATFORM'] = 'linux2'
if os.sys.platform == 'win32':
env['OS_FAMILY'] = 'win'
else:
env['OS_FAMILY'] = 'posix'
if env['PYSYSPLATFORM'] == 'linux2':
env['LINK_LIBGROUP_START'] = '-Wl,--start-group'
env['LINK_LIBGROUP_END'] = '-Wl,--end-group'
env['RELOBJ_LIBDEPS_START'] = '--whole-archive'
env['RELOBJ_LIBDEPS_END'] = '--no-whole-archive'
env['RELOBJ_LIBDEPS_ITEM'] = ''
env["LIBPATH"] = []
if has_option( "noscreenout" ):
env.Append( CPPDEFINES=[ "_NOSCREENOUT" ] )
hasEngine = has_option( "engine" )
hasClient = has_option( "client" )
hasTestcase = has_option( "testcase" )
hasTool = has_option( "tool" )
hasShell = has_option( "shell" )
hasFmp = has_option("fmp")
hasAll = has_option( "all" )
# if everything are set, let's set everything to true
if hasAll:
hasEngine = True
hasClient = True
hasTestcase = True
hasTool = True
hasShell = True
hasFmp = True
# if nothing specified, let's use engine+client+shell by default
elif not ( hasEngine or hasClient or hasTestcase or hasTool or hasShell or hasFmp ):
hasEngine = True
hasClient = True
hasShell = True
boostCompiler = ""
boostVersion = ""
usesm = True
extraLibPlaces = []
env['EXTRACPPPATH'] = []
env['EXTRALIBPATH'] = []
class InstallSetup:
binaries = False
clientSrc = False
headers = False
bannerFiles = tuple()
headerRoot = "include"
def __init__(self):
self.default()
def default(self):
self.binaries = True
self.libraries = False
self.clientSrc = False
self.headers = False
self.bannerFiles = tuple()
self.headerRoot = "include"
self.clientTestsDir = None
def justClient(self):
self.binaries = False
self.libraries = False
self.clientSrc = True
self.headers = True
self.bannerFiles = [ "#distsrc/client/LICENSE.txt",
"#distsrc/client/SConstruct" ]
self.headerRoot = ""
installSetup = InstallSetup()
# ---- other build setup -----
platform = os.sys.platform
if "uname" in dir(os):
processor = os.uname()[4]
else:
processor = "i386"
env['PROCESSOR_ARCHITECTURE'] = processor
DEFAULT_INSTALL_DIR = "/opt/sequoiadb"
installDir = DEFAULT_INSTALL_DIR
nixLibPrefix = "lib"
def findVersion( root , choices ):
if not isinstance(root, list):
root = [root]
for r in root:
for c in choices:
if ( os.path.exists( r + c ) ):
return r + c
raise RuntimeError("can't find a version of [" + repr(root) + "] choices: " + repr(choices))
# add database include, boost include here
hdfsJniPath = ""
hdfsJniMdPath = ""
if guess_os == "linux":
if guess_arch == "ia32":
hdfsJniPath = join(java_dir,"jdk_linux32/include")
hdfsJniMdPath = join(java_dir,"jdk_linux32/include/linux")
elif guess_arch == "ia64":
hdfsJniPath = join(java_dir,"jdk_linux64/include")
hdfsJniMdPath = join(java_dir,"jdk_linux64/include/linux")
elif guess_arch == "ppc64":
hdfsJniPath = join(java_dir,"jdk_ppclinux64/include")
hdfsJniMdPath = join(java_dir,"jdk_ppclinux64/include/linux")
elif guess_os == "win32":
if guess_arch == "ia32":
hdfsJniPath = join(java_dir,"jdk_win32/include")
hdfsJniMdPath = join(java_dir,"jdk_win32/include/win32")
elif guess_arch == "ia64":
hdfsJniPath = join(java_dir,"jdk_win64/include")
hdfsJniMdPath = join(java_dir,"jdk_win64/include/win32")
env.Append( CPPPATH=[join(engine_dir,'include'),join(engine_dir,'client'),join(ssl_dir,'include'),join(gtest_dir,'include'),pcre_dir, boost_dir, ssh2_dir, hdfsJniPath, hdfsJniMdPath] )
env.Append( CPPDEFINES=["__STDC_LIMIT_MACROS", "HAVE_CONFIG_H"] )
env.Append( CPPDEFINES=[ "SDB_DLL_BUILD" ] )
# specify dependent libraries for javascript engine and boost
if guess_os == "linux":
linux = True
platform = "linux"
# -lm
env.Append( LIBS=['m'] )
# -ldl
env.Append( LIBS=['dl'] )
# -lpthread
env.Append( LIBS=["pthread"] )
# GNU
env.Append( CPPDEFINES=[ "_GNU_SOURCE" ] )
# 64 bit linux
if guess_arch == "ia64":
linux64 = True
nixLibPrefix = "lib64"
boost_lib_dir = join(boost_lib_dir,'linux64')
env.Append( EXTRALIBPATH="/lib64" )
# use project-related boost library
env.Append( EXTRALIBPATH=boost_lib_dir )
# use project-related ssl library
env.Append( EXTRALIBPATH=join(ssl_dir,'lib/linux64') )
# use project-related spidermonkey library
if usesm:
if debugBuild:
smlib_dir = join(js_dir,'lib/debug/linux64/lib')
env.Append( CPPPATH=join(js_dir,'lib/debug/linux64/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
else:
smlib_dir = join(js_dir,'lib/release/linux64/lib')
env.Append( CPPPATH=join(js_dir,'lib/release/linux64/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
ssllib_dir = join(ssl_dir,'lib/linux64')
# in case for 32 bit linux or compiling 32 bit in 64 env
elif guess_arch == "ia32":
linux64 = False
nixLibPrefix = "lib"
boost_lib_dir = join(boost_lib_dir,'linux32')
env.Append( EXTRALIBPATH="/lib" )
# we want 32 bit boost library
env.Append( EXTRALIBPATH=boost_lib_dir )
# use project-related ssl library
env.Append( EXTRALIBPATH=join(ssl_dir,'lib/linux32') )
# and 32 bit spidermonkey library
if usesm:
if debugBuild:
smlib_dir = join(js_dir,'lib/debug/linux32/lib')
env.Append( CPPPATH=join(js_dir,'lib/debug/linux32/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
else:
smlib_dir = join(js_dir,'lib/release/linux32/lib')
env.Append( CPPPATH=join(js_dir,'lib/release/linux32/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
# if we are in 64 bit box but want to build 32 bit release
ssllib_dir = join(ssl_dir,'lib/linux32')
# power pc linux
elif guess_arch == "ppc64":
linux64 = True
nixLibPrefix = "lib64"
boost_lib_dir = join(boost_lib_dir,'ppclinux64')
# use big endian
env.Append( CPPDEFINES=[ "SDB_BIG_ENDIAN" ] )
#env.Append( EXTRALIBPATH="/usr/lib64" )
env.Append( EXTRALIBPATH="/lib64" )
# use project-related boost library
env.Append( EXTRALIBPATH=boost_lib_dir )
# use project-related ssl library
env.Append( EXTRALIBPATH=join(ssl_dir,'lib/ppclinux64') )
# use project-related spidermonkey library
if usesm:
if debugBuild:
smlib_dir = join(js_dir,'lib/debug/ppclinux64/lib')
env.Append( CPPPATH=join(js_dir,'lib/debug/ppclinux64/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
else:
smlib_dir = join(js_dir,'lib/release/ppclinux64/lib')
env.Append( CPPPATH=join(js_dir,'lib/release/ppclinux64/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
ssllib_dir = join(ssl_dir,'lib/ppclinux64')
# spider monkey
if usesm:
smlib_file = join(smlib_dir, 'libmozjs185.so')
env.Append( CPPDEFINES=[ "XP_UNIX" ] )
env.Append( LIBS=['js_static'] )
# SSL
env.Append( LIBS=['crypto'] )
ssllib_file = join(ssllib_dir, 'libcrypto.a')
ssllib_file1 = join(ssllib_dir, 'libcrypto.a')
nix = True
elif "win32" == guess_os:
# when building windows
windows = True
# check VC compiler
for pathdir in env['ENV']['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(pathdir, 'cl.exe')):
print( "found visual studio at " + pathdir )
break
else:
#use current environment
env['ENV'] = dict(os.environ)
# if we are 64 bit
if guess_arch == "ia64":
boost_lib_dir = join(boost_lib_dir,'win64')
# use 64 bit boost library
env.Append( EXTRALIBPATH=boost_lib_dir )
# use project-related ssl library
env.Append( EXTRALIBPATH=join(ssl_dir,'lib/win64') )
# use 64 bit spidermonkey
if usesm:
if debugBuild:
smlib_dir = join(js_dir,'lib/debug/win64/lib')
env.Append( CPPPATH=join(js_dir,'lib/debug/win64/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
else:
smlib_dir = join(js_dir,'lib/release/win64/lib')
env.Append( CPPPATH=join(js_dir,'lib/release/win64/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
ssllib_dir = join(ssl_dir,'lib/win64')
else:
boost_lib_dir = join(boost_lib_dir,'win32')
# we are 32 bit
env.Append( EXTRALIBPATH=boost_lib_dir )
# use project-related ssl library
env.Append( EXTRALIBPATH=join(ssl_dir,'lib/win32') )
if usesm:
if debugBuild:
smlib_dir = join(js_dir,'lib/debug/win32/lib')
env.Append( CPPPATH=join(js_dir,'lib/debug/win32/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
else:
smlib_dir = join(js_dir,'lib/release/win32/lib')
env.Append( CPPPATH=join(js_dir,'lib/release/win32/include') )
env.Append( EXTRALIBPATH=[smlib_dir] )
ssllib_dir = join(ssl_dir,'lib/win32')
if usesm:
smlib_file = join(smlib_dir, 'mozjs185-1.0.dll')
env.Append( CPPDEFINES=[ "XP_WIN" ] )
env.Append( LIBS=['mozjs185-1.0'] )
env.Append( CPPDEFINES=["JS_HAVE_STDINT_H"] )
# SSL
env.Append( LIBS=['libeay32'] )
ssllib_file = join(ssllib_dir, 'libeay32.dll')
ssllib_file1 = join(ssllib_dir, 'ssleay32.dll')
# UNICODE
env.Append( CPPDEFINES=[ "_UNICODE" ] )
env.Append( CPPDEFINES=[ "UNICODE" ] )
# find windows SDK
winSDKHome = findVersion( [ "C:/Program Files/Microsoft SDKs/Windows/", "C:/Program Files (x86)/Microsoft SDKs/Windows/" ] ,
[ "v7.1", "v7.0A", "v7.0", "v6.1", "v6.0a", "v6.0" ] )
print( "Windows SDK Root '" + winSDKHome + "'" )
env.Append( EXTRACPPPATH=[ winSDKHome + "/Include" ] )
env.Append( CPPFLAGS=" /EHsc /W3 " )
env.Append( CPPFLAGS=" /wd4355 /wd4800 /wd4267 /wd4244 /wd4200 " )
env.Append( CPPDEFINES=["_CONSOLE","_CRT_SECURE_NO_WARNINGS","PSAPI_VERSION=1","_CRT_RAND_S" ] )
if release:
env.Append( CPPDEFINES=[ "NDEBUG" ] )
env.Append( CPPFLAGS= " /O2 /Gy " )
env.Append( CPPFLAGS= " /MT /Zi /errorReport:none " )
env.Append( CPPFLAGS= " /GL " )
env.Append( LINKFLAGS=" /LTCG " )
env.Append( LINKFLAGS=" /DEBUG " )
else:
env.Append( CPPFLAGS=" /RTC1 /MDd /Z7 /errorReport:none " )
if debugBuild:
env.Append( LINKFLAGS=" /debug " )
env.Append( CPPFLAGS=" /Od " )
env.Append( CPPDEFINES=[ "_DEBUG" ] )
if guess_arch == "ia64":
env.Append( EXTRALIBPATH=[ winSDKHome + "/Lib/x64" ] )
else:
env.Append( EXTRALIBPATH=[ winSDKHome + "/Lib" ] )
if release:
env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT " )
else:
env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRT " )
winLibString = "ws2_32.lib kernel32.lib advapi32.lib Psapi.lib"
winLibString += " user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib "
winLibString += " odbc32.lib odbccp32.lib uuid.lib dbghelp.lib "
env.Append( LIBS=Split(winLibString) )
else:
print( "No special config for [" + os.sys.platform + "] which probably means it won't work" )
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
if nix:
env.Append( CPPFLAGS="-fPIC -fno-strict-aliasing -ggdb -pthread -Wno-write-strings -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Wno-address" )
if linux:
env.Append( CPPFLAGS=" -pipe " )
env.Append( CPPFLAGS=" -fno-builtin-memcmp " )
env.Append( CPPDEFINES="_FILE_OFFSET_BITS=64" )
env.Append( CXXFLAGS=" -Wnon-virtual-dtor " )
env.Append( LINKFLAGS=" -fPIC -pthread -rdynamic" )
env.Append( LIBS=[] )
env['ENV']['HOME'] = os.environ['HOME']
env['ENV']['TERM'] = os.environ['TERM']
if debugBuild:
env.Append( CPPFLAGS=" -O0 -fstack-protector " );
env['ENV']['GLIBCXX_FORCE_NEW'] = 1;
env.Append( CPPFLAGS=" -D_DEBUG" );
else:
env.Append( CPPFLAGS=" -O3 " )
try:
umask = os.umask(022)
except OSError:
pass
env.Append( CPPPATH=env["EXTRACPPPATH"], LIBPATH=env["EXTRALIBPATH"])
# --- check system ---
def getSysInfo():
if windows:
return "windows " + str( sys.getwindowsversion() )
else:
return " ".join( os.uname() )
clientCppEnv = env.Clone()
clientCppEnv.Append( CPPDEFINES=[ "SDB_DLL_BUILD" ] )
clientCEnv = clientCppEnv.Clone()
clientCppEnv["BUILD_DIR"] = clientCppVariantDir
clientCEnv["BUILD_DIR"] = clientCVariantDir
# --- append boost library to env ---
if nix:
for b in boostLibs:
env.Append ( _LIBFLAGS='${SLIBS}',
SLIBS=" " + join(boost_lib_dir,"libboost_" + b + ".a") )
testEnv = env.Clone()
testEnv.Append( CPPPATH=["../"] )
shellEnv = None
shellEnv = env.Clone();
toolEnv = None
toolEnv = env.Clone() ;
fmpEnv = None
fmpEnv = env.Clone() ;
if windows:
shellEnv.Append( LIBS=["winmm.lib"] )
#env.Append( CPPFLAGS=" /TP " )
# add engine and client variable
env.Append( CPPDEFINES=[ "SDB_ENGINE" ] )
clientCppEnv.Append( CPPDEFINES=[ "SDB_CLIENT" ] )
clientCEnv.Append( CPPDEFINES=[ "SDB_CLIENT" ] )
# should we use engine or client for test env? not sure, let's put client for now
testEnv.Append( CPPDEFINES=[ "SDB_CLIENT" ] )
shellEnv.Append( CPPDEFINES=[ "SDB_CLIENT" ] )
shellEnv.Append( CPPDEFINES=[ "SDB_SHELL" ] )
toolEnv.Append( CPPDEFINES=[ "SDB_CLIENT" ] )
toolEnv.Append( CPPDEFINES=[ "SDB_TOOL" ] )
toolEnv.Append( CPPPATH=[ncursesinclude_dir] )
fmpEnv.Append( CPPDEFINES=[ "SDB_FMP" ] )
fmpEnv.Append( CPPDEFINES=[ "SDB_CLIENT" ] )
env['INSTALL_DIR'] = installDir
if testEnv is not None:
testEnv['INSTALL_DIR'] = installDir
if shellEnv is not None:
shellEnv['INSTALL_DIR'] = installDir
if clientCppEnv is not None:
clientCppEnv['INSTALL_DIR'] = installDir
if clientCEnv is not None:
clientCEnv['INSTALL_DIR'] = installDir
if fmpEnv is not None:
fmpEnv['INSTALL_DIR'] = installDir
# The following symbols are exported for use in subordinate SConscript files.
# Ideally, the SConscript files would be purely declarative. They would only
# import build environment objects, and would contain few or no conditional
# statements or branches.
#
# Currently, however, the SConscript files do need some predicates for
# conditional decision making that hasn't been moved up to this SConstruct file,
# and they are exported here, as well.
Export("env")
Export("shellEnv")
Export("toolEnv")
Export("testEnv")
Export("fmpEnv")
Export("clientCppEnv")
Export("clientCEnv")
Export("installSetup getSysInfo")
Export("usesm")
Export("windows linux nix")
if usesm:
Export("smlib_file")
Export("ssllib_file")
Export("ssllib_file1")
Export("hasEngine")
Export("hasTestcase")
Export("hasTool")
Export("driverDir")
Export("guess_os")
# Generating Versioning information
# In order to change the file location, we have to modify both win32 and linux
# ossVer_Autogen.h is NOT in SVN, we have to generate this file by scons before
# actually compling the project
# Thus, we should avoid putting ossVer* files to release package
#
# In github build, we don't have svn info, so we don't run svn or SubWCRev
# command. Instead the svn fork tool should already generated the right
# ossVer_Autogen.h file
if not os.path.isfile ( "gitbuild" ):
if guess_os == "win32":
# In windows platform, we take advantage of SubWCRev
os.system ("SubWCRev . misc/autogen/ossVer.tmp SequoiaDB/engine/include/ossVer_Autogen.h")
else:
# In NIX platform, we use svn and sed to send to ossVer_Autogen.h
os.system("sed \"s/WCREV/$(svn info | grep Revision | awk '{print $2}')/g\" misc/autogen/ossVer.tmp > oss.tmp")
os.system("sed 's/\$//g' oss.tmp > SequoiaDB/engine/include/ossVer_Autogen.h")
language = get_option ( "language" )
if language is None:
os.system ( "scons -C misc/autogen" )
else:
os.system ( "scons -C misc/autogen --language=" + language )
if hasEngine:
env.SConscript( 'SequoiaDB/SConscript', variant_dir=variantDir, duplicate=False )
# Convert javascript files to a cpp file
print 'Convert js files to cpp'
sys.path.append(join(root_dir, 'misc'))
import jsToCpp
jsToCpp.jsToCpp(engine_dir)
if hasClient:
clientCppEnv.SConscript( 'SequoiaDB/SConscriptClientCpp', variant_dir=clientCppVariantDir, duplicate=False )
clientCEnv.SConscript ( 'SequoiaDB/SConscriptClientC', variant_dir=clientCVariantDir, duplicate=False )
if hasShell:
shellEnv.SConscript ( 'SequoiaDB/SConscriptShell', variant_dir=shellVariantDir, duplicate=False )
if hasTool:
toolEnv.SConscript ( 'SequoiaDB/SConscriptTool', variant_dir=toolVariantDir, duplicate=False )
if hasFmp:
fmpEnv.SConscript ( 'SequoiaDB/SConscriptFmp', variant_dir=fmpVariantDir, duplicate=False )
#if hasTestcase:
# env.SConscript( 'SequoiaDB/SConscript', variant_dir=variantDir, duplicate=False )
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/itkang/SequoiaDB.git
git@gitee.com:itkang/SequoiaDB.git
itkang
SequoiaDB
SequoiaDB
master

搜索帮助