def METHOD_NAME(self):
	"""
	Check for configuration needed to build perl extensions.
	Sets different xxx_PERLEXT variables in the environment.
	Also sets the ARCHDIR_PERL variable useful as installation path,
	which can be overridden by ``--with-perl-archdir`` option.
	"""
	env = self.env
	perl = env.PERL
	if not perl:
		self.fatal('find perl first')
	def cmd_perl_config(s):
		return perl + ['-MConfig', '-e', 'print \"%s\"' % s]
	def cfg_str(cfg):
		return self.cmd_and_log(cmd_perl_config(cfg))
	def cfg_lst(cfg):
		return Utils.to_list(cfg_str(cfg))
	def find_xsubpp():
		for var in ('privlib', 'vendorlib'):
			xsubpp = cfg_lst('$Config{%s}/ExtUtils/xsubpp$Config{exe_ext}' % var)
			if xsubpp and os.path.isfile(xsubpp[0]):
				return xsubpp
		return self.find_program('xsubpp')
	env.LINKFLAGS_PERLEXT = cfg_lst('$Config{lddlflags}')
	env.INCLUDES_PERLEXT = cfg_lst('$Config{archlib}/CORE')
	env.CFLAGS_PERLEXT = cfg_lst('$Config{ccflags} $Config{cccdlflags}')
	env.EXTUTILS_TYPEMAP = cfg_lst('$Config{privlib}/ExtUtils/typemap')
	env.XSUBPP = find_xsubpp()
	if not getattr(Options.options, 'perlarchdir', None):
		env.ARCHDIR_PERL = cfg_str('$Config{sitearch}')
	else:
		env.ARCHDIR_PERL = getattr(Options.options, 'perlarchdir')
	env.perlext_PATTERN = '%s.' + cfg_str('$Config{dlext}')