Skip to content

Commit f7a62f2

Browse files
author
Erlend Egeberg Aasland
authored
bpo-45847: Make socket module conditional (GH-29769)
1 parent 39b60ce commit f7a62f2

File tree

3 files changed

+51
-18
lines changed

3 files changed

+51
-18
lines changed

configure

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,8 @@ MODULE_OSSAUDIODEV_FALSE
712712
MODULE_OSSAUDIODEV_TRUE
713713
MODULE_GRP_FALSE
714714
MODULE_GRP_TRUE
715+
MODULE__SOCKET_FALSE
716+
MODULE__SOCKET_TRUE
715717
MODULE_MMAP_FALSE
716718
MODULE_MMAP_TRUE
717719
MODULE_FCNTL_FALSE
@@ -738,8 +740,6 @@ MODULE__TYPING_FALSE
738740
MODULE__TYPING_TRUE
739741
MODULE__STRUCT_FALSE
740742
MODULE__STRUCT_TRUE
741-
MODULE__SOCKET_FALSE
742-
MODULE__SOCKET_TRUE
743743
MODULE_SELECT_FALSE
744744
MODULE_SELECT_TRUE
745745
MODULE__RANDOM_FALSE
@@ -8371,7 +8371,7 @@ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
83718371
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
83728372
linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
83738373
sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h \
8374-
sys/mman.h sys/eventfd.h linux/soundcard.h sys/soundcard.h syslog.h
8374+
sys/mman.h sys/eventfd.h linux/soundcard.h sys/soundcard.h syslog.h netinet/in.h
83758375
do :
83768376
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
83778377
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -21222,15 +21222,6 @@ else
2122221222
fi
2122321223
as_fn_append MODULE_BLOCK "MODULE_SELECT=yes$as_nl"
2122421224

21225-
if true; then
21226-
MODULE__SOCKET_TRUE=
21227-
MODULE__SOCKET_FALSE='#'
21228-
else
21229-
MODULE__SOCKET_TRUE='#'
21230-
MODULE__SOCKET_FALSE=
21231-
fi
21232-
as_fn_append MODULE_BLOCK "MODULE__SOCKET=yes$as_nl"
21233-
2123421225
if true; then
2123521226
MODULE__STRUCT_TRUE=
2123621227
MODULE__STRUCT_FALSE='#'
@@ -21445,6 +21436,42 @@ fi
2144521436
$as_echo "$py_cv_module_mmap" >&6; }
2144621437

2144721438

21439+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _socket" >&5
21440+
$as_echo_n "checking for stdlib extension module _socket... " >&6; }
21441+
case $py_stdlib_not_available in #(
21442+
*_socket*) :
21443+
py_cv_module__socket=n/a ;; #(
21444+
*) :
21445+
if true; then :
21446+
if test "$ac_cv_header_sys_socket_h" = "yes" -a "$ac_cv_header_sys_types_h" = "yes" -a "$ac_cv_header_netinet_in_h" = "yes"; then :
21447+
py_cv_module__socket=yes
21448+
else
21449+
py_cv_module__socket=missing
21450+
fi
21451+
else
21452+
py_cv_module__socket=disabled
21453+
fi
21454+
;;
21455+
esac
21456+
as_fn_append MODULE_BLOCK "MODULE__SOCKET=$py_cv_module__socket$as_nl"
21457+
if test "x$py_cv_module__socket" = xyes; then :
21458+
21459+
21460+
21461+
21462+
fi
21463+
if test "$py_cv_module__socket" = yes; then
21464+
MODULE__SOCKET_TRUE=
21465+
MODULE__SOCKET_FALSE='#'
21466+
else
21467+
MODULE__SOCKET_TRUE='#'
21468+
MODULE__SOCKET_FALSE=
21469+
fi
21470+
21471+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $py_cv_module__socket" >&5
21472+
$as_echo "$py_cv_module__socket" >&6; }
21473+
21474+
2144821475

