diff options
author | Victor Stinner <vstinner@python.org> | 2020-12-16 12:12:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-16 12:12:36 +0100 |
commit | 1c653f17cb84d81df3a74ab0b42140d2bb68c5c4 (patch) | |
tree | 45c3f92f1a2d44d3e8e2c56c938822c75b75a155 /Tools | |
parent | bpo-40364: asyncio uses os.waitstatus_to_exitcode() (GH-23798) (diff) | |
download | cpython-1c653f17cb84d81df3a74ab0b42140d2bb68c5c4.tar.gz cpython-1c653f17cb84d81df3a74ab0b42140d2bb68c5c4.tar.bz2 cpython-1c653f17cb84d81df3a74ab0b42140d2bb68c5c4.zip |
bpo-42613: Fix freeze.py config directory (GH-23792)
Fix freeze.py tool to use the prope config and library directories.
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/freeze/freeze.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py index 83aa508a46a..d66e1e2708e 100755 --- a/Tools/freeze/freeze.py +++ b/Tools/freeze/freeze.py @@ -93,6 +93,7 @@ import modulefinder import getopt import os import sys +import sysconfig # Import the freeze-private modules @@ -226,7 +227,7 @@ def main(): extensions_c = 'frozen_extensions.c' if ishome: print("(Using Python source directory)") - binlib = exec_prefix + configdir = exec_prefix incldir = os.path.join(prefix, 'Include') config_h_dir = exec_prefix config_c_in = os.path.join(prefix, 'Modules', 'config.c.in') @@ -235,22 +236,21 @@ def main(): if win: frozendllmain_c = os.path.join(exec_prefix, 'Pc\\frozen_dllmain.c') else: - binlib = os.path.join(exec_prefix, - 'lib', 'python%s' % version, - 'config-%s' % flagged_version) + configdir = sysconfig.get_config_var('LIBPL') incldir = os.path.join(prefix, 'include', 'python%s' % flagged_version) config_h_dir = os.path.join(exec_prefix, 'include', 'python%s' % flagged_version) - config_c_in = os.path.join(binlib, 'config.c.in') - frozenmain_c = os.path.join(binlib, 'frozenmain.c') - makefile_in = os.path.join(binlib, 'Makefile') - frozendllmain_c = os.path.join(binlib, 'frozen_dllmain.c') + config_c_in = os.path.join(configdir, 'config.c.in') + frozenmain_c = os.path.join(configdir, 'frozenmain.c') + makefile_in = os.path.join(configdir, 'Makefile') + frozendllmain_c = os.path.join(configdir, 'frozen_dllmain.c') + libdir = sysconfig.get_config_var('LIBDIR') supp_sources = [] defines = [] includes = ['-I' + incldir, '-I' + config_h_dir] # sanity check of directories and files - check_dirs = [prefix, exec_prefix, binlib, incldir] + check_dirs = [prefix, exec_prefix, configdir, incldir] if not win: # These are not directories on Windows. check_dirs = check_dirs + extensions @@ -457,7 +457,7 @@ def main(): cflags = ['$(OPT)'] cppflags = defines + includes - libs = [os.path.join(binlib, '$(LDLIBRARY)')] + libs = [os.path.join(libdir, '$(LDLIBRARY)')] somevars = {} if os.path.exists(makefile_in): |