bpo-45847: Port array, _contextvars, math, and cmath to PY_STDLIB_MOD_SIMPLE (GH-29688)

This commit is contained in:
Erlend Egeberg Aasland 2021-11-22 09:05:36 +01:00 committed by GitHub
parent db2277a114
commit 133c65a870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 90 additions and 6 deletions

View File

@ -28,6 +28,12 @@
############################################################################
# Modules that should always be present (POSIX and Windows):
@MODULE_ARRAY_TRUE@array arraymodule.c
@MODULE__CONTEXTVARS_TRUE@_contextvars _contextvarsmodule.c
# needs libm
@MODULE_MATH_TRUE@math mathmodule.c
@MODULE_CMATH_TRUE@cmath cmathmodule.c
# needs libm and on some platforms librt
@MODULE__DATETIME_TRUE@_datetime _datetimemodule.c

76
configure vendored
View File

@ -688,8 +688,16 @@ MODULE_OSSAUDIODEV_FALSE
MODULE_OSSAUDIODEV_TRUE
MODULE_GRP_FALSE
MODULE_GRP_TRUE
MODULE_CMATH_FALSE
MODULE_CMATH_TRUE
MODULE_MATH_FALSE
MODULE_MATH_TRUE
MODULE__DATETIME_FALSE
MODULE__DATETIME_TRUE
MODULE__CONTEXTVARS_FALSE
MODULE__CONTEXTVARS_TRUE
MODULE_ARRAY_FALSE
MODULE_ARRAY_TRUE
MODULE_TIME_FALSE
MODULE_TIME_TRUE
MODULE__IO_FALSE
@ -19566,6 +19574,30 @@ fi
if true; then
MODULE_ARRAY_TRUE=
MODULE_ARRAY_FALSE='#'
else
MODULE_ARRAY_TRUE='#'
MODULE_ARRAY_FALSE=
fi
if true; then
MODULE__CONTEXTVARS_TRUE=
MODULE__CONTEXTVARS_FALSE='#'
else
MODULE__CONTEXTVARS_TRUE='#'
MODULE__CONTEXTVARS_FALSE=
fi
if true; then
MODULE__DATETIME_TRUE=
MODULE__DATETIME_FALSE='#'
@ -19580,6 +19612,34 @@ fi
if true; then
MODULE_MATH_TRUE=
MODULE_MATH_FALSE='#'
else
MODULE_MATH_TRUE='#'
MODULE_MATH_FALSE=
fi
as_fn_append MODULE_BLOCK "MODULE_MATH_LDFLAGS=$LIBM$as_nl"
if true; then
MODULE_CMATH_TRUE=
MODULE_CMATH_FALSE='#'
else
MODULE_CMATH_TRUE='#'
MODULE_CMATH_FALSE=
fi
as_fn_append MODULE_BLOCK "MODULE_CMATH_LDFLAGS=$LIBM$as_nl"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module grp" >&5
$as_echo_n "checking for stdlib extension module grp... " >&6; }
@ -20745,10 +20805,26 @@ if test -z "${MODULE_TIME_TRUE}" && test -z "${MODULE_TIME_FALSE}"; then
as_fn_error $? "conditional \"MODULE_TIME\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE_ARRAY_TRUE}" && test -z "${MODULE_ARRAY_FALSE}"; then
as_fn_error $? "conditional \"MODULE_ARRAY\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE__CONTEXTVARS_TRUE}" && test -z "${MODULE__CONTEXTVARS_FALSE}"; then
as_fn_error $? "conditional \"MODULE__CONTEXTVARS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE__DATETIME_TRUE}" && test -z "${MODULE__DATETIME_FALSE}"; then
as_fn_error $? "conditional \"MODULE__DATETIME\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE_MATH_TRUE}" && test -z "${MODULE_MATH_FALSE}"; then
as_fn_error $? "conditional \"MODULE_MATH\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE_CMATH_TRUE}" && test -z "${MODULE_CMATH_FALSE}"; then
as_fn_error $? "conditional \"MODULE_CMATH\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE_GRP_TRUE}" && test -z "${MODULE_GRP_FALSE}"; then
as_fn_error $? "conditional \"MODULE_GRP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View File

@ -6075,7 +6075,11 @@ PY_STDLIB_MOD_SIMPLE([_io], [-I\$(srcdir)/Modules/_io], [])
PY_STDLIB_MOD_SIMPLE([time], [], [$TIMEMODULE_LIB])
dnl always enabled extension modules
PY_STDLIB_MOD_SIMPLE([array])
PY_STDLIB_MOD_SIMPLE([_contextvars])
PY_STDLIB_MOD_SIMPLE([_datetime], [], [$TIMEMODULE_LIB $LIBM])
PY_STDLIB_MOD_SIMPLE([math], [], [$LIBM])
PY_STDLIB_MOD_SIMPLE([cmath], [], [$LIBM])
dnl platform specific extensions
PY_STDLIB_MOD([grp], [], [test "$ac_cv_func_getgrgid" = yes -o "$ac_cv_func_getgrgid_r" = yes])

View File

@ -984,18 +984,16 @@ class PyBuildExt(build_ext):
#
# array objects
self.add(Extension('array', ['arraymodule.c']))
self.addext(Extension('array', ['arraymodule.c']))
# Context Variables
self.add(Extension('_contextvars', ['_contextvarsmodule.c']))
self.addext(Extension('_contextvars', ['_contextvarsmodule.c']))
# math library functions, e.g. sin()
self.add(Extension('math', ['mathmodule.c'],
libraries=['m']))
self.addext(Extension('math', ['mathmodule.c']))
# complex math library functions
self.add(Extension('cmath', ['cmathmodule.c'],
libraries=['m']))
self.addext(Extension('cmath', ['cmathmodule.c']))
# time libraries: librt may be needed for clock_gettime()
time_libs = []