@@ -710,6 +710,8 @@ MODULE_OSSAUDIODEV_FALSE
710710MODULE_OSSAUDIODEV_TRUE
711711MODULE_GRP_FALSE
712712MODULE_GRP_TRUE
713+ MODULE__POSIXSHMEM_FALSE
714+ MODULE__POSIXSHMEM_TRUE
713715MODULE_MMAP_FALSE
714716MODULE_MMAP_TRUE
715717MODULE_FCNTL_FALSE
@@ -20030,9 +20032,14 @@ fi
2003020032
2003120033# checks for POSIX shared memory, used by Modules/_multiprocessing/posixshmem.c
2003220034# shm_* may only be available if linking against librt
20033- save_LIBS="$LIBS"
20034- save_includes_default="$ac_includes_default"
20035- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
20035+ POSIXSHMEM_CFLAGS='-I$(srcdir)/Modules/_multiprocessing'
20036+ save_CFLAGS=$CFLAGS
20037+ save_CPPFLAGS=$CPPFLAGS
20038+ save_LDFLAGS=$LDFLAGS
20039+ save_LIBS=$LIBS
20040+
20041+
20042+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
2003620043$as_echo_n "checking for library containing shm_open... " >&6; }
2003720044if ${ac_cv_search_shm_open+:} false; then :
2003820045 $as_echo_n "(cached) " >&6
@@ -20088,47 +20095,41 @@ if test "$ac_res" != no; then :
2008820095
2008920096fi
2009020097
20091- if test "$ac_cv_search_shm_open" = "-lrt"; then
20092-
20093- $as_echo "#define SHM_NEEDS_LIBRT 1" >>confdefs.h
20094-
20095- fi
20096- for ac_header in sys/mman.h
20097- do :
20098- ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
20099- if test "x$ac_cv_header_sys_mman_h" = xyes; then :
20100- cat >>confdefs.h <<_ACEOF
20101- #define HAVE_SYS_MMAN_H 1
20102- _ACEOF
20103-
20098+ if test "x$ac_cv_search_shm_open" = x-lrt; then :
20099+ POSIXSHMEM_LIBS="-lrt"
2010420100fi
2010520101
20106- done
20107-
20108- # temporarily override ac_includes_default for AC_CHECK_FUNCS below
20109- ac_includes_default="\
20110- ${ac_includes_default}
20111- #ifndef __cplusplus
20112- # ifdef HAVE_SYS_MMAN_H
20113- # include <sys/mman.h>
20114- # endif
20115- #endif
20116- "
20117- for ac_func in shm_open shm_unlink
20102+ save_ac_includes_default=$ac_includes_default
20103+ ac_includes_default="\
20104+ ${ac_includes_default}
20105+ #ifndef __cplusplus
20106+ # ifdef HAVE_SYS_MMAN_H
20107+ # include <sys/mman.h>
20108+ # endif
20109+ #endif
20110+ "
20111+ for ac_func in shm_open shm_unlink
2011820112do :
2011920113 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
2012020114ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
2012120115if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
2012220116 cat >>confdefs.h <<_ACEOF
2012320117#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
2012420118_ACEOF
20125-
20119+ have_posix_shmem=yes
20120+ else
20121+ have_posix_shmem=no
2012620122fi
2012720123done
2012820124
20129- # we don't want to link with librt always, restore LIBS
20130- LIBS="$save_LIBS"
20131- ac_includes_default="$save_includes_default"
20125+ ac_includes_default=$save_ac_includes_default
20126+
20127+ CFLAGS=$save_CFLAGS
20128+ CPPFLAGS=$save_CPPFLAGS
20129+ LDFLAGS=$save_LDFLAGS
20130+ LIBS=$save_LIBS
20131+
20132+
2013220133
2013320134# Check for usable OpenSSL
2013420135
@@ -21072,6 +21073,42 @@ fi
2107221073$as_echo "$py_cv_module_mmap" >&6; }
2107321074
2107421075
21076+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _posixshmem" >&5
21077+ $as_echo_n "checking for stdlib extension module _posixshmem... " >&6; }
21078+ case $py_stdlib_not_available in #(
21079+ *_posixshmem*) :
21080+ py_cv_module__posixshmem=n/a ;; #(
21081+ *) :
21082+ if true; then :
21083+ if test "$have_posix_shmem" = "yes"; then :
21084+ py_cv_module__posixshmem=yes
21085+ else
21086+ py_cv_module__posixshmem=missing
21087+ fi
21088+ else
21089+ py_cv_module__posixshmem=disabled
21090+ fi
21091+ ;;
21092+ esac
21093+ as_fn_append MODULE_BLOCK "MODULE__POSIXSHMEM=$py_cv_module__posixshmem$as_nl"
21094+ if test "x$py_cv_module__posixshmem" = xyes; then :
21095+
21096+ as_fn_append MODULE_BLOCK "MODULE__POSIXSHMEM_CFLAGS=$POSIXSHMEM_CFLAGS$as_nl"
21097+ as_fn_append MODULE_BLOCK "MODULE__POSIXSHMEM_LDFLAGS=$POSIXSHMEM_LIBS$as_nl"
21098+
21099+ fi
21100+ if test "$py_cv_module__posixshmem" = yes; then
21101+ MODULE__POSIXSHMEM_TRUE=
21102+ MODULE__POSIXSHMEM_FALSE='#'
21103+ else
21104+ MODULE__POSIXSHMEM_TRUE='#'
21105+ MODULE__POSIXSHMEM_FALSE=
21106+ fi
21107+
21108+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $py_cv_module__posixshmem" >&5
21109+ $as_echo "$py_cv_module__posixshmem" >&6; }
21110+
21111+
2107521112
2107621113 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module grp" >&5
2107721114$as_echo_n "checking for stdlib extension module grp... " >&6; }
@@ -22621,6 +22658,10 @@ if test -z "${MODULE_MMAP_TRUE}" && test -z "${MODULE_MMAP_FALSE}"; then
2262122658 as_fn_error $? "conditional \"MODULE_MMAP\" was never defined.
2262222659Usually this means the macro was only invoked conditionally." "$LINENO" 5
2262322660fi
22661+ if test -z "${MODULE__POSIXSHMEM_TRUE}" && test -z "${MODULE__POSIXSHMEM_FALSE}"; then
22662+ as_fn_error $? "conditional \"MODULE__POSIXSHMEM\" was never defined.
22663+ Usually this means the macro was only invoked conditionally." "$LINENO" 5
22664+ fi
2262422665if test -z "${MODULE_GRP_TRUE}" && test -z "${MODULE_GRP_FALSE}"; then
2262522666 as_fn_error $? "conditional \"MODULE_GRP\" was never defined.
2262622667Usually this means the macro was only invoked conditionally." "$LINENO" 5
0 commit comments