Lines Matching +full:cxx +full:- +full:test +full:- +full:suite
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
47 if test $HAS_GIT = found
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
71 if test "$cross_compiling" = yes; then
73 if test -z "$PYTHON_FOR_BUILD"; then
76 …if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info@<:@:2@:>@) == '$P…
81 if test x$interp = x; then
85 …lddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt &&…
87 elif test "$cross_compiling" = maybe; then
88 AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
90 PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
99 if test "$prefix" != "/"; then
100 prefix=`echo "$prefix" | sed -e 's/\/$//g'`
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@:>@],
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}"
186 if test ! -d "${UNIVERSALSDK}"
188 AC_MSG_ERROR([--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}])
197 if test -n "${UNIVERSALSDK}"
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}"
243 AC_ARG_WITH(framework-name,
244 AS_HELP_STRING([--with-framework-name=FRAMEWORK],
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@:>@],
271 PYTHONFRAMEWORKDIR=no-framework
279 if test "x${prefix}" = "xNONE"; then
296 if test "x${prefix}" = "xNONE" ; then
306 if test "${prefix}" = "NONE" ; then
321 if test "${prefix}" = "NONE"; then
323 # --prefix option, but wants to install
324 # the framework in a non-default location,
348 PYTHONFRAMEWORKDIR=no-framework
356 if test "x${prefix}" = "xNONE" ; then
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"
389 if test "$cross_compiling" = yes; then
394 *-*-linux-android*)
395 ac_sys_system=Linux-android
397 *-*-linux*)
400 *-*-cygwin*)
403 *-*-vxworks*)
413 ac_sys_system=`uname -s`
414 if test "$ac_sys_system" = "AIX" \
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/\..*//'`
438 if test "$cross_compiling" = yes; then
440 *-*-linux*)
449 *-*-cygwin*)
452 *-*-vxworks*)
460 _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
495 NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
507 OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
522 Darwin/@<:@[12]@:>@@<:@0-9@:>@.*)
535 # On HP-UX, defining _XOPEN_SOURCE to 600 or greater hides
543 if test $define_xopen_source = yes
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
567 if test $define_stdc_a1 = yes
572 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
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
602 if test "$ac_sys_system" = "Darwin"
607 if test -z "${CC}"
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])
634 CXX="$found_clang++"
638 elif test -z "$found_gcc" -a -n "$found_clang"
642 CXX="$found_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++`"
663 AC_SUBST(CXX) subst
665 AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
667 AS_HELP_STRING([--with-cxx-main@<:@=COMPILER@:>@],
668 …pile main() and link Python executable with C++ compiler specified in COMPILER (default is $CXX)]),
675 MAINCC='$(CXX)';;
678 if test -z "$CXX"
680 CXX=$withval
688 preset_cxx="$CXX"
689 if test -z "$CXX"
692 gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
693 cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
694 clang|*/clang) AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ;;
695 icc|*/icc) AC_PATH_TOOL(CXX, [icpc], [icpc], [notfound]) ;;
697 if test "$CXX" = "notfound"
699 CXX=""
702 if test -z "$CXX"
704 AC_CHECK_TOOLS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
705 if test "$CXX" = "notfound"
707 CXX=""
710 if test "$preset_cxx" != "$CXX"
714 By default, distutils will build C++ extension modules with "$CXX".
715 If this is not intended, then set CXX on the configure command line.
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
868 PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
873 rm -f conftest.c conftest.out
879 [MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
884 if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
885 if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
888 elif test x$PLATFORM_TRIPLET != x && test x$MULTIARCH = x; then
893 if test x$MULTIARCH != x; then
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"
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
935 if test "$_arm_arch" = 7; then
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
953 AC_MSG_CHECKING(for --with-suffix)
955 … AS_HELP_STRING([--with-suffix=SUFFIX], [set executable suffix to SUFFIX (default is '.exe')]),
964 # Test whether we're running on a non-case-sensitive system, in which
967 AC_MSG_CHECKING(for case-insensitive build directory)
968 if test ! -d CaseSensitiveTestDir; then
972 if test -d casesensitivetestdir
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).
1030 # If CXX is set, and if it is needed to link a main function that was
1031 # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
1035 if test -z "$LINKCC"
1041 # support -N.
1064 # distutils.unixccompiler to know if it should add --enable-new-dtags
1070 if test "$GCC" = yes; then
1071 ac_prog=`$CC -print-prog-name=ld`
1073 case `"$ac_prog" -V 2>&1 < /dev/null` in
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"
1096 AC_MSG_CHECKING(for --enable-profiling)
1098 … AS_HELP_STRING([--enable-profiling], [enable C-level code profiling with gprof (default is no)]))
1099 if test "x$enable_profiling" = xyes; then
1101 CC="$CC -pg"
1111 if test "x$enable_profiling" = xyes; then
1112 BASECFLAGS="-pg $BASECFLAGS"
1113 LDFLAGS="-pg $LDFLAGS"
1120 # will find it with a -framework option). For this reason there is an
1124 if test "$enable_framework"
1134 if test $enable_shared = "yes"; then
1144 BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
1147 if test "$with_pydebug" != yes
1154 BLDLIBRARY='-L. -lpython$(LDVERSION)'
1157 if test "$with_pydebug" != yes
1163 case `uname -m` in
1171 BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
1176 BLDLIBRARY='-L. -lpython$(LDVERSION)'
1195 if test "$cross_compiling" = yes; then
1206 if test -z "$ARFLAGS"
1212 if test "$cross_compiling" = yes; then
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";;
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.])
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],
1272 if test "$with_trace_refs" = "yes"
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
1289 if test "$assertions" = 'true'; then
1291 elif test "$Py_DEBUG" = 'true'; then
1293 AC_MSG_RESULT(implied by --with-pydebug)
1302 AC_MSG_CHECKING(for --enable-optimizations)
1304 [--enable-optimizations],
1307 if test "$enableval" != no
1316 if test "$Py_OPT" = 'true' ; then
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"
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.
1354 if test "${CC}" = "clang"
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
1381 if test "$Py_LTO" = 'true' ; then
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.])
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"
1436 if test "$ac_cv_prog_cc_g" = "yes"
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}])
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
1485 if test "${REQUIRE_PGO}" = "yes"
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"
1501 if test "${REQUIRE_PGO}" = "yes"
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,
1568 CFLAGS_ALIASING="-fno-strict-aliasing"
1573 if test "$Py_DEBUG" = 'true' ; then
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"
1630 if test $ac_cv_extra_warnings = yes
1632 CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"
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"
1665 if test $ac_cv_no_strict_aliasing = yes
1667 BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
1679 CC="$CC -Wunused-result -Werror"
1696 if test $ac_cv_disable_unused_result_warning = yes
1698 BASECFLAGS="$BASECFLAGS -Wno-unused-result"
1699 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-result"
1704 CC="$CC -Wunused-parameter -Werror"
1717 if test $ac_cv_disable_unused_parameter_warning = yes
1719 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter"
1724 CC="$CC -Wmissing-field-initializers -Werror"
1737 if test $ac_cv_disable_missing_field_initializers = yes
1739 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers"
1744 CC="$CC -Wsign-compare"
1759 if test $ac_cv_enable_sign_compare_warning = yes
1761 BASECFLAGS="$BASECFLAGS -Wsign-compare"
1766 CC="$CC -Wunreachable-code"
1781 # results in non-standard code paths.
1787 if test $ac_cv_enable_unreachable_code_warning = yes && \
1788 test "$Py_DEBUG" != "true" && \
1789 test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`"
1791 BASECFLAGS="$BASECFLAGS -Wunreachable-code"
1797 AC_MSG_CHECKING(if we can turn on $CC strict-prototypes warning)
1799 CC="$CC -Werror -Wstrict-prototypes"
1812 if test $ac_cv_enable_strict_prototypes_warning = yes
1814 CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes"
1819 CC="$CC -Werror=implicit-function-declaration"
1832 if test $ac_cv_enable_implicit_function_declaration_error = yes
1834 CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"
1839 CC="$CC -fvisibility=hidden"
1852 if test $ac_cv_enable_visibility = yes
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.
1874 if test "${CC}" = gcc
1882 CC=gcc-4.0
1883 CPP=cpp-4.0
1890 if test "${enable_universalsdk}"
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])
1939 if test "${UNIVERSALSDK}" != "/"
1941 CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
1942 LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
1943 CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
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
1975 if test ${enable_universalsdk}
1978 all|3-way|intel|64-bit)
1984 if test `/usr/bin/arch` = "i386"
1991 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
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"
2036 if test "$assertions" = 'true'; then
2039 OPT="-DNDEBUG $OPT"
2042 if test "$ac_arch_flags"
2051 # options before we can check whether -Kpthread improves anything.
2076 if test $ac_cv_pthread_is_default = yes
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"
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"
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"
2166 # check if it works for CXX, too.
2168 if test ! -z "$CXX"
2170 AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
2171 ac_save_cxx="$CXX"
2173 if test "$ac_cv_kpthread" = "yes"
2175 CXX="$CXX -Kpthread"
2177 elif test "$ac_cv_kthread" = "yes"
2179 CXX="$CXX -Kthread"
2181 elif test "$ac_cv_pthread" = "yes"
2183 CXX="$CXX -pthread"
2187 if test $ac_cv_cxx_thread = yes
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
2198 rm -fr conftest*
2202 CXX="$ac_save_cxx"
2207 dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
2233 # bluetooth/bluetooth.h has been known to not compile with -std=c99.
2236 CFLAGS="-std=c99 $CFLAGS"
2310 if test "$ac_cv_has_makedev" = "yes"; then
2326 if test "$ac_cv_has_le64toh" = "yes"; then
2336 if test "$use_lfs" = "yes"; then
2351 # Add some code to confdefs.h so that the test for off_t works on SCO
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
2422 if test "$ac_cv_kpthread" = "yes"
2423 then CC="$CC -Kpthread"
2424 elif test "$ac_cv_kthread" = "yes"
2425 then CC="$CC -Kthread"
2426 elif test "$ac_cv_pthread" = "yes"
2427 then CC="$CC -pthread"
2436 if test "$have_pthread_t" = yes ; then
2448 if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then
2455 if test "$ac_pthread_key_t_is_arithmetic_type" = yes ; then
2467 OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
2478 LIBTOOL_CRUFT="-framework System -lcc_dynamic"
2479 if test "${enable_universalsdk}"; then
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`
2488 if test ${gcc_version} '<' 4.0
2490 LIBTOOL_CRUFT="-lcc_dynamic"
2506 if test "${ac_osx_32bit}" = "yes"; then
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)
2541 if test "$enable_framework"
2543 BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
2544 # -F. is needed to allow linking to the framework while
2550 if test $enable_shared = "yes"
2552 …AC_MSG_ERROR([Specifying both --enable-shared and --enable-framework is not supported, use only --…
2562 [Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
2563 dynamic linker (dyld) instead of the old-style (NextStep) dynamic
2572 AC_MSG_CHECKING(for --with-address-sanitizer)
2574 AS_HELP_STRING([--with-address-sanitizer],
2578 BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
2579 LDFLAGS="-fsanitize=address $LDFLAGS"
2585 AC_MSG_CHECKING(for --with-memory-sanitizer)
2587 AS_HELP_STRING([--with-memory-sanitizer],
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"
2600 AC_MSG_CHECKING(for --with-undefined-behavior-sanitizer)
2602 AS_HELP_STRING([--with-undefined-behavior-sanitizer],
2606 BASECFLAGS="-fsanitize=undefined $BASECFLAGS"
2607 LDFLAGS="-fsanitize=undefined $LDFLAGS"
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"
2653 if test "$GCC" = "yes" ; then
2654 LDSHARED='$(CC) -shared'
2655 LDCXXSHARED='$(CXX) -shared'
2657 LDSHARED='$(CC) -G'
2658 LDCXXSHARED='$(CXX) -G'
2661 if test "$GCC" = "yes" ; then
2662 LDSHARED='$(CC) -shared'
2663 LDCXXSHARED='$(CXX) -shared'
2665 LDSHARED='$(CC) -b'
2666 LDCXXSHARED='$(CXX) -b'
2669 LDSHARED='$(CC) -bundle'
2670 LDCXXSHARED='$(CXX) -bundle'
2671 if test "$enable_framework" ; then
2678 LDSHARED="$LDSHARED -undefined suppress"
2679 LDCXXSHARED="$LDCXXSHARED -undefined suppress"
2682 LDSHARED='$(CC) -bundle'
2683 LDCXXSHARED='$(CXX) -bundle'
2684 if test "$enable_framework" ; then
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
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';;
2746 if test "$GCC" = "yes" ; then
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"
2771 SunOS*) if test "$GCC" = yes;
2772 then CCSHARED="-fPIC";
2773 elif test `uname -p` = sparc;
2774 then CCSHARED="-xcode=pic32";
2775 else CCSHARED="-Kpic";
2777 hp*|HP*) if test "$GCC" = yes;
2778 then CCSHARED="-fPIC";
2781 Linux-android*) ;;
2782 Linux*|GNU*) CCSHARED="-fPIC";;
2783 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
2785 if test "$GCC" = "yes"
2786 then CCSHARED="-fPIC"
2787 else CCSHARED="-KPIC"
2790 if test "$GCC" = "yes"
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"
2819 if test "$with_ubsan" = "yes"
2825 LINKFORSHARED="-Wl,-stack_size,$stack_size $LINKFORSHARED"
2831 if test "$enable_framework"
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';;
2872 if test ! "$LIBRARY" = "$LDLIBRARY"
2885 # SHLIBS are libraries (except -lc and -lm) to link to the python shared
2886 # library (with --enable-shared).
2905 AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
2921 # check for libuuid from util-linux
2939 # Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
2940 # stream in big-endian byte-order
2961 LIBS="-lintl $LIBS"])
2977 dnl The AIX_BUILDDATE is obtained from the kernel fileset - bos.mp64
2982 AIX_BUILDDATE=$(lslpp -Lcq bos.mp64 | awk -F: '{ print $NF }')
3011 if test "$ac_cv_aligned_required" = yes ; then
3021 AC_MSG_CHECKING(for --with-hash-algorithm)
3024 AS_HELP_STRING([--with-hash-algorithm=@<:@fnv|siphash24@:>@],
3044 if test -z "$1"; then
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>]
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)]),
3094 AC_MSG_CHECKING(for --with-system-expat)
3096 …AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library, see …
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/…
3107 if test "$ac_sys_system" = "Darwin"
3116 AC_MSG_ERROR([--with-system-ffi accepts no arguments])
3122 if test "$with_system_ffi" != ""
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/ *$//'`"
3137 AC_MSG_CHECKING(for --with-system-libmpdec)
3139 …AS_HELP_STRING([--with-system-libmpdec], [build _decimal module using an installed libmpdec librar…
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…
3161 AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions)
3162 AC_ARG_ENABLE(loadable-sqlite-extensions,
3163 AS_HELP_STRING([--enable-loadable-sqlite-extensions],
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]),
3185 if test "x$with_tcltk_includes" = xdefault || test "x$with_tcltk_libs" = xdefault
3187 if test "x$with_tcltk_includes" != "x$with_tcltk_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…
3208 if test x$with_dbmliborder = xyes
3210 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...])
3213 if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb
3215 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...])
3224 [Define to force use of thread-safe errno, h_errno, and other functions])
3226 if test "$ac_cv_pthread_is_default" = yes
3231 if test "$ac_sys_system" = "SunOS"; then
3232 CFLAGS="$CFLAGS -D_REENTRANT"
3234 elif test "$ac_cv_kpthread" = "yes"
3236 CC="$CC -Kpthread"
3237 if test "$ac_cv_cxx_thread" = "yes"; then
3238 CXX="$CXX -Kpthread"
3241 elif test "$ac_cv_kthread" = "yes"
3243 CC="$CC -Kthread"
3244 if test "$ac_cv_cxx_thread" = "yes"; then
3245 CXX="$CXX -Kthread"
3248 elif test "$ac_cv_pthread" = "yes"
3250 CC="$CC -pthread"
3251 if test "$ac_cv_cxx_thread" = "yes"; then
3252 CXX="$CXX -pthread"
3256 if test ! -z "$withval" -a -d "$withval"
3257 then LDFLAGS="$LDFLAGS -L$withval"
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"
3319 if test "$posix_threads" = "yes"; then
3320 if test "$unistd_defines_pthreads" = "no"; then
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);
3360 if test "$ac_cv_pthread_system_supported" = "yes"; then
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],
3404 if test "$ipv6" = "yes"; then
3420 if test "$ipv6" = "yes"; then
3429 if test "$ipv6" = "yes"; then
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"])
3514 if test "$ipv6type" != "unknown"; then
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"
3526 if test $ipv6trylibc = "yes"; then
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])
3606 AC_MSG_CHECKING([for --with-valgrind])
3608 AS_HELP_STRING([--with-valgrind], [enable Valgrind support (default is no)]),,
3611 if test "$with_valgrind" != no; then
3616 OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
3620 AC_MSG_CHECKING(for --with-dtrace)
3622 AS_HELP_STRING([--with-dtrace],[enable DTrace support (default is no)]),,
3634 if test "$with_dtrace" = "yes"
3637 if test "$DTRACE" = "not found"; then
3645 # generation flag '-G'. We check for presence of this flag, rather than
3651 "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
3654 if test "$ac_cv_dtrace_link" = "yes"; then
3659 # -I${DLINCLDIR} is added to the compile rule for importdl.o
3671 if test -z "$DYNLOADFILE"
3678 if test "$ac_cv_func_dlopen" = yes
3686 if test "$DYNLOADFILE" != "dynload_stub.o"
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
3738 if test "$MACHDEP" != linux; then
3817 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach-o/dyld.h>]], [[void *x=_dyld_shared_cache_conta…
3873 if test "x${ac_cv_flock_decl}" = xyes; then
3903 dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
3926 if test "$ac_cv_have_chflags" = cross ; then
3929 if test "$ac_cv_have_chflags" = yes ; then
3945 if test "$ac_cv_have_lchflags" = cross ; then
3948 if test "$ac_cv_have_lchflags" = yes ; then
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"
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"])
4058 # This gets us our -lcrypt in LIBS when required on the target platform.
4076 LIBS="$LIBS -lrt"
4126 if test $have_getaddrinfo = yes
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) {
4223 if test "${enable_ipv6+set}" = set; then
4224 ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6"
4232 if test $have_getaddrinfo = no || test "$ac_cv_buggy_getaddrinfo" = yes
4234 if test $ipv6 = yes
4237 echo ' or you can specify "--disable-ipv6"'.
4270 if test $ac_cv_header_time_altzone = yes; then
4294 if test $ac_cv_struct_addrinfo = yes; then
4306 if test $ac_cv_struct_sockaddr_storage = yes; then
4319 if test $ac_cv_struct_sockaddr_alg = yes; then
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().])
4428 [Define this if you have the 5-arg version of gethostbyname_r().])
4445 [Define this if you have the 3-arg version of gethostbyname_r().])
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
4484 elif test "$withval" != yes
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
4500 elif test "$withval" != yes
4503 else AC_MSG_ERROR([proper usage is --with-libc=STRING])
4516 if test "$have_gcc_asm_for_x64" = yes
4527 if test "$ax_cv_c_float_words_bigendian" = "yes"
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.
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
4566 if test "$have_gcc_asm_for_x87" = yes
4579 if test "$have_gcc_asm_for_mc68881" = yes
4585 # Detect whether system arithmetic is subject to x87-style double
4586 # rounding issues. The result of this test has little meaning on non
4587 # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding
4588 # mode is round-to-nearest and double rounding issues are present, and
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) */
4619 if test "$ac_cv_x87_double_rounding" = yes
4622 [Define if arithmetic is subject to x87-style double rounding issue])
4666 if test $ac_cv_posix_semaphores_enabled = no
4694 return res==-1 ? 1 : 0;
4702 if test $ac_cv_broken_sem_getvalue = yes
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…
4722 AC_MSG_ERROR([bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30]) ;;
4739 if test "$wchar_h" = yes
4744 AC_MSG_CHECKING(for UCS-4 tcl)
4757 if test "$wchar_h" = yes
4767 return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
4778 if test "$ac_cv_sizeof_wchar_t" -ge 2 \
4779 -a "$ac_cv_wchar_t_signed" = "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)
4794 if test "x$OS_NAME" = "xOracle Solaris"; then
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
4814 # * The Python implementation (always 'cpython-' for us)
4816 # * --with-pydebug (adds a 'd')
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
4886 if test x$PLATFORM_TRIPLET = x; then
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
4916 return (((-1)>>3 == -1) ? 0 : 1);
4923 if test "$ac_cv_rshift_extends_sign" = no
4940 if test "$ac_cv_have_getc_unlocked" = yes
4947 [AS_HELP_STRING([--with(out)-readline@<:@=editline@:>@],
4957 if test "$with_readline" != no; then
4968 AC_MSG_ERROR([proper usage is --with(out)-readline@<:@=editline@:>@])
4977 if test -z "$py_libtermcap"; then
4978 READLINE_LIBS="-l$LIBREADLINE"
4980 READLINE_LIBS="-l$LIBREADLINE -l$py_libtermcap"
4986 if test $py_cv_lib_readline = yes; then
4993 if test $py_cv_lib_readline = no; then
5002 if test "$py_cv_lib_readline" = yes; then
5076 if (val1 != -1 && val1 == nice(2))
5085 if test "$ac_cv_broken_nice" = yes
5117 if test "$ac_cv_broken_poll" = yes
5139 in the library reference and as expected by the test suite.
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)
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"))
5194 if test "$ac_cv_working_tzset" = yes
5210 if test "$ac_cv_stat_tv_nsec" = yes
5226 if test "$ac_cv_stat_tv_nsec2" = yes
5234 if test "$cross_compiling" = no; then
5235 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
5258 if test "$ac_cv_mvwdelch_is_expression" = yes
5275 w->_flags = 0;
5282 if test "$ac_cv_window_has_flags" = yes
5402 if test "x$cross_compiling" = xyes; then
5403 if test "${ac_cv_file__dev_ptmx+set}" != set; then
5408 if test "${ac_cv_file__dev_ptc+set}" != set; then
5416 if test "x$ac_cv_file__dev_ptmx" = xyes; then
5421 if test "x$ac_cv_file__dev_ptc" = xyes; then
5426 if test $ac_sys_system = Darwin
5428 LIBS="$LIBS -framework CoreFoundation"
5459 if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
5462 if (strcmp(buffer, "-123"))
5470 [ac_cv_have_size_t_format="cross -- assuming yes"
5472 if test "$ac_cv_have_size_t_format" != no ; then
5494 size_t len = -1;
5504 if test "$ac_cv_broken_mbstowcs" = yes
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],
5517 if test "$withval" = yes
5523 if test "$withval" = no
5548 [if test "${with_computed_gotos+set}" = set; then
5549 ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos"
5576 if test ! -d $dir; then
5582 # Availability of -O2:
5583 AC_MSG_CHECKING(for -O2)
5585 CFLAGS="-O2"
5592 # http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
5595 CFLAGS="-O2 -D_FORTIFY_SOURCE=2"
5596 if test "$have_O2" = no; then
5620 if test "$have_glibc_memmove_bug" = yes; then
5626 if test "$have_gcc_asm_for_x87" = yes; then
5629 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
5632 AC_MSG_CHECKING(for gcc ipa-pure-const bug)
5634 CFLAGS="-O2"
5657 if test "$have_ipa_pure_const_bug" = yes; then
5659 [Define if gcc has the ipa-pure-const bug.])
5684 if test "$have_stdatomic_h" = yes; then
5705 if test "$have_builtin_atomic" = yes; then
5712 [AS_HELP_STRING([--with-ensurepip@<:@=install|upgrade|no@:>@],
5720 [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])])
5739 if test "$have_dirent_d_type" = yes; then
5765 if test "$have_getrandom_syscall" = yes; then
5771 # the test was written for the Solaris function of <sys/random.h>
5790 if test "$have_getrandom" = yes; then
5800 if test "$ac_cv_search_shm_open" = "-lrt"; then
5802 [Define to 1 if you must link with -lrt for shm_open().])
5823 AC_MSG_CHECKING(for --with-openssl-rpath)
5824 AC_ARG_WITH(openssl-rpath,
5825 AS_HELP_STRING([--with-openssl-rpath=@<:@DIR|auto|no@:>@],
5828 auto: auto-detect rpath from --with-openssl and pkg-config,
5838 [test -d "$with_openssl_rpath"],
5840 AC_MSG_ERROR([--with-openssl-rpath "$with_openssl_rpath" is not a directory]))
5888 # ssl module default cipher suite string
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],
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],
5958 if test "$withval" != 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
5983 if test "$PY_ENABLE_SHARED" = 1 || test "$enable_framework" ; then
5985 if test "$STATIC_LIBPYTHON" = 1; then
5994 # Check whether to disable test modules. Once set, setup.py will not build
5995 # test extension modules and "make install" will not install test suites.
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
6010 AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh)
6015 if test ! -f Modules/Setup.local
6021 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
6022 -s Modules \
6026 if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
6030 echo "please run ./configure --enable-optimizations" >&AS_MESSAGE_FD