2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 09:57:15 +01:00

Issue 722

This commit is contained in:
Thomas Nagy 2012-03-04 15:33:48 +01:00
parent 284c3a0810
commit 85f7426d31
3 changed files with 14 additions and 7 deletions

2
README
View File

@ -10,7 +10,7 @@ For the examples: see the folder demos/
HOW TO CREATE THE WAF SCRIPT
----------------------------
Python 2.6, 2.7, 3.0 or 3.1 is required to generate the waf script. Execute:
Python 2.6, 2.7, 3.0, 3.1 or 3.2 is required to generate the waf script. Execute:
$ ./waf-light configure build
Or, if you have several python versions installed:
$ python3 ./waf-light configure build

View File

@ -12,11 +12,10 @@ from waflib import Configure, Logs
#Configure.autoconfig = True
def options(opt):
opt.load('compiler_c')
opt.load('gnu_dirs')
opt.load('compiler_c gnu_dirs')
def configure(conf):
conf.load('compiler_c')
conf.load('compiler_c gnu_dirs')
conf.check_cc(fragment="int main() { return 0; }\n")
try:

View File

@ -76,9 +76,13 @@ def configure(conf):
return getattr(Options.options, varname, '') or default
env = conf.env
conf.env.LIBDIR = conf.env.BINDIR = []
env['EXEC_PREFIX'] = get_param('EXEC_PREFIX', env['PREFIX'])
env['PACKAGE'] = getattr(Context.g_module, 'APPNAME', None) or env['PACKAGE']
env.LIBDIR = env.BINDIR = []
env.EXEC_PREFIX = get_param('EXEC_PREFIX', env.PREFIX)
corner_case = False
if str(env.PREFIX) == '/usr': # Issue 722, corner case
corner_case = True
env.PREFIX = ''
env.PACKAGE = getattr(Context.g_module, 'APPNAME', None) or env.PACKAGE
complete = False
iter = 0
@ -92,6 +96,10 @@ def configure(conf):
env[name] = Utils.subst_vars(get_param(name, default).replace('/', os.sep), env)
except TypeError:
complete = False
if corner_case:
env.PREFIX = '/usr'
if not complete:
lst = [name for name, _, _ in _options if not env[name.upper()]]
raise conf.errors.WafError('Variable substitution failure %r' % lst)