added debug mode build command line switch

This commit is contained in:
Radim Kolar 2009-08-04 22:19:24 +02:00
parent fc64d4b887
commit 16aec3c842
2 changed files with 23 additions and 2 deletions

View File

@ -50,6 +50,7 @@ from lockprefix import checkForLockPrefix
from clangtest import getVariableSize
from locktype import checkForLockingType
from lamerpack import checkForLamerpack
from debugmode import checkForDebugBuild
conf = Configure(env,{'checkForCCOption':checkForCCOption,
'MAINTAINER_MODE':checkForMaintainerMode,
@ -57,7 +58,8 @@ conf = Configure(env,{'checkForCCOption':checkForCCOption,
'checkPrefix':checkForUserPrefix,
'sizeOf':getVariableSize,
'checkForLockingType':checkForLockingType,
'checkForLamerPack':checkForLamerpack
'checkForLamerPack':checkForLamerpack,
'checkForDebugBuild':checkForDebugBuild
})
# check for CC options
for option in Split("""
@ -105,7 +107,8 @@ conf.env.Append(CPPFLAGS = '-DSYSCONFDIR=\\"'+PREFIX+'/etc\\"')
EFENCE = conf.MAINTAINER_MODE()
if EFENCE == True:
EFENCE=conf.CheckLib("efence","EF_Abort")
conf.checkForLamerPack()
conf.checkForLamerPack()
conf.checkForDebugBuild()
conf.Finish()
env.Append(CPPFLAGS = "-DPACKAGE_VERSION=\\\""+VERSION+"\\\"")

18
site_scons/debugmode.py Normal file
View File

@ -0,0 +1,18 @@
#
# SCons debug mode build tester
#
# Version 1.0
# 04-Aug-2009
#
from SCons.Script import ARGUMENTS
def checkForDebugBuild(conf):
"""Check command line arguments if user requested debug mode build."""
conf.Message("checking if we are building with extra debug code... ")
buildlamer=ARGUMENTS.get('enable-debug', 0)
if buildlamer == 0 or str(buildlamer).lower() == 'no':
conf.Result(0)
else:
conf.env.Append(CPPFLAGS = '-DDEBUG')
conf.Result(1)