summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-09-07 16:56:24 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-09-07 16:56:24 (GMT)
commita6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 (patch)
tree1c31738009bee903417cea928e705a112aea2392 /configure.ac
parent1f06a680de465be0c24a78ea3b610053955daa99 (diff)
downloadcpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.zip
cpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.tar.gz
cpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.tar.bz2
bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config * Always define WITH_THREAD for compatibility.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac79
1 files changed, 19 insertions, 60 deletions
diff --git a/configure.ac b/configure.ac
index 00d5aba..9cded9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2885,73 +2885,39 @@ else
fi])
AC_MSG_RESULT($with_dbmliborder)
-# This is used to generate Setup.config
-AC_SUBST(USE_THREAD_MODULE)
-USE_THREAD_MODULE=""
-
AC_SUBST(LDLAST)
# Templates for things AC_DEFINEd more than once.
# For a single AC_DEFINE, no template is needed.
AH_TEMPLATE(_REENTRANT,
[Define to force use of thread-safe errno, h_errno, and other functions])
-AH_TEMPLATE(WITH_THREAD,
- [Define if you want to compile in rudimentary thread support])
-
-AC_MSG_CHECKING(for --with-threads)
-dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
-AC_ARG_WITH(threads,
- AS_HELP_STRING([--with(out)-threads@<:@=DIRECTORY@:>@], [disable/enable thread support]))
-
-# --with-thread is deprecated, but check for it anyway
-dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
-AC_ARG_WITH(thread,
- AS_HELP_STRING([--with(out)-thread@<:@=DIRECTORY@:>@], [deprecated; use --with(out)-threads]),
- [with_threads=$with_thread])
-
-if test -z "$with_threads"
-then with_threads="yes"
-fi
-AC_MSG_RESULT($with_threads)
-AC_SUBST(THREADOBJ)
-if test "$with_threads" = "no"
-then
- USE_THREAD_MODULE="#"
-elif test "$ac_cv_pthread_is_default" = yes
+if test "$ac_cv_pthread_is_default" = yes
then
- AC_DEFINE(WITH_THREAD)
# Defining _REENTRANT on system with POSIX threads should not hurt.
AC_DEFINE(_REENTRANT)
posix_threads=yes
- THREADOBJ="Python/thread.o"
elif test "$ac_cv_kpthread" = "yes"
then
CC="$CC -Kpthread"
if test "$ac_cv_cxx_thread" = "yes"; then
CXX="$CXX -Kpthread"
fi
- AC_DEFINE(WITH_THREAD)
posix_threads=yes
- THREADOBJ="Python/thread.o"
elif test "$ac_cv_kthread" = "yes"
then
CC="$CC -Kthread"
if test "$ac_cv_cxx_thread" = "yes"; then
CXX="$CXX -Kthread"
fi
- AC_DEFINE(WITH_THREAD)
posix_threads=yes
- THREADOBJ="Python/thread.o"
elif test "$ac_cv_pthread" = "yes"
then
CC="$CC -pthread"
if test "$ac_cv_cxx_thread" = "yes"; then
CXX="$CXX -pthread"
fi
- AC_DEFINE(WITH_THREAD)
posix_threads=yes
- THREADOBJ="Python/thread.o"
else
if test ! -z "$with_threads" -a -d "$with_threads"
then LDFLAGS="$LDFLAGS -L$with_threads"
@@ -2987,43 +2953,36 @@ yes
void * start_routine (void *arg) { exit (0); }]], [[
pthread_create (NULL, NULL, start_routine, NULL)]])],[
AC_MSG_RESULT(yes)
- AC_DEFINE(WITH_THREAD)
posix_threads=yes
- THREADOBJ="Python/thread.o"],[
+ ],[
LIBS=$_libs
- AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
+ AC_CHECK_FUNC(pthread_detach, [
posix_threads=yes
- THREADOBJ="Python/thread.o"],[
- AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
+ ],[
+ AC_CHECK_LIB(pthreads, pthread_create, [
posix_threads=yes
LIBS="$LIBS -lpthreads"
- THREADOBJ="Python/thread.o"], [
- AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
+ ], [
+ AC_CHECK_LIB(c_r, pthread_create, [
posix_threads=yes
LIBS="$LIBS -lc_r"
- THREADOBJ="Python/thread.o"], [
- AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
+ ], [
+ AC_CHECK_LIB(pthread, __pthread_create_system, [
posix_threads=yes
LIBS="$LIBS -lpthread"
- THREADOBJ="Python/thread.o"], [
- AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
+ ], [
+ AC_CHECK_LIB(cma, pthread_create, [
posix_threads=yes
LIBS="$LIBS -lcma"
- THREADOBJ="Python/thread.o"],[
- USE_THREAD_MODULE="#"])
+ ],[
+ AC_MSG_ERROR([could not find pthreads on your system])
+ ])
])])])])])
- AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
+ AC_CHECK_LIB(mpc, usconfig, [
LIBS="$LIBS -lmpc"
- THREADOBJ="Python/thread.o"
- USE_THREAD_MODULE=""])
-
- if test "$posix_threads" != "yes"; then
- AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
- LIBS="$LIBS -lthread"
- THREADOBJ="Python/thread.o"
- USE_THREAD_MODULE=""])
- fi
+ ])
+
fi
if test "$posix_threads" = "yes"; then
@@ -5426,7 +5385,7 @@ if test "$have_getrandom" = yes; then
fi
# generate output files
-AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh)
+AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-config.sh)
AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
AC_OUTPUT
@@ -5444,7 +5403,7 @@ fi
echo "creating Makefile" >&AS_MESSAGE_FD
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
- -s Modules Modules/Setup.config \
+ -s Modules \
Modules/Setup.local Modules/Setup
mv config.c Modules