diff options
author | Christian Heimes <christian@python.org> | 2021-10-26 08:58:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 08:58:43 (GMT) |
commit | b5ee79494b2e0d484b7cf59f6746010e22567702 (patch) | |
tree | 57bc1b5c0529c385ab38a693153a53b29272c484 /Modules/makesetup | |
parent | 6afb285ff0790471a6858e44f85d143f07fda70c (diff) | |
download | cpython-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>
Diffstat (limited to 'Modules/makesetup')
-rwxr-xr-x | Modules/makesetup | 13 |
1 files changed, 11 insertions, 2 deletions
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 |