• Home
  • Raw
  • Download

Lines Matching +full:ipv4 +full:- +full:no +full:- +full:config +full:- +full:for +full:- +full:cpp

2 dnl * Please run autoreconf -if to test your changes! *
5 dnl Python's configure script requires autoconf 2.69 and autoconf-archive.
18 [AC_MSG_ERROR([Please install autoconf-archive package and re-run autoreconf])]
22 if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then
23 # If we're building out-of-tree, we need to make sure the following
25 # Objects/ -> typeslots.inc
26 # Include/ -> Python.h
27 # Python/ -> importlib.h
29 # regenerated when building out-of-tree, regardless of whether or not
30 # the $srcdir counterpart is up-to-date. This is an acceptable trade
32 BASECPPFLAGS="-IObjects -IInclude -IPython"
41 if test -e $srcdir/.git
43 AC_CHECK_PROG(HAS_GIT, git, found, not-found)
45 HAS_GIT=no-repository
49 GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
50 GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
51 GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
65 # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
66 rm -f pybuilddir.txt
72 AC_MSG_CHECKING([for python interpreter for cross build])
73 if test -z "$PYTHON_FOR_BUILD"; then
74 for interp in python$PACKAGE_VERSION python3 python; do
76 …if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info@<:@:2@:>@) == '$P…
85 …dir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && e…
88 AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
90 PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
100 prefix=`echo "$prefix" | sed -e 's/\/$//g'`
103 dnl This is for stuff that absolutely must end up in pyconfig.h.
119 # with other autoconf-based packages that include Python.h
120 grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new
132 # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
136 # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
141 # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
146 # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
157 AC_MSG_CHECKING([for --enable-universalsdk])
159 AS_HELP_STRING([--enable-universalsdk@<:@=SDKDIR@:>@],
162 see Mac/README.rst. (default is no)]),
166 # Locate the best usable SDK, see Mac/README for more
168 enableval="`/usr/bin/xcodebuild -version -sdk macosx Path 2>/dev/null`"
169 if ! ( echo $enableval | grep -E '\.sdk' 1>/dev/null )
172 if test ! -d "${enableval}"
180 no)
186 if test ! -d "${UNIVERSALSDK}"
188 AC_MSG_ERROR([--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}])
197 if test -n "${UNIVERSALSDK}"
201 AC_MSG_RESULT(no)
208 # For backward compatibility reasons we prefer to select '32-bit' if available,
210 UNIVERSAL_ARCHS="32-bit"
211 if test "`uname -s`" = "Darwin"
213 if test -n "${UNIVERSALSDK}"
215 if test -z "`/usr/bin/file -L "${UNIVERSALSDK}/usr/lib/libSystem.dylib" | grep ppc`"
224 AC_MSG_CHECKING(for --with-universal-archs)
225 AC_ARG_WITH(universal-archs,
226 AS_HELP_STRING([--with-universal-archs=ARCH],
228 This option is only valid when --enable-universalsdk is set; options are:
229 ("universal2", "intel-64", "intel-32", "intel", "32-bit",
230 "64-bit", "3-way", or "all")
236 if test -n "${UNIVERSALSDK}"
240 AC_MSG_RESULT(no)
243 AC_ARG_WITH(framework-name,
244 AS_HELP_STRING([--with-framework-name=FRAMEWORK],
245 [specify the name for the python framework on macOS
246 only valid when --enable-framework is set. see Mac/README.rst
251 PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr '[A-Z]' '[a-z]'`
259 AS_HELP_STRING([--enable-framework@<:@=INSTALLDIR@:>@],
262 (default is no)]),
269 no)
271 PYTHONFRAMEWORKDIR=no-framework
323 # --prefix option, but wants to install
324 # the framework in a non-default location,
339 # Add files for Mac specific code to the list of output
348 PYTHONFRAMEWORKDIR=no-framework
380 ## AS_HELP_STRING([--with-dyld],
383 # Set name for machine-dependent library files
384 AC_ARG_VAR([MACHDEP], [name for machine-dependent library files])
386 if test -z "$MACHDEP"
388 # avoid using uname for cross builds
390 # ac_sys_system and ac_sys_release are used for setting
394 *-*-linux-android*)
395 ac_sys_system=Linux-android
397 *-*-linux*)
400 *-*-cygwin*)
403 *-*-vxworks*)
407 # for now, limit cross builds to known configurations
409 AC_MSG_ERROR([cross build not supported for $host])
413 ac_sys_system=`uname -s`
415 -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
416 ac_sys_release=`uname -v`
418 ac_sys_release=`uname -r`
422 tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
424 tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
440 *-*-linux*)
449 *-*-cygwin*)
452 *-*-vxworks*)
456 # for now, limit cross builds to known configurations
458 AC_MSG_ERROR([cross build not supported for $host])
460 _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
465 # features as extensions. For these systems, we skip the definition of
467 # some feature, make sure there is no alternative way to access this
469 # need for not defining _XOPEN_SOURCE on all systems matching the
476 # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
480 define_xopen_source=no
495 NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
496 define_xopen_source=no;;
500 # for Python to use Solaris is simply to leave _XOPEN_SOURCE out
503 define_xopen_source=no;;
506 # Reconfirmed for 7.1.4 by Martin v. Loewis.
507 OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
508 define_xopen_source=no;;
512 define_xopen_source=no;;
519 # has no effect, don't bother defining them
521 define_xopen_source=no;;
522 Darwin/@<:@[12]@:>@@<:@0-9@:>@.*)
523 define_xopen_source=no;;
527 define_xopen_source=no
532 define_xopen_source=no
535 # On HP-UX, defining _XOPEN_SOURCE to 600 or greater hides
538 define_xopen_source=no
545 # X/Open 7, incorporating POSIX.1-2008
552 # cases for HP-UX, we define it globally.
554 Define to activate Unix95-and-earlier features)
556 AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008)
559 # On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE
564 define_stdc_a1=no;;
569 AC_DEFINE(_INCLUDE__STDC_A1_SOURCE, 1, Define to include mbstate_t for mbrtowc)
572 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
580 # checks for alternative programs
583 # for debug/optimization stuff. BASECFLAGS is for flags that are required
589 if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
591 AC_MSG_ERROR([cached CC is different -- throw away $cache_file
595 # Don't let AC_PROG_CC set the default CFLAGS. It normally sets -g -O2
596 # when the compiler supports them, but we don't always want -O2, and
597 # we set -g later.
598 if test -z "$CFLAGS"; then
605 # AC_PROG_CC can handle, see Mac/README for more
607 if test -z "${CC}"
612 for as_dir in $PATH
615 if test -x "${as_dir}/gcc"; then
616 if test -z "${found_gcc}"; then
620 if test -x "${as_dir}/clang"; then
621 if test -z "${found_clang}"; then
628 if test -n "$found_gcc" -a -n "$found_clang"
630 if test -n "`"$found_gcc" --version | grep llvm-gcc`"
632 AC_MSG_NOTICE([Detected llvm-gcc, falling back to clang])
638 elif test -z "$found_gcc" -a -n "$found_clang"
640 AC_MSG_NOTICE([No GCC found, use CLANG])
644 elif test -z "$found_gcc" -a -z "$found_clang"
646 found_clang=`/usr/bin/xcrun -find clang 2>/dev/null`
647 if test -n "${found_clang}"
651 CXX="`/usr/bin/xcrun -find clang++`"
665 AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
667 AS_HELP_STRING([--with-cxx-main@<:@=COMPILER@:>@],
672 no) with_cxx_main=no
678 if test -z "$CXX"
683 with_cxx_main=no
689 if test -z "$CXX"
702 if test -z "$CXX"
720 AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
737 x86_64-linux-gnu
739 x86_64-linux-gnux32
741 i386-linux-gnu
744 aarch64_ilp32-linux-gnu
746 aarch64-linux-gnu
750 aarch64_be_ilp32-linux-gnu
752 aarch64_be-linux-gnu
755 alpha-linux-gnu
758 arm-linux-gnueabihf
760 armeb-linux-gnueabihf
764 arm-linux-gnueabi
766 armeb-linux-gnueabi
769 hppa-linux-gnu
771 ia64-linux-gnu
773 m68k-linux-gnu
776 mipsisa32r6el-linux-gnu
778 mipsisa64r6el-linux-gnuabin32
780 mipsisa64r6el-linux-gnuabi64
786 mipsisa32r6-linux-gnu
788 mipsisa64r6-linux-gnuabin32
790 mipsisa64r6-linux-gnuabi64
796 mipsel-linux-gnu
798 mips64el-linux-gnuabin32
800 mips64el-linux-gnuabi64
806 mips-linux-gnu
808 mips64-linux-gnuabin32
810 mips64-linux-gnuabi64
815 or1k-linux-gnu
817 powerpc-linux-gnuspe
820 powerpc64le-linux-gnu
822 powerpc64-linux-gnu
825 powerpc-linux-gnu
827 s390x-linux-gnu
829 s390-linux-gnu
831 sh4-linux-gnu
833 sparc64-linux-gnu
835 sparc-linux-gnu
838 riscv32-linux-gnu
840 riscv64-linux-gnu
849 x86_64-kfreebsd-gnu
851 i386-kfreebsd-gnu
856 i386-gnu
867 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
868 PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
873 rm -f conftest.c conftest.out
875 AC_MSG_CHECKING([for multiarch])
879 [MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
886 AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
894 MULTIARCH_CPPFLAGS="-DMULTIARCH=\\\"$MULTIARCH\\\""
898 AC_MSG_CHECKING([for -Wl,--no-as-needed])
900 LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
902 [NO_AS_NEEDED="-Wl,--no-as-needed"
905 AC_MSG_RESULT([no])])
910 # checks for UNIX variants that set C preprocessor variables
913 AC_MSG_CHECKING([for the Android API level])
923 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
924 ANDROID_API_LEVEL=`sed -n -e '/__ANDROID_API__/d' -e 's/^android_api = //p' conftest.out`
925 _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out`
927 if test -z "$ANDROID_API_LEVEL"; then
933 AC_MSG_CHECKING([for the Android arm ABI])
936 BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16"
937 LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8"
942 rm -f conftest.c conftest.out
944 # Check for unsupported systems
947 echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
948 echo See README for details.
953 AC_MSG_CHECKING(for --with-suffix)
955 … AS_HELP_STRING([--with-suffix=SUFFIX], [set executable suffix to SUFFIX (default is '.exe')]),
958 no) EXEEXT=;;
964 # Test whether we're running on a non-case-sensitive system, in which
965 # case we give a warning if no ext is given
967 AC_MSG_CHECKING(for case-insensitive build directory)
968 if test ! -d CaseSensitiveTestDir; then
972 if test -d casesensitivetestdir
977 AC_MSG_RESULT(no)
985 cc|*/cc) CC="$CC -Ae";;
991 if test -z "$LIBRARY"
1009 # on the system - some systems like version suffix, others don't
1029 # LINKCC is the command that links the python executable -- default is $(CC).
1035 if test -z "$LINKCC"
1041 # support -N.
1047 # EXPORTSYMS holds the list of exported symbols for AIX.
1063 # make sure we default having it set to "no": this is used by
1064 # distutils.unixccompiler to know if it should add --enable-new-dtags
1068 AC_MSG_CHECKING(for GNU ld)
1071 ac_prog=`$CC -print-prog-name=ld`
1073 case `"$ac_prog" -V 2>&1 < /dev/null` in
1077 GNULD=no;;
1081 AC_MSG_CHECKING(for --enable-shared)
1083 … AS_HELP_STRING([--enable-shared], [enable building a shared Python library (default is no)]))
1085 if test -z "$enable_shared"
1091 enable_shared="no";;
1096 AC_MSG_CHECKING(for --enable-profiling)
1098 … AS_HELP_STRING([--enable-profiling], [enable C-level code profiling with gprof (default is no)]))
1101 CC="$CC -pg"
1104 [enable_profiling=no])
1107 enable_profiling=no
1112 BASECFLAGS="-pg $BASECFLAGS"
1113 LDFLAGS="-pg $LDFLAGS"
1120 # will find it with a -framework option). For this reason there is an
1123 # LDLIBRARY, but empty for MacOSX framework builds.
1144 BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
1154 BLDLIBRARY='-L. -lpython$(LDVERSION)'
1163 case `uname -m` in
1171 BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
1176 BLDLIBRARY='-L. -lpython$(LDVERSION)'
1206 if test -z "$ARFLAGS"
1215 AC_MSG_ERROR([readelf for the host is required for cross builds])
1224 # install -d does not work on HP-UX
1225 if test -z "$INSTALL"
1227 INSTALL="${srcdir}/install-sh -c"
1235 if test -z "$LN" ; then
1237 CYGWIN*) LN="ln -s";;
1242 # For calculating the .so ABI tag.
1246 # Check for --with-pydebug
1247 AC_MSG_CHECKING(for --with-pydebug)
1249 AS_HELP_STRING([--with-pydebug], [build with Py_DEBUG defined (default is no)]),
1251 if test "$withval" != no
1254 [Define if you want to build an interpreter with many run-time checks.])
1258 else AC_MSG_RESULT(no); Py_DEBUG='false'
1260 [AC_MSG_RESULT(no)])
1262 # Check for --with-trace-refs
1263 # --with-trace-refs
1264 AC_MSG_CHECKING(for --with-trace-refs)
1265 AC_ARG_WITH(trace-refs,
1267 [--with-trace-refs],
1268 [enable tracing references for debugging purpose (default is no)]),,
1269 with_trace_refs=no)
1274 …AC_DEFINE(Py_TRACE_REFS, 1, [Define if you want to enable tracing references for debugging purpose…
1277 # Check for --with-assertions.
1280 AC_MSG_CHECKING(for --with-assertions)
1282 AS_HELP_STRING([--with-assertions],[build with C assertions enabled (default is no)]),
1284 if test "$withval" != no
1293 AC_MSG_RESULT(implied by --with-pydebug)
1295 AC_MSG_RESULT(no)
1302 AC_MSG_CHECKING(for --enable-optimizations)
1304 [--enable-optimizations],
1305 [enable expensive, stable optimizations (PGO, etc.) (default is no)]),
1307 if test "$enableval" != no
1313 AC_MSG_RESULT(no);
1315 [AC_MSG_RESULT(no)])
1320 # who want LTO need to use --with-lto themselves.
1321 DEF_MAKE_ALL_RULE="profile-opt"
1326 AX_CHECK_COMPILE_FLAG([-fno-semantic-interposition],[
1327 CFLAGS_NODIST="$CFLAGS_NODIST -fno-semantic-interposition"
1328 LDFLAGS_NODIST="$LDFLAGS_NODIST -fno-semantic-interposition"
1336 REQUIRE_PGO="no"
1340 AC_ARG_VAR(PROFILE_TASK, Python args for PGO generation task)
1342 if test -z "$PROFILE_TASK"
1344 PROFILE_TASK='-m test --pgo --timeout=$(TESTTIMEOUT)'
1348 # Make llvm-relatec checks work on systems where llvm tools are not installed with their
1350 # non-suffixed name in their versioned llvm directory.
1359 if test -L "${clang_bin}"
1369 AC_MSG_CHECKING(for --with-lto)
1370 AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [enable Link-Time-Optimization in any build (default …
1372 if test "$withval" != no
1378 AC_MSG_RESULT(no);
1380 [AC_MSG_RESULT(no)])
1385 AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
1387 if test -n "${LLVM_AR}" -a -x "${LLVM_AR}"
1391 LLVM_AR_FOUND="not-found"
1393 if test "$ac_sys_system" = "Darwin" -a "${LLVM_AR_FOUND}" = "not-found"
1395 # The Apple-supplied ar in Xcode or the Command Line Tools is apparently sufficient
1396 found_llvm_ar=`/usr/bin/xcrun -find ar 2>/dev/null`
1397 if test -n "${found_llvm_ar}"
1401 AC_MSG_NOTICE([llvm-ar found via xcrun: ${LLVM_AR}])
1404 if test $LLVM_AR_FOUND = not-found
1407 … AC_MSG_ERROR([llvm-ar is required for a --with-lto build with clang but could not be found.])
1409 LLVM_AR_ERR=no
1415 LTOFLAGS="-flto -Wl,-export_dynamic"
1416 LTOCFLAGS="-flto"
1419 LTOFLAGS="-flto"
1426 LTOFLAGS="-flto -Wl,-export_dynamic"
1427 LTOCFLAGS="-flto"
1430 LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"
1438 # bpo-30345: Add -g to LDFLAGS when compiling with LTO
1440 LTOFLAGS="$LTOFLAGS -g"
1443 CFLAGS_NODIST="$CFLAGS_NODIST ${LTOCFLAGS-$LTOFLAGS}"
1454 AC_PATH_TOOL(LLVM_PROFDATA, llvm-profdata, '', ${llvm_path})
1456 if test -n "${LLVM_PROFDATA}" -a -x "${LLVM_PROFDATA}"
1460 LLVM_PROF_FOUND="not-found"
1462 if test "$ac_sys_system" = "Darwin" -a "${LLVM_PROF_FOUND}" = "not-found"
1464 found_llvm_profdata=`/usr/bin/xcrun -find llvm-profdata 2>/dev/null`
1465 if test -n "${found_llvm_profdata}"
1467 # llvm-profdata isn't directly in $PATH in some cases.
1469 LLVM_PROFDATA='/usr/bin/xcrun llvm-profdata'
1471 AC_MSG_NOTICE([llvm-profdata found via xcrun: ${LLVM_PROFDATA}])
1474 LLVM_PROF_ERR=no
1478 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
1479 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
1480 LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr"
1481 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\""
1482 if test $LLVM_PROF_FOUND = not-found
1487 …AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations build but could not be found.…
1494 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
1495 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
1496 LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr"
1497 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\""
1498 if test "${LLVM_PROF_FOUND}" = "not-found"
1503 …AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations build but could not be found.…
1508 PGO_PROF_GEN_FLAG="-fprofile-generate"
1509 PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction"
1516 PGO_PROF_GEN_FLAG="-prof-gen"
1517 PGO_PROF_USE_FLAG="-prof-use"
1527 # ------------------------
1528 # (The following bit of code is complicated enough - please keep things
1529 # indented properly. Just pretend you're editing Python code. ;-)
1541 if $CC --version 2>&1 | grep -q clang
1553 if test "${OPT-unset}" = "unset"
1557 # For gcc 4.x we need to use -fwrapv so lets check if its supported
1558 if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
1559 WRAP="-fwrapv"
1562 if test -n "${cc_is_clang}"
1564 # Clang also needs -fwrapv
1565 WRAP="-fwrapv"
1566 # bpo-30104: disable strict aliasing to compile correctly dtoa.c,
1567 # see Makefile.pre.in for more information
1568 CFLAGS_ALIASING="-fno-strict-aliasing"
1574 # Optimization messes up debuggers, so turn it off for
1576 if "$CC" -v --help 2>/dev/null |grep -- -Og > /dev/null; then
1577 OPT="-g -Og -Wall"
1579 OPT="-g -O0 -Wall"
1582 OPT="-g $WRAP -O3 -Wall"
1586 OPT="-O3 -Wall"
1591 SCO_SV*) OPT="$OPT -m486 -DSCO5"
1597 OPT="-O"
1606 # The -arch flags for universal builds on macOS
1613 CFLAGS_NODIST="$CFLAGS_NODIST -std=c99"
1615 AC_MSG_CHECKING(for -Wextra)
1617 CC="$CC -Wextra -Werror"
1625 ac_cv_extra_warnings=no
1632 CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"
1636 # GCC produce warnings for legal Python code. Enable
1637 # -fno-strict-aliasing on versions of GCC that support but produce
1639 AC_MSG_CHECKING(whether $CC accepts and needs -fno-strict-aliasing)
1641 CC="$CC -fno-strict-aliasing"
1648 CC="$ac_save_cc -fstrict-aliasing"
1649 CFLAGS="$CFLAGS -Werror -Wstrict-aliasing"
1655 ac_cv_no_strict_aliasing=no
1660 ac_cv_no_strict_aliasing=no
1667 BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
1674 ac_cv_disable_unused_result_warning=no
1679 CC="$CC -Wunused-result -Werror"
1688 ac_cv_disable_unused_result_warning=no
1698 BASECFLAGS="$BASECFLAGS -Wno-unused-result"
1699 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-result"
1704 CC="$CC -Wunused-parameter -Werror"
1712 ac_cv_disable_unused_parameter_warning=no
1719 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter"
1724 CC="$CC -Wmissing-field-initializers -Werror"
1732 ac_cv_disable_missing_field_initializers=no
1739 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers"
1744 CC="$CC -Wsign-compare"
1753 ac_cv_enable_sign_compare_warning=no
1761 BASECFLAGS="$BASECFLAGS -Wsign-compare"
1766 CC="$CC -Wunreachable-code"
1775 ac_cv_enable_unreachable_code_warning=no
1781 # results in non-standard code paths.
1785 # for clang. Try to determine if the compiler is not really gcc and,
1789 test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`"
1791 BASECFLAGS="$BASECFLAGS -Wunreachable-code"
1793 ac_cv_enable_unreachable_code_warning=no
1797 AC_MSG_CHECKING(if we can turn on $CC strict-prototypes warning)
1799 CC="$CC -Werror -Wstrict-prototypes"
1807 ac_cv_enable_strict_prototypes_warning=no
1814 CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes"
1819 CC="$CC -Werror=implicit-function-declaration"
1827 ac_cv_enable_implicit_function_declaration_error=no
1834 CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"
1839 CC="$CC -fvisibility=hidden"
1847 ac_cv_enable_visibility=no
1854 CFLAGS_NODIST="$CFLAGS_NODIST -fvisibility=hidden"
1857 # if using gcc on alpha, use -mieee to get (near) full IEEE 754
1862 BASECFLAGS="$BASECFLAGS -mieee"
1868 BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
1872 # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
1873 # used to be here, but non-Apple gcc doesn't accept them.
1882 CC=gcc-4.0
1883 CPP=cpp-4.0
1893 32-bit)
1894 UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
1898 64-bit)
1899 UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
1904 UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
1905 LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
1906 ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
1909 UNIVERSAL_ARCH_FLAGS="-arch arm64 -arch x86_64"
1911 LIPO_INTEL64_FLAGS="-extract x86_64"
1915 UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
1916 LIPO_32BIT_FLAGS="-extract i386"
1917 ARCH_RUN_32BIT="/usr/bin/arch -i386"
1919 intel-32)
1920 UNIVERSAL_ARCH_FLAGS="-arch i386"
1924 intel-64)
1925 UNIVERSAL_ARCH_FLAGS="-arch x86_64"
1929 3-way)
1930 UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
1931 LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
1932 ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
1935 … AC_MSG_ERROR([proper usage is --with-universal-arch=universal2|32-bit|64-bit|all|intel|3-way])
1941 CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
1942 LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
1943 CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
1950 # Calculate an appropriate deployment target for this build:
1952 # features are enabled (such as builtin libedit support for readline)
1964 cur_target_major=`sw_vers -productVersion | \
1965 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
1966 cur_target_minor=`sw_vers -productVersion | \
1967 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
1969 if test ${cur_target_major} -eq 10 && \
1970 test ${cur_target_minor} -ge 3 && \
1971 test ${cur_target_minor} -le 5
1978 all|3-way|intel|64-bit)
1991 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
2005 [AC_MSG_RESULT(no)
2006 AC_MSG_ERROR(check config.log and use the '--with-universal-archs' option)
2017 BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
2020 BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
2028 # ICC needs -fp-model strict or floats behave badly
2029 CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
2032 CFLAGS_NODIST="$CFLAGS_NODIST -qalias=noansi -qmaxmem=-1"
2039 OPT="-DNDEBUG $OPT"
2051 # options before we can check whether -Kpthread improves anything.
2069 ac_cv_kthread=no
2070 ac_cv_pthread=no
2071 ],[ac_cv_pthread_is_default=no],[ac_cv_pthread_is_default=no])
2078 ac_cv_kpthread=no
2080 # -Kpthread, if available, provides the right #defines
2082 # Some compilers won't report that they do not support -Kpthread,
2085 AC_MSG_CHECKING(whether $CC accepts -Kpthread)
2088 CC="$CC -Kpthread"
2102 ]])],[ac_cv_kpthread=yes],[ac_cv_kpthread=no],[ac_cv_kpthread=no])
2107 if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
2109 # -Kthread, if available, provides the right #defines
2111 # Some compilers won't report that they do not support -Kthread,
2114 AC_MSG_CHECKING(whether $CC accepts -Kthread)
2117 CC="$CC -Kthread"
2131 ]])],[ac_cv_kthread=yes],[ac_cv_kthread=no],[ac_cv_kthread=no])
2136 if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
2138 # -pthread, if available, provides the right #defines
2140 # Some compilers won't report that they do not support -pthread,
2143 AC_MSG_CHECKING(whether $CC accepts -pthread)
2146 CC="$CC -pthread"
2160 ]])],[ac_cv_pthread=yes],[ac_cv_pthread=no],[ac_cv_pthread=no])
2165 # If we have set a CC compiler flag for thread support then
2166 # check if it works for CXX, too.
2167 ac_cv_cxx_thread=no
2168 if test ! -z "$CXX"
2170 AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
2175 CXX="$CXX -Kpthread"
2179 CXX="$CXX -Kthread"
2183 CXX="$CXX -pthread"
2190 $CXX -c conftest.$ac_ext 2>&5
2191 if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
2192 && test -s conftest$ac_exeext && ./conftest$ac_exeext
2196 ac_cv_cxx_thread=no
2198 rm -fr conftest*
2204 dnl # check for ANSI or K&R ("traditional") preprocessor
2205 dnl AC_MSG_CHECKING(for C preprocessor type)
2207 dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
2213 # checks for header files
2233 # bluetooth/bluetooth.h has been known to not compile with -std=c99.
2236 CFLAGS="-std=c99 $CFLAGS"
2289 # checks for typedefs
2290 was_it_defined=no
2291 AC_MSG_CHECKING(for clock_t in time.h)
2297 AC_MSG_CHECKING(for makedev)
2308 ],[ac_cv_has_makedev=yes],[ac_cv_has_makedev=no])
2315 AC_MSG_CHECKING(for le64toh)
2324 ],[ac_cv_has_le64toh=yes],[ac_cv_has_le64toh=no])
2331 # Don't use largefile support for GNU/Hurd
2333 use_lfs=no
2351 # Add some code to confdefs.h so that the test for off_t works on SCO
2372 # ANSI C requires sizeof(char) == 1, so no need to check it
2399 if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
2400 "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
2404 to add some flags for configuration and compilation to enable this mode.
2405 (For Solaris and Linux, the necessary defines are already defined.)])
2408 AC_MSG_RESULT(no)
2423 then CC="$CC -Kpthread"
2425 then CC="$CC -Kthread"
2427 then CC="$CC -pthread"
2430 AC_MSG_CHECKING(for pthread_t)
2431 have_pthread_t=no
2448 if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then
2452 [ac_pthread_key_t_is_arithmetic_type=no]
2460 AC_MSG_RESULT(no)
2467 OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
2478 LIBTOOL_CRUFT="-framework System -lcc_dynamic"
2482 LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `/usr/bin/arch`"
2484 …LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYT…
2485 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
2487 gcc_version=`gcc -dumpversion`
2490 LIBTOOL_CRUFT="-lcc_dynamic"
2504 ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes])
2536 LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
2537 …LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYT…
2538 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
2540 AC_MSG_CHECKING(for --enable-framework)
2543 BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
2544 # -F. is needed to allow linking to the framework while
2552 …AC_MSG_ERROR([Specifying both --enable-shared and --enable-framework is not supported, use only --
2555 AC_MSG_RESULT(no)
2558 AC_MSG_CHECKING(for dyld)
2562 [Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
2563 dynamic linker (dyld) instead of the old-style (NextStep) dynamic
2565 AC_MSG_RESULT(always on for Darwin)
2568 AC_MSG_RESULT(no)
2572 AC_MSG_CHECKING(for --with-address-sanitizer)
2574 AS_HELP_STRING([--with-address-sanitizer],
2575 [enable AddressSanitizer memory error detector, 'asan' (default is no)]),
2578 BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
2579 LDFLAGS="-fsanitize=address $LDFLAGS"
2581 with_pymalloc="no"
2583 [AC_MSG_RESULT(no)])
2585 AC_MSG_CHECKING(for --with-memory-sanitizer)
2587 AS_HELP_STRING([--with-memory-sanitizer],
2588 … [enable MemorySanitizer allocation error detector, 'msan' (default is no)]),
2591 AX_CHECK_COMPILE_FLAG([-fsanitize=memory],[
2592 BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS"
2593 LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS"
2596 with_pymalloc="no"
2598 [AC_MSG_RESULT(no)])
2600 AC_MSG_CHECKING(for --with-undefined-behavior-sanitizer)
2602 AS_HELP_STRING([--with-undefined-behavior-sanitizer],
2603 … [enable UndefinedBehaviorSanitizer undefined behaviour detector, 'ubsan' (default is no)]),
2606 BASECFLAGS="-fsanitize=undefined $BASECFLAGS"
2607 LDFLAGS="-fsanitize=undefined $LDFLAGS"
2611 AC_MSG_RESULT(no)
2612 with_ubsan="no"
2624 # -- usually .so, .sl on HP-UX, .dll on Cygwin
2626 if test -z "$SHLIB_SUFFIX"; then
2629 case `uname -m` in
2641 # -- "cc -G" on SunOS 5.x.
2645 if test -z "$LDSHARED"
2649 BLDSHARED="Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
2650 LDSHARED="\$(LIBPL)/ld_so_aix \$(CC) -bI:\$(LIBPL)/python.exp"
2654 LDSHARED='$(CC) -shared'
2655 LDCXXSHARED='$(CXX) -shared'
2657 LDSHARED='$(CC) -G'
2658 LDCXXSHARED='$(CXX) -G'
2662 LDSHARED='$(CC) -shared'
2663 LDCXXSHARED='$(CXX) -shared'
2665 LDSHARED='$(CC) -b'
2666 LDCXXSHARED='$(CXX) -b'
2669 LDSHARED='$(CC) -bundle'
2670 LDCXXSHARED='$(CXX) -bundle'
2677 # No framework. Ignore undefined symbols, assuming they come from Python
2678 LDSHARED="$LDSHARED -undefined suppress"
2679 LDCXXSHARED="$LDCXXSHARED -undefined suppress"
2682 LDSHARED='$(CC) -bundle'
2683 LDCXXSHARED='$(CXX) -bundle'
2690 # No framework, use the Python app as bundle-loader
2691 BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
2692 LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
2693 LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
2696 # Use -undefined dynamic_lookup whenever possible (10.3 and later).
2700 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
2702 sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
2703 if test ${dep_target_major} -eq 10 && \
2704 test ${dep_target_minor} -le 2
2706 # building for OS X 10.0 through 10.2
2709 # building for OS X 10.3 and later
2710 LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
2711 LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
2716 LDSHARED='$(CC) -shared'
2717 LDCXXSHARED='$(CXX) -shared';;
2719 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
2721 LDSHARED='$(CC) -shared'
2722 LDCXXSHARED='$(CXX) -shared'
2724 LDSHARED="ld -Bshareable"
2727 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
2729 LDSHARED='$(CC) -shared $(CCSHARED)'
2730 LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
2732 case `uname -r` in
2733 [[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
2734 LDSHARED="ld -Bshareable ${LDFLAGS}"
2737 LDSHARED='$(CC) -shared $(CCSHARED)'
2738 LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
2743 LDSHARED='$(CC) -shared'
2744 LDCXXSHARED='$(CXX) -shared';;
2747 LDSHARED='$(CC) -shared'
2748 LDCXXSHARED='$(CXX) -shared'
2750 LDSHARED='$(CC) -G'
2751 LDCXXSHARED='$(CXX) -G'
2754 LDSHARED='$(CC) -Wl,-G,-Bexport'
2755 LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
2757 LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
2758 LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
2763 LDCXXSHARED=${LDCXXSHARED-$LDSHARED}
2764 BLDSHARED=${BLDSHARED-$LDSHARED}
2766 # library (module) -- this is only needed for a few systems
2768 if test -z "$CCSHARED"
2772 then CCSHARED="-fPIC";
2773 elif test `uname -p` = sparc;
2774 then CCSHARED="-xcode=pic32";
2775 else CCSHARED="-Kpic";
2778 then CCSHARED="-fPIC";
2781 Linux-android*) ;;
2782 Linux*|GNU*) CCSHARED="-fPIC";;
2783 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
2786 then CCSHARED="-fPIC"
2787 else CCSHARED="-KPIC"
2791 then CCSHARED="-fPIC"
2792 else CCSHARED="-Kpic -belf"
2795 CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic"
2800 # the python executable -- this is only needed for a few systems
2802 if test -z "$LINKFORSHARED"
2805 AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
2807 LINKFORSHARED="-Wl,-E -Wl,+s";;
2808 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
2809 Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
2810 Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
2811 # -u libsys_s pulls in all symbols in libsys
2813 LINKFORSHARED="$extra_undefs -framework CoreFoundation"
2816 # small for the default recursion limit. Increase the stack size
2825 LINKFORSHARED="-Wl,-stack_size,$stack_size $LINKFORSHARED"
2836 OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
2837 SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
2838 ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
2840 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
2842 LINKFORSHARED="-Wl,--export-dynamic"
2846 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
2848 LINKFORSHARED="-Xlinker --export-dynamic"
2852 if test $enable_shared = "no"
2854 LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
2857 # -Wl,-E causes the symbols to be added to the dynamic
2859 # is loaded. -N 2048K causes the stack size to be set
2862 LINKFORSHARED='-Wl,-E -N 2048K';;
2864 LINKFORSHARED='-Wl,-export-dynamic';;
2885 # SHLIBS are libraries (except -lc and -lm) to link to the python shared
2886 # library (with --enable-shared).
2887 # For platforms on which shared libraries are not allowed to have unresolved
2902 # checks for libraries
2904 AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
2905 AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
2907 # checks for uuid.h location
2910 AC_MSG_CHECKING(for uuid_generate_time_safe)
2918 [AC_MSG_RESULT(no)]
2921 # check for libuuid from util-linux
2926 # AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
2928 AC_MSG_CHECKING(for uuid_create)
2936 [AC_MSG_RESULT(no)]
2939 # Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
2940 # stream in big-endian byte-order
2941 AC_MSG_CHECKING(for uuid_enc_be)
2949 [AC_MSG_RESULT(no)]
2957 # check if we need libintl for locale functions
2960 [Define to 1 if libintl is needed for locale functions.])
2961 LIBS="-lintl $LIBS"])
2963 # checks for system dependent C++ extensions support
2965 AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support)
2971 [Define for AIX if your compiler is a genuine IBM xlC/xlC_r
2972 and you want support for AIX C++ shared extension modules.])
2975 AC_MSG_RESULT(no)
2977 dnl The AIX_BUILDDATE is obtained from the kernel fileset - bos.mp64
2980 # as a baseline for bdist module packages
2981 AC_MSG_CHECKING(for the system builddate)
2982 AIX_BUILDDATE=$(lslpp -Lcq bos.mp64 | awk -F: '{ print $NF }')
2990 # check for systems that require aligned memory access
2998 for (i=0; i < 16; i++)
3006 [ac_cv_aligned_required=no],
3018 [Define hash algorithm for str, bytes and memoryview.
3021 AC_MSG_CHECKING(for --with-hash-algorithm)
3024 AS_HELP_STRING([--with-hash-algorithm=@<:@fnv|siphash24@:>@],
3025 … [select hash algorithm for use in Python/pyhash.c (default is SipHash24)]),
3044 if test -z "$1"; then
3045 # Empty string is allowed: it indicates no system TZPATH
3052 AC_MSG_ERROR([--with-tzpath must contain only absolute paths, not $1])
3058 AC_MSG_CHECKING(for --with-tzpath)
3060 AS_HELP_STRING([--with-tzpath=<list of absolute paths separated by pathsep>]
3061 [Select the default time zone search path for zoneinfo.TZPATH]),
3065 AC_MSG_ERROR([--with-tzpath requires a value])
3078 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
3079 AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
3080 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
3082 AC_MSG_CHECKING(for --with-libs)
3084 … AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs (default is no)]),
3089 [AC_MSG_RESULT(no)])
3093 # Check for use of the system expat library
3094 AC_MSG_CHECKING(for --with-system-expat)
3096 …AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library, see …
3098 [with_system_expat="no"])
3102 # Check for use of the system libffi library
3103 AC_MSG_CHECKING(for --with-system-ffi)
3105 …AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library, see Doc/…
3111 with_system_ffi="no"
3113 yes|no)
3116 AC_MSG_ERROR([--with-system-ffi accepts no arguments])
3124 AC_MSG_WARN([--with(out)-system-ffi is ignored on this platform])
3129 if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
3130 … LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
3136 # Check for use of the system libmpdec library
3137 AC_MSG_CHECKING(for --with-system-libmpdec)
3139 …HELP_STRING([--with-system-libmpdec], [build _decimal module using an installed libmpdec library, …
3141 [with_system_libmpdec="no"])
3145 # Check whether _decimal should use a coroutine-local or thread-local context
3146 AC_MSG_CHECKING(for --with-decimal-contextvar)
3148 …AS_HELP_STRING([--with-decimal-contextvar], [build _decimal module using a coroutine-local rather …
3152 if test "$with_decimal_contextvar" != "no"
3155 …[Define if you want build the _decimal module using a coroutine-local rather than a thread-local c…
3160 # Check for support for loadable sqlite extensions
3161 AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions)
3162 AC_ARG_ENABLE(loadable-sqlite-extensions,
3163 AS_HELP_STRING([--enable-loadable-sqlite-extensions],
3164 … [support loadable extensions in _sqlite module, see Doc/library/sqlite3.rst (default is no)]),
3166 [enable_loadable_sqlite_extensions="no"])
3170 # Check for --with-tcltk-includes=path and --with-tcltk-libs=path
3173 AC_MSG_CHECKING(for --with-tcltk-includes)
3174 AC_ARG_WITH(tcltk-includes,
3175 … AS_HELP_STRING([--with-tcltk-includes='-I...'], [override search for Tcl and Tk include files]),
3179 AC_MSG_CHECKING(for --with-tcltk-libs)
3180 AC_ARG_WITH(tcltk-libs,
3181 AS_HELP_STRING([--with-tcltk-libs='-L...'], [override search for Tcl and Tk libs]),
3189 AC_MSG_ERROR([use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither])
3191 if test -n "$PKG_CONFIG" && "$PKG_CONFIG" --exists tcl tk; then
3192 TCLTK_INCLUDES="`"$PKG_CONFIG" tcl tk --cflags-only-I 2>/dev/null`"
3193 TCLTK_LIBS="`"$PKG_CONFIG" tcl tk --libs 2>/dev/null`"
3203 # Check for --with-dbmliborder
3204 AC_MSG_CHECKING(for --with-dbmliborder)
3206 …AS_HELP_STRING([--with-dbmliborder=db1:db2:...], [override order to check db backends for dbm; a v…
3210 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...])
3212 for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do
3215 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...])
3221 # Templates for things AC_DEFINEd more than once.
3222 # For a single AC_DEFINE, no template is needed.
3224 [Define to force use of thread-safe errno, h_errno, and other functions])
3232 CFLAGS="$CFLAGS -D_REENTRANT"
3236 CC="$CC -Kpthread"
3238 CXX="$CXX -Kpthread"
3243 CC="$CC -Kthread"
3245 CXX="$CXX -Kthread"
3250 CC="$CC -pthread"
3252 CXX="$CXX -pthread"
3256 if test ! -z "$withval" -a -d "$withval"
3257 then LDFLAGS="$LDFLAGS -L$withval"
3263 AC_MSG_CHECKING(for _POSIX_THREADS in unistd.h)
3270 ], unistd_defines_pthreads=yes, unistd_defines_pthreads=no)
3274 # Just looking for pthread_create in libpthread is not enough:
3278 LIBS="$LIBS -lpthread"
3279 AC_MSG_CHECKING([for pthread_create in -lpthread])
3295 LIBS="$LIBS -lpthreads"
3299 LIBS="$LIBS -lc_r"
3303 LIBS="$LIBS -lpthread"
3307 LIBS="$LIBS -lcma"
3314 LIBS="$LIBS -lmpc"
3320 if test "$unistd_defines_pthreads" = "no"; then
3329 [Defined for Solaris 2.6 bug in pthread header.])
3350 if (pthread_attr_init(&attr)) return (-1);
3351 if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1);
3352 if (pthread_create(&id, &attr, foo, NULL)) return (-1);
3356 [ac_cv_pthread_system_supported=no],
3357 [ac_cv_pthread_system_supported=no])
3374 # Check for enable-ipv6
3375 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
3376 AC_MSG_CHECKING([if --enable-ipv6 is specified])
3378 AS_HELP_STRING([--enable-ipv6],
3379 … [enable ipv6 (with ipv4) support, see Doc/library/socket.rst (default is yes if supported)]),
3381 no)
3382 AC_MSG_RESULT(no)
3383 ipv6=no
3400 AC_MSG_RESULT(no)
3401 ipv6=no
3415 AC_MSG_RESULT(no, IPv6 disabled)
3416 ipv6=no
3427 ipv6trylibc=no
3431 for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
3455 linux-glibc)
3465 linux-inet6)
3467 if test -d /usr/inet6; then
3471 BASECFLAGS="-I/usr/inet6/include $BASECFLAGS"
3475 if test -f /etc/netconfig; then
3476 if $GREP -q tcp6 /etc/netconfig; then
3501 BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"])
3521 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
3522 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
3523 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
3529 echo 'Fatal: no $ipv6lib library found. cannot continue.'
3537 AC_MSG_CHECKING(for CAN_RAW_FD_FRAMES)
3544 AC_MSG_RESULT(no)
3547 AC_MSG_CHECKING(for CAN_RAW_JOIN_FILTERS)
3554 AC_MSG_RESULT(no)
3557 # Check for --with-doc-strings
3558 AC_MSG_CHECKING(for --with-doc-strings)
3559 AC_ARG_WITH(doc-strings,
3560 AS_HELP_STRING([--with-doc-strings], [enable documentation strings (default is yes)]))
3562 if test -z "$with_doc_strings"
3565 if test "$with_doc_strings" != "no"
3572 # Check for Python-specific malloc support
3573 AC_MSG_CHECKING(for --with-pymalloc)
3575 AS_HELP_STRING([--with-pymalloc], [enable specialized mallocs (default is yes)]))
3577 if test -z "$with_pymalloc"
3581 if test "$with_pymalloc" != "no"
3584 [Define if you want to compile in Python-specific mallocs])
3588 # Check for --with-c-locale-coercion
3589 AC_MSG_CHECKING(for --with-c-locale-coercion)
3590 AC_ARG_WITH(c-locale-coercion,
3591 AS_HELP_STRING([--with-c-locale-coercion],
3592 [enable C locale coercion to a UTF-8 based locale (default is yes)]))
3594 if test -z "$with_c_locale_coercion"
3598 if test "$with_c_locale_coercion" != "no"
3601 [Define if you want to coerce the C locale to a UTF-8 based locale])
3605 # Check for Valgrind support
3606 AC_MSG_CHECKING([for --with-valgrind])
3608 AS_HELP_STRING([--with-valgrind], [enable Valgrind support (default is no)]),,
3609 with_valgrind=no)
3611 if test "$with_valgrind" != no; then
3616 OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
3619 # Check for DTrace support
3620 AC_MSG_CHECKING(for --with-dtrace)
3622 AS_HELP_STRING([--with-dtrace],[enable DTrace support (default is no)]),,
3623 with_dtrace=no)
3645 # generation flag '-G'. We check for presence of this flag, rather than
3649 ac_cv_dtrace_link=no
3651 "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
3659 # -I${DLINCLDIR} is added to the compile rule for importdl.o
3667 # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic
3671 if test -z "$DYNLOADFILE"
3692 # MACHDEP_OBJS can be set to platform-specific object files needed by Python
3696 if test -z "$MACHDEP_OBJS"
3702 if test -z "$MACHDEP_OBJS"; then
3708 # checks for library functions
3735 # Force lchmod off for Linux. Linux disallows changing the mode of symbolic
3748 # For some functions, having a definition is not sufficient, since
3750 AC_MSG_CHECKING(for chroot)
3754 [AC_MSG_RESULT(no)
3756 AC_MSG_CHECKING(for link)
3760 [AC_MSG_RESULT(no)
3762 AC_MSG_CHECKING(for symlink)
3766 [AC_MSG_RESULT(no)
3768 AC_MSG_CHECKING(for fchdir)
3772 [AC_MSG_RESULT(no)
3774 AC_MSG_CHECKING(for fsync)
3778 [AC_MSG_RESULT(no)
3780 AC_MSG_CHECKING(for fdatasync)
3784 [AC_MSG_RESULT(no)
3786 AC_MSG_CHECKING(for epoll)
3790 [AC_MSG_RESULT(no)
3792 AC_MSG_CHECKING(for epoll_create1)
3796 [AC_MSG_RESULT(no)
3798 AC_MSG_CHECKING(for kqueue)
3805 [AC_MSG_RESULT(no)
3807 AC_MSG_CHECKING(for prlimit)
3814 [AC_MSG_RESULT(no)
3816 AC_MSG_CHECKING(for _dyld_shared_cache_contains_path)
3817 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach-o/dyld.h>]], [[void *x=_dyld_shared_cache_conta…
3820 [AC_MSG_RESULT(no)
3823 AC_MSG_CHECKING(for memfd_create)
3834 [AC_MSG_RESULT(no)
3837 AC_MSG_CHECKING(for eventfd)
3845 [AC_MSG_RESULT(no)
3849 # functions ctermid_r, setgroups in the library, but no prototype
3854 AC_MSG_CHECKING(for ctermid_r)
3860 [AC_MSG_RESULT(no)
3863 AC_CACHE_CHECK([for flock declaration], [ac_cv_flock_decl],
3870 [ac_cv_flock_decl=no]
3882 AC_MSG_CHECKING(for getpagesize)
3888 [AC_MSG_RESULT(no)
3891 AC_MSG_CHECKING(for broken unsetenv)
3895 [AC_MSG_RESULT(no)],
3900 dnl check for true
3903 dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
3904 dnl On others, they are in the C library, so we to take no action
3911 AC_CACHE_CHECK([for chflags], [ac_cv_have_chflags], [dnl
3923 [ac_cv_have_chflags=no],
3927 AC_CHECK_FUNC([chflags], [ac_cv_have_chflags="yes"], [ac_cv_have_chflags="no"])
3933 AC_CACHE_CHECK([for lchflags], [ac_cv_have_lchflags], [dnl
3943 ]])],[ac_cv_have_lchflags=yes],[ac_cv_have_lchflags=no],[ac_cv_have_lchflags=cross])
3946 AC_CHECK_FUNC([lchflags], [ac_cv_have_lchflags="yes"], [ac_cv_have_lchflags="no"])
3954 dnl On MacOSX the linker will search for dylibs on the entire linker path
3955 dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first
3960 dnl The -L/usr/local/lib is needed as wel to get the same compilation
3967 CFLAGS="${CFLAGS} -Wl,-search_paths_first"
3968 LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
3981 AC_MSG_CHECKING(for hstrerror)
3987 [AC_MSG_RESULT(no)
3990 AC_MSG_CHECKING(for inet_aton)
3999 [AC_MSG_RESULT(no)
4002 AC_MSG_CHECKING(for inet_pton)
4011 [AC_MSG_RESULT(no)
4015 AC_MSG_CHECKING(for setgroups)
4024 [AC_MSG_RESULT(no)
4027 # check for openpty and forkpty
4031 [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"],
4032 AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"])
4037 [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"],
4038 AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"])
4042 # check for long file support functions
4057 # We search for both crypt and crypt_r as one or the other may be defined
4058 # This gets us our -lcrypt in LIBS when required on the target platform.
4064 #define _GNU_SOURCE /* Required for crypt_r()'s prototype in glibc. */
4076 LIBS="$LIBS -lrt"
4079 [Library needed by timemodule.c: librt may be needed for clock_gettime()])
4095 AC_MSG_CHECKING(for major, minor, and makedev)
4111 AC_MSG_RESULT(no)
4115 # for [no]getaddrinfo in netdb.h.
4116 AC_MSG_CHECKING(for getaddrinfo)
4124 [have_getaddrinfo=no])
4144 for (passive = 0; passive <= 1; passive++) {
4154 for (ai = aitop; ai; ai = ai->ai_next) {
4155 if (ai->ai_addr == NULL ||
4156 ai->ai_addrlen == 0 ||
4157 getnameinfo(ai->ai_addr, ai->ai_addrlen,
4162 switch (ai->ai_family) {
4220 [ac_cv_buggy_getaddrinfo=no],
4224 ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6"
4232 if test $have_getaddrinfo = no || test "$ac_cv_buggy_getaddrinfo" = yes
4237 echo ' or you can specify "--disable-ipv6"'.
4246 # checks for structures
4263 AC_MSG_CHECKING(for time.h that defines altzone)
4267 [ac_cv_header_time_altzone=no])
4274 was_it_defined=no
4288 AC_MSG_CHECKING(for addrinfo)
4292 [ac_cv_struct_addrinfo=no]))
4298 AC_MSG_CHECKING(for sockaddr_storage)
4304 [ac_cv_struct_sockaddr_storage=no]))
4310 AC_MSG_CHECKING(for sockaddr_alg)
4317 [ac_cv_struct_sockaddr_alg=no]))
4323 # checks for compiler characteristics
4328 works=no
4329 AC_MSG_CHECKING(for working signed char)
4336 have_prototypes=no
4337 AC_MSG_CHECKING(for prototypes)
4346 works=no
4347 AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
4366 # check for socketpair
4367 AC_MSG_CHECKING(for socketpair)
4374 [AC_MSG_RESULT(no)]
4384 [AC_MSG_RESULT(no)]
4387 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
4409 [Define this if you have the 6-arg version of gethostbyname_r().])
4412 AC_MSG_RESULT(no)
4428 [Define this if you have the 5-arg version of gethostbyname_r().])
4431 AC_MSG_RESULT(no)
4445 [Define this if you have the 3-arg version of gethostbyname_r().])
4448 AC_MSG_RESULT(no)
4462 # checks for system services
4465 # Linux requires this for correct f.p. operations
4471 # check for --with-libm=...
4475 *) LIBM=-lm
4477 AC_MSG_CHECKING(for --with-libm=STRING)
4479 …AS_HELP_STRING([--with-libm=STRING], [override libm math library to STRING (default is system-depe…
4481 if test "$withval" = no
4487 else AC_MSG_ERROR([proper usage is --with-libm=STRING])
4491 # check for --with-libc=...
4493 AC_MSG_CHECKING(for --with-libc=STRING)
4495 …AS_HELP_STRING([--with-libc=STRING], [override libc C library to STRING (default is system-depende…
4497 if test "$withval" = no
4503 else AC_MSG_ERROR([proper usage is --with-libc=STRING])
4508 # * Check for gcc x64 inline assembler *
4511 AC_MSG_CHECKING(for x64 gcc inline assembler)
4514 ]])],[have_gcc_asm_for_x64=yes],[have_gcc_asm_for_x64=no])
4523 # * Check for various properties of floating point *
4530 [Define if C doubles are 64-bit IEEE 754 binary format, stored
4532 elif test "$ax_cv_c_float_words_bigendian" = "no"
4535 [Define if C doubles are 64-bit IEEE 754 binary format, stored
4538 # Some ARM platforms use a mixed-endian representation for doubles.
4539 # While Python doesn't currently have full support for these platforms
4540 # (see e.g., issue 1762561), we can at least make sure that float <-> string
4545 [Define if C doubles are 64-bit IEEE 754 binary format, stored
4546 in ARM mixed-endian order (byte order 45670123)])
4550 # correctly-rounded string <-> double conversion functions from
4551 # Python/dtoa.c, which in turn require that the FPU uses 53-bit
4553 # rounding precision of 64 bits. For gcc/x86, we can fix this by
4556 # This inline assembler syntax may also work for suncc and icc,
4564 ]])],[have_gcc_asm_for_x87=yes],[have_gcc_asm_for_x87=no])
4577 ]])],[have_gcc_asm_for_mc68881=yes],[have_gcc_asm_for_mc68881=no])
4585 # Detect whether system arithmetic is subject to x87-style double
4588 # mode is round-to-nearest and double rounding issues are present, and
4589 # 0 otherwise. See http://bugs.python.org/issue2937 for more info.
4590 AC_MSG_CHECKING(for x87-style double rounding)
4599 /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
4600 x = 0.99999999999999989; /* 1-2**-53 */
4604 /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */
4614 [ac_cv_x87_double_rounding=no],
4616 [ac_cv_x87_double_rounding=no])
4622 [Define if arithmetic is subject to x87-style double rounding issue])
4626 # * Check for mathematical functions *
4636 # For multiprocessing module, check that sem_open
4637 # actually works. For FreeBSD versions <= 7.2,
4662 [ac_cv_posix_semaphores_enabled=no],
4666 if test $ac_cv_posix_semaphores_enabled = no
4672 # Multiprocessing check for broken sem_getvalue
4673 AC_MSG_CHECKING(for broken sem_getvalue)
4694 return res==-1 ? 1 : 0;
4697 [ac_cv_broken_sem_getvalue=no],
4710 # determine what size digit to use for Python's longs
4711 AC_MSG_CHECKING([digit size for Python's longs])
4712 AC_ARG_ENABLE(big-digits,
4713 AS_HELP_STRING([--enable-big-digits@<:@=15|30@:>@],[use big digits (30 or 15 bits) for Python longs…
4717 no)
4722 AC_MSG_ERROR([bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30]) ;;
4727 [AC_MSG_RESULT(no value specified)])
4729 # check for wchar.h
4735 wchar_h="no"
4744 AC_MSG_CHECKING(for UCS-4 tcl)
4745 have_ucs4_tcl=no
4767 return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
4771 [ac_cv_wchar_t_signed=no],
4778 if test "$ac_cv_sizeof_wchar_t" -ge 2 \
4779 -a "$ac_cv_wchar_t_signed" = "no"
4787 AC_MSG_RESULT(no)
4792 if test -f /etc/os-release; then
4793 OS_NAME=$(awk -F= '/^NAME=/ {print substr($2,2,length($2)-2)}' /etc/os-release)
4795 # bpo-43667: In Oracle Solaris, the internal form of wchar_t in
4796 # non-Unicode locales is not Unicode and hence cannot be used directly.
4799 [Define if the internal form of wchar_t in non-Unicode locales
4806 # check for endianness
4809 # ABI version string for Python extension modules. This appears between the
4814 # * The Python implementation (always 'cpython-' for us)
4816 # * --with-pydebug (adds a 'd')
4818 # Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
4819 # would get a shared library ABI version tag of 'cpython-32dmu' and shared
4820 # libraries would be named 'foo.cpython-32dmu.so'.
4822 # In Python 3.2 and older, --with-wide-unicode added a 'u' flag.
4823 # In Python 3.7 and older, --with-pymalloc added a 'm' flag.
4828 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
4832 if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then
4835 …ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${PLATFORM_TRIPLET:+-$PLATF…
4849 if test -n "$ANDROID_API_LEVEL" -o "$MACHDEP" = "cygwin"; then
4850 LIBPYTHON="-lpython${VERSION}${ABIFLAGS}"
4860 # Check for --with-platlibdir
4864 AC_MSG_CHECKING(for --with-platlibdir)
4866 AS_HELP_STRING([--with-platlibdir=DIRNAME],
4870 # --with-platlibdir
4871 # --with-platlibdir=
4872 # --without-platlibdir
4873 if test -n "$withval" -a "$withval" != yes -a "$withval" != no
4879 AC_MSG_RESULT(no)
4881 [AC_MSG_RESULT(no)])
4887 LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}"
4889 LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
4893 # Check for --with-wheel-pkg-dir=PATH
4896 AC_MSG_CHECKING(for --with-wheel-pkg-dir)
4897 AC_ARG_WITH(wheel-pkg-dir,
4898 AS_HELP_STRING([--with-wheel-pkg-dir=PATH],
4901 if test -n "$withval"; then
4905 AC_MSG_RESULT(no)
4907 [AC_MSG_RESULT(no)])
4916 return (((-1)>>3 == -1) ? 0 : 1);
4920 [ac_cv_rshift_extends_sign=no],
4923 if test "$ac_cv_rshift_extends_sign" = no
4926 [Define if i>>j for signed int i does not extend the sign bit
4930 # check for getc_unlocked and related locking functions
4931 AC_MSG_CHECKING(for getc_unlocked() and friends)
4938 ]])],[ac_cv_have_getc_unlocked=yes],[ac_cv_have_getc_unlocked=no])])
4947 [AS_HELP_STRING([--with(out)-readline@<:@=editline@:>@],
4948 [use Editline for backend or disable readline module])],
4953 py_cv_lib_readline=no
4957 if test "$with_readline" != no; then
4968 AC_MSG_ERROR([proper usage is --with(out)-readline@<:@=editline@:>@])
4976 for py_libtermcap in "" tinfo ncursesw ncurses curses termcap; do
4977 if test -z "$py_libtermcap"; then
4978 READLINE_LIBS="-l$LIBREADLINE"
4980 READLINE_LIBS="-l$LIBREADLINE -l$py_libtermcap"
4993 if test $py_cv_lib_readline = no; then
5003 # check for readline 2.2
5008 #include <stdio.h> /* Must be first for Gnu Readline */
5019 #include <stdio.h> /* Must be first for Gnu Readline */
5027 # check for readline 4.0
5042 # check for readline 4.2
5052 #include <stdio.h> /* Must be first for Gnu Readline */
5068 AC_MSG_CHECKING(for broken nice())
5076 if (val1 != -1 && val1 == nice(2))
5082 [ac_cv_broken_nice=no],
5083 [ac_cv_broken_nice=no])])
5091 AC_MSG_CHECKING(for broken poll())
5114 [ac_cv_broken_poll=no],
5115 [ac_cv_broken_poll=no]))
5124 AC_MSG_CHECKING(for working tzset())
5141 tm->tm_zone does not exist since it is the alternative way
5148 time_t groundhogday = 1044144000; /* GMT-based */
5153 if (localtime(&groundhogday)->tm_hour != 0)
5156 /* For UTC, tzname[1] is sometimes "", sometimes " " */
5164 if (localtime(&groundhogday)->tm_hour != 19)
5171 putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
5173 if (localtime(&groundhogday)->tm_hour != 11)
5181 if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
5183 if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
5191 [ac_cv_working_tzset=no],
5192 [ac_cv_working_tzset=no])])
5200 # Look for subsecond timestamps in struct stat
5201 AC_MSG_CHECKING(for tv_nsec in struct stat)
5208 [ac_cv_stat_tv_nsec=no]))
5216 # Look for BSD style subsecond timestamps in struct stat
5217 AC_MSG_CHECKING(for tv_nsec2 in struct stat)
5224 [ac_cv_stat_tv_nsec2=no]))
5234 if test "$cross_compiling" = no; then
5235 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
5255 [ac_cv_mvwdelch_is_expression=no]))
5275 w->_flags = 0;
5278 [ac_cv_window_has_flags=no]))
5288 AC_MSG_CHECKING(for is_pad)
5296 [AC_MSG_RESULT(no)]
5299 AC_MSG_CHECKING(for is_term_resized)
5303 [AC_MSG_RESULT(no)]
5306 AC_MSG_CHECKING(for resize_term)
5310 [AC_MSG_RESULT(no)]
5313 AC_MSG_CHECKING(for resizeterm)
5317 [AC_MSG_RESULT(no)]
5320 AC_MSG_CHECKING(for immedok)
5328 [AC_MSG_RESULT(no)]
5331 AC_MSG_CHECKING(for syncok)
5339 [AC_MSG_RESULT(no)]
5342 AC_MSG_CHECKING(for wchgat)
5350 [AC_MSG_RESULT(no)]
5353 AC_MSG_CHECKING(for filter)
5361 [AC_MSG_RESULT(no)]
5364 AC_MSG_CHECKING(for has_key)
5372 [AC_MSG_RESULT(no)]
5375 AC_MSG_CHECKING(for typeahead)
5383 [AC_MSG_RESULT(no)]
5386 AC_MSG_CHECKING(for use_env)
5394 [AC_MSG_RESULT(no)]
5399 AC_MSG_NOTICE([checking for device files])
5404 AC_MSG_CHECKING([for /dev/ptmx])
5406 AC_MSG_ERROR([set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling])
5409 AC_MSG_CHECKING([for /dev/ptc])
5411 AC_MSG_ERROR([set ac_cv_file__dev_ptc to yes/no in your CONFIG_SITE file when cross compiling])
5428 LIBS="$LIBS -framework CoreFoundation"
5431 AC_CACHE_CHECK([for %zd printf() format support], ac_cv_have_size_t_format, [dnl
5459 if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
5462 if (strcmp(buffer, "-123"))
5469 [ac_cv_have_size_t_format=no],
5470 [ac_cv_have_size_t_format="cross -- assuming yes"
5472 if test "$ac_cv_have_size_t_format" != no ; then
5474 [Define to printf format modifier for Py_ssize_t])
5488 AC_MSG_CHECKING(for broken mbstowcs)
5494 size_t len = -1;
5500 [ac_cv_broken_mbstowcs=no],
5502 [ac_cv_broken_mbstowcs=no]))
5511 # Check for --with-computed-gotos
5512 AC_MSG_CHECKING(for --with-computed-gotos)
5513 AC_ARG_WITH(computed-gotos,
5514 AS_HELP_STRING([--with-computed-gotos],
5523 if test "$withval" = no
5527 AC_MSG_RESULT(no)
5530 [AC_MSG_RESULT(no value specified)])
5547 [ac_cv_computed_gotos=no],
5549 ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos"
5551 ac_cv_computed_gotos=no
5567 for h in `(cd $srcdir;echo Python/thread_*.h)`
5574 AC_MSG_CHECKING(for build directories)
5575 for dir in $SRCDIRS; do
5576 if test ! -d $dir; then
5582 # Availability of -O2:
5583 AC_MSG_CHECKING(for -O2)
5585 CFLAGS="-O2"
5587 ]])],[have_O2=yes],[have_O2=no])
5591 # _FORTIFY_SOURCE wrappers for memmove and bcopy are incorrect:
5592 # http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
5593 AC_MSG_CHECKING(for glibc _FORTIFY_SOURCE/memmove bug)
5595 CFLAGS="-O2 -D_FORTIFY_SOURCE=2"
5596 if test "$have_O2" = no; then
5615 [have_glibc_memmove_bug=no],
5623 for memmove and bcopy.])
5629 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
5632 AC_MSG_CHECKING(for gcc ipa-pure-const bug)
5634 CFLAGS="-O2"
5652 [have_ipa_pure_const_bug=no],
5659 [Define if gcc has the ipa-pure-const bug.])
5665 # Check for stdatomic.h
5666 AC_MSG_CHECKING(for stdatomic.h)
5680 ],[have_stdatomic_h=yes],[have_stdatomic_h=no])
5689 # Check for GCC >= 4.7 and clang __atomic builtin functions
5690 AC_MSG_CHECKING(for builtin __atomic_load_n and __atomic_store_n functions)
5701 ],[have_builtin_atomic=yes],[have_builtin_atomic=no])
5710 AC_MSG_CHECKING(for ensurepip)
5712 [AS_HELP_STRING([--with-ensurepip@<:@=install|upgrade|no@:>@],
5719 [no],[ENSUREPIP=no],
5720 [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])])
5736 ],[have_dirent_d_type=yes],[have_dirent_d_type=no])
5745 AC_MSG_CHECKING(for the Linux getrandom() syscall)
5757 /* ignore the result, Python checks for ENOSYS and EAGAIN at runtime */
5762 ],[have_getrandom_syscall=yes],[have_getrandom_syscall=no])
5771 # the test was written for the Solaris function of <sys/random.h>
5772 AC_MSG_CHECKING(for the getrandom() function)
5782 /* ignore the result, Python checks for ENOSYS at runtime */
5787 ],[have_getrandom=yes],[have_getrandom=no])
5795 # checks for POSIX shared memory, used by Modules/_multiprocessing/posixshmem.c
5800 if test "$ac_cv_search_shm_open" = "-lrt"; then
5802 [Define to 1 if you must link with -lrt for shm_open().])
5805 # temporarily override ac_includes_default for AC_CHECK_FUNCS below
5819 # Check for usable OpenSSL
5820 AX_CHECK_OPENSSL([have_openssl=yes],[have_openssl=no])
5823 AC_MSG_CHECKING(for --with-openssl-rpath)
5824 AC_ARG_WITH(openssl-rpath,
5825 AS_HELP_STRING([--with-openssl-rpath=@<:@DIR|auto|no@:>@],
5826 [Set runtime library directory (rpath) for OpenSSL libraries,
5827 no (default): don't set rpath,
5828 auto: auto-detect rpath from --with-openssl and pkg-config,
5832 [with_openssl_rpath=no]
5836 [no],[OPENSSL_RPATH=],
5838 [test -d "$with_openssl_rpath"],
5840 AC_MSG_ERROR([--with-openssl-rpath "$with_openssl_rpath" is not a directory]))
5883 [AC_MSG_RESULT(no)])
5890 [Default cipher suites list for ssl module.
5893 [Cipher suite string for PY_SSL_DEFAULT_CIPHERS=0]
5896 AC_MSG_CHECKING(for --with-ssl-default-suites)
5897 AC_ARG_WITH(ssl-default-suites,
5898 AS_HELP_STRING([--with-ssl-default-suites=@<:@python|openssl|STRING@:>@],
5928 AC_MSG_CHECKING(for --with-builtin-hashlib-hashes)
5929 AC_ARG_WITH(builtin-hashlib-hashes,
5930 AS_HELP_STRING([--with-builtin-hashlib-hashes=md5,sha1,sha256,sha512,sha3,blake2],
5938 no)
5950 # --with-experimental-isolated-subinterpreters
5953 AC_MSG_CHECKING(for --with-experimental-isolated-subinterpreters)
5954 AC_ARG_WITH(experimental-isolated-subinterpreters,
5955 AS_HELP_STRING([--with-experimental-isolated-subinterpreters],
5956 [better isolate subinterpreters, experimental build mode (default is no)]),
5958 if test "$withval" != no
5963 AC_MSG_RESULT(no);
5965 [AC_MSG_RESULT(no)])
5967 # --with-static-libpython
5969 AC_MSG_CHECKING(for --with-static-libpython)
5970 AC_ARG_WITH(static-libpython,
5971 AS_HELP_STRING([--without-static-libpython],
5974 if test "$withval" = no
5976 AC_MSG_RESULT(no);
5996 AC_MSG_CHECKING(for --disable-test-modules)
5997 AC_ARG_ENABLE(test-modules,
5998 AS_HELP_STRING([--disable-test-modules], [don't build nor install test modules]))
5999 if test "$enable_test_modules" = no; then
6000 TEST_MODULES=no
6004 AC_MSG_RESULT(no)
6010 AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
6015 if test ! -f Modules/Setup.local
6017 echo "# Edit this file for local setup changes" >Modules/Setup.local
6021 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
6022 -s Modules \
6024 mv config.c Modules
6026 if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
6030 echo "please run ./configure --enable-optimizations" >&AS_MESSAGE_FD