Lines Matching +full:i686 +full:- +full:linux +full:- +full:gnu +full:- +full:pkg +full:- +full:config
2 dnl * Please run autoreconf -if to test your changes! *
5 dnl Python's configure.ac file requires autoconf 2.69 and autoconf-archive.
18 [AC_MSG_ERROR([Please install autoconf-archive package and re-run autoreconf])]
23 [AC_MSG_ERROR([Please install pkgconf's m4 macro package and re-run autoreconf])]
27 dnl - _SAVE_VAR([VAR]) Helper for SAVE_ENV; stores VAR as save_VAR
28 dnl - _RESTORE_VAR([VAR]) Helper for RESTORE_ENV; restores VAR from save_VAR
29 dnl - SAVE_ENV Saves CFLAGS, LDFLAGS, LIBS, and CPPFLAGS
30 dnl - RESTORE_ENV Restores CFLAGS, LDFLAGS, LIBS, and CPPFLAGS
31 dnl - WITH_SAVE_ENV([SCRIPT]) Runs SCRIPT wrapped with SAVE_ENV/RESTORE_ENV
52 dnl PY_CHECK_FUNC(FUNCTION, [INCLUDES], [AC_DEFINE-VAR])
72 dnl PY_CHECK_LIB(LIBRARY, FUNCTION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES])
86 AS_IF([test "$ac_sys_system" = "Emscripten" -a -z "$py_cflags" -a -z "$py_libs"], [
95 if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then
96 # If we're building out-of-tree, we need to make sure the following
98 # Objects/ -> typeslots.inc
99 # Include/ -> Python.h
100 # Python/ -> importlib.h
102 # regenerated when building out-of-tree, regardless of whether or not
103 # the $srcdir counterpart is up-to-date. This is an acceptable trade
105 BASECPPFLAGS="-IObjects -IInclude -IPython"
114 if test -e $srcdir/.git
116 AC_CHECK_PROG(HAS_GIT, git, found, not-found)
118 HAS_GIT=no-repository
122 GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
123 GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
124 GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
139 [AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])]
142 # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
143 rm -f pybuilddir.txt
146 [build-python],
147 [AS_HELP_STRING([--with-build-python=python]PYTHON_VERSION,
150 AC_MSG_CHECKING([for --with-build-python])
153 …AS_VAR_IF([with_build_python], [no], [AC_MSG_ERROR([invalid --with-build-python option: expected p…
155 if ! $(command -v "$with_build_python" >/dev/null 2>&1); then
158 …build_python_ver=$($with_build_python -c "import sys; print(f'{sys.version_info.major}.{sys.versio…
165 …dir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && e…
169 [AC_MSG_ERROR([Cross compiling requires --with-build-python])]
171 PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
211 if command -v "$PYTHON_FOR_REGEN" >/dev/null 2>&1; then
212 AC_MSG_RESULT([$($PYTHON_FOR_REGEN -V 2>/dev/null)])
223 prefix=`echo "$prefix" | sed -e 's/\/$//g'`
242 # with other autoconf-based packages that include Python.h
243 grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new
255 # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
260 # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
265 # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
276 dnl Allow users to disable pkg-config or require pkg-config
278 [pkg-config], optwith
279 [AS_HELP_STRING([[--with-pkg-config=[yes|no|check]]],
280 [use pkg-config to detect build options (default is check)])],
286 if test -z "$PKG_CONFIG"; then
287 dnl invalidate stale config.cache values
296 dnl force AX_CHECK_OPENSSL to ignore pkg-config
300 [AC_MSG_ERROR([invalid argument --with-pkg-config=$with_pkg_config])]
302 if test "$with_pkg_config" = yes -a -z "$PKG_CONFIG"; then
303 AC_MSG_ERROR([pkg-config is required])]
306 AC_MSG_CHECKING([for --enable-universalsdk])
308 AS_HELP_STRING([--enable-universalsdk@<:@=SDKDIR@:>@],
317 enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`"
318 if ! ( echo $enableval | grep -E '\.sdk' 1>/dev/null )
321 if test ! -d "${enableval}"
335 if test ! -d "${UNIVERSALSDK}"
337 AC_MSG_ERROR([--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}])
346 if test -n "${UNIVERSALSDK}"
357 # For backward compatibility reasons we prefer to select '32-bit' if available,
359 UNIVERSAL_ARCHS="32-bit"
360 if test "`uname -s`" = "Darwin"
362 if test -n "${UNIVERSALSDK}"
364 if test -z "`/usr/bin/file -L "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
373 AC_MSG_CHECKING(for --with-universal-archs)
374 AC_ARG_WITH(universal-archs,
375 AS_HELP_STRING([--with-universal-archs=ARCH],
377 This option is only valid when --enable-universalsdk is set; options are:
378 ("universal2", "intel-64", "intel-32", "intel", "32-bit",
379 "64-bit", "3-way", or "all")
385 if test -n "${UNIVERSALSDK}"
392 AC_ARG_WITH(framework-name,
393 AS_HELP_STRING([--with-framework-name=FRAMEWORK],
395 only valid when --enable-framework is set. see Mac/README.rst
400 PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr '[A-Z]' '[a-z]'`
408 AS_HELP_STRING([--enable-framework@<:@=INSTALLDIR@:>@],
420 PYTHONFRAMEWORKDIR=no-framework
472 # --prefix option, but wants to install
473 # the framework in a non-default location,
497 PYTHONFRAMEWORKDIR=no-framework
528 # Set name for machine-dependent library files
529 AC_ARG_VAR([MACHDEP], [name for machine-dependent library files])
531 if test -z "$MACHDEP"
539 *-*-linux-android*)
540 ac_sys_system=Linux-android
542 *-*-linux*)
543 ac_sys_system=Linux
545 *-*-cygwin*)
548 *-*-vxworks*)
551 *-*-emscripten)
554 *-*-wasi)
564 ac_sys_system=`uname -s`
566 -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
567 ac_sys_release=`uname -v`
569 ac_sys_release=`uname -r`
573 tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
575 tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
580 linux*) MACHDEP="linux";;
591 *-*-linux*)
600 *-*-cygwin*)
603 *-*-vxworks*)
606 wasm32-*-* | wasm64-*-*)
614 _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
637 # As this has a different meaning on Linux, only define it on OpenBSD
643 # As this has a different meaning on Linux, only define it on OpenBSD
649 NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
661 OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
676 Darwin/@<:@[12]@:>@@<:@0-9@:>@.*)
689 # On HP-UX, defining _XOPEN_SOURCE to 600 or greater hides
699 # X/Open 7, incorporating POSIX.1-2008
706 # cases for HP-UX, we define it globally.
708 Define to activate Unix95-and-earlier features)
710 AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008)
713 # On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE
726 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
743 if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
745 AC_MSG_ERROR([cached CC is different -- throw away $cache_file
749 # Don't let AC_PROG_CC set the default CFLAGS. It normally sets -g -O2
750 # when the compiler supports them, but we don't always want -O2, and
751 # we set -g later.
752 if test -z "$CFLAGS"; then
757 dnl On Emscripten use MEMORY64 setting to build target wasm64-emscripten.
760 [wasm64-*-emscripten], [
761 AS_VAR_APPEND([CFLAGS], [" -sMEMORY64=1"])
762 AS_VAR_APPEND([LDFLAGS], [" -sMEMORY64=1"])
771 if test -z "${CC}"
779 if test -x "${as_dir}/gcc"; then
780 if test -z "${found_gcc}"; then
784 if test -x "${as_dir}/clang"; then
785 if test -z "${found_clang}"; then
792 if test -n "$found_gcc" -a -n "$found_clang"
794 if test -n "`"$found_gcc" --version | grep llvm-gcc`"
796 AC_MSG_NOTICE([Detected llvm-gcc, falling back to clang])
802 elif test -z "$found_gcc" -a -n "$found_clang"
808 elif test -z "$found_gcc" -a -z "$found_clang"
810 found_clang=`/usr/bin/xcrun -find clang 2>/dev/null`
811 if test -n "${found_clang}"
815 CXX="`/usr/bin/xcrun -find clang++`"
850 ac_cv_cc_name=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
854 rm -f conftest.c conftest.out
864 AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
866 AS_HELP_STRING([--with-cxx-main@<:@=COMPILER@:>@],
877 if test -z "$CXX"
888 if test -z "$CXX"
901 if test -z "$CXX"
924 #undef linux
936 x86_64-linux-gnu
938 x86_64-linux-gnux32
940 i386-linux-gnu
943 aarch64_ilp32-linux-gnu
945 aarch64-linux-gnu
949 aarch64_be_ilp32-linux-gnu
951 aarch64_be-linux-gnu
954 alpha-linux-gnu
957 arm-linux-gnueabihf
959 armeb-linux-gnueabihf
963 arm-linux-gnueabi
965 armeb-linux-gnueabi
968 hppa-linux-gnu
970 ia64-linux-gnu
972 m68k-linux-gnu
975 mipsisa32r6el-linux-gnu
977 mipsisa64r6el-linux-gnuabin32
979 mipsisa64r6el-linux-gnuabi64
985 mipsisa32r6-linux-gnu
987 mipsisa64r6-linux-gnuabin32
989 mipsisa64r6-linux-gnuabi64
995 mipsel-linux-gnu
997 mips64el-linux-gnuabin32
999 mips64el-linux-gnuabi64
1005 mips-linux-gnu
1007 mips64-linux-gnuabin32
1009 mips64-linux-gnuabi64
1014 or1k-linux-gnu
1016 powerpc-linux-gnuspe
1019 powerpc64le-linux-gnu
1021 powerpc64-linux-gnu
1024 powerpc-linux-gnu
1026 s390x-linux-gnu
1028 s390-linux-gnu
1030 sh4-linux-gnu
1032 sparc64-linux-gnu
1034 sparc-linux-gnu
1037 riscv32-linux-gnu
1039 riscv64-linux-gnu
1048 x86_64-kfreebsd-gnu
1050 i386-kfreebsd-gnu
1055 i386-gnu
1062 wasm32-emscripten
1064 wasm32-wasi
1070 wasm64-emscripten
1072 wasm64-wasi
1083 PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
1085 linux-musl*)
1086 PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'`
1093 rm -f conftest.c conftest.out
1099 [MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
1114 MULTIARCH_CPPFLAGS="-DMULTIARCH=\\\"$MULTIARCH\\\""
1118 dnl Support tiers according to https://peps.python.org/pep-0011/
1124 [x86_64-*-linux-gnu/gcc], [PY_SUPPORT_TIER=1], dnl Linux on AMD64, any vendor, glibc, gcc
1125 [x86_64-apple-darwin*/clang], [PY_SUPPORT_TIER=1], dnl macOS on Intel, any version
1126 [i686-pc-windows-msvc/msvc], [PY_SUPPORT_TIER=1], dnl 32bit Windows on Intel, MSVC
1127 [x86_64-pc-windows-msvc/msvc], [PY_SUPPORT_TIER=1], dnl 64bit Windows on AMD64, MSVC
1129 [aarch64-apple-darwin*/clang], [PY_SUPPORT_TIER=2], dnl macOS on M1, any version
1130 [aarch64-*-linux-gnu/gcc], [PY_SUPPORT_TIER=2], dnl Linux ARM64, glibc, gcc+clang
1131 [aarch64-*-linux-gnu/clang], [PY_SUPPORT_TIER=2],
1132 …[powerpc64le-*-linux-gnu/gcc], [PY_SUPPORT_TIER=2], dnl Linux on PPC64 little endian, glibc, g…
1133 …[x86_64-*-linux-gnu/clang], [PY_SUPPORT_TIER=2], dnl Linux on AMD64, any vendor, glibc, cla…
1135 [aarch64-pc-windows-msvc/msvc], [PY_SUPPORT_TIER=3], dnl Windows ARM64, MSVC
1136 …[armv7l-*-linux-gnueabihf/gcc], [PY_SUPPORT_TIER=3], dnl ARMv7 LE with hardware floats, any ven…
1137 …[powerpc64le-*-linux-gnu/clang], [PY_SUPPORT_TIER=3], dnl Linux on PPC64 little endian, glibc, c…
1138 …[s390x-*-linux-gnu/gcc], [PY_SUPPORT_TIER=3], dnl Linux on 64bit s390x (big endian), gli…
1139 [wasm32-unknown-emscripten/clang], [PY_SUPPORT_TIER=3], dnl WebAssembly Emscripten
1140 [wasm32-unknown-wasi/clang], [PY_SUPPORT_TIER=3], dnl WebAssembly System Interface
1141 [x86_64-*-freebsd*/clang], [PY_SUPPORT_TIER=3], dnl FreeBSD on AMD64
1154 AC_CACHE_CHECK([for -Wl,--no-as-needed], [ac_cv_wl_no_as_needed], [
1156 AS_VAR_APPEND([LDFLAGS], [-Wl,--no-as-needed])
1158 [NO_AS_NEEDED="-Wl,--no-as-needed"
1177 ANDROID_API_LEVEL=`sed -n -e '/__ANDROID_API__/d' -e 's/^android_api = //p' conftest.out`
1178 _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out`
1180 if test -z "$ANDROID_API_LEVEL"; then
1188 BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16"
1189 LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8"
1194 rm -f conftest.c conftest.out
1198 [atheos*|Linux*/1*], [
1206 AC_MSG_CHECKING([for --with-emscripten-target])
1207 AC_ARG_WITH([emscripten-target],
1208 [AS_HELP_STRING([--with-emscripten-target=@<:@browser|node@:>@], [Emscripten platform])],
1218 [browser-debug], [ac_sys_emscripten_target=browser-debug],
1219 [node-debug], [ac_sys_emscripten_target=node-debug],
1220 [AC_MSG_ERROR([Invalid argument: --with-emscripten-target=browser|node])]
1223 AC_MSG_ERROR([--with-emscripten-target only applies to Emscripten])
1230 dnl On Emscripten dlopen() requires -s MAIN_MODULE and -fPIC. The flags
1233 dnl See https://emscripten.org/docs/compiling/Dynamic-Linking.html
1234 AC_MSG_CHECKING([for --enable-wasm-dynamic-linking])
1235 AC_ARG_ENABLE([wasm-dynamic-linking],
1236 [AS_HELP_STRING([--enable-wasm-dynamic-linking],
1242 [AC_MSG_ERROR([--enable-wasm-dynamic-linking only applies to Emscripten and WASI])]
1249 AC_MSG_CHECKING([for --enable-wasm-pthreads])
1250 AC_ARG_ENABLE([wasm-pthreads],
1251 [AS_HELP_STRING([--enable-wasm-pthreads],
1257 [AC_MSG_ERROR([--enable-wasm-pthreads only applies to Emscripten and WASI])]
1264 AC_MSG_CHECKING([for --with-suffix])
1266 …[AS_HELP_STRING([--with-suffix=SUFFIX], [set executable suffix to SUFFIX (default is empty, yes is…
1283 # Test whether we're running on a non-case-sensitive system, in which
1286 AC_MSG_CHECKING(for case-insensitive build directory)
1287 if test ! -d CaseSensitiveTestDir; then
1291 if test -d casesensitivetestdir && test -z "$EXEEXT"
1304 cc|*/cc) CC="$CC -Ae";;
1310 if test -z "$LIBRARY"
1328 # on the system - some systems like version suffix, others don't
1348 # LINKCC is the command that links the python executable -- default is $(CC).
1354 if test -z "$LINKCC"
1360 # support -N.
1381 # GNULD is set to "yes" if the GNU linker is used. If this goes wrong
1383 # distutils.unixccompiler to know if it should add --enable-new-dtags
1384 # to linker command lines, and failing to detect GNU ld simply results
1387 AC_MSG_CHECKING(for GNU ld)
1390 ac_prog=`$CC -print-prog-name=ld`
1392 case `"$ac_prog" -V 2>&1 < /dev/null` in
1393 *GNU*)
1400 AC_MSG_CHECKING(for --enable-shared)
1402 … AS_HELP_STRING([--enable-shared], [enable building a shared Python library (default is no)]))
1404 if test -z "$enable_shared"
1415 # --with-static-libpython
1417 AC_MSG_CHECKING(for --with-static-libpython)
1418 AC_ARG_WITH(static-libpython,
1419 AS_HELP_STRING([--without-static-libpython],
1432 AC_MSG_CHECKING(for --enable-profiling)
1434 … AS_HELP_STRING([--enable-profiling], [enable C-level code profiling with gprof (default is no)]))
1437 CC="$CC -pg"
1448 BASECFLAGS="-pg $BASECFLAGS"
1449 LDFLAGS="-pg $LDFLAGS"
1456 # will find it with a -framework option). For this reason there is an
1480 BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
1488 Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*)
1490 BLDLIBRARY='-L. -lpython$(LDVERSION)'
1499 case `uname -m` in
1507 BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
1512 BLDLIBRARY='-L. -lpython$(LDVERSION)'
1536 if test -z "$HOSTRUNNER"
1544 AC_CACHE_CHECK([for node --experimental-wasm-bigint], [ac_cv_tool_node_wasm_bigint], [
1545 if $NODE -v --experimental-wasm-bigint > /dev/null 2>&1; then
1552 AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-bigint"])
1556 AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-threads"])
1558 … AC_CACHE_CHECK([for node --experimental-wasm-bulk-memory], [ac_cv_tool_node_wasm_bulk_memory], [
1559 if $NODE -v --experimental-wasm-bulk-memory > /dev/null 2>&1; then
1566 AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-bulk-memory"])
1570 … AS_VAR_IF([host_cpu], [wasm64], [AS_VAR_APPEND([HOSTRUNNER], [" --experimental-wasm-memory64"])])
1575 …mtime run --env PYTHONPATH=/$(shell realpath --relative-to $(abs_srcdir) $(abs_builddir))/$(shell …
1583 if test -n "$HOSTRUNNER"; then
1623 if test -z "$ARFLAGS"
1641 # install -d does not work on HP-UX
1642 if test -z "$INSTALL"
1644 INSTALL="${srcdir}/install-sh -c"
1652 if test -z "$LN" ; then
1654 CYGWIN*) LN="ln -s";;
1663 # Check for --with-pydebug
1664 AC_MSG_CHECKING(for --with-pydebug)
1666 AS_HELP_STRING([--with-pydebug], [build with Py_DEBUG defined (default is no)]),
1671 [Define if you want to build an interpreter with many run-time checks.])
1679 # Check for --with-trace-refs
1680 # --with-trace-refs
1681 AC_MSG_CHECKING(for --with-trace-refs)
1682 AC_ARG_WITH(trace-refs,
1684 [--with-trace-refs],
1695 # Check for --enable-pystats
1696 AC_MSG_CHECKING([for --enable-pystats])
1699 [--enable-pystats],
1709 # Check for --with-assertions.
1712 AC_MSG_CHECKING(for --with-assertions)
1714 AS_HELP_STRING([--with-assertions],[build with C assertions enabled (default is no)]),
1725 AC_MSG_RESULT(implied by --with-pydebug)
1734 AC_MSG_CHECKING(for --enable-optimizations)
1736 [--enable-optimizations],
1753 # who want LTO need to use --with-lto themselves.
1754 DEF_MAKE_ALL_RULE="profile-opt"
1759 AX_CHECK_COMPILE_FLAG([-fno-semantic-interposition],[
1760 CFLAGS_NODIST="$CFLAGS_NODIST -fno-semantic-interposition"
1761 LDFLAGS_NODIST="$LDFLAGS_NODIST -fno-semantic-interposition"
1765 elif test "$ac_sys_system" = "Emscripten" -o "$ac_sys_system" = "WASI"; then
1779 if test -z "$PROFILE_TASK"
1781 PROFILE_TASK='-m test --pgo --timeout=$(TESTTIMEOUT)'
1785 # Make llvm-related checks work on systems where llvm tools are not installed with their
1787 # non-suffixed name in their versioned llvm directory.
1796 if test -L "${clang_bin}"
1806 AC_MSG_CHECKING(for --with-lto)
1807 AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto=@<:@full|thin|no|yes@:>@], [enable Link-Time-Optimizati…
1839 LDFLAGS_NOLTO="-fno-lto"
1840 dnl Clang linker requires -flto in order to link objects with LTO information.
1842 AX_CHECK_COMPILE_FLAG([-flto=thin],[LDFLAGS_NOLTO="-flto=thin"],[LDFLAGS_NOLTO="-flto"])
1844 AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
1846 if test -n "${LLVM_AR}" -a -x "${LLVM_AR}"
1850 LLVM_AR_FOUND="not-found"
1852 if test "$ac_sys_system" = "Darwin" -a "${LLVM_AR_FOUND}" = "not-found"
1854 # The Apple-supplied ar in Xcode or the Command Line Tools is apparently sufficient
1855 found_llvm_ar=`/usr/bin/xcrun -find ar 2>/dev/null`
1856 if test -n "${found_llvm_ar}"
1860 AC_MSG_NOTICE([llvm-ar found via xcrun: ${LLVM_AR}])
1863 if test $LLVM_AR_FOUND = not-found
1866 … AC_MSG_ERROR([llvm-ar is required for a --with-lto build with clang but could not be found.])
1876 LTOFLAGS="-flto -Wl,-export_dynamic"
1877 LTOCFLAGS="-flto"
1879 LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic"
1880 LTOCFLAGS="-flto=${Py_LTO_POLICY}"
1886 LTOFLAGS="-flto"
1888 LTOFLAGS="-flto=${Py_LTO_POLICY}"
1897 LTOFLAGS="-flto"
1898 LTOCFLAGS="-flto"
1906 LDFLAGS_NOLTO="-fno-lto"
1909 LTOFLAGS="-flto -Wl,-export_dynamic"
1910 LTOCFLAGS="-flto"
1913 LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"
1921 # bpo-30345: Add -g to LDFLAGS when compiling with LTO
1923 LTOFLAGS="$LTOFLAGS -g"
1926 CFLAGS_NODIST="$CFLAGS_NODIST ${LTOCFLAGS-$LTOFLAGS}"
1937 AC_PATH_TOOL(LLVM_PROFDATA, llvm-profdata, '', ${llvm_path})
1939 if test -n "${LLVM_PROFDATA}" -a -x "${LLVM_PROFDATA}"
1943 LLVM_PROF_FOUND="not-found"
1945 if test "$ac_sys_system" = "Darwin" -a "${LLVM_PROF_FOUND}" = "not-found"
1947 found_llvm_profdata=`/usr/bin/xcrun -find llvm-profdata 2>/dev/null`
1948 if test -n "${found_llvm_profdata}"
1950 # llvm-profdata isn't directly in $PATH in some cases.
1952 LLVM_PROFDATA='/usr/bin/xcrun llvm-profdata'
1954 AC_MSG_NOTICE([llvm-profdata found via xcrun: ${LLVM_PROFDATA}])
1961 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
1962 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
1963 LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr"
1964 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\""
1965 if test $LLVM_PROF_FOUND = not-found
1970 …AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations build but could not be found.…
1977 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
1978 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
1979 LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr"
1980 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\""
1981 if test "${LLVM_PROF_FOUND}" = "not-found"
1986 …AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations build but could not be found.…
1991 PGO_PROF_GEN_FLAG="-fprofile-generate"
1992 PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction"
1999 PGO_PROF_GEN_FLAG="-prof-gen"
2000 PGO_PROF_USE_FLAG="-prof-use"
2010 # ------------------------
2011 # (The following bit of code is complicated enough - please keep things
2012 # indented properly. Just pretend you're editing Python code. ;-)
2024 if $CC --version 2>&1 | grep -q clang
2032 # Check if CC supports -Og optimization level
2034 CFLAGS="-Og"
2035 AC_CACHE_CHECK([if $CC supports -Og optimization level],
2050 PYDEBUG_CFLAGS="-O0"
2052 [PYDEBUG_CFLAGS="-Og"])
2058 if test "${OPT-unset}" = "unset"
2062 # For gcc 4.x we need to use -fwrapv so lets check if its supported
2063 if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
2064 WRAP="-fwrapv"
2067 if test -n "${cc_is_clang}"
2069 # Clang also needs -fwrapv
2070 WRAP="-fwrapv"
2071 # bpo-30104: disable strict aliasing to compile correctly dtoa.c,
2073 CFLAGS_ALIASING="-fno-strict-aliasing"
2079 OPT="-g $PYDEBUG_CFLAGS -Wall"
2081 OPT="-g $WRAP -O3 -Wall"
2085 OPT="-O3 -Wall"
2090 SCO_SV*) OPT="$OPT -m486 -DSCO5"
2096 OPT="-O"
2105 dnl node-debug or browser-debug.
2109 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sALLOW_MEMORY_GROWTH -sTOTAL_MEMORY=20971520"])
2112 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sWASM_BIGINT"])
2115 …AS_VAR_APPEND([LDFLAGS_NODIST], [" -sFORCE_FILESYSTEM -lidbfs.js -lnodefs.js -lproxyfs.js -lworker…
2118 AS_VAR_APPEND([LINKFORSHARED], [" -sMAIN_MODULE"])
2122 AS_VAR_APPEND([CFLAGS_NODIST], [" -pthread"])
2123 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sUSE_PTHREADS"])
2124 AS_VAR_APPEND([LINKFORSHARED], [" -sPROXY_TO_PTHREAD"])
2129 AS_VAR_IF([ac_sys_emscripten_target], [browser-debug], [wasm_debug=yes])
2130 AS_VAR_APPEND([LINKFORSHARED], [" --preload-file=\$(WASM_ASSETS_DIR)"])
2133 dnl separate-dwarf does not seem to work in Chrome DevTools Support.
2134 WASM_LINKFORSHARED_DEBUG="-gsource-map --emit-symbol-map"
2137 AS_VAR_IF([ac_sys_emscripten_target], [node-debug], [wasm_debug=yes])
2138 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sALLOW_MEMORY_GROWTH -sNODERAWFS"])
2139 AS_VAR_APPEND([LINKFORSHARED], [" -sEXIT_RUNTIME"])
2140 WASM_LINKFORSHARED_DEBUG="-gseparate-dwarf --emit-symbol-map"
2145 AS_VAR_APPEND([LDFLAGS_NODIST], [" -sASSERTIONS"])
2148 AS_VAR_APPEND([LINKFORSHARED], [" -O2 -g0"])
2155 LIBS="$LIBS -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks"
2159 dnl https://github.com/WebAssembly/wasi-libc/issues/233
2160 …AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=524288 -Wl,--stack-first -Wl,--initial-memory=104…
2177 # The -arch flags for universal builds on macOS
2186 AS_VAR_APPEND([CFLAGS], ["-W$2 -Werror"])
2198 CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
2200 PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra])
2202 [CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"])
2206 # -fno-strict-aliasing on versions of GCC that support but produce
2209 CC="$CC -fno-strict-aliasing"
2211 AC_CACHE_CHECK([whether $CC accepts and needs -fno-strict-aliasing],
2217 CC="$ac_save_cc -fstrict-aliasing"
2218 CFLAGS="$CFLAGS -Werror -Wstrict-aliasing"
2234 [BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"])
2240 [PY_CHECK_CC_WARNING([disable], [unused-result])])
2242 [BASECFLAGS="$BASECFLAGS -Wno-unused-result"
2243 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-result"])
2245 PY_CHECK_CC_WARNING([disable], [unused-parameter])
2247 [CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter"])
2249 PY_CHECK_CC_WARNING([disable], [missing-field-initializers])
2251 [CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers"])
2253 PY_CHECK_CC_WARNING([enable], [sign-compare])
2255 [BASECFLAGS="$BASECFLAGS -Wsign-compare"])
2257 PY_CHECK_CC_WARNING([enable], [unreachable-code])
2259 # results in non-standard code paths.
2267 test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`"
2269 BASECFLAGS="$BASECFLAGS -Wunreachable-code"
2274 PY_CHECK_CC_WARNING([enable], [strict-prototypes])
2276 [CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes"])
2279 CC="$CC -Werror=implicit-function-declaration"
2293 [CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"])
2296 CC="$CC -fvisibility=hidden"
2309 [CFLAGS_NODIST="$CFLAGS_NODIST -fvisibility=hidden"])
2311 # if using gcc on alpha, use -mieee to get (near) full IEEE 754
2316 BASECFLAGS="$BASECFLAGS -mieee"
2322 BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
2326 # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
2327 # used to be here, but non-Apple gcc doesn't accept them.
2336 CC=gcc-4.0
2337 CPP=cpp-4.0
2347 32-bit)
2348 UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
2352 64-bit)
2353 UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
2358 UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
2359 LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
2360 ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
2363 UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
2365 LIPO_INTEL64_FLAGS="-extract x86_64"
2369 UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
2370 LIPO_32BIT_FLAGS="-extract i386"
2371 ARCH_RUN_32BIT="/usr/bin/arch -i386"
2373 intel-32)
2374 UNIVERSAL_ARCH_FLAGS="-arch i386"
2378 intel-64)
2379 UNIVERSAL_ARCH_FLAGS="-arch x86_64"
2383 3-way)
2384 UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
2385 LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
2386 ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
2389 … AC_MSG_ERROR([proper usage is --with-universal-arch=universal2|32-bit|64-bit|all|intel|3-way])
2395 CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
2396 LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
2397 CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
2418 cur_target_major=`sw_vers -productVersion | \
2419 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
2420 cur_target_minor=`sw_vers -productVersion | \
2421 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
2423 if test ${cur_target_major} -eq 10 && \
2424 test ${cur_target_minor} -ge 3 && \
2425 test ${cur_target_minor} -le 5
2432 all|3-way|intel|64-bit)
2445 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
2460 AC_MSG_ERROR(check config.log and use the '--with-universal-archs' option)
2471 BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
2474 BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
2482 # ICC needs -fp-model strict or floats behave badly
2483 CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
2486 CFLAGS_NODIST="$CFLAGS_NODIST -qalias=noansi -qmaxmem=-1"
2493 OPT="-DNDEBUG $OPT"
2505 # options before we can check whether -Kpthread improves anything.
2533 # -Kpthread, if available, provides the right #defines
2535 # Some compilers won't report that they do not support -Kpthread,
2538 AC_CACHE_CHECK([whether $CC accepts -Kpthread], [ac_cv_kpthread],
2540 CC="$CC -Kpthread"
2558 if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
2560 # -Kthread, if available, provides the right #defines
2562 # Some compilers won't report that they do not support -Kthread,
2565 AC_CACHE_CHECK([whether $CC accepts -Kthread], [ac_cv_kthread],
2567 CC="$CC -Kthread"
2585 if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
2587 # -pthread, if available, provides the right #defines
2589 # Some compilers won't report that they do not support -pthread,
2592 AC_CACHE_CHECK([whether $CC accepts -pthread], [ac_cv_pthread],
2594 CC="$CC -pthread"
2615 if test ! -z "$CXX"
2622 CXX="$CXX -Kpthread"
2626 CXX="$CXX -Kthread"
2630 CXX="$CXX -pthread"
2637 $CXX -c conftest.$ac_ext 2>&5
2638 if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
2639 && test -s conftest$ac_exeext && ./conftest$ac_exeext
2645 rm -fr conftest*
2654 dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
2667 ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/memfd.h \
2668 linux/random.h linux/soundcard.h \
2669 …linux/tipc.h linux/wait.h netdb.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h…
2681 # bluetooth/bluetooth.h has been known to not compile with -std=c99.
2682 # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
2684 CFLAGS="-std=c99 $CFLAGS"
2698 # On Linux, netlink.h requires asm/types.h
2699 AC_CHECK_HEADERS(linux/netlink.h,,,[
2708 # On Linux, qrtr.h requires asm/types.h
2709 AC_CHECK_HEADERS(linux/qrtr.h,,,[
2718 AC_CHECK_HEADERS(linux/vm_sockets.h,,,[
2724 # On Linux, can.h, can/bcm.h, can/j1939.h, can/raw.h require sys/socket.h
2726 AC_CHECK_HEADERS(linux/can.h linux/can/bcm.h linux/can/j1939.h linux/can/raw.h netcan/can.h,,,[
2777 # Don't use largefile support for GNU/Hurd
2778 case $ac_sys_system in GNU*)
2845 if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
2846 "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
2860 (For Solaris and Linux, the necessary defines are already defined.)])
2878 then CC="$CC -Kpthread"
2880 then CC="$CC -Kthread"
2882 then CC="$CC -pthread"
2902 if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then
2922 OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
2933 LIBTOOL_CRUFT="-framework System -lcc_dynamic"
2937 LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `/usr/bin/arch`"
2939 …LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYT…
2940 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
2942 gcc_version=`gcc -dumpversion`
2945 LIBTOOL_CRUFT="-lcc_dynamic"
2991 LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
2992 …LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYT…
2993 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
2995 AC_MSG_CHECKING(for --enable-framework)
2998 BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
2999 # -F. is needed to allow linking to the framework while
3007 …AC_MSG_ERROR([Specifying both --enable-shared and --enable-framework is not supported, use only --…
3017 [Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
3018 dynamic linker (dyld) instead of the old-style (NextStep) dynamic
3027 AC_MSG_CHECKING(for --with-address-sanitizer)
3029 AS_HELP_STRING([--with-address-sanitizer],
3033 BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
3034 LDFLAGS="-fsanitize=address $LDFLAGS"
3040 AC_MSG_CHECKING(for --with-memory-sanitizer)
3042 AS_HELP_STRING([--with-memory-sanitizer],
3046 AX_CHECK_COMPILE_FLAG([-fsanitize=memory],[
3047 BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS"
3048 LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS"
3055 AC_MSG_CHECKING(for --with-undefined-behavior-sanitizer)
3057 AS_HELP_STRING([--with-undefined-behavior-sanitizer],
3061 BASECFLAGS="-fsanitize=undefined $BASECFLAGS"
3062 LDFLAGS="-fsanitize=undefined $LDFLAGS"
3079 # -- usually .so, .sl on HP-UX, .dll on Cygwin
3081 if test -z "$SHLIB_SUFFIX"; then
3084 case `uname -m` in
3096 # -- "cc -G" on SunOS 5.x.
3100 if test -z "$LDSHARED"
3104 BLDSHARED="Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
3105 LDSHARED="\$(LIBPL)/ld_so_aix \$(CC) -bI:\$(LIBPL)/python.exp"
3109 LDSHARED='$(CC) -shared'
3110 LDCXXSHARED='$(CXX) -shared'
3112 LDSHARED='$(CC) -G'
3113 LDCXXSHARED='$(CXX) -G'
3117 LDSHARED='$(CC) -shared'
3118 LDCXXSHARED='$(CXX) -shared'
3120 LDSHARED='$(CC) -b'
3121 LDCXXSHARED='$(CXX) -b'
3124 LDSHARED='$(CC) -bundle'
3125 LDCXXSHARED='$(CXX) -bundle'
3133 LDSHARED="$LDSHARED -undefined suppress"
3134 LDCXXSHARED="$LDCXXSHARED -undefined suppress"
3137 LDSHARED='$(CC) -bundle'
3138 LDCXXSHARED='$(CXX) -bundle'
3145 # No framework, use the Python app as bundle-loader
3146 BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
3147 LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
3148 LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
3151 # Use -undefined dynamic_lookup whenever possible (10.3 and later).
3155 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
3157 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
3158 if test ${dep_target_major} -eq 10 && \
3159 test ${dep_target_minor} -le 2
3165 LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
3166 LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
3171 LDSHARED='$(CC) -shared'
3172 LDCXXSHARED='$(CXX) -shared';;
3173 Linux*|GNU*|QNX*|VxWorks*|Haiku*)
3174 LDSHARED='$(CC) -shared'
3175 LDCXXSHARED='$(CXX) -shared';;
3177 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
3179 LDSHARED='$(CC) -shared'
3180 LDCXXSHARED='$(CXX) -shared'
3182 LDSHARED="ld -Bshareable"
3185 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
3187 LDSHARED='$(CC) -shared $(CCSHARED)'
3188 LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
3190 case `uname -r` in
3191 [[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
3192 LDSHARED="ld -Bshareable ${LDFLAGS}"
3195 LDSHARED='$(CC) -shared $(CCSHARED)'
3196 LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
3201 LDSHARED='$(CC) -shared'
3202 LDCXXSHARED='$(CXX) -shared';;
3205 LDSHARED='$(CC) -shared'
3206 LDCXXSHARED='$(CXX) -shared'
3208 LDSHARED='$(CC) -G'
3209 LDCXXSHARED='$(CXX) -G'
3212 LDSHARED='$(CC) -Wl,-G,-Bexport'
3213 LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
3219 LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
3220 LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
3226 dnl test -z $LDSHARED block to configure BLDSHARED for side module support.
3227 if test "$enable_wasm_dynamic_linking" = "yes" -a "$ac_sys_system" = "Emscripten"; then
3228 BLDSHARED='$(CC) -shared -sSIDE_MODULE=1'
3232 LDCXXSHARED=${LDCXXSHARED-$LDSHARED}
3235 BLDSHARED=${BLDSHARED-$LDSHARED}
3239 # library (module) -- this is only needed for a few systems
3241 if test -z "$CCSHARED"
3245 then CCSHARED="-fPIC";
3246 elif test `uname -p` = sparc;
3247 then CCSHARED="-xcode=pic32";
3248 else CCSHARED="-Kpic";
3251 then CCSHARED="-fPIC";
3254 Linux-android*) ;;
3255 Linux*|GNU*) CCSHARED="-fPIC";;
3258 CCSHARED="-fPIC"
3260 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
3261 Haiku*) CCSHARED="-fPIC";;
3264 then CCSHARED="-fPIC"
3265 else CCSHARED="-KPIC"
3269 then CCSHARED="-fPIC"
3270 else CCSHARED="-Kpic -belf"
3273 CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic"
3278 # the python executable -- this is only needed for a few systems
3280 if test -z "$LINKFORSHARED"
3283 AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
3285 LINKFORSHARED="-Wl,-E -Wl,+s";;
3286 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
3287 Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
3288 Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
3289 # -u libsys_s pulls in all symbols in libsys
3291 LINKFORSHARED="$extra_undefs -framework CoreFoundation"
3303 LINKFORSHARED="-Wl,-stack_size,$stack_size $LINKFORSHARED"
3314 OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
3315 SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
3316 ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
3318 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
3320 LINKFORSHARED="-Wl,--export-dynamic"
3324 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
3326 LINKFORSHARED="-Xlinker --export-dynamic"
3332 LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
3335 # -Wl,-E causes the symbols to be added to the dynamic
3337 # is loaded. -N 2048K causes the stack size to be set
3340 LINKFORSHARED='-Wl,-E -N 2048K';;
3342 LINKFORSHARED='-Wl,-export-dynamic';;
3362 dnl WASM dynamic linking requires -fPIC.
3369 # SHLIBS are libraries (except -lc and -lm) to link to the python shared
3370 # library (with --enable-shared).
3389 AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
3400 dnl Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
3401 dnl stream in big-endian byte-order
3405 LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""}
3406 LIBUUID_LIBS=${LIBUUID_LIBS-""}
3413 dnl linux-util's libuuid has uuid_generate_time_safe() since v2.20 (2011)
3430 LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""}
3431 LIBUUID_LIBS=${LIBUUID_LIBS-"-luuid"}
3443 LIBUUID_CFLAGS=${LIBUUID_CFLAGS-""}
3444 LIBUUID_LIBS=${LIBUUID_LIBS-""}
3453 # pthread (first!) on Linux
3460 LIBS="-lintl $LIBS"])
3476 dnl The AIX_BUILDDATE is obtained from the kernel fileset - bos.mp64
3481 AIX_BUILDDATE=$(lslpp -Lcq bos.mp64 | awk -F: '{ print $NF }')
3518 AC_MSG_CHECKING(for --with-hash-algorithm)
3521 AS_HELP_STRING([--with-hash-algorithm=@<:@fnv|siphash13|siphash24@:>@],
3544 if test -z "$1"; then
3552 AC_MSG_ERROR([--with-tzpath must contain only absolute paths, not $1])
3558 AC_MSG_CHECKING(for --with-tzpath)
3560 AS_HELP_STRING([--with-tzpath=<list of absolute paths separated by pathsep>]
3565 AC_MSG_ERROR([--with-tzpath requires a value])
3578 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
3579 AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
3580 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
3584 AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS)
3588 AC_MSG_CHECKING(for --with-libs)
3590 … AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs (default is no)]),
3598 AC_MSG_CHECKING(for --with-system-expat)
3600 …AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library, see …
3607 LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""}
3608 LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"}
3611 LIBEXPAT_CFLAGS="-I\$(srcdir)/Modules/expat"
3612 LIBEXPAT_LDFLAGS="-lm \$(LIBEXPAT_A)"
3621 AC_MSG_CHECKING(for --with-system-ffi)
3623 …AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library, see Doc/…
3634 AC_MSG_ERROR([--with-system-ffi accepts no arguments])
3642 AC_MSG_WARN([--with(out)-system-ffi is ignored on this platform])
3647 if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
3648 … LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
3655 AC_MSG_CHECKING(for --with-system-libmpdec)
3657 …AS_HELP_STRING([--with-system-libmpdec], [build _decimal module using an installed libmpdec librar…
3663 LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""}
3664 LIBMPDEC_LDFLAGS=${LIBMPDEC_LDFLAGS-"-lmpdec"}
3667 LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec"
3668 LIBMPDEC_LDFLAGS="-lm \$(LIBMPDEC_A)"
3671 dnl Disable forced inlining in debug builds, see GH-94847
3673 AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DTEST_COVERAGE"])
3681 # Check whether _decimal should use a coroutine-local or thread-local context
3682 AC_MSG_CHECKING(for --with-decimal-contextvar)
3684 …AS_HELP_STRING([--with-decimal-contextvar], [build _decimal module using a coroutine-local rather …
3691 …[Define if you want build the _decimal module using a coroutine-local rather than a thread-local c…
3709 elif test $ac_cv_sizeof_size_t -eq 8; then
3717 elif test $ac_cv_sizeof_size_t -eq 4; then
3718 if test "$ac_cv_gcc_asm_for_x87" = yes -a "$libmpdec_system" != sunos; then
3731 [x64], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_64=1 -DASM=1"])],
3732 [uint128], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1"])],
3733 [ansi64], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_64=1 -DANSI=1"])],
3734 …[ppro], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_32=1 -DANSI=1 -DASM=1 -Wno-unknown-pr…
3735 [ansi32], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_32=1 -DANSI=1"])],
3736 …[ansi-legacy], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DCONFIG_32=1 -DANSI=1 -DLEGACY_COMPILER=1"])],
3737 [universal], [AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DUNIVERSAL=1"])],
3743 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
3744 # https://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
3745 AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -fno-ipa-pure-const"])
3750 # https://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
3751 AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -U_FORTIFY_SOURCE"])
3758 LIBNSL_CFLAGS=${LIBNSL_CFLAGS-""}
3767 LIBNSL_LIBS=${LIBNSL_LIBS-$libnsl}
3779 [NetBSD*], [OSSAUDIODEV_LIBS="-lossaudio"],
3784 PY_CHECK_EMSCRIPTEN_PORT([LIBSQLITE3], [-sUSE_SQLITE3])
3786 dnl Check for SQLite library. Use pkg-config if available.
3789 LIBSQLITE3_CFLAGS=${LIBSQLITE3_CFLAGS-""}
3790 LIBSQLITE3_LIBS=${LIBSQLITE3_LIBS-"-lsqlite3"}
3793 AS_VAR_APPEND([LIBSQLITE3_CFLAGS], [' -I$(srcdir)/Modules/_sqlite'])
3795 dnl PY_CHECK_SQLITE_FUNC(FUNCTION, IF-FOUND, IF-NOT-FOUND)
3803 dnl bpo-45774/GH-29507: The CPP check in AC_CHECK_HEADER can fail on FreeBSD,
3851 AC_MSG_CHECKING([for --enable-loadable-sqlite-extensions])
3852 AC_ARG_ENABLE([loadable-sqlite-extensions],
3854 [--enable-loadable-sqlite-extensions], [
3875 dnl Detect Tcl/Tk. Use pkg-config if available.
3892 TCLTK_CFLAGS=${TCLTK_CFLAGS-""}
3893 TCLTK_LIBS=${TCLTK_LIBS-""}
3940 AS_VAR_APPEND([TCLTK_CFLAGS], [" -Wno-strict-prototypes -DWITH_APPINIT=1"])
3956 GDBM_LIBS=${GDBM_LIBS-"-lgdbm"}
3970 # "gdbm-ndbm.h" and "gdbm/ndbm.h" are both normalized to "gdbm_ndbm_h"
3986 [gdbm-ndbm.h],
3991 AC_DEFINE([HAVE_GDBM_DASH_NDBM_H], [1], [Define to 1 if you have the <gdbm-ndbm.h> header file.])
3995 if test "$ac_cv_header_gdbm_slash_ndbm_h" = yes -o "$ac_cv_header_gdbm_dash_ndbm_h" = yes; then
4002 # db.h re-defines the name of the function
4006 LIBS="$LIBS -ldb"
4018 AC_DEFINE([HAVE_LIBDB], [1], [Define to 1 if you have the `db' library (-ldb).])
4022 # Check for --with-dbmliborder
4023 AC_MSG_CHECKING(for --with-dbmliborder)
4025 …AS_HELP_STRING([--with-dbmliborder=db1:db2:...], [override order to check db backends for dbm; a v…
4041 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:... (gdbm:ndbm:bdb)])
4048 [Define to force use of thread-safe errno, h_errno, and other functions])
4056 CFLAGS="$CFLAGS -D_REENTRANT"
4060 CC="$CC -Kpthread"
4062 CXX="$CXX -Kpthread"
4067 CC="$CC -Kthread"
4069 CXX="$CXX -Kthread"
4074 CC="$CC -pthread"
4076 CXX="$CXX -pthread"
4080 if test ! -z "$withval" -a -d "$withval"
4081 then LDFLAGS="$LDFLAGS -L$withval"
4086 # (e.g. gnu pth with pthread emulation)
4102 LIBS="$LIBS -lpthread"
4103 AC_MSG_CHECKING([for pthread_create in -lpthread])
4120 LIBS="$LIBS -lpthreads"
4124 LIBS="$LIBS -lc_r"
4128 LIBS="$LIBS -lpthread"
4132 LIBS="$LIBS -lcma"
4141 LIBS="$LIBS -lmpc"
4179 if (pthread_attr_init(&attr)) return (-1);
4180 if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1);
4181 if (pthread_create(&id, &attr, foo, NULL)) return (-1);
4205 # Check for enable-ipv6
4206 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
4207 AC_MSG_CHECKING([if --enable-ipv6 is specified])
4209 AS_HELP_STRING([--enable-ipv6],
4266 for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
4290 linux-glibc)
4291 dnl http://www.v6.linux.or.jp/
4300 linux-inet6)
4301 dnl http://www.v6.linux.or.jp/
4302 if test -d /usr/inet6; then
4306 BASECFLAGS="-I/usr/inet6/include $BASECFLAGS"
4310 if test -f /etc/netconfig; then
4311 if $GREP -q tcp6 /etc/netconfig; then
4336 BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"])
4356 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
4357 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
4358 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
4376 #include <linux/can/raw.h>]],
4382 AC_DEFINE(HAVE_LINUX_CAN_RAW_FD_FRAMES, 1, [Define if compiling using Linux 3.6 or later.])
4387 #include <linux/can/raw.h>]],
4393 AC_DEFINE(HAVE_LINUX_CAN_RAW_JOIN_FILTERS, 1, [Define if compiling using Linux 4.1 or later.])
4396 # Check for --with-doc-strings
4397 AC_MSG_CHECKING(for --with-doc-strings)
4398 AC_ARG_WITH(doc-strings,
4399 AS_HELP_STRING([--with-doc-strings], [enable documentation strings (default is yes)]))
4401 if test -z "$with_doc_strings"
4411 # Check for Python-specific malloc support
4412 AC_MSG_CHECKING(for --with-pymalloc)
4414 AS_HELP_STRING([--with-pymalloc], [enable specialized mallocs (default is yes)]))
4416 if test -z "$with_pymalloc"
4418 dnl default to yes except for wasm32-emscripten and wasm32-wasi.
4428 [Define if you want to compile in Python-specific mallocs])
4434 AC_MSG_CHECKING(for --with-freelists)
4436 AS_HELP_STRING([--with-freelists], [enable object freelists (default is yes)]))
4438 if test -z "$with_freelists"
4449 # Check for --with-c-locale-coercion
4450 AC_MSG_CHECKING(for --with-c-locale-coercion)
4451 AC_ARG_WITH(c-locale-coercion,
4452 AS_HELP_STRING([--with-c-locale-coercion],
4453 [enable C locale coercion to a UTF-8 based locale (default is yes)]))
4455 if test -z "$with_c_locale_coercion"
4462 [Define if you want to coerce the C locale to a UTF-8 based locale])
4467 AC_MSG_CHECKING([for --with-valgrind])
4469 AS_HELP_STRING([--with-valgrind], [enable Valgrind support (default is no)]),,
4477 OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
4481 AC_MSG_CHECKING(for --with-dtrace)
4483 AS_HELP_STRING([--with-dtrace],[enable DTrace support (default is no)]),,
4506 # generation flag '-G'. We check for presence of this flag, rather than
4512 "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
4520 dnl Platform-specific C and header files.
4533 # -I${DLINCLDIR} is added to the compile rule for importdl.o
4545 if test -z "$DYNLOADFILE"
4566 # MACHDEP_OBJS can be set to platform-specific object files needed by Python
4570 if test -z "$MACHDEP_OBJS"
4576 if test -z "$MACHDEP_OBJS"; then
4610 # Force lchmod off for Linux. Linux disallows changing the mode of symbolic
4613 if test "$MACHDEP" != linux; then
4623 dnl PY_CHECK_FUNC(FUNCTION, [INCLUDES], [AC_DEFINE-VAR])
4662 PY_CHECK_FUNC([_dyld_shared_cache_contains_path], [#include <mach-o/dyld.h>], [HAVE_DYLD_SHARED_CAC…
4700 [AC_CHECK_LIB([bsd], [flock], [FCNTL_LIBS="-lbsd"])])])
4720 dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
4773 PY_CHECK_EMSCRIPTEN_PORT([ZLIB], [-sUSE_ZLIB])
4787 ZLIB_CFLAGS=${ZLIB_CFLAGS-""}
4788 ZLIB_LIBS=${ZLIB_LIBS-"-lz"}
4796 BINASCII_CFLAGS="-DUSE_ZLIB_CRC32 $ZLIB_CFLAGS"
4801 PY_CHECK_EMSCRIPTEN_PORT([BZIP2], [-sUSE_BZIP2])
4811 BZIP2_CFLAGS=${BZIP2_CFLAGS-""}
4812 BZIP2_LIBS=${BZIP2_LIBS-"-lbz2"}
4825 LIBLZMA_CFLAGS=${LIBLZMA_CFLAGS-""}
4826 LIBLZMA_LIBS=${LIBLZMA_LIBS-"-llzma"}
4877 [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"],
4878 AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"])
4886 [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"],
4887 AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"])
4923 LIBCRYPT_LIBS=${LIBCRYPT_LIBS-$libcrypt}
4950 LIBS="$LIBS -lrt"
5043 for (ai = aitop; ai; ai = ai->ai_next) {
5044 if (ai->ai_addr == NULL ||
5045 ai->ai_addrlen == 0 ||
5046 getnameinfo(ai->ai_addr, ai->ai_addrlen,
5051 switch (ai->ai_family) {
5113 ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6"
5121 if test "$ac_cv_func_getaddrinfo" = no -o "$ac_cv_buggy_getaddrinfo" = yes
5126 or pass the "--disable-ipv6" option to configure.
5188 # include <linux/if_alg.h>]], [[struct sockaddr_alg s]])],
5192 AC_DEFINE(HAVE_SOCKADDR_ALG, 1, [struct sockaddr_alg (linux/if_alg.h)])
5255 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
5277 [Define this if you have the 6-arg version of gethostbyname_r().])
5296 [Define this if you have the 5-arg version of gethostbyname_r().])
5313 [Define this if you have the 3-arg version of gethostbyname_r().])
5333 # Linux requires this for correct f.p. operations
5339 # check for --with-libm=...
5343 *) LIBM=-lm
5345 AC_MSG_CHECKING(for --with-libm=STRING)
5347 …AS_HELP_STRING([--with-libm=STRING], [override libm math library to STRING (default is system-depe…
5355 else AC_MSG_ERROR([proper usage is --with-libm=STRING])
5359 # check for --with-libc=...
5361 AC_MSG_CHECKING(for --with-libc=STRING)
5363 …AS_HELP_STRING([--with-libc=STRING], [override libc C library to STRING (default is system-depende…
5371 else AC_MSG_ERROR([proper usage is --with-libc=STRING])
5399 [Define if C doubles are 64-bit IEEE 754 binary format, stored
5404 [Define if C doubles are 64-bit IEEE 754 binary format, stored
5407 # Some ARM platforms use a mixed-endian representation for doubles.
5409 # (see e.g., issue 1762561), we can at least make sure that float <-> string
5414 [Define if C doubles are 64-bit IEEE 754 binary format, stored
5415 in ARM mixed-endian order (byte order 45670123)])
5419 # correctly-rounded string <-> double conversion functions from
5420 # Python/dtoa.c, which in turn require that the FPU uses 53-bit
5452 # Detect whether system arithmetic is subject to x87-style double
5455 # mode is round-to-nearest and double rounding issues are present, and
5457 AC_CACHE_CHECK([for x87-style double rounding], [ac_cv_x87_double_rounding], [
5466 /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
5467 x = 0.99999999999999989; /* 1-2**-53 */
5471 /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */
5489 [Define if arithmetic is subject to x87-style double rounding issue])
5565 return res==-1 ? 1 : 0;
5584 AC_ARG_ENABLE(big-digits,
5585 AS_HELP_STRING([--enable-big-digits@<:@=15|30@:>@],[use big digits (30 or 15 bits) for Python longs…
5594 AC_MSG_ERROR([bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30]) ;;
5626 return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
5636 if test "$ac_cv_sizeof_wchar_t" -ge 2 \
5637 -a "$ac_cv_wchar_t_signed" = "no"
5650 if test -f /etc/os-release; then
5651 OS_NAME=$(awk -F= '/^NAME=/ {print substr($2,2,length($2)-2)}' /etc/os-release)
5653 # bpo-43667: In Oracle Solaris, the internal form of wchar_t in
5654 # non-Unicode locales is not Unicode and hence cannot be used directly.
5657 [Define if the internal form of wchar_t in non-Unicode locales
5672 # * The Python implementation (always 'cpython-' for us)
5674 # * --with-pydebug (adds a 'd')
5677 # would get a shared library ABI version tag of 'cpython-32dmu' and shared
5678 # libraries would be named 'foo.cpython-32dmu.so'.
5680 # In Python 3.2 and older, --with-wide-unicode added a 'u' flag.
5681 # In Python 3.7 and older, --with-pymalloc added a 'm' flag.
5686 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
5690 if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then
5693 …ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${PLATFORM_TRIPLET:+-$PLATF…
5707 if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then
5708 LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
5718 # Check for --with-platlibdir
5722 AC_MSG_CHECKING(for --with-platlibdir)
5724 AS_HELP_STRING([--with-platlibdir=DIRNAME],
5728 # --with-platlibdir
5729 # --with-platlibdir=
5730 # --without-platlibdir
5731 if test -n "$withval" -a "$withval" != yes -a "$withval" != no
5745 LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}"
5747 LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
5751 # Check for --with-wheel-pkg-dir=PATH
5754 AC_MSG_CHECKING(for --with-wheel-pkg-dir)
5755 AC_ARG_WITH(wheel-pkg-dir,
5756 AS_HELP_STRING([--with-wheel-pkg-dir=PATH],
5759 if test -n "$withval"; then
5773 return (((-1)>>3 == -1) ? 0 : 1);
5801 [AS_HELP_STRING([--with(out)-readline@<:@=editline@:>@],
5822 AC_MSG_ERROR([proper usage is --with(out)-readline@<:@=editline@:>@])
5831 if test -z "$py_libtermcap"; then
5832 READLINE_LIBS="-l$LIBREADLINE"
5834 READLINE_LIBS="-l$LIBREADLINE -l$py_libtermcap"
5862 #include <stdio.h> /* Must be first for Gnu Readline */
5873 #include <stdio.h> /* Must be first for Gnu Readline */
5906 #include <stdio.h> /* Must be first for Gnu Readline */
5929 if (val1 != -1 && val1 == nice(2))
5990 tm->tm_zone does not exist since it is the alternative way
5997 time_t groundhogday = 1044144000; /* GMT-based */
6002 if (localtime(&groundhogday)->tm_hour != 0)
6013 if (localtime(&groundhogday)->tm_hour != 19)
6020 putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
6022 if (localtime(&groundhogday)->tm_hour != 11)
6030 if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
6032 if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
6079 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
6116 w->_flags = 0;
6195 LIBS="$LIBS -framework CoreFoundation"
6226 if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
6229 if (strcmp(buffer, "-123"))
6237 [ac_cv_have_size_t_format="cross -- assuming yes"
6261 size_t len = -1;
6277 # Check for --with-computed-gotos
6278 AC_MSG_CHECKING(for --with-computed-gotos)
6279 AC_ARG_WITH(computed-gotos,
6280 AS_HELP_STRING([--with-computed-gotos],
6314 ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos"
6359 if test ! -d $dir; then
6365 # Availability of -O2:
6366 AC_CACHE_CHECK([for -O2], [ac_cv_compile_o2], [
6368 CFLAGS="-O2"
6374 # http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
6377 CFLAGS="-O2 -D_FORTIFY_SOURCE=2"
6410 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
6411 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
6414 AC_MSG_CHECKING(for gcc ipa-pure-const bug)
6416 CFLAGS="-O2"
6441 [Define if gcc has the ipa-pure-const bug.])
6492 [AS_HELP_STRING([--with-ensurepip@<:@=install|upgrade|no@:>@],
6506 [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])])
6530 # check if the Linux getrandom() syscall is available
6531 AC_CACHE_CHECK([for the Linux getrandom() syscall], [ac_cv_getrandom_syscall], [
6538 #include <linux/random.h>
6554 [Define to 1 if the Linux getrandom() syscall is available])
6585 POSIXSHMEM_CFLAGS='-I$(srcdir)/Modules/_multiprocessing'
6588 AS_VAR_IF([ac_cv_search_shm_open], [-lrt], [POSIXSHMEM_LIBS="-lrt"])
6609 rpath_arg="-Wl,--enable-new-dtags,-rpath="
6611 rpath_arg="-Wl,-rpath="
6614 AC_MSG_CHECKING(for --with-openssl-rpath)
6615 AC_ARG_WITH(openssl-rpath,
6616 AS_HELP_STRING([--with-openssl-rpath=@<:@DIR|auto|no@:>@],
6619 auto: auto-detect rpath from --with-openssl and pkg-config,
6631 … [-L*], [OPENSSL_LDFLAGS_RPATH="$OPENSSL_LDFLAGS_RPATH ${rpath_arg}$(echo $arg | cut -c3-)"]
6637 [test -d "$with_openssl_rpath"],
6642 AC_MSG_ERROR([--with-openssl-rpath "$with_openssl_rpath" is not a directory]))
6649 # Requires static OpenSSL build with position-independent code. Some features
6657 [-l*], [
6658 libname=$(echo $arg | cut -c3-)
6659 new_OPENSSL_LIBS="$new_OPENSSL_LIBS -l:lib${libname}.a -Wl,--exclude-libs,lib${libname}.a"
6669 dnl AX_CHECK_OPENSSL does not export libcrypto-only libs
6673 [-l*ssl*|-Wl*ssl*], [],
6734 AC_MSG_CHECKING(for --with-ssl-default-suites)
6735 AC_ARG_WITH(ssl-default-suites,
6736 AS_HELP_STRING([--with-ssl-default-suites=@<:@python|openssl|STRING@:>@],
6766 AC_MSG_CHECKING(for --with-builtin-hashlib-hashes)
6767 AC_ARG_WITH(builtin-hashlib-hashes,
6768 AS_HELP_STRING([--with-builtin-hashlib-hashes=md5,sha1,sha256,sha512,sha3,blake2],
6806 AC_MSG_CHECKING([for --disable-test-modules])
6807 AC_ARG_ENABLE([test-modules],
6808 [AS_HELP_STRING([--disable-test-modules], [don't build nor install test modules])], [
6889 [MODULE_BUILDTYPE=${MODULE_BUILDTYPE:-shared}]
6910 dnl PY_STDLIB_MOD([NAME], [ENABLED-TEST], [SUPPORTED-TEST], [CFLAGS], [LDFLAGS])
6911 dnl sets MODULE_$NAME_STATE based on PY_STDLIB_MOD_SET_NA(), ENABLED-TEST,
6912 dnl and SUPPORTED_TEST. ENABLED-TEST and SUPPORTED-TEST default to true if
6960 PY_STDLIB_MOD_SIMPLE([_io], [-I\$(srcdir)/Modules/_io], [])
6986 [-I\$(srcdir)/Modules/_multiprocessing])
7002 [], [test "$ac_cv_header_sys_ioctl_h" = "yes" -a "$ac_cv_header_fcntl_h" = "yes"],
7005 [], [test "$ac_cv_header_sys_mman_h" = "yes" -a "$ac_cv_header_sys_stat_h" = "yes"])
7008 -a "$ac_cv_header_sys_types_h" = "yes"
7009 -a "$ac_cv_header_netinet_in_h" = "yes"]))
7012 PY_STDLIB_MOD([grp], [], [test "$ac_cv_func_getgrgid" = yes -o "$ac_cv_func_getgrgid_r" = yes])
7014 [], [test "$ac_cv_header_linux_soundcard_h" = yes -o "$ac_cv_header_sys_soundcard_h" = yes],
7016 PY_STDLIB_MOD([pwd], [], [test "$ac_cv_func_getpwuid" = yes -o "$ac_cv_func_getpwuid_r" = yes])
7020 [], [-framework SystemConfiguration -framework CoreFoundation])
7021 PY_STDLIB_MOD([spwd], [], [test "$ac_cv_func_getspent" = yes -o "$ac_cv_func_getspnam" = yes])
7060 [], [test "$have_nis" = yes -a "$ac_cv_header_rpc_rpc_h" = yes],
7098 …LIB_MOD([_ctypes_test], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes], [], [-lm])
7110 AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
7116 if test ! -f Modules/Setup.local
7122 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
7123 -s Modules \
7125 mv config.c Modules
7127 if test -z "$PKG_CONFIG"; then
7128 AC_MSG_WARN([pkg-config is missing. Some dependencies may not be detected correctly.])
7131 if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
7135 please run ./configure --enable-optimizations
7142 CPython core team, see https://peps.python.org/pep-0011/ for more information.