• Home
  • Raw
  • Download

Lines Matching +full:libncurses +full:- +full:dev

2 dnl * Please run autoreconf -ivf -Werror to test your changes! *
5 dnl Python's configure script requires autoconf 2.71, autoconf-archive,
6 dnl aclocal 1.16, and pkg-config.
8 dnl It is recommended to use the Tools/build/regen-configure.sh shell script
22 [AC_MSG_ERROR([Please install autoconf-archive package and re-run autoreconf])]
27 [AC_MSG_ERROR([Please install pkgconf's m4 macro package and re-run autoreconf])]
31 dnl - _SAVE_VAR([VAR]) Helper for SAVE_ENV; stores VAR as save_VAR
32 dnl - _RESTORE_VAR([VAR]) Helper for RESTORE_ENV; restores VAR from save_VAR
33 dnl - SAVE_ENV Saves CFLAGS, LDFLAGS, LIBS, and CPPFLAGS
34 dnl - RESTORE_ENV Restores CFLAGS, LDFLAGS, LIBS, and CPPFLAGS
35 dnl - WITH_SAVE_ENV([SCRIPT]) Runs SCRIPT wrapped with SAVE_ENV/RESTORE_ENV
56 dnl PY_CHECK_FUNC(FUNCTION, [INCLUDES], [AC_DEFINE-VAR])
76 dnl PY_CHECK_LIB(LIBRARY, FUNCTION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES])
90 AS_IF([test "$ac_sys_system" = "Emscripten" -a -z "$py_cflags" -a -z "$py_libs"], [
99 if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then
100 # If we're building out-of-tree, we need to make sure the following
102 # Objects/ -> typeslots.inc
103 # Include/ -> Python.h
105 # regenerated when building out-of-tree, regardless of whether or not
106 # the $srcdir counterpart is up-to-date. This is an acceptable trade
108 BASECPPFLAGS="-IObjects -IInclude -IPython"
117 if test -e $srcdir/.git
119 AC_CHECK_PROG([HAS_GIT], [git], [found], [not-found])
121 HAS_GIT=no-repository
125 GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
126 GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
127 GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
142 [AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])]
145 # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
146 rm -f pybuilddir.txt
148 AC_ARG_WITH([build-python],
149 [AS_HELP_STRING([--with-build-python=python]PYTHON_VERSION,
152 AC_MSG_CHECKING([for --with-build-python])
155 …AS_VAR_IF([with_build_python], [no], [AC_MSG_ERROR([invalid --with-build-python option: expected p…
157 if ! $(command -v "$with_build_python" >/dev/null 2>&1); then
160 …build_python_ver=$($with_build_python -c "import sys; print(f'{sys.version_info.major}.{sys.versio…
167 …$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) _PYTHON_SYSCONFIGDATA_PATH=$(shell test -f pybuilddir.txt && e…
171 [AC_MSG_ERROR([Cross compiling requires --with-build-python])]
173 PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
213 if command -v "$PYTHON_FOR_REGEN" >/dev/null 2>&1; then
214 AC_MSG_RESULT([$($PYTHON_FOR_REGEN -V 2>/dev/null)])
225 prefix=`echo "$prefix" | sed -e 's/\/$//g'`
244 # with other autoconf-based packages that include Python.h
245 grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new
257 # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
263 # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
269 # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
281 dnl Allow users to disable pkg-config or require pkg-config
282 AC_ARG_WITH([pkg-config],
283 [AS_HELP_STRING([[--with-pkg-config=[yes|no|check]]],
284 [use pkg-config to detect build options (default is check)])],
290 if test -z "$PKG_CONFIG"; then
300 dnl force AX_CHECK_OPENSSL to ignore pkg-config
304 [AC_MSG_ERROR([invalid argument --with-pkg-config=$with_pkg_config])]
306 if test "$with_pkg_config" = yes -a -z "$PKG_CONFIG"; then
307 AC_MSG_ERROR([pkg-config is required])]
310 # Set name for machine-dependent library files
311 AC_ARG_VAR([MACHDEP], [name for machine-dependent library files])
313 if test -z "$MACHDEP"
321 *-*-linux-android*)
322 ac_sys_system=Linux-android
324 *-*-linux*)
327 *-*-cygwin*)
330 *-apple-ios*)
333 *-*-vxworks*)
336 *-*-emscripten)
339 *-*-wasi*)
349 ac_sys_system=`uname -s`
351 -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
352 ac_sys_release=`uname -v`
354 ac_sys_release=`uname -r`
358 tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
360 tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
365 linux-android*) MACHDEP="android";;
375 SUNOS_VERSION=`echo $ac_sys_release | sed -e 's!\.\([0-9]\)$!.0\1!g' | tr -d '.'`
377 [The version of SunOS/Solaris as reported by `uname -r' without the dot.])
382 # On cross-compile builds, configure will look for a host-specific compiler by
383 # prepending the user-provided host triple to the required binary name.
385 # On iOS, this results in binaries like "arm64-apple-ios13.0-simulator-gcc",
387 # iOS version. As the default cross-compiler name won't exist, configure falls
391 # "iOS/Resources/bin") in their path, rather than defining platform-specific
395 if test -z "$AR"; then
397 aarch64-apple-ios*-simulator) AR=arm64-apple-ios-simulator-ar ;;
398 aarch64-apple-ios*) AR=arm64-apple-ios-ar ;;
399 x86_64-apple-ios*-simulator) AR=x86_64-apple-ios-simulator-ar ;;
403 if test -z "$CC"; then
405 aarch64-apple-ios*-simulator) CC=arm64-apple-ios-simulator-clang ;;
406 aarch64-apple-ios*) CC=arm64-apple-ios-clang ;;
407 x86_64-apple-ios*-simulator) CC=x86_64-apple-ios-simulator-clang ;;
411 if test -z "$CPP"; then
413 aarch64-apple-ios*-simulator) CPP=arm64-apple-ios-simulator-cpp ;;
414 aarch64-apple-ios*) CPP=arm64-apple-ios-cpp ;;
415 x86_64-apple-ios*-simulator) CPP=x86_64-apple-ios-simulator-cpp ;;
419 if test -z "$CXX"; then
421 aarch64-apple-ios*-simulator) CXX=arm64-apple-ios-simulator-clang++ ;;
422 aarch64-apple-ios*) CXX=arm64-apple-ios-clang++ ;;
423 x86_64-apple-ios*-simulator) CXX=x86_64-apple-ios-simulator-clang++ ;;
428 AC_MSG_CHECKING([for --enable-universalsdk])
430 AS_HELP_STRING([--enable-universalsdk@<:@=SDKDIR@:>@],
439 enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`"
440 if ! ( echo $enableval | grep -E '\.sdk' 1>/dev/null )
443 if test ! -d "${enableval}"
457 if test ! -d "${UNIVERSALSDK}"
459 AC_MSG_ERROR([--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}])
468 if test -n "${UNIVERSALSDK}"
479 # For backward compatibility reasons we prefer to select '32-bit' if available,
481 UNIVERSAL_ARCHS="32-bit"
482 if test "`uname -s`" = "Darwin"
484 if test -n "${UNIVERSALSDK}"
486 if test -z "`/usr/bin/file -L "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
495 AC_MSG_CHECKING([for --with-universal-archs])
496 AC_ARG_WITH([universal-archs],
497 AS_HELP_STRING([--with-universal-archs=ARCH],
499 This option is only valid when --enable-universalsdk is set; options are:
500 ("universal2", "intel-64", "intel-32", "intel", "32-bit",
501 "64-bit", "3-way", or "all")
507 if test -n "${UNIVERSALSDK}"
514 AC_ARG_WITH([framework-name],
515 AS_HELP_STRING([--with-framework-name=FRAMEWORK],
517 only valid when --enable-framework is set. see Mac/README.rst
522 PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr '[A-Z]' '[a-z]'`
530 AS_HELP_STRING([--enable-framework@<:@=INSTALLDIR@:>@],
547 iOS) AC_MSG_ERROR([iOS builds must use --enable-framework]) ;;
550 PYTHONFRAMEWORKDIR=no-framework
611 # --prefix option, but wants to install
612 # the framework in a non-default location,
657 iOS) AC_MSG_ERROR([iOS builds must use --enable-framework]) ;;
660 PYTHONFRAMEWORKDIR=no-framework
699 AC_MSG_CHECKING([for --with-app-store-compliance])
703 [--with-app-store-compliance=@<:@PATCH-FILE@:>@],
705 Optional PATCH-FILE specifies the custom patch to apply.]
712 APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch"
727 APP_STORE_COMPLIANCE_PATCH="Mac/Resources/app-store-compliance.patch"
742 *-*-linux*)
751 *-*-cygwin*)
754 *-apple-ios*)
755 _host_os=`echo $host | cut -d '-' -f3`
756 _host_device=`echo $host | cut -d '-' -f4`
761 IPHONEOS_DEPLOYMENT_TARGET=$(echo ${_host_os} | cut -c4-)
767 _host_ident=${IPHONEOS_DEPLOYMENT_TARGET}-arm64-iphone${_host_device}
770 _host_ident=${IPHONEOS_DEPLOYMENT_TARGET}-$host_cpu-iphone${_host_device}
774 *-*-vxworks*)
777 wasm32-*-* | wasm64-*-*)
785 _PYTHON_HOST_PLATFORM="$MACHDEP${_host_ident:+-$_host_ident}"
822 NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
834 OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
849 Darwin/@<:@[12]@:>@@<:@0-9@:>@.*)
865 # On HP-UX, defining _XOPEN_SOURCE to 600 or greater hides
875 # X/Open 7, incorporating POSIX.1-2008
882 # cases for HP-UX, we define it globally.
884 [Define to activate Unix95-and-earlier features])
887 [Define to activate features from IEEE Stds 1003.1-2008])
890 # On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE
904 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
924 if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
926 AC_MSG_ERROR([cached CC is different -- throw away $cache_file
930 # Don't let AC_PROG_CC set the default CFLAGS. It normally sets -g -O2
931 # when the compiler supports them, but we don't always want -O2, and
932 # we set -g later.
933 if test -z "$CFLAGS"; then
938 dnl On Emscripten use MEMORY64 setting to build target wasm64-emscripten.
941 [wasm64-*-emscripten], [
942 AS_VAR_APPEND([CFLAGS], [" -sMEMORY64=1"])
943 AS_VAR_APPEND([LDFLAGS], [" -sMEMORY64=1"])
950 AS_VAR_APPEND([CFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"])
951 AS_VAR_APPEND([LDFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"])
960 if test -z "$SDKROOT"; then
964 SDKROOT=$(xcrun --show-sdk-path)
975 if test -z "${CC}"
983 if test -x "${as_dir}/gcc"; then
984 if test -z "${found_gcc}"; then
988 if test -x "${as_dir}/clang"; then
989 if test -z "${found_clang}"; then
996 if test -n "$found_gcc" -a -n "$found_clang"
998 if test -n "`"$found_gcc" --version | grep llvm-gcc`"
1000 AC_MSG_NOTICE([Detected llvm-gcc, falling back to clang])
1006 elif test -z "$found_gcc" -a -n "$found_clang"
1012 elif test -z "$found_gcc" -a -z "$found_clang"
1014 found_clang=`/usr/bin/xcrun -find clang 2>/dev/null`
1015 if test -n "${found_clang}"
1019 CXX="`/usr/bin/xcrun -find clang++`"
1055 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
1056 ac_cv_cc_name=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
1063 rm -f conftest.c conftest.out
1086 if test -z "$CXX"
1099 if test -z "$CXX"
1118 if $CPP $CPPFLAGS $srcdir/Misc/platform_triplet.c >conftest.out 2>/dev/null; then
1119 PLATFORM_TRIPLET=`grep '^PLATFORM_TRIPLET=' conftest.out | tr -d ' '`
1125 rm -f conftest.out
1128 dnl For example, `arm64-apple-darwin` is redundant, because there isn't a
1129 dnl non-Apple Darwin. Including the CPU architecture can also be potentially
1130 dnl redundant - on macOS, for example, it's possible to do a single compile
1140 [MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
1160 [iOS], [SOABI_PLATFORM=`echo "$PLATFORM_TRIPLET" | cut -d '-' -f2`],
1165 MULTIARCH_CPPFLAGS="-DMULTIARCH=\\\"$MULTIARCH\\\""
1169 dnl Support tiers according to https://peps.python.org/pep-0011/
1175 [x86_64-*-linux-gnu/gcc], [PY_SUPPORT_TIER=1], dnl Linux on AMD64, any vendor, glibc, gcc
1176 [x86_64-apple-darwin*/clang], [PY_SUPPORT_TIER=1], dnl macOS on Intel, any version
1177 [aarch64-apple-darwin*/clang], [PY_SUPPORT_TIER=1], dnl macOS on M1, any version
1178 [i686-pc-windows-msvc/msvc], [PY_SUPPORT_TIER=1], dnl 32bit Windows on Intel, MSVC
1179 [x86_64-pc-windows-msvc/msvc], [PY_SUPPORT_TIER=1], dnl 64bit Windows on AMD64, MSVC
1181 [aarch64-*-linux-gnu/gcc], [PY_SUPPORT_TIER=2], dnl Linux ARM64, glibc, gcc+clang
1182 [aarch64-*-linux-gnu/clang], [PY_SUPPORT_TIER=2],
1183 …[powerpc64le-*-linux-gnu/gcc], [PY_SUPPORT_TIER=2], dnl Linux on PPC64 little endian, glibc, g…
1184 …[wasm32-unknown-wasip1/clang], [PY_SUPPORT_TIER=2], dnl WebAssembly System Interface preview1,…
1185 …[x86_64-*-linux-gnu/clang], [PY_SUPPORT_TIER=2], dnl Linux on AMD64, any vendor, glibc, cla…
1187 [aarch64-pc-windows-msvc/msvc], [PY_SUPPORT_TIER=3], dnl Windows ARM64, MSVC
1188 …[armv7l-*-linux-gnueabihf/gcc], [PY_SUPPORT_TIER=3], dnl ARMv7 LE with hardware floats, any ven…
1189 …[powerpc64le-*-linux-gnu/clang], [PY_SUPPORT_TIER=3], dnl Linux on PPC64 little endian, glibc, c…
1190 …[s390x-*-linux-gnu/gcc], [PY_SUPPORT_TIER=3], dnl Linux on 64bit s390x (big endian), gli…
1191 [x86_64-*-freebsd*/clang], [PY_SUPPORT_TIER=3], dnl FreeBSD on AMD64
1192 [aarch64-apple-ios*-simulator/clang], [PY_SUPPORT_TIER=3], dnl iOS Simulator on arm64
1193 [aarch64-apple-ios*/clang], [PY_SUPPORT_TIER=3], dnl iOS on ARM64
1194 [aarch64-*-linux-android/clang], [PY_SUPPORT_TIER=3], dnl Android on ARM64
1195 [x86_64-*-linux-android/clang], [PY_SUPPORT_TIER=3], dnl Android on AMD64
1209 AC_CACHE_CHECK([for -Wl,--no-as-needed], [ac_cv_wl_no_as_needed], [
1211 AS_VAR_APPEND([LDFLAGS], [" -Wl,--no-as-needed"])
1213 [NO_AS_NEEDED="-Wl,--no-as-needed"
1231 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
1232 ANDROID_API_LEVEL=`sed -n -e '/__ANDROID_API__/d' -e 's/^android_api = //p' conftest.out`
1233 _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out`
1235 if test -z "$ANDROID_API_LEVEL"; then
1242 LIBS="$LIBS -llog"
1247 BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16"
1248 LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8"
1253 rm -f conftest.c conftest.out
1265 AC_MSG_CHECKING([for --with-emscripten-target])
1266 AC_ARG_WITH([emscripten-target],
1267 [AS_HELP_STRING([--with-emscripten-target=@<:@browser|node@:>@], [Emscripten platform])],
1277 [browser-debug], [ac_sys_emscripten_target=browser-debug],
1278 [node-debug], [ac_sys_emscripten_target=node-debug],
1279 [AC_MSG_ERROR([Invalid argument: --with-emscripten-target=browser|node])]
1282 AC_MSG_ERROR([--with-emscripten-target only applies to Emscripten])
1289 dnl On Emscripten dlopen() requires -s MAIN_MODULE and -fPIC. The flags
1292 dnl See https://emscripten.org/docs/compiling/Dynamic-Linking.html
1293 AC_MSG_CHECKING([for --enable-wasm-dynamic-linking])
1294 AC_ARG_ENABLE([wasm-dynamic-linking],
1295 [AS_HELP_STRING([--enable-wasm-dynamic-linking],
1301 [AC_MSG_ERROR([--enable-wasm-dynamic-linking only applies to Emscripten and WASI])]
1308 AC_MSG_CHECKING([for --enable-wasm-pthreads])
1309 AC_ARG_ENABLE([wasm-pthreads],
1310 [AS_HELP_STRING([--enable-wasm-pthreads],
1316 [AC_MSG_ERROR([--enable-wasm-pthreads only applies to Emscripten and WASI])]
1323 AC_MSG_CHECKING([for --with-suffix])
1325 …[AS_HELP_STRING([--with-suffix=SUFFIX], [set executable suffix to SUFFIX (default is empty, yes is…
1345 # Test whether we're running on a non-case-sensitive system, in which
1348 AC_MSG_CHECKING([for case-insensitive build directory])
1349 if test ! -d CaseSensitiveTestDir; then
1353 if test -d casesensitivetestdir && test -z "$EXEEXT"
1366 cc|*/cc) CC="$CC -Ae";;
1372 if test -z "$LIBRARY"
1390 # on the system - some systems like version suffix, others don't
1410 # LINKCC is the command that links the python executable -- default is $(CC).
1416 if test -z "$LINKCC"
1422 # support -N.
1445 # distutils.unixccompiler to know if it should add --enable-new-dtags
1452 ac_prog=`$CC -print-prog-name=ld`
1454 case `"$ac_prog" -V 2>&1 < /dev/null` in
1462 AC_MSG_CHECKING([for --enable-shared])
1464 … AS_HELP_STRING([--enable-shared], [enable building a shared Python library (default is no)]))
1466 if test -z "$enable_shared"
1477 # --with-static-libpython
1479 AC_MSG_CHECKING([for --with-static-libpython])
1480 AC_ARG_WITH([static-libpython],
1481 AS_HELP_STRING([--without-static-libpython],
1494 AC_MSG_CHECKING([for --enable-profiling])
1496 … AS_HELP_STRING([--enable-profiling], [enable C-level code profiling with gprof (default is no)]))
1499 CC="$CC -pg"
1510 BASECFLAGS="-pg $BASECFLAGS"
1511 LDFLAGS="-pg $LDFLAGS"
1518 # will find it with a -framework option). For this reason there is an
1522 # but uses a non-versioned framework layout.
1547 BLDLIBRARY='-L. -lpython$(LDVERSION)'
1552 BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
1562 BLDLIBRARY='-L. -lpython$(LDVERSION)'
1567 if test "$ac_sys_system" != "Linux-android"; then
1577 case `uname -m` in
1585 BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
1590 BLDLIBRARY='-L. -lpython$(LDVERSION)'
1619 if test -z "$HOSTRUNNER"
1627 AC_CACHE_CHECK([for node --experimental-wasm-bigint], [ac_cv_tool_node_wasm_bigint], [
1628 if $NODE -v --experimental-wasm-bigint > /dev/null 2>&1; then
1635 AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-bigint"])
1639 AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-threads"])
1641 … AC_CACHE_CHECK([for node --experimental-wasm-bulk-memory], [ac_cv_tool_node_wasm_bulk_memory], [
1642 if $NODE -v --experimental-wasm-bulk-memory > /dev/null 2>&1; then
1649 AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-bulk-memory"])
1653 … AS_VAR_IF([host_cpu], [wasm64], [AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-memory64"])])
1658--wasm max-wasm-stack=8388608 --wasi preview2=n --env PYTHONPATH=/$(shell realpath --relative-to $…
1665 if test -n "$HOSTRUNNER"; then
1703 if test -z "$ARFLAGS"
1710 # install -d does not work on HP-UX
1711 if test -z "$INSTALL"
1713 INSTALL="${srcdir}/install-sh -c"
1721 if test -z "$LN" ; then
1723 CYGWIN*) LN="ln -s";;
1734 # Check for --disable-gil
1735 # --disable-gil
1736 AC_MSG_CHECKING([for --disable-gil])
1738 …[AS_HELP_STRING([--disable-gil], [enable experimental support for running without the GIL (default…
1752 # Check for --with-pydebug
1753 AC_MSG_CHECKING([for --with-pydebug])
1755 [AS_HELP_STRING([--with-pydebug], [build with Py_DEBUG defined (default is no)]) ],
1760 [Define if you want to build an interpreter with many run-time checks.])
1768 # Check for --with-trace-refs
1769 # --with-trace-refs
1770 AC_MSG_CHECKING([for --with-trace-refs])
1771 AC_ARG_WITH([trace-refs],
1772 …[AS_HELP_STRING([--with-trace-refs], [enable tracing references for debugging purpose (default is …
1783 if test "$disable_gil" = "yes" -a "$with_trace_refs" = "yes";
1785 AC_MSG_ERROR([--disable-gil cannot be used with --with-trace-refs])
1788 # Check for --enable-pystats
1789 AC_MSG_CHECKING([for --enable-pystats])
1792 [--enable-pystats],
1803 # Check for --with-assertions.
1806 AC_MSG_CHECKING([for --with-assertions])
1808 AS_HELP_STRING([--with-assertions],[build with C assertions enabled (default is no)]),
1819 AC_MSG_RESULT([implied by --with-pydebug])
1824 # Check for --enable-experimental-jit:
1825 AC_MSG_CHECKING([for --enable-experimental-jit])
1826 AC_ARG_ENABLE([experimental-jit],
1827 [AS_HELP_STRING([--enable-experimental-jit@<:@=no|yes|yes-off|interpreter@:>@],
1828 [build the experimental just-in-time compiler (default is no)])],
1833 yes) jit_flags="-D_Py_JIT"; tier2_flags="-D_Py_TIER2=1" ;;
1834 yes-off) jit_flags="-D_Py_JIT"; tier2_flags="-D_Py_TIER2=3" ;;
1835 interpreter) jit_flags=""; tier2_flags="-D_Py_TIER2=4" ;;
1836 interpreter-off) jit_flags=""; tier2_flags="-D_Py_TIER2=6" ;; # Secret option
1838 …[invalid argument: --enable-experimental-jit=$enable_experimental_jit; expected no|yes|yes-off|int…
1853 [AS_VAR_APPEND([REGEN_JIT_COMMAND], [" --debug"])],
1863 AC_MSG_CHECKING([for --enable-optimizations])
1865 [--enable-optimizations],
1882 # who want LTO need to use --with-lto themselves.
1883 DEF_MAKE_ALL_RULE="profile-opt"
1888 AX_CHECK_COMPILE_FLAG([-fno-semantic-interposition],[
1889 CFLAGS_NODIST="$CFLAGS_NODIST -fno-semantic-interposition"
1890 LDFLAGS_NODIST="$LDFLAGS_NODIST -fno-semantic-interposition"
1891 ], [], [-Werror])
1894 elif test "$ac_sys_system" = "Emscripten" -o "$ac_sys_system" = "WASI"; then
1908 if test -z "$PROFILE_TASK"
1910 PROFILE_TASK='-m test --pgo --timeout=$(TESTTIMEOUT)'
1914 # Make llvm-related checks work on systems where llvm tools are not installed with their
1916 # non-suffixed name in their versioned llvm directory.
1925 if test -L "${clang_bin}"
1935 AC_MSG_CHECKING([for --with-lto])
1937 …[AS_HELP_STRING([--with-lto=@<:@full|thin|no|yes@:>@], [enable Link-Time-Optimization in any build…
1969 LDFLAGS_NOLTO="-fno-lto"
1970 dnl Clang linker requires -flto in order to link objects with LTO information.
1972 AX_CHECK_COMPILE_FLAG([-flto=thin],[LDFLAGS_NOLTO="-flto=thin"],[LDFLAGS_NOLTO="-flto"])
1974 AC_PATH_TOOL([LLVM_AR], [llvm-ar], [''], [${llvm_path}])
1976 if test -n "${LLVM_AR}" -a -x "${LLVM_AR}"
1980 LLVM_AR_FOUND="not-found"
1982 if test "$ac_sys_system" = "Darwin" -a "${LLVM_AR_FOUND}" = "not-found"
1984 # The Apple-supplied ar in Xcode or the Command Line Tools is apparently sufficient
1985 found_llvm_ar=`/usr/bin/xcrun -find ar 2>/dev/null`
1986 if test -n "${found_llvm_ar}"
1990 AC_MSG_NOTICE([llvm-ar found via xcrun: ${LLVM_AR}])
1993 if test $LLVM_AR_FOUND = not-found
1996 … AC_MSG_ERROR([llvm-ar is required for a --with-lto build with clang but could not be found.])
2007 AX_CHECK_COMPILE_FLAG([-flto=thin],[
2008 LTOFLAGS="-flto=thin -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
2009 LTOCFLAGS="-flto=thin"
2011 LTOFLAGS="-flto -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
2012 LTOCFLAGS="-flto"
2016 LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
2017 LTOCFLAGS="-flto=${Py_LTO_POLICY}"
2024 AX_CHECK_COMPILE_FLAG([-flto=thin],[LTOFLAGS="-flto=thin"],[LTOFLAGS="-flto"])
2026 LTOFLAGS="-flto=${Py_LTO_POLICY}"
2035 LTOFLAGS="-flto"
2036 LTOCFLAGS="-flto"
2044 LDFLAGS_NOLTO="-fno-lto"
2047 LTOFLAGS="-flto -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
2048 LTOCFLAGS="-flto"
2051 LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"
2059 # bpo-30345: Add -g to LDFLAGS when compiling with LTO
2061 LTOFLAGS="$LTOFLAGS -g"
2064 CFLAGS_NODIST="$CFLAGS_NODIST ${LTOCFLAGS-$LTOFLAGS}"
2075 AC_PATH_TOOL([LLVM_PROFDATA], [llvm-profdata], [''], [${llvm_path}])
2077 if test -n "${LLVM_PROFDATA}" -a -x "${LLVM_PROFDATA}"
2081 LLVM_PROF_FOUND="not-found"
2083 if test "$ac_sys_system" = "Darwin" -a "${LLVM_PROF_FOUND}" = "not-found"
2085 found_llvm_profdata=`/usr/bin/xcrun -find llvm-profdata 2>/dev/null`
2086 if test -n "${found_llvm_profdata}"
2088 # llvm-profdata isn't directly in $PATH in some cases.
2090 LLVM_PROFDATA='/usr/bin/xcrun llvm-profdata'
2092 AC_MSG_NOTICE([llvm-profdata found via xcrun: ${LLVM_PROFDATA}])
2102 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
2103 PGO_PROF_USE_FLAG="-fprofile-instr-use=\"\$(shell pwd)/code.profclangd\""
2106 -output=\"\$(shell pwd)/code.profclangd\"
2109 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"\$(shell pwd)/code-%p.profclangr\""
2110 if test $LLVM_PROF_FOUND = not-found
2115 …AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations build but could not be found.…
2122 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
2123 PGO_PROF_USE_FLAG="-fprofile-instr-use=\"\$(shell pwd)/code.profclangd\""
2126 -output=\"\$(shell pwd)/code.profclangd\"
2129 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"\$(shell pwd)/code-%p.profclangr\""
2130 if test "${LLVM_PROF_FOUND}" = "not-found"
2135 …AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations build but could not be found.…
2140 PGO_PROF_GEN_FLAG="-fprofile-generate"
2141 PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction"
2148 PGO_PROF_GEN_FLAG="-prof-gen"
2149 PGO_PROF_USE_FLAG="-prof-use"
2157 AC_MSG_CHECKING([for --enable-bolt])
2159 [--enable-bolt],
2160 [enable usage of the llvm-bolt post-link optimizer (default is no)])],
2175 DEF_MAKE_ALL_RULE="bolt-opt"
2178 # -fno-reorder-blocks-and-partition is required for bolt to work.
2180 AX_CHECK_COMPILE_FLAG([-fno-reorder-blocks-and-partition],[
2181 CFLAGS_NODIST="$CFLAGS_NODIST -fno-reorder-blocks-and-partition"
2185 LDFLAGS_NODIST="$LDFLAGS_NODIST -Wl,--emit-relocs"
2188 CFLAGS_NODIST="$CFLAGS_NODIST -fno-pie"
2189 # We want to add these no-pie flags to linking executables but not shared libraries:
2190 LINKCC="$LINKCC -fno-pie -no-pie"
2192 AC_PATH_TOOL([LLVM_BOLT], [llvm-bolt], [''], [${llvm_path}])
2193 if test -n "${LLVM_BOLT}" -a -x "${LLVM_BOLT}"
2195 AC_MSG_RESULT(["Found llvm-bolt"])
2197 AC_MSG_ERROR([llvm-bolt is required for a --enable-bolt build but could not be found.])
2201 AC_PATH_TOOL([MERGE_FDATA], [merge-fdata], [''], [${llvm_path}])
2202 if test -n "${MERGE_FDATA}" -a -x "${MERGE_FDATA}"
2204 AC_MSG_RESULT(["Found merge-fdata"])
2206 AC_MSG_ERROR([merge-fdata is required for a --enable-bolt build but could not be found.])
2219 [Arguments to llvm-bolt when instrumenting binaries]
2222 if test -z "${BOLT_INSTRUMENT_FLAGS}"
2230 [Arguments to llvm-bolt when creating a BOLT optimized binary]
2233 if test -z "${BOLT_APPLY_FLAGS}"
2238 -update-debug-sections
2239 -reorder-blocks=ext-tsp
2240 -reorder-functions=hfsort+
2241 -split-functions
2242 -icf=1
2243 -inline-all
2244 -split-eh
2245 -reorder-functions-use-hot-size
2246 -peepholes=none
2247 -jump-tables=aggressive
2248 -inline-ap
2249 -indirect-call-promotion=all
2250 -dyno-stats
2251 -use-gnu-stack
2252 -frame-opt=hot
2262 # ------------------------
2263 # (The following bit of code is complicated enough - please keep things
2264 # indented properly. Just pretend you're editing Python code. ;-)
2276 if $CC --version 2>&1 | grep -q clang
2285 dnl is defined behaviour via twos-complement.
2289 CFLAGS="-fstrict-overflow -fno-strict-overflow"
2290 AC_CACHE_CHECK([if $CC supports -fstrict-overflow and -fno-strict-overflow],
2301 [STRICT_OVERFLOW_CFLAGS="-fstrict-overflow"
2302 NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"],
2306 AC_MSG_CHECKING([for --with-strict-overflow])
2307 AC_ARG_WITH([strict-overflow],
2309 [--with-strict-overflow],
2310 [if 'yes', add -fstrict-overflow to CFLAGS, else add -fno-strict-overflow (default is no)]
2315 … [AC_MSG_WARN([--with-strict-overflow=yes requires a compiler that supports -fstrict-overflow])],
2323 # Check if CC supports -Og optimization level
2325 CFLAGS="-Og"
2326 AC_CACHE_CHECK([if $CC supports -Og optimization level],
2341 PYDEBUG_CFLAGS="-O0"
2343 [PYDEBUG_CFLAGS="-Og"])
2349 if test "${OPT-unset}" = "unset"
2353 if test -n "${cc_is_clang}"
2355 # bpo-30104: disable strict aliasing to compile correctly dtoa.c,
2357 CFLAGS_ALIASING="-fno-strict-aliasing"
2363 OPT="-g $PYDEBUG_CFLAGS -Wall"
2365 OPT="-g -O3 -Wall"
2369 OPT="-O3 -Wall"
2374 SCO_SV*) OPT="$OPT -m486 -DSCO5"
2380 OPT="-O"
2389 dnl node-debug or browser-debug.
2393 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sALLOW_MEMORY_GROWTH -sTOTAL_MEMORY=20971520"])
2396 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sWASM_BIGINT"])
2399 …AS_VAR_APPEND([LDFLAGS_NODIST], [" -sFORCE_FILESYSTEM -lidbfs.js -lnodefs.js -lproxyfs.js -lworker…
2402 AS_VAR_APPEND([LINKFORSHARED], [" -sMAIN_MODULE"])
2406 AS_VAR_APPEND([CFLAGS_NODIST], [" -pthread"])
2407 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sUSE_PTHREADS"])
2408 AS_VAR_APPEND([LINKFORSHARED], [" -sPROXY_TO_PTHREAD"])
2413 AS_VAR_IF([ac_sys_emscripten_target], [browser-debug], [wasm_debug=yes])
2414 AS_VAR_APPEND([LINKFORSHARED], [" --preload-file=\$(WASM_ASSETS_DIR)"])
2417 dnl separate-dwarf does not seem to work in Chrome DevTools Support.
2418 WASM_LINKFORSHARED_DEBUG="-gsource-map --emit-symbol-map"
2421 AS_VAR_IF([ac_sys_emscripten_target], [node-debug], [wasm_debug=yes])
2422 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sALLOW_MEMORY_GROWTH -sNODERAWFS"])
2423 AS_VAR_APPEND([LINKFORSHARED], [" -sEXIT_RUNTIME"])
2424 WASM_LINKFORSHARED_DEBUG="-gseparate-dwarf --emit-symbol-map"
2429 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sASSERTIONS"])
2432 AS_VAR_APPEND([LINKFORSHARED], [" -O2 -g0"])
2439 LIBS="$LIBS -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks"
2446 # wasm32-wasi-threads.
2447 # Note: wasi-threads requires --import-memory.
2448 # Note: wasi requires --export-memory.
2449 # Note: --export-memory is implicit unless --import-memory is given
2451 AS_VAR_APPEND([CFLAGS], [" -target wasm32-wasi-threads -pthread"])
2452 AS_VAR_APPEND([CFLAGS_NODIST], [" -target wasm32-wasi-threads -pthread"])
2453 AS_VAR_APPEND([LDFLAGS_NODIST], [" -target wasm32-wasi-threads -pthread"])
2454 AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--import-memory"])
2455 AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--export-memory"])
2456 AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--max-memory=10485760"])
2459 dnl gh-117645: Set the memory size to 20 MiB, the stack size to 8 MiB,
2461 dnl https://github.com/WebAssembly/wasi-libc/issues/233
2462 …AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=8388608 -Wl,--stack-first -Wl,--initial-memory=20…
2479 # The -arch flags for universal builds on macOS
2488 AS_VAR_APPEND([CFLAGS], [" -W$2 -Werror"])
2504 CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
2506 PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra])
2508 [CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"])
2512 # -fno-strict-aliasing on versions of GCC that support but produce
2515 CC="$CC -fno-strict-aliasing"
2517 AC_CACHE_CHECK([whether $CC accepts and needs -fno-strict-aliasing],
2523 CC="$ac_save_cc -fstrict-aliasing"
2524 CFLAGS="$CFLAGS -Werror -Wstrict-aliasing"
2540 [BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"])
2546 [PY_CHECK_CC_WARNING([disable], [unused-result])])
2548 [BASECFLAGS="$BASECFLAGS -Wno-unused-result"
2549 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-result"])
2551 PY_CHECK_CC_WARNING([disable], [unused-parameter])
2553 [CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter"])
2555 PY_CHECK_CC_WARNING([disable], [int-conversion])
2557 [CFLAGS_NODIST="$CFLAGS_NODIST -Wno-int-conversion"])
2559 PY_CHECK_CC_WARNING([disable], [missing-field-initializers])
2561 [CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers"])
2563 PY_CHECK_CC_WARNING([enable], [sign-compare])
2565 [BASECFLAGS="$BASECFLAGS -Wsign-compare"])
2567 PY_CHECK_CC_WARNING([enable], [unreachable-code])
2569 # results in non-standard code paths.
2577 test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`"
2579 BASECFLAGS="$BASECFLAGS -Wunreachable-code"
2584 PY_CHECK_CC_WARNING([enable], [strict-prototypes])
2586 [CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes"])
2589 CC="$CC -Werror=implicit-function-declaration"
2603 [CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"])
2606 CC="$CC -fvisibility=hidden"
2619 [CFLAGS_NODIST="$CFLAGS_NODIST -fvisibility=hidden"])
2621 # if using gcc on alpha, use -mieee to get (near) full IEEE 754
2626 BASECFLAGS="$BASECFLAGS -mieee"
2632 BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
2636 # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
2637 # used to be here, but non-Apple gcc doesn't accept them.
2646 CC=gcc-4.0
2647 CPP=cpp-4.0
2657 32-bit)
2658 UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
2662 64-bit)
2663 UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
2668 UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
2669 LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
2670 ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
2673 UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
2675 LIPO_INTEL64_FLAGS="-extract x86_64"
2679 UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
2680 LIPO_32BIT_FLAGS="-extract i386"
2681 ARCH_RUN_32BIT="/usr/bin/arch -i386"
2683 intel-32)
2684 UNIVERSAL_ARCH_FLAGS="-arch i386"
2688 intel-64)
2689 UNIVERSAL_ARCH_FLAGS="-arch x86_64"
2693 3-way)
2694 UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
2695 LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
2696 ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
2699 … AC_MSG_ERROR([proper usage is --with-universal-arch=universal2|32-bit|64-bit|all|intel|3-way])
2705 CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
2706 LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
2707 CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
2728 cur_target_major=`sw_vers -productVersion | \
2729 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
2730 cur_target_minor=`sw_vers -productVersion | \
2731 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
2733 if test ${cur_target_major} -eq 10 && \
2734 test ${cur_target_minor} -ge 3 && \
2735 test ${cur_target_minor} -le 5
2742 all|3-way|intel|64-bit)
2755 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
2770 AC_MSG_ERROR([check config.log and use the '--with-universal-archs' option])
2781 BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
2784 BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
2795 # ICC needs -fp-model strict or floats behave badly
2796 CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
2799 CFLAGS_NODIST="$CFLAGS_NODIST -qalias=noansi -qmaxmem=-1"
2806 OPT="-DNDEBUG $OPT"
2818 # options before we can check whether -Kpthread improves anything.
2846 # -Kpthread, if available, provides the right #defines
2848 # Some compilers won't report that they do not support -Kpthread,
2851 AC_CACHE_CHECK([whether $CC accepts -Kpthread], [ac_cv_kpthread],
2853 CC="$CC -Kpthread"
2871 if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
2873 # -Kthread, if available, provides the right #defines
2875 # Some compilers won't report that they do not support -Kthread,
2878 AC_CACHE_CHECK([whether $CC accepts -Kthread], [ac_cv_kthread],
2880 CC="$CC -Kthread"
2898 if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
2900 # -pthread, if available, provides the right #defines
2902 # Some compilers won't report that they do not support -pthread,
2905 AC_CACHE_CHECK([whether $CC accepts -pthread], [ac_cv_pthread],
2907 CC="$CC -pthread"
2927 if test ! -z "$CXX"
2934 CXX="$CXX -Kpthread"
2938 CXX="$CXX -Kthread"
2942 CXX="$CXX -pthread"
2951 $CXX -c conftest.$ac_ext 2>&5
2952 if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
2953 && test -s conftest$ac_exeext && ./conftest$ac_exeext
2959 rm -fr conftest*
2969 dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
2997 # bluetooth/bluetooth.h has been known to not compile with -std=c99.
3000 CFLAGS="-std=c99 $CFLAGS"
3164 if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
3165 "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
3197 then CC="$CC -Kpthread"
3199 then CC="$CC -Kthread"
3201 then CC="$CC -pthread"
3221 if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then
3238 AC_MSG_CHECKING([for --enable-framework])
3241 BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
3242 # -F. is needed to allow linking to the framework while
3250 …AC_MSG_ERROR([Specifying both --enable-shared and --enable-framework is not supported, use only --
3256 # Check for --with-dsymutil
3261 AC_MSG_CHECKING([for --with-dsymutil])
3265 [--with-dsymutil],
3291 [Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
3292 dynamic linker (dyld) instead of the old-style (NextStep) dynamic
3301 AC_MSG_CHECKING([for --with-address-sanitizer])
3303 AS_HELP_STRING([--with-address-sanitizer],
3307 BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
3308 LDFLAGS="-fsanitize=address $LDFLAGS"
3314 AC_MSG_CHECKING([for --with-memory-sanitizer])
3318 [--with-memory-sanitizer],
3323 AX_CHECK_COMPILE_FLAG([-fsanitize=memory],[
3324 BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS"
3325 LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS"
3332 AC_MSG_CHECKING([for --with-undefined-behavior-sanitizer])
3336 [--with-undefined-behavior-sanitizer],
3341 BASECFLAGS="-fsanitize=undefined $BASECFLAGS"
3342 LDFLAGS="-fsanitize=undefined $LDFLAGS"
3350 AC_MSG_CHECKING([for --with-thread-sanitizer])
3354 [--with-thread-sanitizer],
3359 BASECFLAGS="-fsanitize=thread $BASECFLAGS"
3360 LDFLAGS="-fsanitize=thread $LDFLAGS"
3377 # -- usually .so, .sl on HP-UX, .dll on Cygwin
3379 if test -z "$SHLIB_SUFFIX"; then
3382 case `uname -m` in
3394 # -- "cc -G" on SunOS 5.x.
3398 if test -z "$LDSHARED"
3402 BLDSHARED="Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
3403 LDSHARED="\$(LIBPL)/ld_so_aix \$(CC) -bI:\$(LIBPL)/python.exp"
3407 LDSHARED='$(CC) -shared'
3408 LDCXXSHARED='$(CXX) -shared'
3410 LDSHARED='$(CC) -G'
3411 LDCXXSHARED='$(CXX) -G'
3415 LDSHARED='$(CC) -shared'
3416 LDCXXSHARED='$(CXX) -shared'
3418 LDSHARED='$(CC) -b'
3419 LDCXXSHARED='$(CXX) -b'
3422 LDSHARED='$(CC) -bundle'
3423 LDCXXSHARED='$(CXX) -bundle'
3431 LDSHARED="$LDSHARED -undefined suppress"
3432 LDCXXSHARED="$LDCXXSHARED -undefined suppress"
3435 LDSHARED='$(CC) -bundle'
3436 LDCXXSHARED='$(CXX) -bundle'
3443 # No framework, use the Python app as bundle-loader
3444 BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
3445 LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
3446 LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
3449 # Use -undefined dynamic_lookup whenever possible (10.3 and later).
3453 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
3455 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
3456 if test ${dep_target_major} -eq 10 && \
3457 test ${dep_target_minor} -le 2
3463 LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
3464 LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
3469 LDSHARED='$(CC) -dynamiclib -F . -framework $(PYTHONFRAMEWORK)'
3470 LDCXXSHARED='$(CXX) -dynamiclib -F . -framework $(PYTHONFRAMEWORK)'
3474 LDSHARED='$(CC) -shared'
3475 LDCXXSHARED='$(CXX) -shared';;
3477 LDSHARED='$(CC) -shared'
3478 LDCXXSHARED='$(CXX) -shared';;
3480 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
3482 LDSHARED='$(CC) -shared'
3483 LDCXXSHARED='$(CXX) -shared'
3485 LDSHARED="ld -Bshareable"
3488 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
3490 LDSHARED='$(CC) -shared $(CCSHARED)'
3491 LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
3493 case `uname -r` in
3494 [[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
3495 LDSHARED="ld -Bshareable ${LDFLAGS}"
3498 LDSHARED='$(CC) -shared $(CCSHARED)'
3499 LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
3504 LDSHARED='$(CC) -shared'
3505 LDCXXSHARED='$(CXX) -shared';;
3508 LDSHARED='$(CC) -shared'
3509 LDCXXSHARED='$(CXX) -shared'
3511 LDSHARED='$(CC) -G'
3512 LDCXXSHARED='$(CXX) -G'
3515 LDSHARED='$(CC) -Wl,-G,-Bexport'
3516 LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
3522 LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
3523 LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
3529 dnl test -z $LDSHARED block to configure BLDSHARED for side module support.
3530 if test "$enable_wasm_dynamic_linking" = "yes" -a "$ac_sys_system" = "Emscripten"; then
3531 BLDSHARED='$(CC) -shared -sSIDE_MODULE=1'
3535 LDCXXSHARED=${LDCXXSHARED-$LDSHARED}
3538 BLDSHARED=${BLDSHARED-$LDSHARED}
3542 # library (module) -- this is only needed for a few systems
3544 if test -z "$CCSHARED"
3548 then CCSHARED="-fPIC";
3549 elif test `uname -p` = sparc;
3550 then CCSHARED="-xcode=pic32";
3551 else CCSHARED="-Kpic";
3554 then CCSHARED="-fPIC";
3557 Linux*|GNU*) CCSHARED="-fPIC";;
3560 CCSHARED="-fPIC"
3562 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
3563 Haiku*) CCSHARED="-fPIC";;
3566 then CCSHARED="-fPIC"
3567 else CCSHARED="-KPIC"
3571 then CCSHARED="-fPIC"
3572 else CCSHARED="-Kpic -belf"
3575 CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic"
3580 # the python executable -- this is only needed for a few systems
3582 if test -z "$LINKFORSHARED"
3585 AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
3587 LINKFORSHARED="-Wl,-E -Wl,+s";;
3588 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
3589 Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
3590 Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
3591 # -u libsys_s pulls in all symbols in libsys
3593 LINKFORSHARED="$extra_undefs -framework CoreFoundation"
3610 LINKFORSHARED="-Wl,-stack_size,$stack_size $LINKFORSHARED"
3617 …LINKFORSHARED="-Wl,-stack_size,$stack_size $LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWOR…
3620 OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
3621 SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
3622 ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
3624 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
3626 LINKFORSHARED="-Wl,--export-dynamic"
3630 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
3632 LINKFORSHARED="-Xlinker --export-dynamic"
3638 LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
3641 # -Wl,-E causes the symbols to be added to the dynamic
3643 # is loaded. -N 2048K causes the stack size to be set
3646 LINKFORSHARED='-Wl,-E -N 2048K';;
3648 LINKFORSHARED='-Wl,-export-dynamic';;
3668 dnl WASM dynamic linking requires -fPIC.
3675 # SHLIBS are libraries (except -lc and -lm) to link to the python shared
3676 # library (with --enable-shared).
3691 dnl perf trampoline is Linux specific and requires an arch-specific
3695 [x86_64-linux-gnu], [perf_trampoline=yes],
3696 [aarch64-linux-gnu], [perf_trampoline=yes],
3707 AS_VAR_APPEND([BASECFLAGS], [" -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"])
3715 AC_CHECK_LIB([dld], [shl_load]) # Dynamic linking for HP-UX
3726 dnl Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
3727 dnl stream in big-endian byte-order
3731 LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""}
3732 LIBUUID_LIBS=${LIBUUID_LIBS-""}
3739 [dnl linux-util's libuuid has uuid_generate_time_safe() since v2.20 (2011)
3754 LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""}
3755 LIBUUID_LIBS=${LIBUUID_LIBS-"-luuid"}
3767 LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""}
3768 LIBUUID_LIBS=${LIBUUID_LIBS-""}
3784 LIBS="-lintl $LIBS"])
3800 dnl The AIX_BUILDDATE is obtained from the kernel fileset - bos.mp64
3805 AIX_BUILDDATE=$(lslpp -Lcq bos.mp64 | awk -F: '{ print $NF }')
3833 if test "$ac_sys_system" = "Linux-android"; then
3849 AC_MSG_CHECKING([for --with-hash-algorithm])
3854 [--with-hash-algorithm=@<:@fnv|siphash13|siphash24@:>@],
3878 if test -z "$1"; then
3885 if ( echo $1 | grep '\(^\|:\)\(@<:@^/@:>@\|$\)' > /dev/null); then
3886 AC_MSG_ERROR([--with-tzpath must contain only absolute paths, not $1])
3892 AC_MSG_CHECKING([for --with-tzpath])
3896 [--with-tzpath=<list of absolute paths separated by pathsep>],
3902 AC_MSG_ERROR([--with-tzpath requires a value])
3915 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
3916 AC_CHECK_LIB([nsl], [t_open], [LIBS="-lnsl $LIBS"]) # SVR4
3917 AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
3921 AC_CHECK_LIB([network], [socket], [LIBS="-lnetwork $LIBS"], [], [$LIBS])
3925 AC_MSG_CHECKING([for --with-libs])
3929 [--with-libs='lib1 ...'],
3939 AC_MSG_CHECKING([for --with-system-expat])
3943 [--with-system-expat],
3950 LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""}
3951 LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"}
3954 LIBEXPAT_CFLAGS="-I\$(srcdir)/Modules/expat"
3955 LIBEXPAT_LDFLAGS="-lm \$(LIBEXPAT_A)"
3966 CFLAGS="-I${SDKROOT}/usr/include/ffi $CFLAGS"
3971 LIBFFI_CFLAGS="-I${SDKROOT}/usr/include/ffi -DUSING_APPLE_OS_LIBFFI=1"
3972 LIBFFI_LIBS="-lffi"
3985 LIBFFI_CFLAGS=${LIBFFI_CFLAGS-""}
3986 LIBFFI_LIBS=${LIBFFI_LIBS-"-lffi"}
4003 [sunos5], [AS_VAR_APPEND([LIBFFI_LIBS], [" -mimpure-text"])]
4007 AS_VAR_APPEND([LIBFFI_CFLAGS], [" -DUSING_MALLOC_CLOSURE_DOT_C=1"])
4011 dnl HAVE_LIBDL: for dlopen, see gh-76828
4012 AS_VAR_IF([ac_cv_lib_dl_dlopen], [yes], [AS_VAR_APPEND([LIBFFI_LIBS], [" -ldl"])])
4025 AC_MSG_CHECKING([for --with-system-libmpdec])
4029 [--with-system-libmpdec],
4037 [LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec"
4038 LIBMPDEC_LIBS="-lm \$(LIBMPDEC_A)"
4047 [LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""}
4048 LIBMPDEC_LIBS=${LIBMPDEC_LIBS-"-lmpdec -lm"}
4077 # Disable forced inlining in debug builds, see GH-94847
4080 [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DTEST_COVERAGE"])])
4082 # Check whether _decimal should use a coroutine-local or thread-local context
4083 AC_MSG_CHECKING([for --with-decimal-contextvar])
4087 [--with-decimal-contextvar],
4088 …[build _decimal module using a coroutine-local rather than a thread-local context (default is yes)]
4096 …[Define if you want build the _decimal module using a coroutine-local rather than a thread-local c…
4116 elif test $ac_cv_sizeof_size_t -eq 8; then
4124 elif test $ac_cv_sizeof_size_t -eq 4; then
4125 if test "$ac_cv_gcc_asm_for_x87" = yes -a "$libmpdec_system" != sunos; then
4138 [x64], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_64=1 -DASM=1"])],
4139 … [uint128], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1"])],
4140 [ansi64], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_64=1 -DANSI=1"])],
4141 …[ppro], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_32=1 -DANSI=1 -DASM=1 -Wno-unknown-pr…
4142 [ansi32], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_32=1 -DANSI=1"])],
4143 …[ansi-legacy], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_32=1 -DANSI=1 -DLEGACY_COMPILER=1"])],
4144 [universal], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DUNIVERSAL=1"])],
4151 # https://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
4152 AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -fno-ipa-pure-const"])
4157 # https://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
4158 AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -U_FORTIFY_SOURCE"])
4166 PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
4168 dnl Check for SQLite library. Use pkg-config if available.
4171 LIBSQLITE3_CFLAGS=${LIBSQLITE3_CFLAGS-""}
4172 LIBSQLITE3_LIBS=${LIBSQLITE3_LIBS-"-lsqlite3"}
4175 AS_VAR_APPEND([LIBSQLITE3_CFLAGS], [' -I$(srcdir)/Modules/_sqlite'])
4177 dnl PY_CHECK_SQLITE_FUNC(FUNCTION, IF-FOUND, IF-NOT-FOUND)
4185 dnl bpo-45774/GH-29507: The CPP check in AC_CHECK_HEADER can fail on FreeBSD,
4232 AC_MSG_CHECKING([for --enable-loadable-sqlite-extensions])
4233 AC_ARG_ENABLE([loadable-sqlite-extensions],
4235 [--enable-loadable-sqlite-extensions], [
4256 dnl Detect Tcl/Tk. Use pkg-config if available.
4273 TCLTK_CFLAGS=${TCLTK_CFLAGS-""}
4274 TCLTK_LIBS=${TCLTK_LIBS-""}
4321 AS_VAR_APPEND([TCLTK_CFLAGS], [" -Wno-strict-prototypes -DWITH_APPINIT=1"])
4337 GDBM_LIBS=${GDBM_LIBS-"-lgdbm"}
4364 dnl "gdbm-ndbm.h" and "gdbm/ndbm.h" are both normalized to "gdbm_ndbm_h"
4380 [gdbm-ndbm.h],
4385 AC_DEFINE([HAVE_GDBM_DASH_NDBM_H], [1], [Define to 1 if you have the <gdbm-ndbm.h> header file.])
4389 if test "$ac_cv_header_gdbm_slash_ndbm_h" = yes -o "$ac_cv_header_gdbm_dash_ndbm_h" = yes; then
4397 # db.h re-defines the name of the function
4401 LIBS="$LIBS -ldb"
4413 AC_DEFINE([HAVE_LIBDB], [1], [Define to 1 if you have the `db' library (-ldb).])
4417 # Check for --with-dbmliborder
4418 AC_MSG_CHECKING([for --with-dbmliborder])
4422 [--with-dbmliborder=db1:db2:...],
4440 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:... (gdbm:ndbm:bdb)])
4452 DBM_CFLAGS="-DUSE_NDBM"
4460 DBM_CFLAGS="-DUSE_GDBM_COMPAT"
4461 DBM_LIBS="-lgdbm_compat"
4468 DBM_CFLAGS="-DUSE_BERKDB"
4469 DBM_LIBS="-ldb"
4482 [Define to force use of thread-safe errno, h_errno, and other functions])
4490 CFLAGS="$CFLAGS -D_REENTRANT"
4494 CC="$CC -Kpthread"
4496 CXX="$CXX -Kpthread"
4501 CC="$CC -Kthread"
4503 CXX="$CXX -Kthread"
4508 CC="$CC -pthread"
4510 CXX="$CXX -pthread"
4514 if test ! -z "$withval" -a -d "$withval"
4515 then LDFLAGS="$LDFLAGS -L$withval"
4532 LIBS="$LIBS -lpthread"
4533 AC_MSG_CHECKING([for pthread_create in -lpthread])
4550 LIBS="$LIBS -lpthreads"
4554 LIBS="$LIBS -lc_r"
4558 LIBS="$LIBS -lpthread"
4562 LIBS="$LIBS -lcma"
4571 LIBS="$LIBS -lmpc"
4609 if (pthread_attr_init(&attr)) return (-1);
4610 if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1);
4611 if (pthread_create(&id, &attr, foo, NULL)) return (-1);
4636 # Check for enable-ipv6
4637 AH_TEMPLATE([ENABLE_IPV6], [Define if --enable-ipv6 is specified])
4638 AC_MSG_CHECKING([if --enable-ipv6 is specified])
4641 [--enable-ipv6],
4697 if test "$ipv6" = yes -a "$cross_compiling" = no; then
4698 for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
4713 linux-glibc)
4719 linux-inet6)
4721 if test -d /usr/inet6; then
4725 BASECFLAGS="-I/usr/inet6/include $BASECFLAGS"
4729 if test -f /etc/netconfig; then
4730 if $GREP -q tcp6 /etc/netconfig; then
4747 BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"])
4764 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
4766 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
4767 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
4807 # Check for --with-doc-strings
4808 AC_MSG_CHECKING([for --with-doc-strings])
4810 [doc-strings],
4811 [AS_HELP_STRING([--with-doc-strings], [enable documentation strings (default is yes)])])
4813 if test -z "$with_doc_strings"
4865 # --with-mimalloc
4866 AC_MSG_CHECKING([for --with-mimalloc])
4868 [AS_HELP_STRING([--with-mimalloc],
4876 # mimalloc-atomic.h wants C11 stdatomic.h on POSIX
4877 AC_MSG_ERROR([mimalloc requires stdatomic.h, use --without-mimalloc to disable mimalloc.])
4883 AC_MSG_ERROR([--disable-gil requires mimalloc memory allocator (--with-mimalloc).])
4890 # Check for Python-specific malloc support
4891 AC_MSG_CHECKING([for --with-pymalloc])
4894 [AS_HELP_STRING([--with-pymalloc], [enable specialized mallocs (default is yes)])])
4896 if test -z "$with_pymalloc"
4898 dnl default to yes except for wasm32-emscripten and wasm32-wasi.
4908 [Define if you want to compile in Python-specific mallocs])
4914 AC_MSG_CHECKING([for --with-freelists])
4917 [AS_HELP_STRING([--with-freelists], [enable object freelists (default is yes)])])
4919 if test -z "$with_freelists"
4930 # Check for --with-c-locale-coercion
4931 AC_MSG_CHECKING([for --with-c-locale-coercion])
4933 [c-locale-coercion],
4934 …[AS_HELP_STRING([--with-c-locale-coercion], [enable C locale coercion to a UTF-8 based locale (def…
4936 if test -z "$with_c_locale_coercion"
4943 [Define if you want to coerce the C locale to a UTF-8 based locale])
4948 AC_MSG_CHECKING([for --with-valgrind])
4951 [AS_HELP_STRING([--with-valgrind], [enable Valgrind support (default is no)])],
4960 OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
4964 AC_MSG_CHECKING([for --with-dtrace])
4967 [AS_HELP_STRING([--with-dtrace], [enable DTrace support (default is no)])],
4991 # generation flag '-G'. We check for presence of this flag, rather than
4997 "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
5005 dnl Platform-specific C and header files.
5018 # -I${DLINCLDIR} is added to the compile rule for importdl.o
5030 if test -z "$DYNLOADFILE"
5051 # MACHDEP_OBJS can be set to platform-specific object files needed by Python
5055 if test -z "$MACHDEP_OBJS"
5061 if test -z "$MACHDEP_OBJS"; then
5067 if test "$ac_sys_system" = "Linux-android"; then
5074 …# (https://android.googlesource.com/platform/system/sepolicy/+/refs/heads/android13-release/public…
5080 if test "$ANDROID_API_LEVEL" -lt 23; then
5129 # header definition prevents usage - autoconf doesn't use the headers), or
5161 PY_CHECK_FUNC([_dyld_shared_cache_contains_path], [@%:@include <mach-o/dyld.h>], [HAVE_DYLD_SHARED_…
5206 [AC_CHECK_LIB([bsd], [flock], [FCNTL_LIBS="-lbsd"])])])
5227 dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
5282 PY_CHECK_EMSCRIPTEN_PORT([ZLIB], [-sUSE_ZLIB])
5296 ZLIB_CFLAGS=${ZLIB_CFLAGS-""}
5297 ZLIB_LIBS=${ZLIB_LIBS-"-lz"}
5305 BINASCII_CFLAGS="-DUSE_ZLIB_CRC32 $ZLIB_CFLAGS"
5310 PY_CHECK_EMSCRIPTEN_PORT([BZIP2], [-sUSE_BZIP2])
5320 BZIP2_CFLAGS=${BZIP2_CFLAGS-""}
5321 BZIP2_LIBS=${BZIP2_LIBS-"-lbz2"}
5334 LIBLZMA_CFLAGS=${LIBLZMA_CFLAGS-""}
5335 LIBLZMA_LIBS=${LIBLZMA_LIBS-"-llzma"}
5386 [AC_DEFINE([HAVE_OPENPTY]) LIBS="$LIBS -lutil"],
5388 [AC_DEFINE([HAVE_OPENPTY]) LIBS="$LIBS -lbsd"])])])
5394 [AC_DEFINE([HAVE_FORKPTY]) LIBS="$LIBS -lutil"],
5396 [AC_DEFINE([HAVE_FORKPTY]) LIBS="$LIBS -lbsd"])])])
5422 LIBS="$LIBS -lrt"
5438 if test "$ac_sys_system" != "Linux-android" && test "$ac_sys_system" != "iOS"
5449 if ! { test "$ac_sys_system" = "Linux-android" &&
5450 test "$ANDROID_API_LEVEL" -lt 23; }; then
5527 for (ai = aitop; ai; ai = ai->ai_next) {
5528 if (ai->ai_addr == NULL ||
5529 ai->ai_addrlen == 0 ||
5530 getnameinfo(ai->ai_addr, ai->ai_addrlen,
5535 switch (ai->ai_family) {
5596 if test "$ac_sys_system" = "Linux-android" || test "$ac_sys_system" = "iOS"; then
5599 ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6"
5607 if test "$ac_cv_func_getaddrinfo" = no -o "$ac_cv_buggy_getaddrinfo" = yes
5612 or pass the "--disable-ipv6" option to configure.
5719 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
5741 [Define this if you have the 6-arg version of gethostbyname_r().])
5760 [Define this if you have the 5-arg version of gethostbyname_r().])
5777 [Define this if you have the 3-arg version of gethostbyname_r().])
5803 # check for --with-libm=...
5807 *) LIBM=-lm
5809 AC_MSG_CHECKING([for --with-libm=STRING])
5811 …[AS_HELP_STRING([--with-libm=STRING], [override libm math library to STRING (default is system-dep…
5819 else AC_MSG_ERROR([proper usage is --with-libm=STRING])
5823 # check for --with-libc=...
5825 AC_MSG_CHECKING([for --with-libc=STRING])
5827 …[AS_HELP_STRING([--with-libc=STRING], [override libc C library to STRING (default is system-depend…
5835 else AC_MSG_ERROR([proper usage is --with-libc=STRING])
5861 [Define if C doubles are 64-bit IEEE 754 binary format,
5864 [Define if C doubles are 64-bit IEEE 754 binary format,
5867 [*arm*], [# Some ARM platforms use a mixed-endian representation for
5870 # least make sure that float <-> string conversions work.
5874 [Define if C doubles are 64-bit IEEE 754 binary format,
5875 stored in ARM mixed-endian order (byte order 45670123)])],
5877 [Define if C doubles are 64-bit IEEE 754 binary format,
5881 # correctly-rounded string <-> double conversion functions from
5882 # Python/dtoa.c, which in turn require that the FPU uses 53-bit
5914 # Detect whether system arithmetic is subject to x87-style double
5917 # mode is round-to-nearest and double rounding issues are present, and
5919 AC_CACHE_CHECK([for x87-style double rounding], [ac_cv_x87_double_rounding], [
5928 /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
5929 x = 0.99999999999999989; /* 1-2**-53 */
5933 /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */
5951 [Define if arithmetic is subject to x87-style double rounding issue])
6027 return res==-1 ? 1 : 0;
6046 AC_ARG_ENABLE([big-digits],
6047 AS_HELP_STRING([--enable-big-digits@<:@=15|30@:>@],[use big digits (30 or 15 bits) for Python longs…
6056 AC_MSG_ERROR([bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30]) ;;
6091 return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
6101 if test "$ac_cv_sizeof_wchar_t" -ge 2 \
6102 -a "$ac_cv_wchar_t_signed" = "no"
6115 if test -f /etc/os-release; then
6116 OS_NAME=$(awk -F= '/^NAME=/ {print substr($2,2,length($2)-2)}' /etc/os-release)
6118 # bpo-43667: In Oracle Solaris, the internal form of wchar_t in
6119 # non-Unicode locales is not Unicode and hence cannot be used directly.
6122 [Define if the internal form of wchar_t in non-Unicode locales
6137 # * The Python implementation (always 'cpython-' for us)
6139 # * --disable-gil (adds a 't')
6140 # * --with-pydebug (adds a 'd')
6143 # would get a shared library ABI version tag of 'cpython-32dmu' and shared
6144 # libraries would be named 'foo.cpython-32dmu.so'.
6146 # In Python 3.2 and older, --with-wide-unicode added a 'u' flag.
6147 # In Python 3.7 and older, --with-pymalloc added a 'm' flag.
6152 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${SOABI_PLATFORM:+-$SOABI_PLATFORM}
6160 …ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${SOABI_PLATFORM:+-$SOABI_P…
6173 # Do not rename LIBPYTHON - it's accessed via sysconfig by package build
6182 if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin");…
6197 # Check for --with-platlibdir
6201 AC_MSG_CHECKING([for --with-platlibdir])
6205 [--with-platlibdir=DIRNAME],
6210 # --with-platlibdir
6211 # --with-platlibdir=
6212 # --without-platlibdir
6213 if test -n "$withval" -a "$withval" != yes -a "$withval" != no
6227 LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}${ABI_THREAD}/config-${LDVERSION}"
6229 …LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}${ABI_THREAD}/config-${LDVERSION}-${PLATFORM_TRIP…
6233 # Check for --with-wheel-pkg-dir=PATH
6236 AC_MSG_CHECKING([for --with-wheel-pkg-dir])
6238 [wheel-pkg-dir],
6240 [--with-wheel-pkg-dir=PATH],
6244 if test -n "$withval"; then
6258 return (((-1)>>3 == -1) ? 0 : 1);
6274 FILE *f = fopen("/dev/null", "r");
6286 dnl - libreadline provides "readline/readline.h" header and "libreadline"
6287 dnl shared library. pkg-config file is readline.pc
6288 dnl - libedit provides "editline/readline.h" header and "libedit" shared
6289 dnl library. pkg-config file ins libedit.pc
6290 dnl - editline is not supported ("readline.h" and "libeditline" shared library)
6300 [AS_HELP_STRING([--with(out)-readline@<:@=editline|readline|no@:>@],
6307 [AC_MSG_ERROR([proper usage is --with(out)-readline@<:@=editline|readline|no@:>@])]
6325 READLINE_CFLAGS=${LIBREADLINE_CFLAGS-""}
6326 READLINE_LIBS=${LIBREADLINE_LIBS-"-lreadline"}
6347 READLINE_CFLAGS=${LIBEDIT_CFLAGS-""}
6348 READLINE_LIBS=${LIBEDIT_LIBS-"-ledit"}
6356 READLINE_CFLAGS=$(echo $READLINE_CFLAGS | sed 's/-D_XOPEN_SOURCE=600//g')
6389 AC_CACHE_CHECK([for rl_pre_input_hook in -l$LIBREADLINE], [ac_cv_readline_rl_pre_input_hook], [
6400 …AC_CACHE_CHECK([for rl_completion_display_matches_hook in -l$LIBREADLINE], [ac_cv_readline_rl_comp…
6411 … AC_CACHE_CHECK([for rl_resize_terminal in -l$LIBREADLINE], [ac_cv_readline_rl_resize_terminal], [
6422 …AC_CACHE_CHECK([for rl_completion_matches in -l$LIBREADLINE], [ac_cv_readline_rl_completion_matche…
6437 AC_CACHE_CHECK([for append_history in -l$LIBREADLINE], [ac_cv_readline_append_history], [
6476 if (val1 != -1 && val1 == nice(2))
6537 tm->tm_zone does not exist since it is the alternative way
6544 time_t groundhogday = 1044144000; /* GMT-based */
6549 if (localtime(&groundhogday)->tm_hour != 0)
6560 if (localtime(&groundhogday)->tm_hour != 19)
6567 putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
6569 if (localtime(&groundhogday)->tm_hour != 11)
6577 if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
6579 if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
6664 # also serves as a fallback in case pkg-config failed.
6669 CURSES_LIBS=${CURSES_LIBS-"$ac_cv_search_initscr"}])],
6674 PANEL_LIBS=${PANEL_LIBS-"$ac_cv_search_update_panels"}])],
6702 CURSES_CFLAGS=$(echo $CURSES_CFLAGS | sed 's/-D_XOPEN_SOURCE=600//g')
6706 dnl System-supplied ncurses combines libncurses/libpanel and supports wide
6708 dnl If a locally-supplied version of libncursesw is found, we will use that.
6713 AS_VAR_APPEND([CURSES_CFLAGS], [" -D_XOPEN_SOURCE_EXTENDED=1"])
6717 PANEL_CFLAGS=$(echo $PANEL_CFLAGS | sed 's/-D_XOPEN_SOURCE=600//g')
6740 w->_flags = 0;
6794 dnl Some cross-compile builds are predictable; they won't ever
6795 dnl have /dev/ptmx or /dev/ptc, so we can set them explicitly.
6796 if test "$ac_sys_system" = "Linux-android" || test "$ac_sys_system" = "iOS"; then
6802 AC_MSG_CHECKING([for /dev/ptmx])
6807 AC_MSG_CHECKING([for /dev/ptc])
6813 AC_CHECK_FILE([/dev/ptmx], [], [])
6816 [Define to 1 if you have the /dev/ptmx device file.])
6818 AC_CHECK_FILE([/dev/ptc], [], [])
6821 [Define to 1 if you have the /dev/ptc device file.])
6827 LIBS="$LIBS -framework CoreFoundation"
6847 size_t len = -1;
6863 # Check for --with-computed-gotos
6864 AC_MSG_CHECKING([for --with-computed-gotos])
6866 [computed-gotos],
6868 [--with-computed-gotos],
6903 ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos"
6955 if test ! -d $dir; then
6961 # Availability of -O2:
6962 AC_CACHE_CHECK([for -O2], [ac_cv_compile_o2], [
6964 CFLAGS="-O2"
6970 # http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
6973 CFLAGS="-O2 -D_FORTIFY_SOURCE=2"
7007 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
7010 AC_MSG_CHECKING([for gcc ipa-pure-const bug])
7012 CFLAGS="-O2"
7037 [Define if gcc has the ipa-pure-const bug.])
7046 [AS_HELP_STRING([--with-ensurepip@<:@=install|upgrade|no@:>@],
7061 [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])])
7140 POSIXSHMEM_CFLAGS='-I$(srcdir)/Modules/_multiprocessing'
7143 AS_VAR_IF([ac_cv_search_shm_open], [-lrt], [POSIXSHMEM_LIBS="-lrt"])
7164 rpath_arg="-Wl,--enable-new-dtags,-rpath="
7168 rpath_arg="-Wl,-rpath,"
7170 rpath_arg="-Wl,-rpath="
7174 AC_MSG_CHECKING([for --with-openssl-rpath])
7175 AC_ARG_WITH([openssl-rpath],
7176 AS_HELP_STRING([--with-openssl-rpath=@<:@DIR|auto|no@:>@],
7179 auto: auto-detect rpath from --with-openssl and pkg-config,
7191 … [-L*], [OPENSSL_LDFLAGS_RPATH="$OPENSSL_LDFLAGS_RPATH ${rpath_arg}$(echo $arg | cut -c3-)"]
7197 [test -d "$with_openssl_rpath"],
7202 AC_MSG_ERROR([--with-openssl-rpath "$with_openssl_rpath" is not a directory]))
7208 # Requires static OpenSSL build with position-independent code. Some features
7216 [-l*], [
7217 libname=$(echo $arg | cut -c3-)
7218 new_OPENSSL_LIBS="$new_OPENSSL_LIBS -l:lib${libname}.a -Wl,--exclude-libs,lib${libname}.a"
7228 dnl AX_CHECK_OPENSSL does not export libcrypto-only libs
7232 [-l*ssl*|-Wl*ssl*], [],
7293 AC_MSG_CHECKING([for --with-ssl-default-suites])
7295 [ssl-default-suites],
7297 [--with-ssl-default-suites=@<:@python|openssl|STRING@:>@],
7326 AC_MSG_CHECKING([for --with-builtin-hashlib-hashes])
7328 [builtin-hashlib-hashes],
7330 [--with-builtin-hashlib-hashes=md5,sha1,sha2,sha3,blake2],
7369 AC_MSG_CHECKING([for --disable-test-modules])
7370 AC_ARG_ENABLE([test-modules],
7371 [AS_HELP_STRING([--disable-test-modules], [don't build nor install test modules])], [
7382 # gh-109054: Check if -latomic is needed to get <pyatomic.h> atomic functions.
7388 # gh-112779: On RISC-V, GCC 12 and earlier require libatomic support for 1-byte
7389 # and 2-byte operations, but not for 8-byte operations.
7397 CPPFLAGS="${BASECPPFLAGS} -I. -I${srcdir}/Include ${CPPFLAGS}"
7443 [LIBS="${LIBS} -latomic"
7444 LIBATOMIC=${LIBATOMIC-"-latomic"}])
7547 [MODULE_BUILDTYPE=${MODULE_BUILDTYPE:-shared}]
7557 dnl PY_STDLIB_MOD([NAME], [ENABLED-TEST], [SUPPORTED-TEST], [CFLAGS], [LDFLAGS])
7558 dnl sets MODULE_$NAME_STATE based on PY_STDLIB_MOD_SET_NA(), ENABLED-TEST,
7559 dnl and SUPPORTED_TEST. ENABLED-TEST and SUPPORTED-TEST default to true if
7607 PY_STDLIB_MOD_SIMPLE([_io], [-I\$(srcdir)/Modules/_io], [])
7635 [-I\$(srcdir)/Modules/_multiprocessing])
7650 [], [test "$ac_cv_header_sys_ioctl_h" = "yes" -a "$ac_cv_header_fcntl_h" = "yes"],
7653 [], [test "$ac_cv_header_sys_mman_h" = "yes" -a "$ac_cv_header_sys_stat_h" = "yes"])
7656 -a "$ac_cv_header_sys_types_h" = "yes"
7657 -a "$ac_cv_header_netinet_in_h" = "yes"]))
7663 PY_STDLIB_MOD([pwd], [], [test "$ac_cv_func_getpwuid" = yes -o "$ac_cv_func_getpwuid_r" = yes])
7667 [], [-framework SystemConfiguration -framework CoreFoundation])
7689 …[-I\$(srcdir)/Modules/_hacl/include -I\$(srcdir)/Modules/_hacl/internal -D_BSD_SOURCE -D_DEFAULT_S…
7692 …[-I\$(srcdir)/Modules/_hacl/include -I\$(srcdir)/Modules/_hacl/internal -D_BSD_SOURCE -D_DEFAULT_S…
7695 …[-I\$(srcdir)/Modules/_hacl/include -I\$(srcdir)/Modules/_hacl/internal -D_BSD_SOURCE -D_DEFAULT_S…
7716 [test -n "$with_dbmliborder"], [test "$have_dbm" != "no"],
7754 dnl Modules/_testcapi needs -latomic for 32bit AIX build
7768 [test "$TEST_MODULES" = yes], [test "$have_libffi" = yes -a "$ac_cv_func_dlopen" = yes],
7783 Misc/python-embed.pc
7784 Misc/python-config.sh
7795 if test ! -f Modules/Setup.local
7801 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
7802 -s Modules \
7804 if test $? -ne 0; then
7810 if test -z "$PKG_CONFIG"; then
7811 AC_MSG_WARN([pkg-config is missing. Some dependencies may not be detected correctly.])
7814 if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
7818 please run ./configure --enable-optimizations
7825 CPython core team, see https://peps.python.org/pep-0011/ for more information.