summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-10-26 08:58:43 (GMT)
committerGitHub <noreply@github.com>2021-10-26 08:58:43 (GMT)
commitb5ee79494b2e0d484b7cf59f6746010e22567702 (patch)
tree57bc1b5c0529c385ab38a693153a53b29272c484
parent6afb285ff0790471a6858e44f85d143f07fda70c (diff)
downloadcpython-b5ee79494b2e0d484b7cf59f6746010e22567702.zip
cpython-b5ee79494b2e0d484b7cf59f6746010e22567702.tar.gz
cpython-b5ee79494b2e0d484b7cf59f6746010e22567702.tar.bz2
bpo-45548: makesetup improvements (GH-29225)
* record which modules are build as shared extensions * put object files in same directory as source files * remove dependency on deleted _math.c Signed-off-by: Christian Heimes <christian@python.org>
-rw-r--r--Makefile.pre.in5
-rwxr-xr-xModules/makesetup13
2 files changed, 14 insertions, 4 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 7d40366..60acc16 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -21,6 +21,7 @@
# === Variables set by makesetup ===
MODBUILT_NAMES= _MODBUILT_NAMES_
+MODSHARED_NAMES= _MODSHARED_NAMES_
MODDISABLED_NAMES= _MODDISABLED_NAMES_
MODOBJS= _MODOBJS_
MODLIBS= _MODLIBS_
@@ -2120,8 +2121,8 @@ Python/thread.o: @THREADHEADERS@ $(srcdir)/Python/condvar.h
##########################################################################
# Module dependencies
-MODULE_CMATH_DEPS=$(srcdir)/Modules/_math.h $(srcdir)/Modules/_math.c
-MODULE_MATH_DEPS=$(srcdir)/Modules/_math.h $(srcdir)/Modules/_math.c
+MODULE_CMATH_DEPS=$(srcdir)/Modules/_math.h
+MODULE_MATH_DEPS=$(srcdir)/Modules/_math.h
MODULE_PYEXPAT_DEPS=$(srcdir)/Modules/expat/ascii.h $(srcdir)/Modules/expat/asciitab.h $(srcdir)/Modules/expat/expat.h $(srcdir)/Modules/expat/expat_config.h $(srcdir)/Modules/expat/expat_external.h $(srcdir)/Modules/expat/internal.h $(srcdir)/Modules/expat/latin1tab.h $(srcdir)/Modules/expat/utf8tab.h $(srcdir)/Modules/expat/xmlrole.h $(srcdir)/Modules/expat/xmltok.h $(srcdir)/Modules/expat/xmltok_impl.h
MODULE_UNICODEDATA_DEPS=$(srcdir)/Modules/unicodedata_db.h $(srcdir)/Modules/unicodename_db.h
MODULE__BLAKE2_DEPS=$(srcdir)/Modules/_blake2/impl/blake2-config.h $(srcdir)/Modules/_blake2/impl/blake2-dispatch.c $(srcdir)/Modules/_blake2/impl/blake2-impl.h $(srcdir)/Modules/_blake2/impl/blake2-kat.h $(srcdir)/Modules/_blake2/impl/blake2.h $(srcdir)/Modules/_blake2/impl/blake2b-load-sse2.h $(srcdir)/Modules/_blake2/impl/blake2b-load-sse41.h $(srcdir)/Modules/_blake2/impl/blake2b-ref.c $(srcdir)/Modules/_blake2/impl/blake2b-round.h $(srcdir)/Modules/_blake2/impl/blake2b-test.c $(srcdir)/Modules/_blake2/impl/blake2b.c $(srcdir)/Modules/_blake2/impl/blake2bp-test.c $(srcdir)/Modules/_blake2/impl/blake2bp.c $(srcdir)/Modules/_blake2/impl/blake2s-load-sse2.h $(srcdir)/Modules/_blake2/impl/blake2s-load-sse41.h $(srcdir)/Modules/_blake2/impl/blake2s-load-xop.h $(srcdir)/Modules/_blake2/impl/blake2s-ref.c $(srcdir)/Modules/_blake2/impl/blake2s-round.h $(srcdir)/Modules/_blake2/impl/blake2s-test.c $(srcdir)/Modules/_blake2/impl/blake2s.c $(srcdir)/Modules/_blake2/impl/blake2sp-test.c $(srcdir)/Modules/_blake2/impl/blake2sp.c $(srcdir)/Modules/hashlib.h
diff --git a/Modules/makesetup b/Modules/makesetup
index 9046657..7547315 100755
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -31,6 +31,7 @@
# - insert an identifying comment at the start
# - replace _MODBUILT_NAMES_ by the list of *static* and *shared* modules
# from Setup
+# - replace _MODBSHARED_NAMES_ by the list of *shared* modules from Setup
# - replace _MODDISABLED_NAMES_ by the list of *disabled* modules from Setup
# - replace _MODOBJS_ by the list of objects from Setup (except for
# Setup files after a -n option)
@@ -114,6 +115,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
" >$rulesf
DEFS=
BUILT=
+ BUILT_SHARED=
DISABLED=
MODS=
SHAREDMODS=
@@ -222,7 +224,10 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
*.m) obj=`basename $src .m`.o; cc='$(CC)';; # Obj-C
*) continue;;
esac
- obj="$srcdir/$obj"
+ case $src in
+ */*) obj="$srcdir/`dirname $src`/$obj";;
+ *) obj="$srcdir/$obj";;
+ esac
objs="$objs $obj"
case $src in
glmodule.c) ;;
@@ -246,7 +251,10 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
do
file="$srcdir/$mod\$(EXT_SUFFIX)"
case $doconfig in
- no) SHAREDMODS="$SHAREDMODS $file";;
+ no)
+ SHAREDMODS="$SHAREDMODS $file"
+ BUILT_SHARED="$BUILT_SHARED $mod"
+ ;;
esac
rule="$file: $objs"
rule="$rule; \$(BLDSHARED) $objs $libs $ExtraLibs -o $file"
@@ -296,6 +304,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
str="# Generated automatically from $makepre by makesetup."
echo "$str" >>$sedf
echo "s%_MODBUILT_NAMES_%$BUILT%" >>$sedf
+ echo "s%_MODSHARED_NAMES_%$BUILT_SHARED%" >>$sedf
echo "s%_MODDISABLED_NAMES_%$DISABLED%" >>$sedf
echo "s%_MODOBJS_%$OBJS%" >>$sedf
echo "s%_MODLIBS_%$LIBS%" >>$sedf