2144921476
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module grp" >&5
2145021477
$as_echo_n "checking for stdlib extension module grp... " >&6; }
@@ -22982,10 +23009,6 @@ if test -z "${MODULE_SELECT_TRUE}" && test -z "${MODULE_SELECT_FALSE}"; then
2298223009
as_fn_error $? "conditional \"MODULE_SELECT\" was never defined.
2298323010
Usually this means the macro was only invoked conditionally." "$LINENO" 5
2298423011
fi
22985-
if test -z "${MODULE__SOCKET_TRUE}" && test -z "${MODULE__SOCKET_FALSE}"; then
22986-
as_fn_error $? "conditional \"MODULE__SOCKET\" was never defined.
22987-
Usually this means the macro was only invoked conditionally." "$LINENO" 5
22988-
fi
2298923012
if test -z "${MODULE__STRUCT_TRUE}" && test -z "${MODULE__STRUCT_FALSE}"; then
2299023013
as_fn_error $? "conditional \"MODULE__STRUCT\" was never defined.
2299123014
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -23038,6 +23061,10 @@ if test -z "${MODULE_MMAP_TRUE}" && test -z "${MODULE_MMAP_FALSE}"; then
2303823061
as_fn_error $? "conditional \"MODULE_MMAP\" was never defined.
2303923062
Usually this means the macro was only invoked conditionally." "$LINENO" 5
2304023063
fi
23064+
if test -z "${MODULE__SOCKET_TRUE}" && test -z "${MODULE__SOCKET_FALSE}"; then
23065+
as_fn_error $? "conditional \"MODULE__SOCKET\" was never defined.
23066+
Usually this means the macro was only invoked conditionally." "$LINENO" 5
23067+
fi
2304123068
if test -z "${MODULE_GRP_TRUE}" && test -z "${MODULE_GRP_FALSE}"; then
2304223069
as_fn_error $? "conditional \"MODULE_GRP\" was never defined.
2304323070
Usually this means the macro was only invoked conditionally." "$LINENO" 5

configure.ac

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,7 @@ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
22062206
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
22072207
linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
22082208
sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h \
2209-
sys/mman.h sys/eventfd.h linux/soundcard.h sys/soundcard.h syslog.h)
2209+
sys/mman.h sys/eventfd.h linux/soundcard.h sys/soundcard.h syslog.h netinet/in.h)
22102210
AC_HEADER_DIRENT
22112211
AC_HEADER_MAJOR
22122212

@@ -6292,7 +6292,6 @@ PY_STDLIB_MOD_SIMPLE([_posixsubprocess])
62926292
PY_STDLIB_MOD_SIMPLE([_queue])
62936293
PY_STDLIB_MOD_SIMPLE([_random])
62946294
PY_STDLIB_MOD_SIMPLE([select])
6295-
PY_STDLIB_MOD_SIMPLE([_socket])
62966295
PY_STDLIB_MOD_SIMPLE([_struct])
62976296
PY_STDLIB_MOD_SIMPLE([_typing])
62986297
PY_STDLIB_MOD_SIMPLE([_xxsubinterpreters])
@@ -6319,6 +6318,10 @@ PY_STDLIB_MOD([fcntl],
63196318
[], [$FCNTL_LIBS])
63206319
PY_STDLIB_MOD([mmap],
63216320
[], [test "$ac_cv_header_sys_mman_h" = "yes" -a "$ac_cv_header_sys_stat_h" = "yes"])
6321+
PY_STDLIB_MOD([_socket],
6322+
[], m4_flatten([test "$ac_cv_header_sys_socket_h" = "yes"
6323+
-a "$ac_cv_header_sys_types_h" = "yes"
6324+
-a "$ac_cv_header_netinet_in_h" = "yes"]))
63226325

63236326
dnl platform specific extensions
63246327
PY_STDLIB_MOD([grp], [], [test "$ac_cv_func_getgrgid" = yes -o "$ac_cv_func_getgrgid_r" = yes])

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,9 @@
769769
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
770770
#undef HAVE_NDIR_H
771771

772+
/* Define to 1 if you have the <netinet/in.h> header file. */
773+
#undef HAVE_NETINET_IN_H
774+
772775
/* Define to 1 if you have the <netpacket/packet.h> header file. */
773776
#undef HAVE_NETPACKET_PACKET_H
774777

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy