bpo-45847: port _struct to PY_STDLIB_MOD (GH-29706)

This commit is contained in:
Christian Heimes 2021-11-22 16:58:43 +02:00 committed by GitHub
parent 4fad314246
commit 0e1c2f3ef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 2 deletions

View File

@ -40,6 +40,7 @@
@MODULE__PICKLE_TRUE@_pickle _pickle.c @MODULE__PICKLE_TRUE@_pickle _pickle.c
@MODULE__QUEUE_TRUE@_queue _queuemodule.c @MODULE__QUEUE_TRUE@_queue _queuemodule.c
@MODULE__RANDOM_TRUE@_random _randommodule.c @MODULE__RANDOM_TRUE@_random _randommodule.c
@MODULE__STRUCT_TRUE@_struct _struct.c
@MODULE__TYPING_TRUE@_typing _typingmodule.c @MODULE__TYPING_TRUE@_typing _typingmodule.c
@MODULE__XXSUBINTERPRETERS_TRUE@_xxsubinterpreters _xxsubinterpretersmodule.c @MODULE__XXSUBINTERPRETERS_TRUE@_xxsubinterpreters _xxsubinterpretersmodule.c
@MODULE__ZONEINFO_TRUE@_zoneinfo _zoneinfo.c @MODULE__ZONEINFO_TRUE@_zoneinfo _zoneinfo.c

15
configure vendored
View File

@ -718,6 +718,8 @@ MODULE__XXSUBINTERPRETERS_FALSE
MODULE__XXSUBINTERPRETERS_TRUE MODULE__XXSUBINTERPRETERS_TRUE
MODULE__TYPING_FALSE MODULE__TYPING_FALSE
MODULE__TYPING_TRUE MODULE__TYPING_TRUE
MODULE__STRUCT_FALSE
MODULE__STRUCT_TRUE
MODULE_SELECT_FALSE MODULE_SELECT_FALSE
MODULE_SELECT_TRUE MODULE_SELECT_TRUE
MODULE__RANDOM_FALSE MODULE__RANDOM_FALSE
@ -20571,6 +20573,15 @@ else
fi fi
as_fn_append MODULE_BLOCK "MODULE_SELECT=yes$as_nl" as_fn_append MODULE_BLOCK "MODULE_SELECT=yes$as_nl"
if true; then
MODULE__STRUCT_TRUE=
MODULE__STRUCT_FALSE='#'
else
MODULE__STRUCT_TRUE='#'
MODULE__STRUCT_FALSE=
fi
as_fn_append MODULE_BLOCK "MODULE__STRUCT=yes$as_nl"
if true; then if true; then
MODULE__TYPING_TRUE= MODULE__TYPING_TRUE=
MODULE__TYPING_FALSE='#' MODULE__TYPING_FALSE='#'
@ -22011,6 +22022,10 @@ if test -z "${MODULE_SELECT_TRUE}" && test -z "${MODULE_SELECT_FALSE}"; then
as_fn_error $? "conditional \"MODULE_SELECT\" was never defined. as_fn_error $? "conditional \"MODULE_SELECT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi fi
if test -z "${MODULE__STRUCT_TRUE}" && test -z "${MODULE__STRUCT_FALSE}"; then
as_fn_error $? "conditional \"MODULE__STRUCT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE__TYPING_TRUE}" && test -z "${MODULE__TYPING_FALSE}"; then if test -z "${MODULE__TYPING_TRUE}" && test -z "${MODULE__TYPING_FALSE}"; then
as_fn_error $? "conditional \"MODULE__TYPING\" was never defined. as_fn_error $? "conditional \"MODULE__TYPING\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5

View File

@ -6137,6 +6137,7 @@ PY_STDLIB_MOD_SIMPLE([_posixsubprocess])
PY_STDLIB_MOD_SIMPLE([_queue]) PY_STDLIB_MOD_SIMPLE([_queue])
PY_STDLIB_MOD_SIMPLE([_random]) PY_STDLIB_MOD_SIMPLE([_random])
PY_STDLIB_MOD_SIMPLE([select]) PY_STDLIB_MOD_SIMPLE([select])
PY_STDLIB_MOD_SIMPLE([_struct])
PY_STDLIB_MOD_SIMPLE([_typing]) PY_STDLIB_MOD_SIMPLE([_typing])
PY_STDLIB_MOD_SIMPLE([_xxsubinterpreters]) PY_STDLIB_MOD_SIMPLE([_xxsubinterpreters])
PY_STDLIB_MOD_SIMPLE([_zoneinfo]) PY_STDLIB_MOD_SIMPLE([_zoneinfo])

View File

@ -1023,6 +1023,7 @@ class PyBuildExt(build_ext):
self.addext(Extension("_queue", ["_queuemodule.c"])) self.addext(Extension("_queue", ["_queuemodule.c"]))
self.addext(Extension("_statistics", ["_statisticsmodule.c"])) self.addext(Extension("_statistics", ["_statisticsmodule.c"]))
self.addext(Extension("_struct", ["_struct.c"]))
self.addext(Extension("_typing", ["_typingmodule.c"])) self.addext(Extension("_typing", ["_typingmodule.c"]))
# Modules with some UNIX dependencies -- on by default: # Modules with some UNIX dependencies -- on by default:
@ -1446,6 +1447,9 @@ class PyBuildExt(build_ext):
self.missing.append('_uuid') self.missing.append('_uuid')
def detect_modules(self): def detect_modules(self):
# remove dummy extension
self.extensions = []
self.configure_compiler() self.configure_compiler()
self.init_inc_lib_dirs() self.init_inc_lib_dirs()
@ -2100,9 +2104,9 @@ def main():
'build_scripts': PyBuildScripts, 'build_scripts': PyBuildScripts,
'install': PyBuildInstall, 'install': PyBuildInstall,
'install_lib': PyBuildInstallLib}, 'install_lib': PyBuildInstallLib},
# The struct module is defined here, because build_ext won't be # A dummy module is defined here, because build_ext won't be
# called unless there's at least one extension module defined. # called unless there's at least one extension module defined.
ext_modules=[Extension('_struct', ['_struct.c'])], ext_modules=[Extension('_dummy', ['_dummy.c'])],
# If you change the scripts installed here, you also need to # If you change the scripts installed here, you also need to
# check the PyBuildScripts command above, and change the links # check the PyBuildScripts command above, and change the links