diff options
author | Greg Ward <gward@python.net> | 1999-09-13 13:58:34 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 1999-09-13 13:58:34 (GMT) |
commit | fa4eb188f4002383b2c50957e1ec089d1641a8ca (patch) | |
tree | eca298b5c8a6bd09c589d2ef1e21eca68f23fd8d /Lib/distutils/command/install_lib.py | |
parent | c9c011cd969ddd3f1223fac5695ec285daa8f847 (diff) | |
download | cpython-fa4eb188f4002383b2c50957e1ec089d1641a8ca.zip cpython-fa4eb188f4002383b2c50957e1ec089d1641a8ca.tar.gz cpython-fa4eb188f4002383b2c50957e1ec089d1641a8ca.tar.bz2 |
Changed selection of installation directories (in 'set_final_options()')
so that pure Python modules are installed to the platform-specific
directory if there are any extension modules in this distribution.
Diffstat (limited to 'Lib/distutils/command/install_lib.py')
-rw-r--r-- | Lib/distutils/command/install_lib.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py index 876a34c..a2ba16c 100644 --- a/Lib/distutils/command/install_lib.py +++ b/Lib/distutils/command/install_lib.py @@ -23,15 +23,23 @@ class InstallPy (Command): self.optimize = 1 def set_final_options (self): - # If we don't have a 'dir' value, we'll have to ask the 'install' - # command for one. (This usually means the user ran 'install_py' - # directly, rather than going through 'install' -- so in reality, - # 'find_command_obj()' will create an 'install' command object, - # which we then query. + # Find out from the 'build_ext' command if we were asked to build + # any extensions. If so, that means even pure-Python modules in + # this distribution have to be installed to the "platlib" + # directory. + extensions = self.get_peer_option ('build_ext', 'extensions') + if extensions: + dir_option = 'install_site_platlib' + else: + dir_option = 'install_site_lib' + + # Get all the information we need to install pure Python modules + # from the umbrella 'install' command -- build (source) directory, + # install (target) directory, and whether to compile .py files. self.set_undefined_options ('install', ('build_lib', 'build_dir'), - ('install_site_lib', 'dir'), + (dir_option, 'dir'), ('compile_py', 'compile'), ('optimize_py', 'optimize')) |