added support for building clients with/without timeout

This commit is contained in:
Radim Kolar 2009-08-18 20:18:59 +02:00
parent af4a0b4c25
commit 0a776142ac
2 changed files with 26 additions and 1 deletions

View File

@ -51,6 +51,7 @@ from clangtest import getVariableSize
from locktype import checkForLockingType from locktype import checkForLockingType
from lamerpack import checkForLamerpack from lamerpack import checkForLamerpack
from debugmode import checkForDebugBuild from debugmode import checkForDebugBuild
from timeout import checkForClientTimeout
conf = Configure(env,{'checkForCCOption':checkForCCOption, conf = Configure(env,{'checkForCCOption':checkForCCOption,
'MAINTAINER_MODE':checkForMaintainerMode, 'MAINTAINER_MODE':checkForMaintainerMode,
@ -59,7 +60,8 @@ conf = Configure(env,{'checkForCCOption':checkForCCOption,
'sizeOf':getVariableSize, 'sizeOf':getVariableSize,
'checkForLockingType':checkForLockingType, 'checkForLockingType':checkForLockingType,
'checkForLamerPack':checkForLamerpack, 'checkForLamerPack':checkForLamerpack,
'checkForDebugBuild':checkForDebugBuild 'checkForDebugBuild':checkForDebugBuild,
'checkForClientTimeout':checkForClientTimeout
}) })
# check for CC options # check for CC options
for option in Split(""" for option in Split("""
@ -109,6 +111,7 @@ if EFENCE == True:
EFENCE=conf.CheckLib("efence","EF_Abort") EFENCE=conf.CheckLib("efence","EF_Abort")
conf.checkForLamerPack() conf.checkForLamerPack()
conf.checkForDebugBuild() conf.checkForDebugBuild()
conf.checkForClientTimeout()
conf.Finish() conf.Finish()
env.Append(CPPFLAGS = "-DPACKAGE_VERSION=\\\""+VERSION+"\\\"") env.Append(CPPFLAGS = "-DPACKAGE_VERSION=\\\""+VERSION+"\\\"")

22
site_scons/timeout.py Normal file
View File

@ -0,0 +1,22 @@
#
# SCons checker for enabling client timeout feature
#
# Version 1.0
# 18-Aug-2009
#
from SCons.Script import ARGUMENTS
def checkForClientTimeout(conf):
"""Check command line arguments if user requested disabling timeouts."""
conf.Message("Checking if client commands can time out... ")
timeout=ARGUMENTS.get('disable-timeout', 0)
try:
timeout2=int(timeout)
except ValueError:
timeout2=None
if timeout2 == 0 or str(timeout).lower() == 'no':
conf.env.Append(CPPFLAGS = '-DCLIENT_TIMEOUT')
conf.Result(1)
else:
conf.Result(0)