check for fsp lock prefix externalized

This commit is contained in:
Radim Kolar 2009-07-24 22:35:36 +02:00
parent 087c072e50
commit 3308bee429
2 changed files with 20 additions and 11 deletions

View File

@ -38,17 +38,6 @@ env.Replace(CCFLAGS = str(env['CCFLAGS']).split(' '))
#################### Tests ###################
# check for user-supplied lock prefix
def checkForLockPrefix(conf):
conf.Message("checking for user supplied lockprefix... ")
lp = ARGUMENTS.get('lockprefix', 0) or ARGUMENTS.get("with-lockprefix",0)
if lp:
conf.Result(1)
conf.env.Append(CPPFLAGS = '-DFSP_KEY_PREFIX=\\"'+lp+'\\"')
else:
conf.Result(0)
def getVarSize(conf,var):
conf.Message("checking for size of "+var+" ")
rc = conf.TryCompile("""
@ -85,6 +74,7 @@ main ()
from maintainer import checkForMaintainerMode
from compilertest import checkForCCOption
from prefix import checkForUserPrefix
from lockprefix import checkForLockPrefix
conf = Configure(env,{'checkForCCOption':checkForCCOption,
'MAINTAINER_MODE':checkForMaintainerMode,

19
site_scons/lockprefix.py Normal file
View File

@ -0,0 +1,19 @@
#
# SCons user-supplied FSP lock prefix tester
#
# Version 1.0
# 20-Jul-2009
#
from SCons.Script import ARGUMENTS
def checkForLockPrefix(conf):
"""Check for user-supplied lock prefix."""
conf.Message("checking for user supplied lockprefix... ")
lp = ARGUMENTS.get('lockprefix', 0) or ARGUMENTS.get("with-lockprefix",0)
if lp:
conf.Result(1)
conf.env.Append(CPPFLAGS = '-DFSP_KEY_PREFIX=\\"'+lp+'\\"')
else:
conf.Result(0)