diff --git a/README b/README index 94154f7b..c4da2fd2 100644 --- a/README +++ b/README @@ -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 diff --git a/demos/c/wscript b/demos/c/wscript index 8ac9b8bc..94dd7704 100644 --- a/demos/c/wscript +++ b/demos/c/wscript @@ -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: diff --git a/waflib/Tools/gnu_dirs.py b/waflib/Tools/gnu_dirs.py index c9fbe5cf..ac9d836d 100644 --- a/waflib/Tools/gnu_dirs.py +++ b/waflib/Tools/gnu_dirs.py @@ -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)