summaryrefslogtreecommitdiffstats
path: root/Makefile.pre.in
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-10-29 15:49:57 (GMT)
committerGitHub <noreply@github.com>2021-10-29 15:49:57 (GMT)
commitf0150ac94a85c863ec1dcb58b9e33ed7ce465ec8 (patch)
tree0af6f5979b7f5a9e75db0b4aa57abf4b15e7e2ef /Makefile.pre.in
parentd9575218d7ab3d85b15ce3d4779660b9b724d343 (diff)
downloadcpython-f0150ac94a85c863ec1dcb58b9e33ed7ce465ec8.zip
cpython-f0150ac94a85c863ec1dcb58b9e33ed7ce465ec8.tar.gz
cpython-f0150ac94a85c863ec1dcb58b9e33ed7ce465ec8.tar.bz2
bpo-45548: Some test modules must be built as shared libs (GH-29268)
Some test cases don't work when test modules are static extensions. Add dependency on Modules/config.c to trigger a rebuild whenever a module build type is changed. ``makesetup`` puts shared extensions into ``Modules/`` directory. Create symlinks from pybuilddir so the extensions can be imported. Note: It is not possible to use the content of pybuilddir.txt as a build target. Makefile evaluates target variables in the first pass. The pybuilddir.txt file does not exist at that point.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r--Makefile.pre.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 60acc16..322800a 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -705,8 +705,17 @@ $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
fi
-oldsharedmods: $(SHAREDMODS)
-
+# create relative links from build/lib.platform/egg.so to Modules/egg.so
+# pybuilddir.txt is created too late. We cannot use it in Makefile
+# targets. ln --relative is not portable.
+oldsharedmods: $(SHAREDMODS) pybuilddir.txt
+ @target=`cat pybuilddir.txt`; \
+ $(MKDIR_P) $$target; \
+ for mod in X $(SHAREDMODS); do \
+ if test $$mod != X; then \
+ $(LN) -sf ../../$$mod $$target/`basename $$mod`; \
+ fi; \
+ done
Makefile Modules/config.c: Makefile.pre \
$(srcdir)/Modules/config.c.in \