Bug 1317359 - Move add_old_configure_* functions to util.configure. r=chmanchester

--HG--
extra : rebase_source : 240fd42920ed4a17592c368ab764672cac01ca31
This commit is contained in:
Mike Hommey 2016-11-15 14:35:22 +09:00
Родитель 146b6bf411
Коммит 5fd2ce5f30
2 изменённых файлов: 38 добавлений и 38 удалений

Просмотреть файл

@ -123,44 +123,6 @@ def mozconfig(current_project, mozconfig, old_configure, build_env, help):
set_config('MOZCONFIG', depends(mozconfig)(lambda m: m['path']))
# Hacks related to old-configure
# ==============================
@dependable
def old_configure_assignments():
return []
@dependable
def extra_old_configure_args():
return []
@template
def add_old_configure_assignment(var, value):
var = dependable(var)
value = dependable(value)
@depends(old_configure_assignments, var, value)
@imports(_from='mozbuild.shellutil', _import='quote')
def add_assignment(assignments, var, value):
if var is None or value is None:
return
if value is True:
assignments.append('%s=1' % var)
elif value is False:
assignments.append('%s=' % var)
else:
if isinstance(value, (list, tuple)):
value = quote(*value)
assignments.append('%s=%s' % (var, quote(str(value))))
@template
def add_old_configure_arg(arg):
@depends(extra_old_configure_args, arg)
def add_arg(args, arg):
if arg:
args.append(arg)
option(env='PYTHON', nargs=1, help='Python interpreter')
# Setup python virtualenv

Просмотреть файл

@ -400,3 +400,41 @@ def depends_when(*args, **kwargs):
return fn(*args)
return wrapper
return decorator
# Hacks related to old-configure
# ==============================
@dependable
def old_configure_assignments():
return []
@dependable
def extra_old_configure_args():
return []
@template
def add_old_configure_assignment(var, value):
var = dependable(var)
value = dependable(value)
@depends(old_configure_assignments, var, value)
@imports(_from='mozbuild.shellutil', _import='quote')
def add_assignment(assignments, var, value):
if var is None or value is None:
return
if value is True:
assignments.append('%s=1' % var)
elif value is False:
assignments.append('%s=' % var)
else:
if isinstance(value, (list, tuple)):
value = quote(*value)
assignments.append('%s=%s' % (var, quote(str(value))))
@template
def add_old_configure_arg(arg):
@depends(extra_old_configure_args, arg)
def add_arg(args, arg):
if arg:
args.append(arg)