|
- diff -Naur Python-3.8.0-orig/configure.ac Python-3.8.0/configure.ac
- --- Python-3.8.0-orig/configure.ac 2019-10-22 10:00:29.329088100 +0300
- +++ Python-3.8.0/configure.ac 2019-10-22 10:00:31.778292400 +0300
- @@ -1960,6 +1960,46 @@
- BASECFLAGS="$BASECFLAGS $ac_arch_flags"
- fi
-
- +dnl NOTE:
- +dnl - GCC 4.4+ for mingw* require and use posix threads(pthreads-w32)
- +dnl - Host may contain installed pthreads-w32.
- +dnl - On windows platform only NT-thread model is supported.
- +dnl To avoid miss detection scipt first will check for NT-thread model
- +dnl and if is not found will try to detect build options for pthread
- +dnl model. Autodetection could be overiden if variable with_nt_threads
- +dnl is set in "Site Configuration" (see autoconf manual).
- +dnl If NT-thread model is enabled script skips some checks that
- +dnl impact build process. When a new functionality is added, developers
- +dnl are responsible to update configure script to avoid thread models
- +dnl to be mixed.
- +
- +AC_MSG_CHECKING([for NT threads])
- +AC_ARG_WITH(nt-threads,
- + AS_HELP_STRING([--with-nt-threads], [build with windows threads]),
- +[
- + case $withval in
- + no) with_nt_threads=no;;
- + yes) with_nt_threads=yes;;
- + *) with_nt_threads=yes;;
- + esac], [
- + with_nt_threads=no])
- +if test $with_nt_threads = yes ; then
- +AC_LINK_IFELSE([
- + AC_LANG_PROGRAM([[]],[[_beginthread(0, 0, 0);]])
- + ],
- + [with_nt_threads=yes],
- + [with_nt_threads=no])
- +fi
- +AC_MSG_RESULT([$with_nt_threads])
- +
- +if test $with_nt_threads = yes ; then
- + dnl temporary default flag to avoid additional pthread checks
- + dnl and initilize other ac..thread flags to no
- + ac_cv_pthread_is_default=no
- + ac_cv_kthread=no
- + ac_cv_pthread=no
- + dnl ac_cv_kpthread is set to no if default is yes (see below)
- +else
- # On some compilers, pthreads are available without further options
- # (e.g. MacOS X). On some of these systems, the compiler will not
- # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
- @@ -2078,6 +2118,8 @@
- AC_MSG_RESULT($ac_cv_pthread)
- fi
-
- +fi
- +
- # If we have set a CC compiler flag for thread support then
- # check if it works for CXX, too.
- ac_cv_cxx_thread=no
- @@ -2098,6 +2140,10 @@
- then
- CXX="$CXX -pthread"
- ac_cv_cxx_thread=yes
- +elif test $with_nt_threads = yes
- +then
- + dnl set to always to skip extra pthread check below
- + ac_cv_cxx_thread=always
- fi
-
- if test $ac_cv_cxx_thread = yes
- @@ -2130,8 +2176,8 @@
- AC_HEADER_STDC
- AC_CHECK_HEADERS(asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \
- fcntl.h grp.h \
- -ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
- -sched.h shadow.h signal.h stropts.h termios.h \
- +ieeefp.h io.h langinfo.h libintl.h process.h \
- +shadow.h signal.h stropts.h termios.h \
- utime.h \
- poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
- sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
- @@ -2145,6 +2191,14 @@
- AC_HEADER_DIRENT
- AC_HEADER_MAJOR
-
- +# If using nt threads, don't look for pthread.h or thread.h
- +if test "x$with_nt_threads" = xno ; then
- +AC_HEADER_STDC
- +AC_CHECK_HEADERS(pthread.h sched.h thread.h)
- +AC_HEADER_DIRENT
- +AC_HEADER_MAJOR
- +fi
- +
- # bluetooth/bluetooth.h has been known to not compile with -std=c99.
- # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
- SAVE_CFLAGS=$CFLAGS
- @@ -2342,6 +2396,10 @@
-
- AC_MSG_CHECKING(for pthread_t)
- have_pthread_t=no
- +if test $with_nt_threads = yes ; then
- + dnl skip check for pthread_t if NT-thread model is enabled
- + have_pthread_t=skip
- +else
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t x; x = *(pthread_t*)0;]])
- ],[have_pthread_t=yes],[])
- @@ -2372,6 +2430,7 @@
- else
- AC_MSG_RESULT(no)
- fi
- +fi
- CC="$ac_save_cc"
-
- AC_SUBST(OTHER_LIBTOOL_OPT)
- @@ -2814,10 +2873,15 @@
- [AC_MSG_RESULT(no)]
- )
-
- +if test $with_nt_threads = yes ; then
- + dnl do not search for sem_init if NT-thread model is enabled
- + :
- +else
- # 'Real Time' functions on Solaris
- # posix4 on Solaris 2.6
- # pthread (first!) on Linux
- AC_SEARCH_LIBS(sem_init, pthread rt posix4)
- +fi
-
- # check if we need libintl for locale functions
- AC_CHECK_LIB(intl, textdomain,
- @@ -3087,6 +3151,11 @@
- CXX="$CXX -pthread"
- fi
- posix_threads=yes
- +elif test $with_nt_threads = yes
- +then
- + posix_threads=no
- + AC_DEFINE(NT_THREADS, 1,
- + [Define to 1 if you want to use native NT threads])
- else
- if test ! -z "$withval" -a -d "$withval"
- then LDFLAGS="$LDFLAGS -L$withval"
- @@ -3538,6 +3607,15 @@
- fi
-
- # checks for library functions
- +if test $with_nt_threads = yes ; then
- + dnl GCC(mingw) 4.4+ require and use posix threads(pthreads-w32)
- + dnl and host may contain installed pthreads-w32.
- + dnl Skip checks for some functions declared in pthreads-w32 if
- + dnl NT-thread model is enabled.
- + ac_cv_func_pthread_kill=skip
- + ac_cv_func_sem_open=skip
- + ac_cv_func_sched_setscheduler=skip
- +fi
- AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
- clock confstr copy_file_range ctermid dup3 execv explicit_bzero explicit_memset \
- faccessat fchmod fchmodat fchown fchownat \
- @@ -4462,6 +4540,10 @@
- # the kernel module that provides POSIX semaphores
- # isn't loaded by default, so an attempt to call
- # sem_open results in a 'Signal 12' error.
- +if test $with_nt_threads = yes ; then
- + dnl skip posix semaphores test if NT-thread model is enabled
- + ac_cv_posix_semaphores_enabled=no
- +fi
- AC_MSG_CHECKING(whether POSIX semaphores are enabled)
- AC_CACHE_VAL(ac_cv_posix_semaphores_enabled,
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
- @@ -4495,6 +4577,14 @@
-
- # Multiprocessing check for broken sem_getvalue
- AC_MSG_CHECKING(for broken sem_getvalue)
- +if test $with_nt_threads = yes ; then
- + dnl Skip test if NT-thread model is enabled.
- + dnl NOTE the test case below fail for pthreads-w32 as:
- + dnl - SEM_FAILED is not defined;
- + dnl - sem_open is a stub;
- + dnl - sem_getvalue work(!).
- + ac_cv_broken_sem_getvalue=skip
- +fi
- AC_CACHE_VAL(ac_cv_broken_sem_getvalue,
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
- #include <unistd.h>
- diff -Naur Python-3.8.0-orig/Modules/_multiprocessing/multiprocessing.h Python-3.8.0/Modules/_multiprocessing/multiprocessing.h
- --- Python-3.8.0-orig/Modules/_multiprocessing/multiprocessing.h 2019-10-14 16:34:47.000000000 +0300
- +++ Python-3.8.0/Modules/_multiprocessing/multiprocessing.h 2019-10-22 10:00:32.168293100 +0300
- @@ -21,6 +21,9 @@
- # endif
- # define SEM_HANDLE HANDLE
- # define SEM_VALUE_MAX LONG_MAX
- +# if defined(HAVE_SEM_OPEN) && defined(_POSIX_THREADS)
- +# include <semaphore.h>
- +# endif
- #else
- # include <fcntl.h> /* O_CREAT and O_EXCL */
- # if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
- diff -Naur Python-3.8.0-orig/pyconfig.h.in Python-3.8.0/pyconfig.h.in
- --- Python-3.8.0-orig/pyconfig.h.in 2019-10-14 16:34:47.000000000 +0300
- +++ Python-3.8.0/pyconfig.h.in 2019-10-22 10:00:32.558293800 +0300
- @@ -1352,6 +1352,9 @@
- /* Define if mvwdelch in curses.h is an expression. */
- #undef MVWDELCH_IS_EXPRESSION
-
- +/* Define to 1 if you want to use native NT threads */
- +#undef NT_THREADS
- +
- /* Define to the address where bug reports for this package should be sent. */
- #undef PACKAGE_BUGREPORT
-
|