]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45573: Add Modules/Setup.stdlib with conditional modules (GH-29615)
authorChristian Heimes <christian@python.org>
Thu, 18 Nov 2021 13:40:01 +0000 (15:40 +0200)
committerGitHub <noreply@github.com>
Thu, 18 Nov 2021 13:40:01 +0000 (14:40 +0100)
.gitignore
Makefile.pre.in
Misc/NEWS.d/next/Build/2021-11-18-12-18-43.bpo-45573.xsMZzn.rst [new file with mode: 0644]
Modules/Setup.stdlib.in [new file with mode: 0644]
configure
configure.ac

index e261d6c997135802ca2fe63b2d9068198310dbf2..0831c58d3674897eba2b63eaa5b52ecc6d86bc17 100644 (file)
@@ -76,6 +76,7 @@ Misc/python-embed.pc
 Misc/python-config.sh
 Modules/Setup.config
 Modules/Setup.local
+Modules/Setup.stdlib
 Modules/config.c
 Modules/ld_so_aix
 Programs/_freeze_module
index 55336d24ed19436fa0ddec7185a020fb89b14775..1afd9e1331949a592d7f9afdce1265a892ccf623 100644 (file)
@@ -898,11 +898,19 @@ oldsharedmods: $(SHAREDMODS) pybuilddir.txt
                fi; \
        done
 
+Modules/Setup.local:
+       @# Create empty Setup.local when file was deleted by user
+       echo "# Edit this file for local setup changes" > $@
+
+Modules/Setup.stdlib: $(srcdir)/Modules/Setup.stdlib.in config.status
+       ./config.status $@
+
 Makefile Modules/config.c: Makefile.pre \
                                $(srcdir)/Modules/config.c.in \
                                $(MAKESETUP) \
                                $(srcdir)/Modules/Setup \
-                               Modules/Setup.local
+                               Modules/Setup.local \
+                               Modules/Setup.stdlib
        $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
                                -s Modules \
                                Modules/Setup.local \
@@ -2159,6 +2167,7 @@ libainstall:      @DEF_MAKE_RULE@ python-config
        $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
        $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
        $(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup
+       $(INSTALL_DATA) Modules/Setup.stdlib $(DESTDIR)$(LIBPL)/Setup.stdlib
        $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
        $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
        $(INSTALL_DATA) Misc/python-embed.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc
@@ -2387,7 +2396,7 @@ distclean: clobber
            if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \
        done
        -rm -f core Makefile Makefile.pre config.status Modules/Setup.local \
-               Modules/ld_so_aix Modules/python.exp Misc/python.pc \
+               Modules/Setup.stdlib Modules/ld_so_aix Modules/python.exp Misc/python.pc \
                Misc/python-embed.pc Misc/python-config.sh
        -rm -f python*-gdb.py
        -rm -f Python/frozen_modules/*.h
diff --git a/Misc/NEWS.d/next/Build/2021-11-18-12-18-43.bpo-45573.xsMZzn.rst b/Misc/NEWS.d/next/Build/2021-11-18-12-18-43.bpo-45573.xsMZzn.rst
new file mode 100644 (file)
index 0000000..5dac52e
--- /dev/null
@@ -0,0 +1,2 @@
+``configure`` now creates ``Modules/Setup.stdlib`` with conditionally
+enabled/disabled extension module lines. The file is not used, yet.
diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in
new file mode 100644 (file)
index 0000000..0722eae
--- /dev/null
@@ -0,0 +1,55 @@
+# -*- makefile -*-
+#
+# This file is autogenerated from Modules/Setup.stdlib.in.
+#
+
+# The file is not used by default yet. For testing do:
+#
+#     ln -sfr Modules/Setup.stdlib Modules/Setup.local
+#
+
+# * @MODULE_{NAME}_TRUE@ is removed when configure detects all build
+#   dependencies for a module. Otherwise the template variable is replaced
+#   by a comment "#" and the module is skipped.
+# * Module lines without any compiler and linker flags automatically use
+#   $(MODULE_{NAME}_CFLAGS) and $(MODULE_{NAME}_LDFLAGS). These flags are
+#   generated by PY_STDLIB_MOD macro.
+# * All source files automatically depend on $(PYTHON_HEADERS) and
+#   $(MODULE_{NAME}_DEPS).
+#
+# See Modules/Setup and Modules/makesetup
+#
+
+
+# Build modules statically or as shared extensions
+*shared*
+# *static*
+
+
+############################################################################
+# Modules that should always be present (POSIX and Windows):
+
+# _decimal uses libmpdec
+# either static libmpdec.a from Modules/_decimal/libmpdec or libmpdec.so
+# with ./configure --with-system-libmpdec
+@MODULE__DECIMAL_TRUE@_decimal _decimal/_decimal.c
+
+
+############################################################################
+# XML and text
+
+# pyexpat module uses libexpat
+# either static libexpat.a from Modules/expat or libexpat.so with
+# ./configure --with-system-expat
+@MODULE_PYEXPAT_TRUE@pyexpat pyexpat.c
+
+# _elementtree libexpat via CAPI hook in pyexpat.
+@MODULE__ELEMENTTREE_TRUE@_elementtree _elementtree.c
+
+
+############################################################################
+# Modules with some UNIX dependencies
+#
+
+# Linux and FreeBSD, needs sys/soundcard.h or linux/soundcard.h
+@MODULE_OSSAUDIODEV_TRUE@ossaudiodev ossaudiodev.c
index f8987128a01cf78e6bf659d42d34d22e5b0574ad..fc7b8dc5968ab49a882d8def6a4f0e6489f99841 100755 (executable)
--- a/configure
+++ b/configure
@@ -19437,6 +19437,8 @@ $as_echo "$py_cv_module__decimal" >&6; }
 # generate output files
 ac_config_files="$ac_config_files Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh"
 
+ac_config_files="$ac_config_files Modules/Setup.stdlib"
+
 ac_config_files="$ac_config_files Modules/ld_so_aix"
 
 cat >confcache <<\_ACEOF
@@ -20172,6 +20174,7 @@ do
     "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;;
     "Misc/python-embed.pc") CONFIG_FILES="$CONFIG_FILES Misc/python-embed.pc" ;;
     "Misc/python-config.sh") CONFIG_FILES="$CONFIG_FILES Misc/python-config.sh" ;;
+    "Modules/Setup.stdlib") CONFIG_FILES="$CONFIG_FILES Modules/Setup.stdlib" ;;
     "Modules/ld_so_aix") CONFIG_FILES="$CONFIG_FILES Modules/ld_so_aix" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
index 78b22d531b9439df900505576e885432ac6b7aa6..d2cb67a39cb4a5e59d2e055b96c5df7e0bea5c60 100644 (file)
@@ -6005,6 +6005,7 @@ AC_SUBST([MODULE_BLOCK])
 
 # generate output files
 AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
+AC_CONFIG_FILES([Modules/Setup.stdlib])
 AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
 AC_OUTPUT