]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-96269: static and shared ext need different deps (#96316)
authorChristian Heimes <christian@python.org>
Wed, 16 Nov 2022 13:03:35 +0000 (14:03 +0100)
committerGitHub <noreply@github.com>
Wed, 16 Nov 2022 13:03:35 +0000 (14:03 +0100)
Makefile.pre.in
Modules/makesetup

index 90f5dd7964fe4e6a2743f68a4860faac2fb79c45..e1910f6aab8c14b873cbb0dcdd95cbdd3120389f 100644 (file)
@@ -2572,7 +2572,9 @@ Python/thread.o: @THREADHEADERS@ $(srcdir)/Python/condvar.h
 ##########################################################################
 # Module dependencies and platform-specific files
 
-MODULE_DEPS=$(PYTHON_HEADERS) Modules/config.c $(EXPORTSYMS)
+# force rebuild when header file or module build flavor (static/shared) is changed
+MODULE_DEPS_STATIC=Modules/config.c
+MODULE_DEPS_SHARED=$(MODULE_DEPS_STATIC) $(EXPORTSYMS)
 
 MODULE_CMATH_DEPS=$(srcdir)/Modules/_math.h
 MODULE_MATH_DEPS=$(srcdir)/Modules/_math.h
index 5c275ac9a049452b6707cee25262f81e4b54d1ac..f000c9cd67310e3d3a10fc35cd20598263314825 100755 (executable)
@@ -262,12 +262,15 @@ sed -e 's/[       ]*#.*//' -e '/^[        ]*$/d' |
                        esac
                        # custom flags first, PY_STDMODULE_CFLAGS may contain -I with system libmpdec
                        case $doconfig in
-                       no)     cc="$cc $cpps \$(PY_STDMODULE_CFLAGS) \$(CCSHARED)";;
+                       no)
+                               cc="$cc $cpps \$(PY_STDMODULE_CFLAGS) \$(CCSHARED)"
+                               rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(MODULE_DEPS_SHARED) \$(PYTHON_HEADERS); $cc -c $src -o $obj"
+                               ;;
                        *)
-                               cc="$cc $cpps \$(PY_BUILTIN_MODULE_CFLAGS)";;
+                               cc="$cc $cpps \$(PY_BUILTIN_MODULE_CFLAGS)"
+                               rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(MODULE_DEPS_STATIC) \$(PYTHON_HEADERS); $cc -c $src -o $obj"
+                               ;;
                        esac
-                       # force rebuild when header file or module build flavor (static/shared) is changed
-                       rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(MODULE_DEPS); $cc -c $src -o $obj"
                        echo "$rule" >>$rulesf
                done
                case $doconfig in