Python-checkins
Threads by month
- ----- 2024 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
November 2021
- 1 participants
- 444 discussions
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only (GH-29691) (GH-29708)
by rhettinger 22 Nov '21
by rhettinger 22 Nov '21
22 Nov '21
https://github.com/python/cpython/commit/56b5cd52ab58d8f2f11f253ec1bb3e6000…
commit: 56b5cd52ab58d8f2f11f253ec1bb3e6000d2dbd2
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington(a)users.noreply.github.com>
committer: rhettinger <rhettinger(a)users.noreply.github.com>
date: 2021-11-22T09:05:54-06:00
summary:
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only (GH-29691) (GH-29708)
(cherry picked from commit 4fad314246399b69ef0c57ba8527d9efade99069)
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz(a)gmx.de>
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz(a)gmx.de>
files:
M Lib/test/test_collections.py
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 75af29b2dc72d..3404b8ad1bcf7 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -668,6 +668,7 @@ class Point(namedtuple('_Point', ['x', 'y'])):
a.w = 5
self.assertEqual(a.__dict__, {'w': 5})
+ @support.cpython_only
def test_field_descriptor(self):
Point = namedtuple('Point', 'x y')
p = Point(11, 22)
1
0
https://github.com/python/cpython/commit/0e1c2f3ef84572b79fa7d8498a69bc5a56…
commit: 0e1c2f3ef84572b79fa7d8498a69bc5a56ff0d8d
branch: main
author: Christian Heimes <christian(a)python.org>
committer: tiran <christian(a)python.org>
date: 2021-11-22T15:58:43+01:00
summary:
bpo-45847: port _struct to PY_STDLIB_MOD (GH-29706)
files:
M Modules/Setup.stdlib.in
M configure
M configure.ac
M setup.py
diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in
index 0688c350db238..b12ae9db5e9b2 100644
--- a/Modules/Setup.stdlib.in
+++ b/Modules/Setup.stdlib.in
@@ -40,6 +40,7 @@
@MODULE__PICKLE_TRUE@_pickle _pickle.c
@MODULE__QUEUE_TRUE@_queue _queuemodule.c
@MODULE__RANDOM_TRUE@_random _randommodule.c
+@MODULE__STRUCT_TRUE@_struct _struct.c
@MODULE__TYPING_TRUE@_typing _typingmodule.c
@MODULE__XXSUBINTERPRETERS_TRUE@_xxsubinterpreters _xxsubinterpretersmodule.c
@MODULE__ZONEINFO_TRUE@_zoneinfo _zoneinfo.c
diff --git a/configure b/configure
index 193d6b9179b75..a1fc09fc04854 100755
--- a/configure
+++ b/configure
@@ -718,6 +718,8 @@ MODULE__XXSUBINTERPRETERS_FALSE
MODULE__XXSUBINTERPRETERS_TRUE
MODULE__TYPING_FALSE
MODULE__TYPING_TRUE
+MODULE__STRUCT_FALSE
+MODULE__STRUCT_TRUE
MODULE_SELECT_FALSE
MODULE_SELECT_TRUE
MODULE__RANDOM_FALSE
@@ -20571,6 +20573,15 @@ else
fi
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
MODULE__TYPING_TRUE=
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.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
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
as_fn_error $? "conditional \"MODULE__TYPING\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/configure.ac b/configure.ac
index b48fa56d3998e..5757c3b2586bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6137,6 +6137,7 @@ PY_STDLIB_MOD_SIMPLE([_posixsubprocess])
PY_STDLIB_MOD_SIMPLE([_queue])
PY_STDLIB_MOD_SIMPLE([_random])
PY_STDLIB_MOD_SIMPLE([select])
+PY_STDLIB_MOD_SIMPLE([_struct])
PY_STDLIB_MOD_SIMPLE([_typing])
PY_STDLIB_MOD_SIMPLE([_xxsubinterpreters])
PY_STDLIB_MOD_SIMPLE([_zoneinfo])
diff --git a/setup.py b/setup.py
index 139847c87ecec..a3aa787a1b708 100644
--- a/setup.py
+++ b/setup.py
@@ -1023,6 +1023,7 @@ def detect_simple_extensions(self):
self.addext(Extension("_queue", ["_queuemodule.c"]))
self.addext(Extension("_statistics", ["_statisticsmodule.c"]))
+ self.addext(Extension("_struct", ["_struct.c"]))
self.addext(Extension("_typing", ["_typingmodule.c"]))
# Modules with some UNIX dependencies -- on by default:
@@ -1446,6 +1447,9 @@ def detect_uuid(self):
self.missing.append('_uuid')
def detect_modules(self):
+ # remove dummy extension
+ self.extensions = []
+
self.configure_compiler()
self.init_inc_lib_dirs()
@@ -2100,9 +2104,9 @@ class DummyProcess:
'build_scripts': PyBuildScripts,
'install': PyBuildInstall,
'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.
- ext_modules=[Extension('_struct', ['_struct.c'])],
+ ext_modules=[Extension('_dummy', ['_dummy.c'])],
# If you change the scripts installed here, you also need to
# check the PyBuildScripts command above, and change the links
1
0
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only (GH-29691)
by rhettinger 22 Nov '21
by rhettinger 22 Nov '21
22 Nov '21
https://github.com/python/cpython/commit/4fad314246399b69ef0c57ba8527d9efad…
commit: 4fad314246399b69ef0c57ba8527d9efade99069
branch: main
author: Carl Friedrich Bolz-Tereick <cfbolz(a)gmx.de>
committer: rhettinger <rhettinger(a)users.noreply.github.com>
date: 2021-11-22T08:44:57-06:00
summary:
bpo-45859: Mark test_field_descriptor in test_collections as CPython-only (GH-29691)
files:
M Lib/test/test_collections.py
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 1bfd44f954788..48327bf50ea42 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -668,6 +668,7 @@ class Point(namedtuple('_Point', ['x', 'y'])):
a.w = 5
self.assertEqual(a.__dict__, {'w': 5})
+ @support.cpython_only
def test_field_descriptor(self):
Point = namedtuple('Point', 'x y')
p = Point(11, 22)
1
0
bpo-45847: Port audioop, _csv, and _posixsubprocess to PY_STDLIB_MOD_SIMPLE (GH-29705)
by miss-islington 22 Nov '21
by miss-islington 22 Nov '21
22 Nov '21
https://github.com/python/cpython/commit/eee683cbde499e62fc90ad366f7c45625f…
commit: eee683cbde499e62fc90ad366f7c45625fe92150
branch: main
author: Erlend Egeberg Aasland <erlend.aasland(a)innova.no>
committer: miss-islington <31488909+miss-islington(a)users.noreply.github.com>
date: 2021-11-22T06:37:25-08:00
summary:
bpo-45847: Port audioop, _csv, and _posixsubprocess to PY_STDLIB_MOD_SIMPLE (GH-29705)
Automerge-Triggered-By: GH:tiran
files:
M Modules/Setup.stdlib.in
M configure
M configure.ac
M setup.py
diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in
index 8ab93704765a5..0688c350db238 100644
--- a/Modules/Setup.stdlib.in
+++ b/Modules/Setup.stdlib.in
@@ -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
@@ -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
@@ -103,6 +105,7 @@
@MODULE_NIS_TRUE@nis nismodule.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
diff --git a/configure b/configure
index dd2e3b8ff4d76..193d6b9179b75 100755
--- a/configure
+++ b/configure
@@ -710,6 +710,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
@@ -722,6 +724,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
@@ -732,6 +736,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
@@ -20475,6 +20481,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='#'
@@ -20520,6 +20535,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='#'
@@ -20575,6 +20599,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='#'
@@ -21936,6 +21971,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
@@ -21956,6 +21995,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
@@ -21980,6 +22023,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
diff --git a/configure.ac b/configure.ac
index 72f2def9b11af..b48fa56d3998e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6127,11 +6127,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])
@@ -6140,6 +6142,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])
diff --git a/setup.py b/setup.py
index dd1a3df60bfdf..139847c87ecec 100644
--- a/setup.py
+++ b/setup.py
@@ -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
1
0
https://github.com/python/cpython/commit/c6dec7e27a82cba33539d07ef8d7346e0a…
commit: c6dec7e27a82cba33539d07ef8d7346e0a232421
branch: main
author: Christian Heimes <christian(a)python.org>
committer: tiran <christian(a)python.org>
date: 2021-11-22T15:18:41+01:00
summary:
bpo-45847: Port nis module to PY_STDLIB_MOD (GH-29699)
files:
M Modules/Setup.stdlib.in
M configure
M configure.ac
M pyconfig.h.in
M setup.py
diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in
index fdd20d4d6217b..8ab93704765a5 100644
--- a/Modules/Setup.stdlib.in
+++ b/Modules/Setup.stdlib.in
@@ -40,7 +40,7 @@
@MODULE__QUEUE_TRUE@_queue _queuemodule.c
@MODULE__RANDOM_TRUE@_random _randommodule.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
# needs libm
@@ -98,6 +98,9 @@
@MODULE_FCNTL_TRUE@fcntl fcntlmodule.c
@MODULE_GRP_TRUE@grp grpmodule.c
@MODULE_MMAP_TRUE@mmap mmapmodule.c
+# FreeBSD: nis/yp APIs are in libc
+# Linux: glibc has deprecated SUN RPC, APIs are in libnsl and libtirpc (bpo-32521)
+@MODULE_NIS_TRUE@nis nismodule.c
# needs sys/soundcard.h or linux/soundcard.h (Linux, FreeBSD)
@MODULE_OSSAUDIODEV_TRUE@ossaudiodev ossaudiodev.c
@MODULE_RESOURCE_TRUE@resource resource.c
diff --git a/configure b/configure
index 0840727058042..dd2e3b8ff4d76 100755
--- a/configure
+++ b/configure
@@ -648,6 +648,8 @@ MODULE_ZLIB_FALSE
MODULE_ZLIB_TRUE
MODULE__SQLITE3_FALSE
MODULE__SQLITE3_TRUE
+MODULE_NIS_FALSE
+MODULE_NIS_TRUE
MODULE__DECIMAL_FALSE
MODULE__DECIMAL_TRUE
MODULE__BLAKE2_FALSE
@@ -787,6 +789,8 @@ TCLTK_LIBS
TCLTK_INCLUDES
LIBSQLITE3_LIBS
LIBSQLITE3_CFLAGS
+LIBNSL_LIBS
+LIBNSL_CFLAGS
LIBMPDEC_INTERNAL
LIBMPDEC_LDFLAGS
LIBMPDEC_CFLAGS
@@ -1014,6 +1018,8 @@ LIBS
CPPFLAGS
CPP
PROFILE_TASK
+LIBNSL_CFLAGS
+LIBNSL_LIBS
LIBSQLITE3_CFLAGS
LIBSQLITE3_LIBS
ZLIB_CFLAGS
@@ -1795,6 +1801,9 @@ Some influential environment variables:
CPP C preprocessor
PROFILE_TASK
Python args for PGO generation task
+ LIBNSL_CFLAGS
+ C compiler flags for LIBNSL, overriding pkg-config
+ LIBNSL_LIBS linker flags for LIBNSL, overriding pkg-config
LIBSQLITE3_CFLAGS
C compiler flags for LIBSQLITE3, overriding pkg-config
LIBSQLITE3_LIBS
@@ -11071,6 +11080,274 @@ if test "$have_glibc_memmove_bug" = yes; then
fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNSL" >&5
+$as_echo_n "checking for LIBNSL... " >&6; }
+
+if test -n "$LIBNSL_CFLAGS"; then
+ pkg_cv_LIBNSL_CFLAGS="$LIBNSL_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnsl\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libnsl") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBNSL_CFLAGS=`$PKG_CONFIG --cflags "libnsl" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBNSL_LIBS"; then
+ pkg_cv_LIBNSL_LIBS="$LIBNSL_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnsl\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libnsl") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBNSL_LIBS=`$PKG_CONFIG --libs "libnsl" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBNSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnsl" 2>&1`
+ else
+ LIBNSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnsl" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBNSL_PKG_ERRORS" >&5
+
+
+ LIBNSL_CFLAGS=
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yp_match" >&5
+$as_echo_n "checking for library containing yp_match... " >&6; }
+if ${ac_cv_search_yp_match+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char yp_match ();
+int
+main ()
+{
+return yp_match ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_yp_match=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_yp_match+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_yp_match+:} false; then :
+
+else
+ ac_cv_search_yp_match=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yp_match" >&5
+$as_echo "$ac_cv_search_yp_match" >&6; }
+ac_res=$ac_cv_search_yp_match
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ have_nis=yes
+else
+ have_nis=no
+fi
+
+
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
+
+
+ case $ac_cv_search_yp_match in #(
+ no) :
+ LIBNSL_LIBS= ;; #(
+ "none required") :
+ LIBNSL_LIBS= ;; #(
+ *) :
+ LIBNSL_LIBS=$ac_cv_search_yp_match
+ ;;
+esac
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ LIBNSL_CFLAGS=
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yp_match" >&5
+$as_echo_n "checking for library containing yp_match... " >&6; }
+if ${ac_cv_search_yp_match+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char yp_match ();
+int
+main ()
+{
+return yp_match ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_yp_match=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_yp_match+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_yp_match+:} false; then :
+
+else
+ ac_cv_search_yp_match=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yp_match" >&5
+$as_echo "$ac_cv_search_yp_match" >&6; }
+ac_res=$ac_cv_search_yp_match
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ have_nis=yes
+else
+ have_nis=no
+fi
+
+
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
+
+
+ case $ac_cv_search_yp_match in #(
+ no) :
+ LIBNSL_LIBS= ;; #(
+ "none required") :
+ LIBNSL_LIBS= ;; #(
+ *) :
+ LIBNSL_LIBS=$ac_cv_search_yp_match
+ ;;
+esac
+
+else
+ LIBNSL_CFLAGS=$pkg_cv_LIBNSL_CFLAGS
+ LIBNSL_LIBS=$pkg_cv_LIBNSL_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_nis=yes
+fi
+
+if test "x$have_nis" = xyes; then :
+
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ CPPFLAGS="$LIBNSL_CFLAGS $CFLAGS"
+ for ac_header in rpc/rpc.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "rpc/rpc.h" "ac_cv_header_rpc_rpc_h" "$ac_includes_default"
+if test "x$ac_cv_header_rpc_rpc_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RPC_RPC_H 1
+_ACEOF
+
+fi
+
+done
+
+
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
+
+
+
+fi
+
+
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSQLITE3" >&5
$as_echo_n "checking for LIBSQLITE3... " >&6; }
@@ -21068,6 +21345,42 @@ fi
$as_echo "$py_cv_module__decimal" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module nis" >&5
+$as_echo_n "checking for stdlib extension module nis... " >&6; }
+ case $py_stdlib_not_available in #(
+ *nis*) :
+ py_cv_module_nis=n/a ;; #(
+ *) :
+ if true; then :
+ if test "$have_nis" = yes -a "$ac_cv_header_rpc_rpc_h" = yes; then :
+ py_cv_module_nis=yes
+else
+ py_cv_module_nis=missing
+fi
+else
+ py_cv_module_nis=disabled
+fi
+ ;;
+esac
+ as_fn_append MODULE_BLOCK "MODULE_NIS=$py_cv_module_nis$as_nl"
+ if test "x$py_cv_module_nis" = xyes; then :
+
+ as_fn_append MODULE_BLOCK "MODULE_NIS_CFLAGS=$LIBNSL_CFLAGS$as_nl"
+ as_fn_append MODULE_BLOCK "MODULE_NIS_LDFLAGS=$LIBNSL_LIBS$as_nl"
+
+fi
+ if test "$py_cv_module_nis" = yes; then
+ MODULE_NIS_TRUE=
+ MODULE_NIS_FALSE='#'
+else
+ MODULE_NIS_TRUE='#'
+ MODULE_NIS_FALSE=
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $py_cv_module_nis" >&5
+$as_echo "$py_cv_module_nis" >&6; }
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _sqlite3" >&5
$as_echo_n "checking for stdlib extension module _sqlite3... " >&6; }
case $py_stdlib_not_available in #(
@@ -21787,6 +22100,10 @@ if test -z "${MODULE__DECIMAL_TRUE}" && test -z "${MODULE__DECIMAL_FALSE}"; then
as_fn_error $? "conditional \"MODULE__DECIMAL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${MODULE_NIS_TRUE}" && test -z "${MODULE_NIS_FALSE}"; then
+ as_fn_error $? "conditional \"MODULE_NIS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${MODULE__SQLITE3_TRUE}" && test -z "${MODULE__SQLITE3_FALSE}"; then
as_fn_error $? "conditional \"MODULE__SQLITE3\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/configure.ac b/configure.ac
index 05992dc28f4d1..72f2def9b11af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3191,6 +3191,28 @@ if test "$have_glibc_memmove_bug" = yes; then
AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -U_FORTIFY_SOURCE"])
fi
+
+dnl check for NIS / libnsl dependencies
+dnl libnsl dependencies include tirpc includes and lib
+PKG_CHECK_MODULES([LIBNSL], [libnsl], [have_nis=yes], [
+ LIBNSL_CFLAGS=
+ WITH_SAVE_ENV([
+ AC_SEARCH_LIBS([yp_match], [nsl], [have_nis=yes], [have_nis=no])
+ ])
+ AS_CASE([$ac_cv_search_yp_match],
+ [no], [LIBNSL_LIBS=],
+ ["none required"], [LIBNSL_LIBS=],
+ [LIBNSL_LIBS=$ac_cv_search_yp_match]
+ )
+])
+
+AS_VAR_IF([have_nis], [yes], [
+ WITH_SAVE_ENV([
+ CPPFLAGS="$LIBNSL_CFLAGS $CFLAGS"
+ AC_CHECK_HEADERS([rpc/rpc.h])
+ ])
+])
+
dnl Check for SQLite library. Use pkg-config if available.
PKG_CHECK_MODULES(
[LIBSQLITE3], [sqlite3 >= 3.7.15], [], [
@@ -6166,6 +6188,9 @@ PY_STDLIB_MOD([_sha3], [test "$with_builtin_sha3" = yes])
PY_STDLIB_MOD([_blake2], [test "$with_builtin_blake2" = yes])
PY_STDLIB_MOD([_decimal], [], [], [$LIBMPDEC_CFLAGS], [$LIBMPDEC_LDFLAGS])
+PY_STDLIB_MOD([nis],
+ [], [test "$have_nis" = yes -a "$ac_cv_header_rpc_rpc_h" = yes],
+ [$LIBNSL_CFLAGS], [$LIBNSL_LIBS])
PY_STDLIB_MOD([_sqlite3],
[test "$have_sqlite3" = "yes"],
[test "$have_supported_sqlite3" = "yes"],
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 6672344437cdd..c9c58656f58ac 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -896,6 +896,9 @@
/* Define if you have readline 4.0 */
#undef HAVE_RL_RESIZE_TERMINAL
+/* Define to 1 if you have the <rpc/rpc.h> header file. */
+#undef HAVE_RPC_RPC_H
+
/* Define to 1 if you have the `rtpSpawn' function. */
#undef HAVE_RTPSPAWN
diff --git a/setup.py b/setup.py
index b9b48b2f74ba0..dd1a3df60bfdf 100644
--- a/setup.py
+++ b/setup.py
@@ -1993,49 +1993,7 @@ def detect_hash_builtins(self):
))
def detect_nis(self):
- if MS_WINDOWS or CYGWIN or HOST_PLATFORM == 'qnx6':
- self.missing.append('nis')
- return
-
- libs = []
- library_dirs = []
- includes_dirs = []
-
- # bpo-32521: glibc has deprecated Sun RPC for some time. Fedora 28
- # moved headers and libraries to libtirpc and libnsl. The headers
- # are in tircp and nsl sub directories.
- rpcsvc_inc = find_file(
- 'rpcsvc/yp_prot.h', self.inc_dirs,
- [os.path.join(inc_dir, 'nsl') for inc_dir in self.inc_dirs]
- )
- rpc_inc = find_file(
- 'rpc/rpc.h', self.inc_dirs,
- [os.path.join(inc_dir, 'tirpc') for inc_dir in self.inc_dirs]
- )
- if rpcsvc_inc is None or rpc_inc is None:
- # not found
- self.missing.append('nis')
- return
- includes_dirs.extend(rpcsvc_inc)
- includes_dirs.extend(rpc_inc)
-
- if self.compiler.find_library_file(self.lib_dirs, 'nsl'):
- libs.append('nsl')
- else:
- # libnsl-devel: check for libnsl in nsl/ subdirectory
- nsl_dirs = [os.path.join(lib_dir, 'nsl') for lib_dir in self.lib_dirs]
- libnsl = self.compiler.find_library_file(nsl_dirs, 'nsl')
- if libnsl is not None:
- library_dirs.append(os.path.dirname(libnsl))
- libs.append('nsl')
-
- if self.compiler.find_library_file(self.lib_dirs, 'tirpc'):
- libs.append('tirpc')
-
- self.add(Extension('nis', ['nismodule.c'],
- libraries=libs,
- library_dirs=library_dirs,
- include_dirs=includes_dirs))
+ self.addext(Extension('nis', ['nismodule.c']))
class PyBuildInstall(install):
1
0
bpo-45813: Make sure that frame->generator is NULLed when generator is deallocated. (GH-29700)
by markshannon 22 Nov '21
by markshannon 22 Nov '21
22 Nov '21
https://github.com/python/cpython/commit/7fd92a8b7ee5bed28c2681fa38e0a1e762…
commit: 7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e
branch: main
author: Mark Shannon <mark(a)hotpy.org>
committer: markshannon <mark(a)hotpy.org>
date: 2021-11-22T14:01:23Z
summary:
bpo-45813: Make sure that frame->generator is NULLed when generator is deallocated. (GH-29700)
files:
A Misc/NEWS.d/next/Core and Builtins/2021-11-22-11-28-13.bpo-45813.ZMaWE2.rst
M Lib/test/test_coroutines.py
M Objects/genobject.c
M Python/frame.c
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
index 4350e185a247f..fc8b8bc9541eb 100644
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -2191,6 +2191,13 @@ async def run_gen():
return 'end'
self.assertEqual(run_async(run_gen()), ([], 'end'))
+ def test_bpo_45813(self):
+ 'This would crash the interpreter in 3.11a2'
+ async def f():
+ pass
+ frame = f().cr_frame
+ frame.clear()
+
class CoroAsyncIOCompatTest(unittest.TestCase):
diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-11-22-11-28-13.bpo-45813.ZMaWE2.rst b/Misc/NEWS.d/next/Core and Builtins/2021-11-22-11-28-13.bpo-45813.ZMaWE2.rst
new file mode 100644
index 0000000000000..65f64b11de0f7
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2021-11-22-11-28-13.bpo-45813.ZMaWE2.rst
@@ -0,0 +1 @@
+Fix crash when calling coro.cr_frame.clear() after coroutine has been freed.
diff --git a/Objects/genobject.c b/Objects/genobject.c
index efd255d33f9be..c899ed6a82e30 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -134,6 +134,7 @@ gen_dealloc(PyGenObject *gen)
InterpreterFrame *frame = gen->gi_xframe;
if (frame != NULL) {
gen->gi_xframe = NULL;
+ frame->generator = NULL;
frame->previous = NULL;
_PyFrame_Clear(frame, 1);
}
diff --git a/Python/frame.c b/Python/frame.c
index 3d2415fee7097..a5c93eaaa5f37 100644
--- a/Python/frame.c
+++ b/Python/frame.c
@@ -99,6 +99,9 @@ take_ownership(PyFrameObject *f, InterpreterFrame *frame)
int
_PyFrame_Clear(InterpreterFrame * frame, int take)
{
+ /* It is the responsibility of the owning generator/coroutine
+ * to have cleared the generator pointer */
+ assert(frame->generator == NULL);
if (frame->frame_obj) {
PyFrameObject *f = frame->frame_obj;
frame->frame_obj = NULL;
1
0
https://github.com/python/cpython/commit/d9cedabeba0d87799f99c0717e81743a1c…
commit: d9cedabeba0d87799f99c0717e81743a1c2d34ce
branch: main
author: Christian Heimes <christian(a)python.org>
committer: tiran <christian(a)python.org>
date: 2021-11-22T14:52:29+01:00
summary:
bpo-45847: Port compression libs to PY_STDLIB_MOD (GH-29702)
files:
M Modules/Setup.stdlib.in
M configure
M configure.ac
M pyconfig.h.in
M setup.py
diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in
index 339a32416d820..fdd20d4d6217b 100644
--- a/Modules/Setup.stdlib.in
+++ b/Modules/Setup.stdlib.in
@@ -56,6 +56,13 @@
# with ./configure --with-system-libmpdec
@MODULE__DECIMAL_TRUE@_decimal _decimal/_decimal.c
+# compression libs and binascii (optional CRC32 from zlib)
+# bindings need -lbz2, -lz, or -llzma, respectively
+@MODULE_BINASCII_TRUE@binascii binascii.c
+@MODULE__BZ2_TRUE@_bz2 _bz2module.c
+@MODULE__LZMA_TRUE@_lzma _lzmamodule.c
+@MODULE_ZLIB_TRUE@zlib zlibmodule.c
+
# hashing builtins, can be disabled with --without-builtin-hashlib-hashes
@MODULE__MD5_TRUE@_md5 md5module.c
@MODULE__SHA1_TRUE@_sha1 sha1module.c
diff --git a/configure b/configure
index f3c33614e4faf..0840727058042 100755
--- a/configure
+++ b/configure
@@ -638,6 +638,14 @@ MODULE__TESTINTERNALCAPI_FALSE
MODULE__TESTINTERNALCAPI_TRUE
MODULE__TESTCAPI_FALSE
MODULE__TESTCAPI_TRUE
+MODULE__LZMA_FALSE
+MODULE__LZMA_TRUE
+MODULE__BZ2_FALSE
+MODULE__BZ2_TRUE
+MODULE_BINASCII_FALSE
+MODULE_BINASCII_TRUE
+MODULE_ZLIB_FALSE
+MODULE_ZLIB_TRUE
MODULE__SQLITE3_FALSE
MODULE__SQLITE3_TRUE
MODULE__DECIMAL_FALSE
@@ -761,6 +769,12 @@ HAVE_GETHOSTBYNAME_R_3_ARG
HAVE_GETHOSTBYNAME_R_5_ARG
HAVE_GETHOSTBYNAME_R_6_ARG
LIBOBJS
+LIBLZMA_LIBS
+LIBLZMA_CFLAGS
+BZIP2_LIBS
+BZIP2_CFLAGS
+ZLIB_LIBS
+ZLIB_CFLAGS
TRUE
MACHDEP_OBJS
DYNLOADFILE
@@ -1001,7 +1015,13 @@ CPPFLAGS
CPP
PROFILE_TASK
LIBSQLITE3_CFLAGS
-LIBSQLITE3_LIBS'
+LIBSQLITE3_LIBS
+ZLIB_CFLAGS
+ZLIB_LIBS
+BZIP2_CFLAGS
+BZIP2_LIBS
+LIBLZMA_CFLAGS
+LIBLZMA_LIBS'
# Initialize some variables set by options.
@@ -1779,6 +1799,15 @@ Some influential environment variables:
C compiler flags for LIBSQLITE3, overriding pkg-config
LIBSQLITE3_LIBS
linker flags for LIBSQLITE3, overriding pkg-config
+ ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config
+ ZLIB_LIBS linker flags for ZLIB, overriding pkg-config
+ BZIP2_CFLAGS
+ C compiler flags for BZIP2, overriding pkg-config
+ BZIP2_LIBS linker flags for BZIP2, overriding pkg-config
+ LIBLZMA_CFLAGS
+ C compiler flags for LIBLZMA, overriding pkg-config
+ LIBLZMA_LIBS
+ linker flags for LIBLZMA, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -13710,7 +13739,69 @@ $as_echo "#define HAVE_LCHFLAGS 1" >>confdefs.h
fi
-for ac_header in zlib.h
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZLIB" >&5
+$as_echo_n "checking for ZLIB... " >&6; }
+
+if test -n "$ZLIB_CFLAGS"; then
+ pkg_cv_ZLIB_CFLAGS="$ZLIB_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "zlib >= 1.2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_ZLIB_CFLAGS=`$PKG_CONFIG --cflags "zlib >= 1.2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$ZLIB_LIBS"; then
+ pkg_cv_ZLIB_LIBS="$ZLIB_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "zlib >= 1.2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_ZLIB_LIBS=`$PKG_CONFIG --libs "zlib >= 1.2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ ZLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib >= 1.2.0" 2>&1`
+ else
+ ZLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib >= 1.2.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$ZLIB_PKG_ERRORS" >&5
+
+
+ for ac_header in zlib.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
if test "x$ac_cv_header_zlib_h" = xyes; then :
@@ -13718,8 +13809,13 @@ if test "x$ac_cv_header_zlib_h" = xyes; then :
#define HAVE_ZLIB_H 1
_ACEOF
- save_LIBS="$LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5
$as_echo_n "checking for gzread in -lz... " >&6; }
if ${ac_cv_lib_z_gzread+:} false; then :
$as_echo_n "(cached) " >&6
@@ -13756,16 +13852,11 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5
$as_echo "$ac_cv_lib_z_gzread" >&6; }
if test "x$ac_cv_lib_z_gzread" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
-
- LIBS="-lz $LIBS"
-fi
-
- LIBS="$save_LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5
+ have_zlib=yes
+ ZLIB_CFLAGS=
+ ZLIB_LIBS=-lz
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5
$as_echo_n "checking for inflateCopy in -lz... " >&6; }
if ${ac_cv_lib_z_inflateCopy+:} false; then :
$as_echo_n "(cached) " >&6
@@ -13802,34 +13893,57 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy" >&5
$as_echo "$ac_cv_lib_z_inflateCopy" >&6; }
if test "x$ac_cv_lib_z_inflateCopy" = xyes; then :
+ $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
+
+fi
-$as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
+
+else
+
+ have_zlib=no
fi
- LIBS="$save_LIBS"
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
+
+
+
+else
+ have_zlib=no
fi
done
-for ac_header in bzlib.h
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ for ac_header in zlib.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_bzlib_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_BZLIB_H 1
+#define HAVE_ZLIB_H 1
_ACEOF
- save_LIBS="$LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzCompress in -lbz2" >&5
-$as_echo_n "checking for BZ2_bzCompress in -lbz2... " >&6; }
-if ${ac_cv_lib_bz2_BZ2_bzCompress+:} false; then :
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5
+$as_echo_n "checking for gzread in -lz... " >&6; }
+if ${ac_cv_lib_z_gzread+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbz2 $LIBS"
+LIBS="-lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -13839,58 +13953,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char BZ2_bzCompress ();
+char gzread ();
int
main ()
{
-return BZ2_bzCompress ();
+return gzread ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_bz2_BZ2_bzCompress=yes
+ ac_cv_lib_z_gzread=yes
else
- ac_cv_lib_bz2_BZ2_bzCompress=no
+ ac_cv_lib_z_gzread=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzCompress" >&5
-$as_echo "$ac_cv_lib_bz2_BZ2_bzCompress" >&6; }
-if test "x$ac_cv_lib_bz2_BZ2_bzCompress" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBBZ2 1
-_ACEOF
-
- LIBS="-lbz2 $LIBS"
-
-fi
-
- LIBS="$save_LIBS"
-
-fi
-
-done
-
-
-for ac_header in lzma.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzma_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LZMA_H 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5
+$as_echo "$ac_cv_lib_z_gzread" >&6; }
+if test "x$ac_cv_lib_z_gzread" = xyes; then :
- save_LIBS="$LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_easy_encoder in -llzma" >&5
-$as_echo_n "checking for lzma_easy_encoder in -llzma... " >&6; }
-if ${ac_cv_lib_lzma_lzma_easy_encoder+:} false; then :
+ have_zlib=yes
+ ZLIB_CFLAGS=
+ ZLIB_LIBS=-lz
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5
+$as_echo_n "checking for inflateCopy in -lz... " >&6; }
+if ${ac_cv_lib_z_inflateCopy+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-llzma $LIBS"
+LIBS="-lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -13900,128 +13994,602 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char lzma_easy_encoder ();
+char inflateCopy ();
int
main ()
{
-return lzma_easy_encoder ();
+return inflateCopy ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_lzma_lzma_easy_encoder=yes
+ ac_cv_lib_z_inflateCopy=yes
else
- ac_cv_lib_lzma_lzma_easy_encoder=no
+ ac_cv_lib_z_inflateCopy=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_easy_encoder" >&5
-$as_echo "$ac_cv_lib_lzma_lzma_easy_encoder" >&6; }
-if test "x$ac_cv_lib_lzma_lzma_easy_encoder" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBLZMA 1
-_ACEOF
-
- LIBS="-llzma $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy" >&5
+$as_echo "$ac_cv_lib_z_inflateCopy" >&6; }
+if test "x$ac_cv_lib_z_inflateCopy" = xyes; then :
+ $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
fi
- LIBS="$save_LIBS"
+
+else
+
+ have_zlib=no
fi
-done
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hstrerror" >&5
-$as_echo_n "checking for hstrerror... " >&6; }
-if ${ac_cv_func_hstrerror+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <netdb.h>
-int
-main ()
-{
-void *x=hstrerror
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_func_hstrerror=yes
else
- ac_cv_func_hstrerror=no
+ have_zlib=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_hstrerror" >&5
-$as_echo "$ac_cv_func_hstrerror" >&6; }
- if test "x$ac_cv_func_hstrerror" = xyes; then :
+done
-$as_echo "#define HAVE_HSTRERROR 1" >>confdefs.h
-fi
+else
+ ZLIB_CFLAGS=$pkg_cv_ZLIB_CFLAGS
+ ZLIB_LIBS=$pkg_cv_ZLIB_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_zlib=yes
+ $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
+fi
+if test "x$have_zlib" = xyes; then :
+ BINASCII_CFLAGS="-DUSE_ZLIB_CRC32 $ZLIB_CFLAGS"
+ BINASCII_LIBS="$ZLIB_LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5
-$as_echo_n "checking for inet_aton... " >&6; }
-if ${ac_cv_func_inet_aton+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+fi
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-int
-main ()
-{
-void *x=inet_aton
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_func_inet_aton=yes
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZIP2" >&5
+$as_echo_n "checking for BZIP2... " >&6; }
+
+if test -n "$BZIP2_CFLAGS"; then
+ pkg_cv_BZIP2_CFLAGS="$BZIP2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bzip2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "bzip2") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_BZIP2_CFLAGS=`$PKG_CONFIG --cflags "bzip2" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
else
- ac_cv_func_inet_aton=no
+ pkg_failed=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
+ else
+ pkg_failed=untried
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_inet_aton" >&5
-$as_echo "$ac_cv_func_inet_aton" >&6; }
- if test "x$ac_cv_func_inet_aton" = xyes; then :
-
-$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
-
+if test -n "$BZIP2_LIBS"; then
+ pkg_cv_BZIP2_LIBS="$BZIP2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bzip2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "bzip2") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_BZIP2_LIBS=`$PKG_CONFIG --libs "bzip2" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
fi
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ BZIP2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bzip2" 2>&1`
+ else
+ BZIP2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bzip2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$BZIP2_PKG_ERRORS" >&5
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5
-$as_echo_n "checking for inet_pton... " >&6; }
-if ${ac_cv_func_inet_pton+:} false; then :
- $as_echo_n "(cached) " >&6
-else
+ for ac_header in bzlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_BZLIB_H 1
+_ACEOF
+
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzCompress in -lbz2" >&5
+$as_echo_n "checking for BZ2_bzCompress in -lbz2... " >&6; }
+if ${ac_cv_lib_bz2_BZ2_bzCompress+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbz2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char BZ2_bzCompress ();
+int
+main ()
+{
+return BZ2_bzCompress ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_bz2_BZ2_bzCompress=yes
+else
+ ac_cv_lib_bz2_BZ2_bzCompress=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzCompress" >&5
+$as_echo "$ac_cv_lib_bz2_BZ2_bzCompress" >&6; }
+if test "x$ac_cv_lib_bz2_BZ2_bzCompress" = xyes; then :
+
+ have_bzip2=yes
+ BZIP2_CFLAGS=
+ BZIP2_LIBS=-lbz2
+
+else
+ have_bzip2=no
+fi
+
+
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
+
+
+
+else
+ have_bzip2=no
+fi
+
+done
+
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ for ac_header in bzlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_BZLIB_H 1
+_ACEOF
+
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzCompress in -lbz2" >&5
+$as_echo_n "checking for BZ2_bzCompress in -lbz2... " >&6; }
+if ${ac_cv_lib_bz2_BZ2_bzCompress+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbz2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char BZ2_bzCompress ();
+int
+main ()
+{
+return BZ2_bzCompress ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_bz2_BZ2_bzCompress=yes
+else
+ ac_cv_lib_bz2_BZ2_bzCompress=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzCompress" >&5
+$as_echo "$ac_cv_lib_bz2_BZ2_bzCompress" >&6; }
+if test "x$ac_cv_lib_bz2_BZ2_bzCompress" = xyes; then :
+
+ have_bzip2=yes
+ BZIP2_CFLAGS=
+ BZIP2_LIBS=-lbz2
+
+else
+ have_bzip2=no
+fi
+
+
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
+
+
+
+else
+ have_bzip2=no
+fi
+
+done
+
+
+else
+ BZIP2_CFLAGS=$pkg_cv_BZIP2_CFLAGS
+ BZIP2_LIBS=$pkg_cv_BZIP2_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_bzip2=yes
+fi
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBLZMA" >&5
+$as_echo_n "checking for LIBLZMA... " >&6; }
+
+if test -n "$LIBLZMA_CFLAGS"; then
+ pkg_cv_LIBLZMA_CFLAGS="$LIBLZMA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "liblzma") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBLZMA_CFLAGS=`$PKG_CONFIG --cflags "liblzma" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBLZMA_LIBS"; then
+ pkg_cv_LIBLZMA_LIBS="$LIBLZMA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "liblzma") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBLZMA_LIBS=`$PKG_CONFIG --libs "liblzma" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBLZMA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblzma" 2>&1`
+ else
+ LIBLZMA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblzma" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBLZMA_PKG_ERRORS" >&5
+
+
+ for ac_header in lzma.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
+if test "x$ac_cv_header_lzma_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LZMA_H 1
+_ACEOF
+
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_easy_encoder in -llzma" >&5
+$as_echo_n "checking for lzma_easy_encoder in -llzma... " >&6; }
+if ${ac_cv_lib_lzma_lzma_easy_encoder+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzma $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzma_easy_encoder ();
+int
+main ()
+{
+return lzma_easy_encoder ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_lzma_lzma_easy_encoder=yes
+else
+ ac_cv_lib_lzma_lzma_easy_encoder=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_easy_encoder" >&5
+$as_echo "$ac_cv_lib_lzma_lzma_easy_encoder" >&6; }
+if test "x$ac_cv_lib_lzma_lzma_easy_encoder" = xyes; then :
+
+ have_liblzma=yes
+ LIBLZMA_CFLAGS=
+ LIBLZMA_LIBS=-llzma
+
+else
+ have_liblzma=no
+fi
+
+
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
+
+
+
+else
+ have_liblzma=no
+fi
+
+done
+
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ for ac_header in lzma.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
+if test "x$ac_cv_header_lzma_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LZMA_H 1
+_ACEOF
+
+ save_CFLAGS=$CFLAGS
+save_CPPFLAGS=$CPPFLAGS
+save_LDFLAGS=$LDFLAGS
+save_LIBS=$LIBS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_easy_encoder in -llzma" >&5
+$as_echo_n "checking for lzma_easy_encoder in -llzma... " >&6; }
+if ${ac_cv_lib_lzma_lzma_easy_encoder+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzma $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzma_easy_encoder ();
+int
+main ()
+{
+return lzma_easy_encoder ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_lzma_lzma_easy_encoder=yes
+else
+ ac_cv_lib_lzma_lzma_easy_encoder=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_easy_encoder" >&5
+$as_echo "$ac_cv_lib_lzma_lzma_easy_encoder" >&6; }
+if test "x$ac_cv_lib_lzma_lzma_easy_encoder" = xyes; then :
+
+ have_liblzma=yes
+ LIBLZMA_CFLAGS=
+ LIBLZMA_LIBS=-llzma
+
+else
+ have_liblzma=no
+fi
+
+
+CFLAGS=$save_CFLAGS
+CPPFLAGS=$save_CPPFLAGS
+LDFLAGS=$save_LDFLAGS
+LIBS=$save_LIBS
+
+
+
+else
+ have_liblzma=no
+fi
+
+done
+
+
+else
+ LIBLZMA_CFLAGS=$pkg_cv_LIBLZMA_CFLAGS
+ LIBLZMA_LIBS=$pkg_cv_LIBLZMA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_liblzma=yes
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hstrerror" >&5
+$as_echo_n "checking for hstrerror... " >&6; }
+if ${ac_cv_func_hstrerror+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netdb.h>
+int
+main ()
+{
+void *x=hstrerror
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_func_hstrerror=yes
+else
+ ac_cv_func_hstrerror=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_hstrerror" >&5
+$as_echo "$ac_cv_func_hstrerror" >&6; }
+ if test "x$ac_cv_func_hstrerror" = xyes; then :
+
+$as_echo "#define HAVE_HSTRERROR 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5
+$as_echo_n "checking for inet_aton... " >&6; }
+if ${ac_cv_func_inet_aton+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+int
+main ()
+{
+void *x=inet_aton
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_func_inet_aton=yes
+else
+ ac_cv_func_inet_aton=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_inet_aton" >&5
+$as_echo "$ac_cv_func_inet_aton" >&6; }
+ if test "x$ac_cv_func_inet_aton" = xyes; then :
+
+$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5
+$as_echo_n "checking for inet_pton... " >&6; }
+if ${ac_cv_func_inet_pton+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -20537,6 +21105,128 @@ $as_echo "$py_cv_module__sqlite3" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module zlib" >&5
+$as_echo_n "checking for stdlib extension module zlib... " >&6; }
+ case $py_stdlib_not_available in #(
+ *zlib*) :
+ py_cv_module_zlib=n/a ;; #(
+ *) :
+ if true; then :
+ if test "$have_zlib" = yes; then :
+ py_cv_module_zlib=yes
+else
+ py_cv_module_zlib=missing
+fi
+else
+ py_cv_module_zlib=disabled
+fi
+ ;;
+esac
+ as_fn_append MODULE_BLOCK "MODULE_ZLIB=$py_cv_module_zlib$as_nl"
+ if test "x$py_cv_module_zlib" = xyes; then :
+
+ as_fn_append MODULE_BLOCK "MODULE_ZLIB_CFLAGS=$ZLIB_CFLAGS$as_nl"
+ as_fn_append MODULE_BLOCK "MODULE_ZLIB_LDFLAGS=$ZLIB_LIBS$as_nl"
+
+fi
+ if test "$py_cv_module_zlib" = yes; then
+ MODULE_ZLIB_TRUE=
+ MODULE_ZLIB_FALSE='#'
+else
+ MODULE_ZLIB_TRUE='#'
+ MODULE_ZLIB_FALSE=
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $py_cv_module_zlib" >&5
+$as_echo "$py_cv_module_zlib" >&6; }
+
+
+ if true; then
+ MODULE_BINASCII_TRUE=
+ MODULE_BINASCII_FALSE='#'
+else
+ MODULE_BINASCII_TRUE='#'
+ MODULE_BINASCII_FALSE=
+fi
+ as_fn_append MODULE_BLOCK "MODULE_BINASCII=yes$as_nl"
+ as_fn_append MODULE_BLOCK "MODULE_BINASCII_CFLAGS=$BINASCII_CFLAGS$as_nl"
+
+ as_fn_append MODULE_BLOCK "MODULE_BINASCII_LDFLAGS=$BINASCII_LIBS$as_nl"
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _bz2" >&5
+$as_echo_n "checking for stdlib extension module _bz2... " >&6; }
+ case $py_stdlib_not_available in #(
+ *_bz2*) :
+ py_cv_module__bz2=n/a ;; #(
+ *) :
+ if true; then :
+ if test "$have_bzip2" = yes; then :
+ py_cv_module__bz2=yes
+else
+ py_cv_module__bz2=missing
+fi
+else
+ py_cv_module__bz2=disabled
+fi
+ ;;
+esac
+ as_fn_append MODULE_BLOCK "MODULE__BZ2=$py_cv_module__bz2$as_nl"
+ if test "x$py_cv_module__bz2" = xyes; then :
+
+ as_fn_append MODULE_BLOCK "MODULE__BZ2_CFLAGS=$BZIP2_CFLAGS$as_nl"
+ as_fn_append MODULE_BLOCK "MODULE__BZ2_LDFLAGS=$BZIP2_LIBS$as_nl"
+
+fi
+ if test "$py_cv_module__bz2" = yes; then
+ MODULE__BZ2_TRUE=
+ MODULE__BZ2_FALSE='#'
+else
+ MODULE__BZ2_TRUE='#'
+ MODULE__BZ2_FALSE=
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $py_cv_module__bz2" >&5
+$as_echo "$py_cv_module__bz2" >&6; }
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _lzma" >&5
+$as_echo_n "checking for stdlib extension module _lzma... " >&6; }
+ case $py_stdlib_not_available in #(
+ *_lzma*) :
+ py_cv_module__lzma=n/a ;; #(
+ *) :
+ if true; then :
+ if test "$have_liblzma" = yes; then :
+ py_cv_module__lzma=yes
+else
+ py_cv_module__lzma=missing
+fi
+else
+ py_cv_module__lzma=disabled
+fi
+ ;;
+esac
+ as_fn_append MODULE_BLOCK "MODULE__LZMA=$py_cv_module__lzma$as_nl"
+ if test "x$py_cv_module__lzma" = xyes; then :
+
+ as_fn_append MODULE_BLOCK "MODULE__LZMA_CFLAGS=$LIBLZMA_CFLAGS$as_nl"
+ as_fn_append MODULE_BLOCK "MODULE__LZMA_LDFLAGS=$LIBLZMA_LIBS$as_nl"
+
+fi
+ if test "$py_cv_module__lzma" = yes; then
+ MODULE__LZMA_TRUE=
+ MODULE__LZMA_FALSE='#'
+else
+ MODULE__LZMA_TRUE='#'
+ MODULE__LZMA_FALSE=
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $py_cv_module__lzma" >&5
+$as_echo "$py_cv_module__lzma" >&6; }
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _testcapi" >&5
$as_echo_n "checking for stdlib extension module _testcapi... " >&6; }
case $py_stdlib_not_available in #(
@@ -21101,6 +21791,22 @@ if test -z "${MODULE__SQLITE3_TRUE}" && test -z "${MODULE__SQLITE3_FALSE}"; then
as_fn_error $? "conditional \"MODULE__SQLITE3\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${MODULE_ZLIB_TRUE}" && test -z "${MODULE_ZLIB_FALSE}"; then
+ as_fn_error $? "conditional \"MODULE_ZLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MODULE_BINASCII_TRUE}" && test -z "${MODULE_BINASCII_FALSE}"; then
+ as_fn_error $? "conditional \"MODULE_BINASCII\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MODULE__BZ2_TRUE}" && test -z "${MODULE__BZ2_FALSE}"; then
+ as_fn_error $? "conditional \"MODULE__BZ2\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MODULE__LZMA_TRUE}" && test -z "${MODULE__LZMA_FALSE}"; then
+ as_fn_error $? "conditional \"MODULE__LZMA\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${MODULE__TESTCAPI_TRUE}" && test -z "${MODULE__TESTCAPI_FALSE}"; then
as_fn_error $? "conditional \"MODULE__TESTCAPI\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/configure.ac b/configure.ac
index 224a9b959d4f9..05992dc28f4d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4054,24 +4054,55 @@ if test "$ac_cv_have_lchflags" = yes ; then
fi
dnl Check for compression libraries
-AC_CHECK_HEADERS([zlib.h], [
- save_LIBS="$LIBS"
- AC_CHECK_LIB([z], [gzread])
- LIBS="$save_LIBS"
- AC_CHECK_LIB([z], [inflateCopy], [AC_DEFINE(HAVE_ZLIB_COPY, 1, [Define if the zlib library has inflateCopy])])
- LIBS="$save_LIBS"
+AH_TEMPLATE([HAVE_ZLIB_COPY], [Define if the zlib library has inflateCopy])
+
+PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0], [
+ have_zlib=yes
+ dnl zlib 1.2.0 (2003) added inflateCopy
+ AC_DEFINE([HAVE_ZLIB_COPY], [1])
+], [
+ AC_CHECK_HEADERS([zlib.h], [
+ WITH_SAVE_ENV([
+ AC_CHECK_LIB([z], [gzread], [
+ have_zlib=yes
+ ZLIB_CFLAGS=
+ ZLIB_LIBS=-lz
+ AC_CHECK_LIB([z], [inflateCopy], [AC_DEFINE([HAVE_ZLIB_COPY], [1])])
+ ], [
+ have_zlib=no
+ ])
+ ])
+ ], [have_zlib=no])
])
-AC_CHECK_HEADERS([bzlib.h], [
- save_LIBS="$LIBS"
- AC_CHECK_LIB([bz2], [BZ2_bzCompress])
- LIBS="$save_LIBS"
+dnl binascii can use zlib for optimized crc32.
+AS_VAR_IF([have_zlib], [yes], [
+ BINASCII_CFLAGS="-DUSE_ZLIB_CRC32 $ZLIB_CFLAGS"
+ BINASCII_LIBS="$ZLIB_LIBS"
])
-AC_CHECK_HEADERS([lzma.h], [
- save_LIBS="$LIBS"
- AC_CHECK_LIB([lzma], [lzma_easy_encoder])
- LIBS="$save_LIBS"
+PKG_CHECK_MODULES([BZIP2], [bzip2], [have_bzip2=yes], [
+ AC_CHECK_HEADERS([bzlib.h], [
+ WITH_SAVE_ENV([
+ AC_CHECK_LIB([bz2], [BZ2_bzCompress], [
+ have_bzip2=yes
+ BZIP2_CFLAGS=
+ BZIP2_LIBS=-lbz2
+ ], [have_bzip2=no])
+ ])
+ ], [have_bzip2=no])
+])
+
+PKG_CHECK_MODULES([LIBLZMA], [liblzma], [have_liblzma=yes], [
+ AC_CHECK_HEADERS([lzma.h], [
+ WITH_SAVE_ENV([
+ AC_CHECK_LIB([lzma], [lzma_easy_encoder], [
+ have_liblzma=yes
+ LIBLZMA_CFLAGS=
+ LIBLZMA_LIBS=-llzma
+ ], [have_liblzma=no])
+ ])
+ ], [have_liblzma=no])
])
PY_CHECK_FUNC([hstrerror], [#include <netdb.h>])
@@ -6140,6 +6171,16 @@ PY_STDLIB_MOD([_sqlite3],
[test "$have_supported_sqlite3" = "yes"],
[$LIBSQLITE3_CFLAGS], [$LIBSQLITE3_LIBS])
+dnl compression libs
+PY_STDLIB_MOD([zlib], [], [test "$have_zlib" = yes],
+ [$ZLIB_CFLAGS], [$ZLIB_LIBS])
+dnl binascii can use zlib for optimized crc32.
+PY_STDLIB_MOD_SIMPLE([binascii], [$BINASCII_CFLAGS], [$BINASCII_LIBS])
+PY_STDLIB_MOD([_bz2], [], [test "$have_bzip2" = yes],
+ [$BZIP2_CFLAGS], [$BZIP2_LIBS])
+PY_STDLIB_MOD([_lzma], [], [test "$have_liblzma" = yes],
+ [$LIBLZMA_CFLAGS], [$LIBLZMA_LIBS])
+
dnl test modules
PY_STDLIB_MOD([_testcapi], [test "$TEST_MODULES" = yes])
PY_STDLIB_MOD([_testinternalcapi], [test "$TEST_MODULES" = yes])
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 6f3adb2314ab7..6672344437cdd 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -595,9 +595,6 @@
/* Define to 1 if you have the `lchown' function. */
#undef HAVE_LCHOWN
-/* Define to 1 if you have the `bz2' library (-lbz2). */
-#undef HAVE_LIBBZ2
-
/* Define to 1 if you have the `db' library (-ldb). */
#undef HAVE_LIBDB
@@ -619,9 +616,6 @@
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
-/* Define to 1 if you have the `lzma' library (-llzma). */
-#undef HAVE_LIBLZMA
-
/* Define to 1 if you have the `ndbm' library (-lndbm). */
#undef HAVE_LIBNDBM
@@ -640,9 +634,6 @@
/* Define to 1 if you have the `uuid' library (-luuid). */
#undef HAVE_LIBUUID
-/* Define to 1 if you have the `z' library (-lz). */
-#undef HAVE_LIBZ
-
/* Define if you have the 'link' function. */
#undef HAVE_LINK
diff --git a/setup.py b/setup.py
index d4eff363d24ef..b9b48b2f74ba0 100644
--- a/setup.py
+++ b/setup.py
@@ -1365,38 +1365,17 @@ def detect_platform_specific_exts(self):
def detect_compress_exts(self):
# Andrew Kuchling's zlib module.
- have_zlib = sysconfig.get_config_var("HAVE_LIBZ")
- if have_zlib:
- self.add(Extension('zlib', ['zlibmodule.c'],
- libraries=['z']))
- else:
- self.missing.append('zlib')
+ self.addext(Extension('zlib', ['zlibmodule.c']))
# Helper module for various ascii-encoders. Uses zlib for an optimized
# crc32 if we have it. Otherwise binascii uses its own.
- if have_zlib:
- define_macros = [('USE_ZLIB_CRC32', None)]
- libraries = ['z']
- else:
- define_macros = None
- libraries = []
- self.add(Extension('binascii', ['binascii.c'],
- define_macros=define_macros,
- libraries=libraries))
+ self.addext(Extension('binascii', ['binascii.c']))
# Gustavo Niemeyer's bz2 module.
- if sysconfig.get_config_var("HAVE_LIBBZ2"):
- self.add(Extension('_bz2', ['_bz2module.c'],
- libraries=['bz2']))
- else:
- self.missing.append('_bz2')
+ self.addext(Extension('_bz2', ['_bz2module.c']))
# LZMA compression support.
- if sysconfig.get_config_var("HAVE_LIBLZMA"):
- self.add(Extension('_lzma', ['_lzmamodule.c'],
- libraries=['lzma']))
- else:
- self.missing.append('_lzma')
+ self.addext(Extension('_lzma', ['_lzmamodule.c']))
def detect_expat_elementtree(self):
# Interface to the Expat XML parser
1
0
bpo-45847: Port mmap, select, and _xxsubinterpreters to Py_STDLIB_MOD (GH-29703)
by tiran 22 Nov '21
by tiran 22 Nov '21
22 Nov '21
https://github.com/python/cpython/commit/b451673f93465a27ee61e408190ee61cb9…
commit: b451673f93465a27ee61e408190ee61cb9dbd5b6
branch: main
author: Erlend Egeberg Aasland <erlend.aasland(a)innova.no>
committer: tiran <christian(a)python.org>
date: 2021-11-22T14:49:58+01:00
summary:
bpo-45847: Port mmap, select, and _xxsubinterpreters to Py_STDLIB_MOD (GH-29703)
files:
M Modules/Setup.stdlib.in
M configure
M configure.ac
M setup.py
diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in
index e1ddc137354b7..339a32416d820 100644
--- a/Modules/Setup.stdlib.in
+++ b/Modules/Setup.stdlib.in
@@ -40,6 +40,7 @@
@MODULE__QUEUE_TRUE@_queue _queuemodule.c
@MODULE__RANDOM_TRUE@_random _randommodule.c
@MODULE__TYPING_TRUE@_typing _typingmodule.c
+@MODULE__XXSUBINTERPRETERS_TRUE@_xxsubinterpreters __xxsubinterpretersmodule.c
@MODULE__ZONEINFO_TRUE@_zoneinfo _zoneinfo.c
# needs libm
@@ -89,9 +90,11 @@
@MODULE_FCNTL_TRUE@fcntl fcntlmodule.c
@MODULE_GRP_TRUE@grp grpmodule.c
+@MODULE_MMAP_TRUE@mmap mmapmodule.c
# needs sys/soundcard.h or linux/soundcard.h (Linux, FreeBSD)
@MODULE_OSSAUDIODEV_TRUE@ossaudiodev ossaudiodev.c
@MODULE_RESOURCE_TRUE@resource resource.c
+@MODULE_SELECT_TRUE@select selectmodule.c
# AIX has shadow passwords, but does not provide getspent API
@MODULE_SPWD_TRUE@spwd spwdmodule.c
@MODULE_SYSLOG_TRUE@syslog syslogmodule.c
diff --git a/configure b/configure
index c725d0f92ce4c..f3c33614e4faf 100755
--- a/configure
+++ b/configure
@@ -688,6 +688,8 @@ MODULE_OSSAUDIODEV_FALSE
MODULE_OSSAUDIODEV_TRUE
MODULE_GRP_FALSE
MODULE_GRP_TRUE
+MODULE_MMAP_FALSE
+MODULE_MMAP_TRUE
MODULE_FCNTL_FALSE
MODULE_FCNTL_TRUE
MODULE__DATETIME_FALSE
@@ -700,8 +702,12 @@ MODULE__STATISTICS_FALSE
MODULE__STATISTICS_TRUE
MODULE__ZONEINFO_FALSE
MODULE__ZONEINFO_TRUE
+MODULE__XXSUBINTERPRETERS_FALSE
+MODULE__XXSUBINTERPRETERS_TRUE
MODULE__TYPING_FALSE
MODULE__TYPING_TRUE
+MODULE_SELECT_FALSE
+MODULE_SELECT_TRUE
MODULE__RANDOM_FALSE
MODULE__RANDOM_TRUE
MODULE__QUEUE_FALSE
@@ -19687,6 +19693,15 @@ else
fi
as_fn_append MODULE_BLOCK "MODULE__RANDOM=yes$as_nl"
+ if true; then
+ MODULE_SELECT_TRUE=
+ MODULE_SELECT_FALSE='#'
+else
+ MODULE_SELECT_TRUE='#'
+ MODULE_SELECT_FALSE=
+fi
+ as_fn_append MODULE_BLOCK "MODULE_SELECT=yes$as_nl"
+
if true; then
MODULE__TYPING_TRUE=
MODULE__TYPING_FALSE='#'
@@ -19696,6 +19711,15 @@ else
fi
as_fn_append MODULE_BLOCK "MODULE__TYPING=yes$as_nl"
+ if true; then
+ MODULE__XXSUBINTERPRETERS_TRUE=
+ MODULE__XXSUBINTERPRETERS_FALSE='#'
+else
+ MODULE__XXSUBINTERPRETERS_TRUE='#'
+ MODULE__XXSUBINTERPRETERS_FALSE=
+fi
+ as_fn_append MODULE_BLOCK "MODULE__XXSUBINTERPRETERS=yes$as_nl"
+
if true; then
MODULE__ZONEINFO_TRUE=
MODULE__ZONEINFO_FALSE='#'
@@ -19788,6 +19812,42 @@ fi
$as_echo "$py_cv_module_fcntl" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module mmap" >&5
+$as_echo_n "checking for stdlib extension module mmap... " >&6; }
+ case $py_stdlib_not_available in #(
+ *mmap*) :
+ py_cv_module_mmap=n/a ;; #(
+ *) :
+ if true; then :
+ if test "$ac_cv_header_sys_mman_h" = "yes" -a "$ac_cv_header_sys_stat_h" = "yes"; then :
+ py_cv_module_mmap=yes
+else
+ py_cv_module_mmap=missing
+fi
+else
+ py_cv_module_mmap=disabled
+fi
+ ;;
+esac
+ as_fn_append MODULE_BLOCK "MODULE_MMAP=$py_cv_module_mmap$as_nl"
+ if test "x$py_cv_module_mmap" = xyes; then :
+
+
+
+
+fi
+ if test "$py_cv_module_mmap" = yes; then
+ MODULE_MMAP_TRUE=
+ MODULE_MMAP_FALSE='#'
+else
+ MODULE_MMAP_TRUE='#'
+ MODULE_MMAP_FALSE=
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $py_cv_module_mmap" >&5
+$as_echo "$py_cv_module_mmap" >&6; }
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module grp" >&5
$as_echo_n "checking for stdlib extension module grp... " >&6; }
@@ -20901,10 +20961,18 @@ if test -z "${MODULE__RANDOM_TRUE}" && test -z "${MODULE__RANDOM_FALSE}"; then
as_fn_error $? "conditional \"MODULE__RANDOM\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${MODULE_SELECT_TRUE}" && test -z "${MODULE_SELECT_FALSE}"; then
+ as_fn_error $? "conditional \"MODULE_SELECT\" 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
as_fn_error $? "conditional \"MODULE__TYPING\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${MODULE__XXSUBINTERPRETERS_TRUE}" && test -z "${MODULE__XXSUBINTERPRETERS_FALSE}"; then
+ as_fn_error $? "conditional \"MODULE__XXSUBINTERPRETERS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${MODULE__ZONEINFO_TRUE}" && test -z "${MODULE__ZONEINFO_FALSE}"; then
as_fn_error $? "conditional \"MODULE__ZONEINFO\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -20929,6 +20997,10 @@ if test -z "${MODULE_FCNTL_TRUE}" && test -z "${MODULE_FCNTL_FALSE}"; then
as_fn_error $? "conditional \"MODULE_FCNTL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${MODULE_MMAP_TRUE}" && test -z "${MODULE_MMAP_FALSE}"; then
+ as_fn_error $? "conditional \"MODULE_MMAP\" 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
diff --git a/configure.ac b/configure.ac
index 25d210bf7eb13..224a9b959d4f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6081,7 +6081,9 @@ PY_STDLIB_MOD_SIMPLE([_opcode])
PY_STDLIB_MOD_SIMPLE([_pickle])
PY_STDLIB_MOD_SIMPLE([_queue])
PY_STDLIB_MOD_SIMPLE([_random])
+PY_STDLIB_MOD_SIMPLE([select])
PY_STDLIB_MOD_SIMPLE([_typing])
+PY_STDLIB_MOD_SIMPLE([_xxsubinterpreters])
PY_STDLIB_MOD_SIMPLE([_zoneinfo])
dnl needs libm
@@ -6092,10 +6094,12 @@ PY_STDLIB_MOD_SIMPLE([math], [], [$LIBM])
dnl needs libm and on some platforms librt
PY_STDLIB_MOD_SIMPLE([_datetime], [], [$TIMEMODULE_LIB $LIBM])
-dnl needs libbsd on some platforms
+dnl modules with some unix dependencies
PY_STDLIB_MOD([fcntl],
[], [test "$ac_cv_header_sys_ioctl_h" = "yes" -a "$ac_cv_header_fcntl_h" = "yes"],
[], [$FCNTL_LIBS])
+PY_STDLIB_MOD([mmap],
+ [], [test "$ac_cv_header_sys_mman_h" = "yes" -a "$ac_cv_header_sys_stat_h" = "yes"])
dnl platform specific extensions
PY_STDLIB_MOD([grp], [], [test "$ac_cv_func_getgrgid" = yes -o "$ac_cv_func_getgrgid_r" = yes])
diff --git a/setup.py b/setup.py
index 28fd6da383a68..d4eff363d24ef 100644
--- a/setup.py
+++ b/setup.py
@@ -1036,17 +1036,17 @@ def detect_simple_extensions(self):
self.addext(Extension('spwd', ['spwdmodule.c']))
# select(2); not on ancient System V
- self.add(Extension('select', ['selectmodule.c']))
+ self.addext(Extension('select', ['selectmodule.c']))
# Memory-mapped files (also works on Win32).
- self.add(Extension('mmap', ['mmapmodule.c']))
+ self.addext(Extension('mmap', ['mmapmodule.c']))
# Lance Ellinghaus's syslog module
# syslog daemon interface
self.addext(Extension('syslog', ['syslogmodule.c']))
# Python interface to subinterpreter C-API.
- self.add(Extension('_xxsubinterpreters', ['_xxsubinterpretersmodule.c']))
+ self.addext(Extension('_xxsubinterpreters', ['_xxsubinterpretersmodule.c']))
#
# Here ends the simple stuff. From here on, modules need certain
1
0
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but init=False (GH-29692)
by miss-islington 22 Nov '21
by miss-islington 22 Nov '21
22 Nov '21
https://github.com/python/cpython/commit/10343bd98390ef15909e3a19f26a617816…
commit: 10343bd98390ef15909e3a19f26a6178162996fd
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington(a)users.noreply.github.com>
committer: miss-islington <31488909+miss-islington(a)users.noreply.github.com>
date: 2021-11-22T05:47:41-08:00
summary:
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but init=False (GH-29692)
Special handling is needed, because for non-slots dataclasses the instance attributes are not set: reading from a field just references the class's attribute of the same name, which contains the default value. But this doesn't work for classes using __slots__: they don't read the class's attribute. So in that case (and that case only), initialize the instance attribute. Handle this for both normal defaults, and for fields using default_factory.
(cherry picked from commit d3062f672c92855b7e9e962ad4bf1a67abd4589b)
Co-authored-by: Eric V. Smith <ericvsmith(a)users.noreply.github.com>
files:
A Misc/NEWS.d/next/Library/2021-11-21-20-50-42.bpo-44649.E8M936.rst
M Lib/dataclasses.py
M Lib/test/test_dataclasses.py
diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py
index 4f4aa3d3487ce..b3a9194d9d068 100644
--- a/Lib/dataclasses.py
+++ b/Lib/dataclasses.py
@@ -447,7 +447,7 @@ def _field_assign(frozen, name, value, self_name):
return f'{self_name}.{name}={value}'
-def _field_init(f, frozen, globals, self_name):
+def _field_init(f, frozen, globals, self_name, slots):
# Return the text of the line in the body of __init__ that will
# initialize this field.
@@ -487,9 +487,15 @@ def _field_init(f, frozen, globals, self_name):
globals[default_name] = f.default
value = f.name
else:
- # This field does not need initialization. Signify that
- # to the caller by returning None.
- return None
+ # If the class has slots, then initialize this field.
+ if slots and f.default is not MISSING:
+ globals[default_name] = f.default
+ value = default_name
+ else:
+ # This field does not need initialization: reading from it will
+ # just use the class attribute that contains the default.
+ # Signify that to the caller by returning None.
+ return None
# Only test this now, so that we can create variables for the
# default. However, return None to signify that we're not going
@@ -521,7 +527,7 @@ def _init_param(f):
def _init_fn(fields, std_fields, kw_only_fields, frozen, has_post_init,
- self_name, globals):
+ self_name, globals, slots):
# fields contains both real fields and InitVar pseudo-fields.
# Make sure we don't have fields without defaults following fields
@@ -548,7 +554,7 @@ def _init_fn(fields, std_fields, kw_only_fields, frozen, has_post_init,
body_lines = []
for f in fields:
- line = _field_init(f, frozen, locals, self_name)
+ line = _field_init(f, frozen, locals, self_name, slots)
# line is None means that this field doesn't require
# initialization (it's a pseudo-field). Just skip it.
if line:
@@ -1027,6 +1033,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
'__dataclass_self__' if 'self' in fields
else 'self',
globals,
+ slots,
))
# Get the fields as a list, and include only real fields. This is
diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py
index b00d0484d387e..bcd004f4ec3aa 100644
--- a/Lib/test/test_dataclasses.py
+++ b/Lib/test/test_dataclasses.py
@@ -2880,6 +2880,28 @@ def test_frozen_pickle(self):
self.assertIsNot(obj, p)
self.assertEqual(obj, p)
+ def test_slots_with_default_no_init(self):
+ # Originally reported in bpo-44649.
+ @dataclass(slots=True)
+ class A:
+ a: str
+ b: str = field(default='b', init=False)
+
+ obj = A("a")
+ self.assertEqual(obj.a, 'a')
+ self.assertEqual(obj.b, 'b')
+
+ def test_slots_with_default_factory_no_init(self):
+ # Originally reported in bpo-44649.
+ @dataclass(slots=True)
+ class A:
+ a: str
+ b: str = field(default_factory=lambda:'b', init=False)
+
+ obj = A("a")
+ self.assertEqual(obj.a, 'a')
+ self.assertEqual(obj.b, 'b')
+
class TestDescriptors(unittest.TestCase):
def test_set_name(self):
# See bpo-33141.
diff --git a/Misc/NEWS.d/next/Library/2021-11-21-20-50-42.bpo-44649.E8M936.rst b/Misc/NEWS.d/next/Library/2021-11-21-20-50-42.bpo-44649.E8M936.rst
new file mode 100644
index 0000000000000..f6391a915a821
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-11-21-20-50-42.bpo-44649.E8M936.rst
@@ -0,0 +1,2 @@
+Handle dataclass(slots=True) with a field that has default a default value,
+but for which init=False.
1
0
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but init=False (GH-29692)
by ericvsmith 22 Nov '21
by ericvsmith 22 Nov '21
22 Nov '21
https://github.com/python/cpython/commit/d3062f672c92855b7e9e962ad4bf1a67ab…
commit: d3062f672c92855b7e9e962ad4bf1a67abd4589b
branch: main
author: Eric V. Smith <ericvsmith(a)users.noreply.github.com>
committer: ericvsmith <ericvsmith(a)users.noreply.github.com>
date: 2021-11-22T08:26:12-05:00
summary:
bpo-44649: Fix dataclasses(slots=True) with a field with a default, but init=False (GH-29692)
Special handling is needed, because for non-slots dataclasses the instance attributes are not set: reading from a field just references the class's attribute of the same name, which contains the default value. But this doesn't work for classes using __slots__: they don't read the class's attribute. So in that case (and that case only), initialize the instance attribute. Handle this for both normal defaults, and for fields using default_factory.
files:
A Misc/NEWS.d/next/Library/2021-11-21-20-50-42.bpo-44649.E8M936.rst
M Lib/dataclasses.py
M Lib/test/test_dataclasses.py
diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py
index aca60501d0e0f..8643589077a4a 100644
--- a/Lib/dataclasses.py
+++ b/Lib/dataclasses.py
@@ -447,7 +447,7 @@ def _field_assign(frozen, name, value, self_name):
return f'{self_name}.{name}={value}'
-def _field_init(f, frozen, globals, self_name):
+def _field_init(f, frozen, globals, self_name, slots):
# Return the text of the line in the body of __init__ that will
# initialize this field.
@@ -487,9 +487,15 @@ def _field_init(f, frozen, globals, self_name):
globals[default_name] = f.default
value = f.name
else:
- # This field does not need initialization. Signify that
- # to the caller by returning None.
- return None
+ # If the class has slots, then initialize this field.
+ if slots and f.default is not MISSING:
+ globals[default_name] = f.default
+ value = default_name
+ else:
+ # This field does not need initialization: reading from it will
+ # just use the class attribute that contains the default.
+ # Signify that to the caller by returning None.
+ return None
# Only test this now, so that we can create variables for the
# default. However, return None to signify that we're not going
@@ -521,7 +527,7 @@ def _init_param(f):
def _init_fn(fields, std_fields, kw_only_fields, frozen, has_post_init,
- self_name, globals):
+ self_name, globals, slots):
# fields contains both real fields and InitVar pseudo-fields.
# Make sure we don't have fields without defaults following fields
@@ -548,7 +554,7 @@ def _init_fn(fields, std_fields, kw_only_fields, frozen, has_post_init,
body_lines = []
for f in fields:
- line = _field_init(f, frozen, locals, self_name)
+ line = _field_init(f, frozen, locals, self_name, slots)
# line is None means that this field doesn't require
# initialization (it's a pseudo-field). Just skip it.
if line:
@@ -1027,6 +1033,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
'__dataclass_self__' if 'self' in fields
else 'self',
globals,
+ slots,
))
# Get the fields as a list, and include only real fields. This is
diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py
index b00d0484d387e..bcd004f4ec3aa 100644
--- a/Lib/test/test_dataclasses.py
+++ b/Lib/test/test_dataclasses.py
@@ -2880,6 +2880,28 @@ def test_frozen_pickle(self):
self.assertIsNot(obj, p)
self.assertEqual(obj, p)
+ def test_slots_with_default_no_init(self):
+ # Originally reported in bpo-44649.
+ @dataclass(slots=True)
+ class A:
+ a: str
+ b: str = field(default='b', init=False)
+
+ obj = A("a")
+ self.assertEqual(obj.a, 'a')
+ self.assertEqual(obj.b, 'b')
+
+ def test_slots_with_default_factory_no_init(self):
+ # Originally reported in bpo-44649.
+ @dataclass(slots=True)
+ class A:
+ a: str
+ b: str = field(default_factory=lambda:'b', init=False)
+
+ obj = A("a")
+ self.assertEqual(obj.a, 'a')
+ self.assertEqual(obj.b, 'b')
+
class TestDescriptors(unittest.TestCase):
def test_set_name(self):
# See bpo-33141.
diff --git a/Misc/NEWS.d/next/Library/2021-11-21-20-50-42.bpo-44649.E8M936.rst b/Misc/NEWS.d/next/Library/2021-11-21-20-50-42.bpo-44649.E8M936.rst
new file mode 100644
index 0000000000000..f6391a915a821
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-11-21-20-50-42.bpo-44649.E8M936.rst
@@ -0,0 +1,2 @@
+Handle dataclass(slots=True) with a field that has default a default value,
+but for which init=False.
1
0