'Finalizes options.'

def finalize_options(self):

    if ((self.prefix or self.exec_prefix or self.home) and (self.install_base or self.install_platbase)):
        raise DistutilsOptionError(('must    supply    either    prefix/exec-prefix/home    or    ' + 'install-base/install-platbase    --    not    both'))
    if (self.home and (self.prefix or self.exec_prefix)):
        raise DistutilsOptionError('must    supply    either    home    or    prefix/exec-prefix    --    not    both')
    if (self.user and (self.prefix or self.exec_prefix or self.home or self.install_base or self.install_platbase)):
        raise DistutilsOptionError("can't    combine    user    with    prefix,    exec_prefix/home,    or    install_(plat)base")
    if (os.name != 'posix'):
        if self.exec_prefix:
            self.warn('exec-prefix    option    ignored    on    this    platform')
            self.exec_prefix = None
    self.dump_dirs('pre-finalize_{unix,other}')
    if (os.name == 'posix'):
        self.finalize_unix()
    else:
        self.finalize_other()
    self.dump_dirs('post-finalize_{unix,other}()')
    py_version = sys.version.split()[0]
    (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
    try:
        abiflags = sys.abiflags
    except AttributeError:
        abiflags = ''
    self.config_vars = {'dist_name': self.distribution.get_name(), 'dist_version': self.distribution.get_version(), 'dist_fullname': self.distribution.get_fullname(), 'py_version': py_version, 'py_version_short': ('%d.%d' % sys.version_info[:2]), 'py_version_nodot': ('%d%d' % sys.version_info[:2]), 'sys_prefix': prefix, 'prefix': prefix, 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix, 'abiflags': abiflags}
    if HAS_USER_SITE:
        self.config_vars['userbase'] = self.install_userbase
        self.config_vars['usersite'] = self.install_usersite
    self.expand_basedirs()
    self.dump_dirs('post-expand_basedirs()')
    self.config_vars['base'] = self.install_base
    self.config_vars['platbase'] = self.install_platbase
    if DEBUG:
        from pprint import pprint
        print 'config    vars:'
        pprint(self.config_vars)
    self.expand_dirs()
    self.dump_dirs('post-expand_dirs()')
    if self.user:
        self.create_home_path()
    if (self.install_lib is None):
        if self.distribution.ext_modules:
            self.install_lib = self.install_platlib
        else:
            self.install_lib = self.install_purelib
    self.convert_paths('lib', 'purelib', 'platlib', 'scripts', 'data', 'headers', 'userbase', 'usersite')
    self.handle_extra_path()
    self.install_libbase = self.install_lib
    self.install_lib = os.path.join(self.install_lib, self.extra_dirs)
    if (self.root is not None):
        self.change_roots('libbase', 'lib', 'purelib', 'platlib', 'scripts', 'data', 'headers')
    self.dump_dirs('after    prepending    root')
    self.set_undefined_options('build', ('build_base', 'build_base'), ('build_lib', 'build_lib'))
