Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45847: Port audioop, _csv, and _posixsubprocess to PY_STDLIB_MOD_SIMPLE #29705

Merged
merged 2 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Modules/Setup.stdlib.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
@MODULE__ASYNCIO_TRUE@_asyncio _asynciomodule.c
@MODULE__BISECT_TRUE@_bisect _bisectmodule.c
@MODULE__CONTEXTVARS_TRUE@_contextvars _contextvarsmodule.c
@MODULE__CSV_TRUE@_csv _csv.c
@MODULE__HEAPQ_TRUE@_heapq _heapqmodule.c
@MODULE__JSON_TRUE@_json _json.c
@MODULE__LSPROF_TRUE@_lsprof _lsprof.c rotatingtree.c
Expand All @@ -44,6 +45,7 @@
@MODULE__ZONEINFO_TRUE@_zoneinfo _zoneinfo.c

# needs libm
@MODULE_AUDIOOP_TRUE@audioop audioop.c
@MODULE_MATH_TRUE@math mathmodule.c
@MODULE_CMATH_TRUE@cmath cmathmodule.c
@MODULE__STATISTICS_TRUE@_statistics _statisticsmodule.c
Expand Down Expand Up @@ -100,6 +102,7 @@
@MODULE_MMAP_TRUE@mmap mmapmodule.c
# needs sys/soundcard.h or linux/soundcard.h (Linux, FreeBSD)
@MODULE_OSSAUDIODEV_TRUE@ossaudiodev ossaudiodev.c
@MODULE__POSIXSUBPROCESS_TRUE@_posixsubprocess _posixsubprocess.c
@MODULE_RESOURCE_TRUE@resource resource.c
@MODULE_SELECT_TRUE@select selectmodule.c
# AIX has shadow passwords, but does not provide getspent API
Expand Down
47 changes: 47 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,8 @@ MODULE_CMATH_FALSE
MODULE_CMATH_TRUE
MODULE__STATISTICS_FALSE
MODULE__STATISTICS_TRUE
MODULE_AUDIOOP_FALSE
MODULE_AUDIOOP_TRUE
MODULE__ZONEINFO_FALSE
MODULE__ZONEINFO_TRUE
MODULE__XXSUBINTERPRETERS_FALSE
Expand All @@ -720,6 +722,8 @@ MODULE__RANDOM_FALSE
MODULE__RANDOM_TRUE
MODULE__QUEUE_FALSE
MODULE__QUEUE_TRUE
MODULE__POSIXSUBPROCESS_FALSE
MODULE__POSIXSUBPROCESS_TRUE
MODULE__PICKLE_FALSE
MODULE__PICKLE_TRUE
MODULE__OPCODE_FALSE
Expand All @@ -730,6 +734,8 @@ MODULE__JSON_FALSE
MODULE__JSON_TRUE
MODULE__HEAPQ_FALSE
MODULE__HEAPQ_TRUE
MODULE__CSV_FALSE
MODULE__CSV_TRUE
MODULE__CONTEXTVARS_FALSE
MODULE__CONTEXTVARS_TRUE
MODULE__BISECT_FALSE
Expand Down Expand Up @@ -20198,6 +20204,15 @@ else
fi
as_fn_append MODULE_BLOCK "MODULE__CONTEXTVARS=yes$as_nl"

if true; then
MODULE__CSV_TRUE=
MODULE__CSV_FALSE='#'
else
MODULE__CSV_TRUE='#'
MODULE__CSV_FALSE=
fi
as_fn_append MODULE_BLOCK "MODULE__CSV=yes$as_nl"

if true; then
MODULE__HEAPQ_TRUE=
MODULE__HEAPQ_FALSE='#'
Expand Down Expand Up @@ -20243,6 +20258,15 @@ else
fi
as_fn_append MODULE_BLOCK "MODULE__PICKLE=yes$as_nl"

if true; then
MODULE__POSIXSUBPROCESS_TRUE=
MODULE__POSIXSUBPROCESS_FALSE='#'
else
MODULE__POSIXSUBPROCESS_TRUE='#'
MODULE__POSIXSUBPROCESS_FALSE=
fi
as_fn_append MODULE_BLOCK "MODULE__POSIXSUBPROCESS=yes$as_nl"

if true; then
MODULE__QUEUE_TRUE=
MODULE__QUEUE_FALSE='#'
Expand Down Expand Up @@ -20298,6 +20322,17 @@ fi
as_fn_append MODULE_BLOCK "MODULE__ZONEINFO=yes$as_nl"


if true; then
MODULE_AUDIOOP_TRUE=
MODULE_AUDIOOP_FALSE='#'
else
MODULE_AUDIOOP_TRUE='#'
MODULE_AUDIOOP_FALSE=
fi
as_fn_append MODULE_BLOCK "MODULE_AUDIOOP=yes$as_nl"
as_fn_append MODULE_BLOCK "MODULE_AUDIOOP_LDFLAGS=$LIBM$as_nl"


if true; then
MODULE__STATISTICS_TRUE=
MODULE__STATISTICS_FALSE='#'
Expand Down Expand Up @@ -21623,6 +21658,10 @@ if test -z "${MODULE__CONTEXTVARS_TRUE}" && test -z "${MODULE__CONTEXTVARS_FALSE
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__CSV_TRUE}" && test -z "${MODULE__CSV_FALSE}"; then
as_fn_error $? "conditional \"MODULE__CSV\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE__HEAPQ_TRUE}" && test -z "${MODULE__HEAPQ_FALSE}"; then
as_fn_error $? "conditional \"MODULE__HEAPQ\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand All @@ -21643,6 +21682,10 @@ if test -z "${MODULE__PICKLE_TRUE}" && test -z "${MODULE__PICKLE_FALSE}"; then
as_fn_error $? "conditional \"MODULE__PICKLE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE__POSIXSUBPROCESS_TRUE}" && test -z "${MODULE__POSIXSUBPROCESS_FALSE}"; then
as_fn_error $? "conditional \"MODULE__POSIXSUBPROCESS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE__QUEUE_TRUE}" && test -z "${MODULE__QUEUE_FALSE}"; then
as_fn_error $? "conditional \"MODULE__QUEUE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand All @@ -21667,6 +21710,10 @@ if test -z "${MODULE__ZONEINFO_TRUE}" && test -z "${MODULE__ZONEINFO_FALSE}"; th
as_fn_error $? "conditional \"MODULE__ZONEINFO\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE_AUDIOOP_TRUE}" && test -z "${MODULE_AUDIOOP_FALSE}"; then
as_fn_error $? "conditional \"MODULE_AUDIOOP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE__STATISTICS_TRUE}" && test -z "${MODULE__STATISTICS_FALSE}"; then
as_fn_error $? "conditional \"MODULE__STATISTICS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6105,11 +6105,13 @@ PY_STDLIB_MOD_SIMPLE([array])
PY_STDLIB_MOD_SIMPLE([_asyncio])
PY_STDLIB_MOD_SIMPLE([_bisect])
PY_STDLIB_MOD_SIMPLE([_contextvars])
PY_STDLIB_MOD_SIMPLE([_csv])
PY_STDLIB_MOD_SIMPLE([_heapq])
PY_STDLIB_MOD_SIMPLE([_json])
PY_STDLIB_MOD_SIMPLE([_lsprof])
PY_STDLIB_MOD_SIMPLE([_opcode])
PY_STDLIB_MOD_SIMPLE([_pickle])
PY_STDLIB_MOD_SIMPLE([_posixsubprocess])
PY_STDLIB_MOD_SIMPLE([_queue])
PY_STDLIB_MOD_SIMPLE([_random])
PY_STDLIB_MOD_SIMPLE([select])
Expand All @@ -6118,6 +6120,7 @@ PY_STDLIB_MOD_SIMPLE([_xxsubinterpreters])
PY_STDLIB_MOD_SIMPLE([_zoneinfo])

dnl needs libm
PY_STDLIB_MOD_SIMPLE([audioop], [], [$LIBM])
PY_STDLIB_MOD_SIMPLE([_statistics], [], [$LIBM])
PY_STDLIB_MOD_SIMPLE([cmath], [], [$LIBM])
PY_STDLIB_MOD_SIMPLE([math], [], [$LIBM])
Expand Down
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,14 +1062,13 @@ def detect_simple_extensions(self):
# 64-bit platforms.
#
# audioop needs libm for floor() in multiple functions.
self.add(Extension('audioop', ['audioop.c'],
libraries=['m']))
self.addext(Extension('audioop', ['audioop.c']))

# CSV files
self.add(Extension('_csv', ['_csv.c']))
self.addext(Extension('_csv', ['_csv.c']))

# POSIX subprocess module helper.
self.add(Extension('_posixsubprocess', ['_posixsubprocess.c']))
self.addext(Extension('_posixsubprocess', ['_posixsubprocess.c']))

def detect_test_extensions(self):
# Python C API test module
Expand Down