]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45582: Fix out-of-tree build issues with new getpath (GH-29902)
authorChristian Heimes <christian@python.org>
Fri, 3 Dec 2021 13:47:06 +0000 (15:47 +0200)
committerGitHub <noreply@github.com>
Fri, 3 Dec 2021 13:47:06 +0000 (14:47 +0100)
.gitignore
Makefile.pre.in
Modules/getpath.c
PCbuild/_freeze_module.vcxproj

index 7e80446d4d4a602824522a6648c73e924c1bc58b..0363244bdaf637bd4a0ba315a632d023cef3c419 100644 (file)
@@ -74,7 +74,6 @@ Mac/pythonw
 Misc/python.pc
 Misc/python-embed.pc
 Misc/python-config.sh
-Modules/getpath.h
 Modules/Setup.config
 Modules/Setup.local
 Modules/Setup.stdlib
index 3dc131b6c9651bc624bd25b09228cdd03544b7cb..264011f226bbc323563343339ca361e2fbfebdb4 100644 (file)
@@ -1062,10 +1062,9 @@ FROZEN_FILES_OUT = \
 Programs/_freeze_module.o: Programs/_freeze_module.c Makefile
 
 Modules/getpath_noop.o: $(srcdir)/Modules/getpath_noop.c Makefile
-       $(CC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Modules/getpath_noop.c
 
-Programs/_freeze_module: Programs/_freeze_module.o $(LIBRARY_OBJS_OMIT_FROZEN) Modules/getpath_noop.o
-       $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o $(LIBRARY_OBJS_OMIT_FROZEN) Modules/getpath_noop.o $(LIBS) $(MODLIBS) $(SYSLIBS)
+Programs/_freeze_module: Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN)
+       $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS)
 
 # BEGIN: freezing modules
 
@@ -1131,11 +1130,11 @@ Python/frozen_modules/frozen_only.h: $(FREEZE_MODULE) Tools/freeze/flag.py
 
 # END: freezing modules
 
-Tools/scripts/freeze_modules.py: $(FREEZE_MODULE)
-
 # We manually freeze getpath.py rather than through freeze_modules
-Modules/getpath.h: Programs/_freeze_module Modules/getpath.py
-       Programs/_freeze_module getpath $(srcdir)/Modules/getpath.py $(srcdir)/Modules/getpath.h
+Python/frozen_modules/getpath.h: $(FREEZE_MODULE) Modules/getpath.py
+       $(FREEZE_MODULE) getpath $(srcdir)/Modules/getpath.py Python/frozen_modules/getpath.h
+
+Tools/scripts/freeze_modules.py: $(FREEZE_MODULE)
 
 .PHONY: regen-frozen
 regen-frozen: Tools/scripts/freeze_modules.py $(FROZEN_FILES_IN)
@@ -1177,7 +1176,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
              -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
              -o $@ $(srcdir)/Modules/getbuildinfo.c
 
-Modules/getpath.o: $(srcdir)/Modules/getpath.c Modules/getpath.h Makefile
+Modules/getpath.o: $(srcdir)/Modules/getpath.c Python/frozen_modules/getpath.h Makefile $(PYTHON_HEADERS)
        $(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
                -DPREFIX='"$(prefix)"' \
                -DEXEC_PREFIX='"$(exec_prefix)"' \
index 32d5db9d2c4dc2c4693d39fb347208c51873a5ef..f66fc8abbd4ffe0ecd79f57ab4fa2453dc65d958 100644 (file)
@@ -19,7 +19,7 @@
 #endif
 
 /* Reference the precompiled getpath.py */
-#include "getpath.h"
+#include "../Python/frozen_modules/getpath.h"
 
 #if (!defined(PREFIX) || !defined(EXEC_PREFIX) \
         || !defined(VERSION) || !defined(VPATH) \
index 7b2df4b8afcc2c94cd623a191dd2a5562c894d52..07a6bfdde7402d6ed06a2960b0848fb4be47df76 100644 (file)
     <GetPath Include="..\Modules\getpath.py">
       <ModName>getpath</ModName>
       <IntFile>$(IntDir)getpath.g.h</IntFile>
-      <OutFile>$(PySourcePath)Modules\getpath.h</OutFile>
+      <OutFile>$(PySourcePath)Python\frozen_modules\getpath.h</OutFile>
     </GetPath>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />