check for user prefix externalized
This commit is contained in:
parent
93618dd883
commit
087c072e50
14
SConstruct
14
SConstruct
|
|
@ -49,17 +49,6 @@ def checkForLockPrefix(conf):
|
||||||
else:
|
else:
|
||||||
conf.Result(0)
|
conf.Result(0)
|
||||||
|
|
||||||
# check for user-supplied prefix
|
|
||||||
def checkForUserPrefix(conf):
|
|
||||||
global PREFIX
|
|
||||||
conf.Message("checking for user supplied prefix... ")
|
|
||||||
lp = ARGUMENTS.get('prefix', 0)
|
|
||||||
if lp:
|
|
||||||
conf.Result(1)
|
|
||||||
PREFIX=lp
|
|
||||||
else:
|
|
||||||
conf.Result(0)
|
|
||||||
|
|
||||||
def getVarSize(conf,var):
|
def getVarSize(conf,var):
|
||||||
conf.Message("checking for size of "+var+" ")
|
conf.Message("checking for size of "+var+" ")
|
||||||
rc = conf.TryCompile("""
|
rc = conf.TryCompile("""
|
||||||
|
|
@ -95,6 +84,7 @@ main ()
|
||||||
|
|
||||||
from maintainer import checkForMaintainerMode
|
from maintainer import checkForMaintainerMode
|
||||||
from compilertest import checkForCCOption
|
from compilertest import checkForCCOption
|
||||||
|
from prefix import checkForUserPrefix
|
||||||
|
|
||||||
conf = Configure(env,{'checkForCCOption':checkForCCOption,
|
conf = Configure(env,{'checkForCCOption':checkForCCOption,
|
||||||
'MAINTAINER_MODE':checkForMaintainerMode,
|
'MAINTAINER_MODE':checkForMaintainerMode,
|
||||||
|
|
@ -170,7 +160,7 @@ elif fun_flock:
|
||||||
else:
|
else:
|
||||||
conf.env.Append(CPPFLAGS = '-DFSP_NOLOCKING')
|
conf.env.Append(CPPFLAGS = '-DFSP_NOLOCKING')
|
||||||
conf.checkForLockPrefix()
|
conf.checkForLockPrefix()
|
||||||
conf.checkPrefix()
|
PREFIX=conf.checkPrefix(PREFIX)
|
||||||
conf.env.Append(CPPFLAGS = '-DSYSCONFDIR=\\"'+PREFIX+'/etc\\"')
|
conf.env.Append(CPPFLAGS = '-DSYSCONFDIR=\\"'+PREFIX+'/etc\\"')
|
||||||
EFENCE = conf.MAINTAINER_MODE()
|
EFENCE = conf.MAINTAINER_MODE()
|
||||||
if EFENCE == True:
|
if EFENCE == True:
|
||||||
|
|
|
||||||
19
site_scons/prefix.py
Normal file
19
site_scons/prefix.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#
|
||||||
|
# SCons user-supplied prefix tester
|
||||||
|
#
|
||||||
|
# Version 1.0
|
||||||
|
# 16-Jun-2009
|
||||||
|
#
|
||||||
|
|
||||||
|
from SCons.Script import ARGUMENTS
|
||||||
|
|
||||||
|
def checkForUserPrefix(conf,oldprefix=None):
|
||||||
|
"""Returns prefix specified on command line or oldprefix if none is found."""
|
||||||
|
conf.Message("checking for user supplied prefix... ")
|
||||||
|
lp = ARGUMENTS.get('prefix', 0)
|
||||||
|
if lp:
|
||||||
|
conf.Result(1)
|
||||||
|
return lp
|
||||||
|
else:
|
||||||
|
conf.Result(0)
|
||||||
|
return oldprefix
|
||||||
Loading…
Reference in New Issue
Block a user