1#
2# SCons checker for enabling client timeout feature
3#
4# Version 1.0
5# 18-Aug-2009
6#
7
8from SCons.Script import ARGUMENTS
9
10def checkForClientTimeout(conf):
11    """Check command line arguments if user requested disabling timeouts."""
12    conf.Message("Checking if client commands can time out... ")
13    timeout=ARGUMENTS.get('disable-timeout', 0)
14    try:
15         timeout2=int(timeout)
16    except ValueError:
17         timeout2=None
18    if timeout2 == 0 or str(timeout).lower() == 'no':
19        conf.env.Append(CPPFLAGS = '-DCLIENT_TIMEOUT')
20        conf.Result(1)
21    else:
22        conf.Result(0)
23