8000 [3.9] bpo-42613: Fix freeze.py config directory (GH-23792) by miss-islington · Pull Request #23817 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.9] bpo-42613: Fix freeze.py config directory (GH-23792) #23817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-42613: Fix freeze.py config directory (GH-23792)
Fix freeze.py tool to use the prope config and library directories.
(cherry picked from commit 1c653f1)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
vstinner authored and miss-islington committed Dec 17, 2020
commit 54f1877b46d673484e9faa71aed6d087284e3ebc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix ``freeze.py`` tool to use the prope config and library directories.
Patch by Victor Stinner.
20 changes: 10 additions & 10 deletions Tools/freeze/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
import getopt
import os
import sys
import sysconfig


# Import the freeze-private modules
Expand Down Expand Up @@ -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')
Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand Down
0