def configure(conf):

	src = getattr(Options.options, SRCDIR, None)
	if not src: src = getattr(Utils.g_module, SRCDIR, None)
	if not src: src = getattr(Utils.g_module, 'top', None)
	if not src:
		src = '.'
		incomplete_src = 1
	src = os.path.abspath(src)

	bld = getattr(Options.options, BLDDIR, None)
	if not bld: bld = getattr(Utils.g_module, BLDDIR, None)
	if not bld: bld = getattr(Utils.g_module, 'out', None)
	if not bld:
		bld = 'build'
		incomplete_bld = 1
	if bld == '.':
		raise Utils.WafError('Setting blddir="." may cause distclean problems')
	bld = os.path.abspath(bld)

	try: os.makedirs(bld)
	except __HOLE__: pass

	# It is not possible to compile specific targets in the configuration
	# this may cause configuration errors if autoconfig is set
	targets = Options.options.compile_targets
	Options.options.compile_targets = None
	Options.is_install = False

	conf.srcdir = src
	conf.blddir = bld
	conf.post_init()

	if 'incomplete_src' in vars():
		conf.check_message_1('Setting srcdir to')
		conf.check_message_2(src)
	if 'incomplete_bld' in vars():
		conf.check_message_1('Setting blddir to')
		conf.check_message_2(bld)

	# calling to main wscript's configure()
	conf.sub_config([''])

	conf.store()

	# this will write a configure lock so that subsequent builds will
	# consider the current path as the root directory (see prepare_impl).
	# to remove: use 'waf distclean'
	env = Environment.Environment()
	env[BLDDIR] = bld
	env[SRCDIR] = src
	env['argv'] = sys.argv
	env['commands'] = Options.commands
	env['options'] = Options.options.__dict__

	# conf.hash & conf.files hold wscript files paths and hash
	# (used only by Configure.autoconfig)
	env['hash'] = conf.hash
	env['files'] = conf.files
	env['environ'] = dict(conf.environ)
	env['cwd'] = os.path.split(Utils.g_module.root_path)[0]

	if Utils.g_module.root_path != src:
		# in case the source dir is somewhere else
		env.store(os.path.join(src, Options.lockfile))

	env.store(Options.lockfile)

	Options.options.compile_targets = targets
dataset/ETHPy150Open appcelerator-archive/poc-nodejs-desktop/Resources/nodejs/builds/linux/node/lib/node/wafadmin/Scripting.py/configure