Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Delta Between Two Patch Sets: configure.ac

Issue 27659: Check for the existence of crypt()
Left Patch Set: Created 3 years, 6 months ago
Right Patch Set: Created 3 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 dnl *********************************************** 1 dnl ***********************************************
2 dnl * Please run autoreconf to test your changes! * 2 dnl * Please run autoreconf to test your changes! *
3 dnl *********************************************** 3 dnl ***********************************************
4 4
5 # Set VERSION so we only need to edit in one place (i.e., here) 5 # Set VERSION so we only need to edit in one place (i.e., here)
6 m4_define(PYTHON_VERSION, 3.6) 6 m4_define(PYTHON_VERSION, 3.7)
7 7
8 AC_PREREQ(2.65) 8 AC_PREREQ(2.65)
9 9
10 AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/) 10 AC_INIT(python, PYTHON_VERSION, https://bugs.python.org/)
11 11
12 AC_SUBST(BASECPPFLAGS) 12 AC_SUBST(BASECPPFLAGS)
13 if test "$abs_srcdir" != "$abs_builddir"; then 13 if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then
14 # If we're building out-of-tree, we need to make sure the following 14 # If we're building out-of-tree, we need to make sure the following
15 # resources get picked up before their $srcdir counterparts. 15 # resources get picked up before their $srcdir counterparts.
16 # Objects/ -> typeslots.inc 16 # Objects/ -> typeslots.inc
17 # Include/ -> Python-ast.h, graminit.h 17 # Include/ -> Python-ast.h, graminit.h
18 # Python/ -> importlib.h 18 # Python/ -> importlib.h
19 # (A side effect of this is that these resources will automatically be 19 # (A side effect of this is that these resources will automatically be
20 # regenerated when building out-of-tree, regardless of whether or not 20 # regenerated when building out-of-tree, regardless of whether or not
21 # the $srcdir counterpart is up-to-date. This is an acceptable trade 21 # the $srcdir counterpart is up-to-date. This is an acceptable trade
22 # off.) 22 # off.)
23 BASECPPFLAGS="-IObjects -IInclude -IPython" 23 BASECPPFLAGS="-IObjects -IInclude -IPython"
(...skipping 18 matching lines...) Expand all
42 HGBRANCH="hg id -b \$(srcdir)" 42 HGBRANCH="hg id -b \$(srcdir)"
43 else 43 else
44 HGVERSION="" 44 HGVERSION=""
45 HGTAG="" 45 HGTAG=""
46 HGBRANCH="" 46 HGBRANCH=""
47 fi 47 fi
48 48
49 AC_CONFIG_SRCDIR([Include/object.h]) 49 AC_CONFIG_SRCDIR([Include/object.h])
50 AC_CONFIG_HEADER(pyconfig.h) 50 AC_CONFIG_HEADER(pyconfig.h)
51 51
52 AC_SUBST(cross_compiling)
53 AC_CANONICAL_HOST 52 AC_CANONICAL_HOST
54 AC_SUBST(build) 53 AC_SUBST(build)
55 AC_SUBST(host) 54 AC_SUBST(host)
56 55
57 # pybuilddir.txt will be created by --generate-posix-vars in the Makefile 56 # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
58 rm -f pybuilddir.txt 57 rm -f pybuilddir.txt
59 58
60 AC_CHECK_PROGS(PYTHON_FOR_GEN, python$PACKAGE_VERSION python3 python, not-found) 59 AC_CHECK_PROGS(PYTHON_FOR_GEN, python$PACKAGE_VERSION python3 python, not-found)
61 if test "$PYTHON_FOR_GEN" = not-found; then 60 if test "$PYTHON_FOR_GEN" = not-found; then
62 PYTHON_FOR_GEN='@echo "Cannot generate $@, python not found !" && \ 61 PYTHON_FOR_GEN='@echo "Cannot generate $@, python not found !" && \
63 echo "To skip re-generation of $@ run <make touch> or <make -t $@>." && \ 62 echo "To skip re-generation of $@ run <make touch> or <make -t $@>." && \
64 echo "Otherwise, set python in PATH and run configure or run <make PYTHON_FO R_GEN=python>." && false &&' 63 echo "Otherwise, set python in PATH and run configure or run <make PYTHON_FO R_GEN=python>." && false &&'
65 fi 64 fi
66 AC_SUBST(PYTHON_FOR_GEN) 65 AC_SUBST(PYTHON_FOR_GEN)
67 66
68 if test "$cross_compiling" = yes; then 67 if test "$cross_compiling" = yes; then
69 AC_MSG_CHECKING([for python interpreter for cross build]) 68 AC_MSG_CHECKING([for python interpreter for cross build])
70 if test -z "$PYTHON_FOR_BUILD"; then 69 if test -z "$PYTHON_FOR_BUILD"; then
71 for interp in python$PACKAGE_VERSION python3 python; do 70 for interp in python$PACKAGE_VERSION python3 python; do
72 which $interp >/dev/null 2>&1 || continue 71 which $interp >/dev/null 2>&1 || continue
73 if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys. version_info@<:@:2@:>@) == '$PACKAGE_VERSION')"; then 72 if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys. version_info@<:@:2@:>@) == '$PACKAGE_VERSION')"; then
74 break 73 break
75 fi 74 fi
76 interp= 75 interp=
77 done 76 done
78 if test x$interp = x; then 77 if test x$interp = x; then
79 AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) 78 AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
80 fi 79 fi
81 AC_MSG_RESULT($interp) 80 AC_MSG_RESULT($interp)
82 » PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLAT FORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$i nterp 81 » PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLAT FORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_ sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp
83 fi 82 fi
84 PGEN_DEPENDENCY='' 83 # Used to comment out stuff for rebuilding generated files
84 GENERATED_COMMENT='#'
85 elif test "$cross_compiling" = maybe; then 85 elif test "$cross_compiling" = maybe; then
86 AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) 86 AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
87 else 87 else
88 PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E' 88 PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
89 PGEN_DEPENDENCY='$(PGEN)' 89 GENERATED_COMMENT=''
90 fi 90 fi
91 AC_SUBST(PYTHON_FOR_BUILD) 91 AC_SUBST(PYTHON_FOR_BUILD)
92 AC_SUBST(PGEN_DEPENDENCY) 92 AC_SUBST(GENERATED_COMMENT)
93 93
94 dnl Ensure that if prefix is specified, it does not end in a slash. If 94 dnl Ensure that if prefix is specified, it does not end in a slash. If
95 dnl it does, we get path names containing '//' which is both ugly and 95 dnl it does, we get path names containing '//' which is both ugly and
96 dnl can cause trouble. 96 dnl can cause trouble.
97 97
98 dnl Last slash shouldn't be stripped if prefix=/ 98 dnl Last slash shouldn't be stripped if prefix=/
99 if test "$prefix" != "/"; then 99 if test "$prefix" != "/"; then
100 prefix=`echo "$prefix" | sed -e 's/\/$//g'` 100 prefix=`echo "$prefix" | sed -e 's/\/$//g'`
101 fi 101 fi
102 102
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 AC_ARG_VAR([MACHDEP], [name for machine-dependent library files]) 372 AC_ARG_VAR([MACHDEP], [name for machine-dependent library files])
373 AC_MSG_CHECKING(MACHDEP) 373 AC_MSG_CHECKING(MACHDEP)
374 if test -z "$MACHDEP" 374 if test -z "$MACHDEP"
375 then 375 then
376 # avoid using uname for cross builds 376 # avoid using uname for cross builds
377 if test "$cross_compiling" = yes; then 377 if test "$cross_compiling" = yes; then
378 # ac_sys_system and ac_sys_release are used for setting 378 # ac_sys_system and ac_sys_release are used for setting
379 # a lot of different things including 'define_xopen_source' 379 # a lot of different things including 'define_xopen_source'
380 # in the case statement below. 380 # in the case statement below.
381 case "$host" in 381 case "$host" in
382 *-*-linux-android*)
383 ac_sys_system=Linux-android
384 ;;
382 *-*-linux*) 385 *-*-linux*)
383 ac_sys_system=Linux 386 ac_sys_system=Linux
384 ;; 387 ;;
385 *-*-cygwin*) 388 *-*-cygwin*)
386 ac_sys_system=Cygwin 389 ac_sys_system=Cygwin
387 ;; 390 ;;
388 *) 391 *)
389 # for now, limit cross builds to known configurations 392 # for now, limit cross builds to known configurations
390 MACHDEP="unknown" 393 MACHDEP="unknown"
391 AC_MSG_ERROR([cross build not supported for $host]) 394 AC_MSG_ERROR([cross build not supported for $host])
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 CXX="`/usr/bin/xcrun -find clang++`" 690 CXX="`/usr/bin/xcrun -find clang++`"
688 691
689 # else: use default behaviour 692 # else: use default behaviour
690 fi 693 fi
691 fi 694 fi
692 fi 695 fi
693 fi 696 fi
694 AC_PROG_CC 697 AC_PROG_CC
695 AC_PROG_CPP 698 AC_PROG_CPP
696 AC_PROG_GREP 699 AC_PROG_GREP
700 AC_PROG_SED
697 701
698 AC_SUBST(CXX) 702 AC_SUBST(CXX)
699 AC_SUBST(MAINCC) 703 AC_SUBST(MAINCC)
700 AC_MSG_CHECKING(for --with-cxx-main=<compiler>) 704 AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
701 AC_ARG_WITH(cxx_main, 705 AC_ARG_WITH(cxx_main,
702 AS_HELP_STRING([--with-cxx-main=<compiler>], 706 AS_HELP_STRING([--with-cxx-main=<compiler>],
703 [compile main() and link python executable with C++ c ompiler]), 707 [compile main() and link python executable with C++ c ompiler]),
704 [ 708 [
705 709
706 case $withval in 710 case $withval in
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 #undef cris 765 #undef cris
762 #undef fr30 766 #undef fr30
763 #undef linux 767 #undef linux
764 #undef hppa 768 #undef hppa
765 #undef hpux 769 #undef hpux
766 #undef i386 770 #undef i386
767 #undef mips 771 #undef mips
768 #undef powerpc 772 #undef powerpc
769 #undef sparc 773 #undef sparc
770 #undef unix 774 #undef unix
771 #if defined(__linux__) 775 #if defined(__ANDROID__)
776 # Android is not a multiarch system.
777 #elif defined(__linux__)
772 # if defined(__x86_64__) && defined(__LP64__) 778 # if defined(__x86_64__) && defined(__LP64__)
773 x86_64-linux-gnu 779 x86_64-linux-gnu
774 # elif defined(__x86_64__) && defined(__ILP32__) 780 # elif defined(__x86_64__) && defined(__ILP32__)
775 x86_64-linux-gnux32 781 x86_64-linux-gnux32
776 # elif defined(__i386__) 782 # elif defined(__i386__)
777 i386-linux-gnu 783 i386-linux-gnu
778 # elif defined(__aarch64__) && defined(__AARCH64EL__) 784 # elif defined(__aarch64__) && defined(__AARCH64EL__)
779 # if defined(__ILP32__) 785 # if defined(__ILP32__)
780 aarch64_ilp32-linux-gnu 786 aarch64_ilp32-linux-gnu
781 # else 787 # else
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 AC_MSG_RESULT([$PLATFORM_TRIPLET]) 881 AC_MSG_RESULT([$PLATFORM_TRIPLET])
876 else 882 else
877 AC_MSG_RESULT([none]) 883 AC_MSG_RESULT([none])
878 fi 884 fi
879 rm -f conftest.c conftest.out 885 rm -f conftest.c conftest.out
880 886
881 if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then 887 if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
882 if test x$PLATFORM_TRIPLET != x$MULTIARCH; then 888 if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
883 AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report]) 889 AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
884 fi 890 fi
885 fi 891 elif test x$PLATFORM_TRIPLET != x && test x$MULTIARCH = x; then
886 if test x$PLATFORM_TRIPLET = x; then 892 MULTIARCH=$PLATFORM_TRIPLET
887 PLATDIR=plat-$MACHDEP 893 fi
888 else
889 PLATDIR=plat-$PLATFORM_TRIPLET
890 fi
891 AC_SUBST(PLATDIR)
892 AC_SUBST(PLATFORM_TRIPLET) 894 AC_SUBST(PLATFORM_TRIPLET)
893 if test x$MULTIARCH != x; then 895 if test x$MULTIARCH != x; then
894 MULTIARCH_CPPFLAGS="-DMULTIARCH=\\\"$MULTIARCH\\\"" 896 MULTIARCH_CPPFLAGS="-DMULTIARCH=\\\"$MULTIARCH\\\""
895 fi 897 fi
896 AC_SUBST(MULTIARCH_CPPFLAGS) 898 AC_SUBST(MULTIARCH_CPPFLAGS)
897 899
898 AC_MSG_CHECKING([for -Wl,--no-as-needed]) 900 AC_MSG_CHECKING([for -Wl,--no-as-needed])
899 save_LDFLAGS="$LDFLAGS" 901 save_LDFLAGS="$LDFLAGS"
900 LDFLAGS="$LDFLAGS -Wl,--no-as-needed" 902 LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
901 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], 903 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
902 [NO_AS_NEEDED="-Wl,--no-as-needed" 904 [NO_AS_NEEDED="-Wl,--no-as-needed"
903 AC_MSG_RESULT([yes])], 905 AC_MSG_RESULT([yes])],
904 [NO_AS_NEEDED="" 906 [NO_AS_NEEDED=""
905 AC_MSG_RESULT([no])]) 907 AC_MSG_RESULT([no])])
906 LDFLAGS="$save_LDFLAGS" 908 LDFLAGS="$save_LDFLAGS"
907 AC_SUBST(NO_AS_NEEDED) 909 AC_SUBST(NO_AS_NEEDED)
908 910
909 911
910 # checks for UNIX variants that set C preprocessor variables 912 # checks for UNIX variants that set C preprocessor variables
911 AC_USE_SYSTEM_EXTENSIONS 913 AC_USE_SYSTEM_EXTENSIONS
912 914
913 AC_MSG_CHECKING([for the Android API level]) 915 AC_MSG_CHECKING([for the Android API level])
914 cat >> conftest.c <<EOF 916 cat >> conftest.c <<EOF
915 #ifdef __ANDROID__ 917 #ifdef __ANDROID__
916 #include <android/api-level.h> 918 #include <android/api-level.h>
917 __ANDROID_API__ 919 android_api = __ANDROID_API__
920 arm_arch = __ARM_ARCH
918 #else 921 #else
919 #error not Android 922 #error not Android
920 #endif 923 #endif
921 EOF 924 EOF
922 925
923 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then 926 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
924 ANDROID_API_LEVEL=`grep -v '^#' conftest.out | grep -v '^ *$'` 927 ANDROID_API_LEVEL=`sed -n -e '/__ANDROID_API__/d' -e 's/^android_api = //p' co nftest.out`
928 _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out`
925 AC_MSG_RESULT([$ANDROID_API_LEVEL]) 929 AC_MSG_RESULT([$ANDROID_API_LEVEL])
926 AC_DEFINE_UNQUOTED(ANDROID_API_LEVEL, $ANDROID_API_LEVEL, [The Android API lev el.]) 930 AC_DEFINE_UNQUOTED(ANDROID_API_LEVEL, $ANDROID_API_LEVEL, [The Android API lev el.])
931
932 AC_MSG_CHECKING([for the Android arm ABI])
933 AC_MSG_RESULT([$_arm_arch])
934 if test "$_arm_arch" = 7; then
935 BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16"
936 LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8"
937 fi
927 else 938 else
928 AC_MSG_RESULT([not Android]) 939 AC_MSG_RESULT([not Android])
929 fi 940 fi
930 rm -f conftest.c conftest.out 941 rm -f conftest.c conftest.out
931 942
932 # Check for unsupported systems 943 # Check for unsupported systems
933 case $ac_sys_system/$ac_sys_release in 944 case $ac_sys_system/$ac_sys_release in
934 atheos*|Linux*/1*) 945 atheos*|Linux*/1*)
935 echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. 946 echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
936 echo See README for details. 947 echo See README for details.
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 then 1260 then
1250 AC_DEFINE(Py_DEBUG, 1, 1261 AC_DEFINE(Py_DEBUG, 1,
1251 [Define if you want to build an interpreter with many run-time checks.]) 1262 [Define if you want to build an interpreter with many run-time checks.])
1252 AC_MSG_RESULT(yes); 1263 AC_MSG_RESULT(yes);
1253 Py_DEBUG='true' 1264 Py_DEBUG='true'
1254 ABIFLAGS="${ABIFLAGS}d" 1265 ABIFLAGS="${ABIFLAGS}d"
1255 else AC_MSG_RESULT(no); Py_DEBUG='false' 1266 else AC_MSG_RESULT(no); Py_DEBUG='false'
1256 fi], 1267 fi],
1257 [AC_MSG_RESULT(no)]) 1268 [AC_MSG_RESULT(no)])
1258 1269
1270 # Enable optimization flags
1271 AC_SUBST(DEF_MAKE_ALL_RULE)
1272 AC_SUBST(DEF_MAKE_RULE)
1273 Py_OPT='false'
1274 AC_MSG_CHECKING(for --enable-optimizations)
1275 AC_ARG_ENABLE(optimizations, AS_HELP_STRING([--enable-optimizations], [Enable ex pensive optimizations (PGO, etc). Disabled by default.]),
1276 [
1277 if test "$withval" != no
1278 then
1279 Py_OPT='true'
1280 AC_MSG_RESULT(yes);
1281 else
1282 Py_OPT='false'
1283 AC_MSG_RESULT(no);
1284 fi],
1285 [AC_MSG_RESULT(no)])
1286 if test "$Py_OPT" = 'true' ; then
1287 # Intentionally not forcing Py_LTO='true' here. Too many toolchains do not
1288 # compile working code using it and both test_distutils and test_gdb are
1289 # broken when you do manage to get a toolchain that works with it. People
1290 # who want LTO need to use --with-lto themselves.
1291 DEF_MAKE_ALL_RULE="profile-opt"
1292 REQUIRE_PGO="yes"
1293 DEF_MAKE_RULE="build_all"
1294 else
1295 DEF_MAKE_ALL_RULE="build_all"
1296 REQUIRE_PGO="no"
1297 DEF_MAKE_RULE="all"
1298 fi
1299
1259 # Enable LTO flags 1300 # Enable LTO flags
1260 AC_SUBST(LTOFLAGS) 1301 AC_SUBST(LTOFLAGS)
1261 AC_MSG_CHECKING(for --with-lto) 1302 AC_MSG_CHECKING(for --with-lto)
1262 AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in PGO builds. Disabled by default.]), 1303 AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in PGO builds. Disabled by default.]),
1263 [ 1304 [
1264 if test "$withval" != no 1305 if test "$withval" != no
1265 then 1306 then
1266 Py_LTO='true' 1307 Py_LTO='true'
1267 AC_MSG_RESULT(yes); 1308 AC_MSG_RESULT(yes);
1268 else 1309 else
1269 Py_LTO='false' 1310 Py_LTO='false'
1270 AC_MSG_RESULT(no); 1311 AC_MSG_RESULT(no);
1271 fi], 1312 fi],
1272 [AC_MSG_RESULT(no)]) 1313 [AC_MSG_RESULT(no)])
1273 if test "$Py_LTO" = 'true' ; then 1314 if test "$Py_LTO" = 'true' ; then
1274 case $CC in 1315 case $CC in
1275 *clang*) 1316 *clang*)
1276 # Any changes made here should be reflected in the GCC+Darwin case below 1317 case $ac_sys_system in
1277 LTOFLAGS="-flto" 1318 Darwin*)
1319 # Any changes made here should be reflected in the GCC+Darwin case bel ow
1320 LTOFLAGS="-flto -Wl,-export_dynamic"
1321 ;;
1322 *)
1323 LTOFLAGS="-flto"
1324 ;;
1325 esac
1278 ;; 1326 ;;
1279 *gcc*) 1327 *gcc*)
1280 case $ac_sys_system in 1328 case $ac_sys_system in
1281 Darwin*) 1329 Darwin*)
1282 LTOFLAGS="-flto" 1330 LTOFLAGS="-flto -Wl,-export_dynamic"
1283 ;; 1331 ;;
1284 *) 1332 *)
1285 LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition= none" 1333 LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition= none"
1286 ;; 1334 ;;
1287 esac 1335 esac
1288 ;; 1336 ;;
1289 esac 1337 esac
1290 fi 1338 fi
1291 1339
1292 # Enable PGO flags. 1340 # Enable PGO flags.
1293 AC_SUBST(PGO_PROF_GEN_FLAG) 1341 AC_SUBST(PGO_PROF_GEN_FLAG)
1294 AC_SUBST(PGO_PROF_USE_FLAG) 1342 AC_SUBST(PGO_PROF_USE_FLAG)
1295 AC_SUBST(LLVM_PROF_MERGER) 1343 AC_SUBST(LLVM_PROF_MERGER)
1296 AC_SUBST(LLVM_PROF_FILE) 1344 AC_SUBST(LLVM_PROF_FILE)
1297 AC_SUBST(LLVM_PROF_ERR) 1345 AC_SUBST(LLVM_PROF_ERR)
1346 # Make this work on systems where llvm tools are not installed with their
1347 # normal names in the default $PATH (ie: Ubuntu). They exist under the
1348 # non-suffixed name in their versioned llvm directory.
1349 llvm_bin_dir=''
1350 llvm_path="${PATH}"
1351 if test "${CC}" = "clang"
1352 then
1353 clang_bin=`which clang`
1354 # Some systems install clang elsewhere as a symlink to the real path
1355 # which is where the related llvm tools are located.
1356 if test -L "${clang_bin}"
1357 then
1358 clang_dir=`dirname "${clang_bin}"`
1359 clang_bin=`readlink "${clang_bin}"`
1360 llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"`
1361 llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}"
1362 fi
1363 fi
1364 AC_SUBST(LLVM_PROFDATA)
1365 AC_PATH_TARGET_TOOL(LLVM_PROFDATA, llvm-profdata, '', ${llvm_path})
1298 AC_SUBST(LLVM_PROF_FOUND) 1366 AC_SUBST(LLVM_PROF_FOUND)
1299 AC_CHECK_PROG(LLVM_PROF_FOUND, llvm-profdata, found, not-found) 1367 if test -n "${LLVM_PROFDATA}" -a -x "${LLVM_PROFDATA}"
1368 then
1369 LLVM_PROF_FOUND="found"
1370 else
1371 LLVM_PROF_FOUND="not-found"
1372 fi
1373 if test "$ac_sys_system" = "Darwin" -a "${LLVM_PROF_FOUND}" = "not-found"
1374 then
1375 found_llvm_profdata=`/usr/bin/xcrun -find llvm-profdata 2>/dev/null`
1376 if test -n "${found_llvm_profdata}"
1377 then
1378 # llvm-profdata isn't directly in $PATH in some cases.
1379 # https://apple.stackexchange.com/questions/197053/
1380 LLVM_PROFDATA='/usr/bin/xcrun llvm-profdata'
1381 LLVM_PROF_FOUND=found
1382 AC_MSG_NOTICE([llvm-profdata found via xcrun: ${LLVM_PROFDATA}])
1383 fi
1384 fi
1300 LLVM_PROF_ERR=no 1385 LLVM_PROF_ERR=no
1301 case $CC in 1386 case $CC in
1302 *clang*) 1387 *clang*)
1303 # Any changes made here should be reflected in the GCC+Darwin case below 1388 # Any changes made here should be reflected in the GCC+Darwin case below
1304 PGO_PROF_GEN_FLAG="-fprofile-instr-generate" 1389 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
1305 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" 1390 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
1306 LLVM_PROF_MERGER="llvm-profdata merge -output=code.profclangd *.profclangr" 1391 LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclang r"
1307 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" 1392 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\""
1308 if test $LLVM_PROF_FOUND = not-found 1393 if test $LLVM_PROF_FOUND = not-found
1309 then 1394 then
1310 LLVM_PROF_ERR=yes 1395 LLVM_PROF_ERR=yes
1396 if test "${REQUIRE_PGO}" = "yes"
1397 then
1398 AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations bui ld but could not be found.])
1399 fi
1311 fi 1400 fi
1312 ;; 1401 ;;
1313 *gcc*) 1402 *gcc*)
1314 case $ac_sys_system in 1403 case $ac_sys_system in
1315 Darwin*) 1404 Darwin*)
1316 PGO_PROF_GEN_FLAG="-fprofile-instr-generate" 1405 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
1317 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" 1406 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
1318 LLVM_PROF_MERGER="llvm-profdata merge -output=code.profclangd *.profclan gr" 1407 LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profc langr"
1319 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" 1408 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\""
1320 if test $LLVM_PROF_FOUND = not-found 1409 if test "${LLVM_PROF_FOUND}" = "not-found"
1321 then 1410 then
1322 LLVM_PROF_ERR=yes 1411 LLVM_PROF_ERR=yes
1412 if test "${REQUIRE_PGO}" = "yes"
1413 then
1414 AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations build but could not be found.])
1415 fi
1323 fi 1416 fi
1324 ;; 1417 ;;
1325 *) 1418 *)
1326 PGO_PROF_GEN_FLAG="-fprofile-generate" 1419 PGO_PROF_GEN_FLAG="-fprofile-generate"
1327 PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction" 1420 PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction"
1328 LLVM_PROF_MERGER="true" 1421 LLVM_PROF_MERGER="true"
1329 LLVM_PROF_FILE="" 1422 LLVM_PROF_FILE=""
1330 ;; 1423 ;;
1331 esac 1424 esac
1332 ;; 1425 ;;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 AC_SUBST(BASECFLAGS) 1498 AC_SUBST(BASECFLAGS)
1406 AC_SUBST(CFLAGS_NODIST) 1499 AC_SUBST(CFLAGS_NODIST)
1407 1500
1408 # The -arch flags for universal builds on OSX 1501 # The -arch flags for universal builds on OSX
1409 UNIVERSAL_ARCH_FLAGS= 1502 UNIVERSAL_ARCH_FLAGS=
1410 AC_SUBST(UNIVERSAL_ARCH_FLAGS) 1503 AC_SUBST(UNIVERSAL_ARCH_FLAGS)
1411 1504
1412 # tweak BASECFLAGS based on compiler and platform 1505 # tweak BASECFLAGS based on compiler and platform
1413 case $GCC in 1506 case $GCC in
1414 yes) 1507 yes)
1508 CFLAGS_NODIST="$CFLAGS_NODIST -std=c99"
1509
1510 AC_MSG_CHECKING(for -Wextra)
1511 ac_save_cc="$CC"
1512 CC="$CC -Wextra -Werror"
1513 AC_CACHE_VAL(ac_cv_extra_warnings,
1514 AC_COMPILE_IFELSE(
1515 [
1516 AC_LANG_PROGRAM([[]], [[]])
1517 ],[
1518 ac_cv_extra_warnings=yes
1519 ],[
1520 ac_cv_extra_warnings=no
1521 ]))
1522 CC="$ac_save_cc"
1523 AC_MSG_RESULT($ac_cv_extra_warnings)
1524
1525 if test $ac_cv_extra_warnings = yes
1526 then
1527 CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"
1528 fi
1529
1415 # Python doesn't violate C99 aliasing rules, but older versions of 1530 # Python doesn't violate C99 aliasing rules, but older versions of
1416 # GCC produce warnings for legal Python code. Enable 1531 # GCC produce warnings for legal Python code. Enable
1417 # -fno-strict-aliasing on versions of GCC that support but produce 1532 # -fno-strict-aliasing on versions of GCC that support but produce
1418 # warnings. See Issue3326 1533 # warnings. See Issue3326
1419 AC_MSG_CHECKING(whether $CC accepts and needs -fno-strict-aliasing) 1534 AC_MSG_CHECKING(whether $CC accepts and needs -fno-strict-aliasing)
1420 ac_save_cc="$CC" 1535 ac_save_cc="$CC"
1421 CC="$CC -fno-strict-aliasing" 1536 CC="$CC -fno-strict-aliasing"
1422 save_CFLAGS="$CFLAGS" 1537 save_CFLAGS="$CFLAGS"
1423 AC_CACHE_VAL(ac_cv_no_strict_aliasing, 1538 AC_CACHE_VAL(ac_cv_no_strict_aliasing,
1424 AC_COMPILE_IFELSE( 1539 AC_COMPILE_IFELSE(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 ])) 1584 ]))
1470 CFLAGS="$save_CFLAGS" 1585 CFLAGS="$save_CFLAGS"
1471 CC="$ac_save_cc" 1586 CC="$ac_save_cc"
1472 AC_MSG_RESULT($ac_cv_disable_unused_result_warning) 1587 AC_MSG_RESULT($ac_cv_disable_unused_result_warning)
1473 ;; 1588 ;;
1474 esac 1589 esac
1475 1590
1476 if test $ac_cv_disable_unused_result_warning = yes 1591 if test $ac_cv_disable_unused_result_warning = yes
1477 then 1592 then
1478 BASECFLAGS="$BASECFLAGS -Wno-unused-result" 1593 BASECFLAGS="$BASECFLAGS -Wno-unused-result"
1594 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-result"
1479 fi 1595 fi
1480 1596
1481 AC_MSG_CHECKING(for -Werror=declaration-after-statement) 1597 AC_MSG_CHECKING(if we can turn off $CC unused parameter warning)
1482 ac_save_cc="$CC" 1598 ac_save_cc="$CC"
1483 CC="$CC -Werror=declaration-after-statement" 1599 CC="$CC -Wunused-parameter -Werror"
1484 save_CFLAGS="$CFLAGS" 1600 AC_CACHE_VAL(ac_cv_disable_unused_parameter_warning,
1485 AC_CACHE_VAL(ac_cv_declaration_after_statement_warning,
1486 AC_COMPILE_IFELSE( 1601 AC_COMPILE_IFELSE(
1487 [ 1602 [
1488 » AC_LANG_PROGRAM([[]], [[]]) 1603 AC_LANG_PROGRAM([[]], [[]])
1489 » ],[ 1604 ],[
1490 ac_cv_declaration_after_statement_warning=yes 1605 ac_cv_disable_unused_parameter_warning=yes
1491 » ],[ 1606 ],[
1492 ac_cv_declaration_after_statement_warning=no 1607 ac_cv_disable_unused_parameter_warning=no
1493 » ])) 1608 ]))
1494 CFLAGS="$save_CFLAGS"
1495 CC="$ac_save_cc" 1609 CC="$ac_save_cc"
1496 AC_MSG_RESULT($ac_cv_declaration_after_statement_warning) 1610 AC_MSG_RESULT($ac_cv_disable_unused_parameter_warning)
1497 1611
1498 if test $ac_cv_declaration_after_statement_warning = yes 1612 if test $ac_cv_disable_unused_parameter_warning = yes
1499 then 1613 then
1500 CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement" 1614 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter"
1615 fi
1616
1617 AC_MSG_CHECKING(if we can turn off $CC missing field initializers warning)
1618 ac_save_cc="$CC"
1619 CC="$CC -Wmissing-field-initializers -Werror"
1620 AC_CACHE_VAL(ac_cv_disable_missing_field_initializers,
1621 AC_COMPILE_IFELSE(
1622 [
1623 AC_LANG_PROGRAM([[]], [[]])
1624 ],[
1625 ac_cv_disable_missing_field_initializers=yes
1626 ],[
1627 ac_cv_disable_missing_field_initializers=no
1628 ]))
1629 CC="$ac_save_cc"
1630 AC_MSG_RESULT($ac_cv_disable_missing_field_initializers)
1631
1632 if test $ac_cv_disable_missing_field_initializers = yes
1633 then
1634 CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers"
1501 fi 1635 fi
1502 1636
1503 AC_MSG_CHECKING(if we can turn on $CC mixed sign comparison warning) 1637 AC_MSG_CHECKING(if we can turn on $CC mixed sign comparison warning)
1504 ac_save_cc="$CC" 1638 ac_save_cc="$CC"
1505 CC="$CC -Wsign-compare" 1639 CC="$CC -Wsign-compare"
1506 save_CFLAGS="$CFLAGS" 1640 save_CFLAGS="$CFLAGS"
1507 AC_CACHE_VAL(ac_cv_enable_sign_compare_warning, 1641 AC_CACHE_VAL(ac_cv_enable_sign_compare_warning,
1508 AC_COMPILE_IFELSE( 1642 AC_COMPILE_IFELSE(
1509 [ 1643 [
1510 AC_LANG_PROGRAM([[]], [[]]) 1644 AC_LANG_PROGRAM([[]], [[]])
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 # if so, only then enable the warning. 1681 # if so, only then enable the warning.
1548 if test $ac_cv_enable_unreachable_code_warning = yes && \ 1682 if test $ac_cv_enable_unreachable_code_warning = yes && \
1549 test "$Py_DEBUG" != "true" && \ 1683 test "$Py_DEBUG" != "true" && \
1550 test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`" 1684 test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`"
1551 then 1685 then
1552 BASECFLAGS="$BASECFLAGS -Wunreachable-code" 1686 BASECFLAGS="$BASECFLAGS -Wunreachable-code"
1553 else 1687 else
1554 ac_cv_enable_unreachable_code_warning=no 1688 ac_cv_enable_unreachable_code_warning=no
1555 fi 1689 fi
1556 AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning) 1690 AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning)
1691
1692 AC_MSG_CHECKING(if we can make implicit function declaration an error in $CC )
1693 ac_save_cc="$CC"
1694 CC="$CC -Werror=implicit-function-declaration"
1695 AC_CACHE_VAL(ac_cv_enable_implicit_function_declaration_error,
1696 AC_COMPILE_IFELSE(
1697 [
1698 AC_LANG_PROGRAM([[]], [[]])
1699 ],[
1700 ac_cv_enable_implicit_function_declaration_error=yes
1701 ],[
1702 ac_cv_enable_implicit_function_declaration_error=no
1703 ]))
1704 CC="$ac_save_cc"
1705 AC_MSG_RESULT($ac_cv_enable_implicit_function_declaration_error)
1706
1707 if test $ac_cv_enable_implicit_function_declaration_error = yes
1708 then
1709 CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"
1710 fi
1557 1711
1558 # if using gcc on alpha, use -mieee to get (near) full IEEE 754 1712 # if using gcc on alpha, use -mieee to get (near) full IEEE 754
1559 # support. Without this, treatment of subnormals doesn't follow 1713 # support. Without this, treatment of subnormals doesn't follow
1560 # the standard. 1714 # the standard.
1561 case $host in 1715 case $host in
1562 alpha*) 1716 alpha*)
1563 BASECFLAGS="$BASECFLAGS -mieee" 1717 BASECFLAGS="$BASECFLAGS -mieee"
1564 ;; 1718 ;;
1565 esac 1719 esac
1566 1720
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS }" 1784 LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS }"
1631 if test "${UNIVERSALSDK}" != "/" 1785 if test "${UNIVERSALSDK}" != "/"
1632 then 1786 then
1633 CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}" 1787 CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
1634 fi 1788 fi
1635 fi 1789 fi
1636 1790
1637 # Calculate an appropriate deployment target for this build: 1791 # Calculate an appropriate deployment target for this build:
1638 # The deployment target value is used explicitly to enable certain 1792 # The deployment target value is used explicitly to enable certain
1639 # features are enabled (such as builtin libedit support for readline) 1793 # features are enabled (such as builtin libedit support for readline)
1640 # through the use of Apple's Availabiliy Macros and is used as a 1794 # through the use of Apple's Availability Macros and is used as a
1641 # component of the string returned by distutils.get_platform(). 1795 # component of the string returned by distutils.get_platform().
1642 # 1796 #
1643 # Use the value from: 1797 # Use the value from:
1644 # 1. the MACOSX_DEPLOYMENT_TARGET environment variable if specified 1798 # 1. the MACOSX_DEPLOYMENT_TARGET environment variable if specified
1645 # 2. the operating system version of the build machine if >= 10.6 1799 # 2. the operating system version of the build machine if >= 10.6
1646 # 3. If running on OS X 10.3 through 10.5, use the legacy tests 1800 # 3. If running on OS X 10.3 through 10.5, use the legacy tests
1647 # below to pick either 10.3, 10.4, or 10.5 as the target. 1801 # below to pick either 10.3, 10.4, or 10.5 as the target.
1648 # 4. If we are running on OS X 10.2 or earlier, good luck! 1802 # 4. If we are running on OS X 10.2 or earlier, good luck!
1649 1803
1650 AC_MSG_CHECKING(which MACOSX_DEPLOYMENT_TARGET to use) 1804 AC_MSG_CHECKING(which MACOSX_DEPLOYMENT_TARGET to use)
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 dnl int foo; 2039 dnl int foo;
1886 dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something"); 2040 dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
1887 dnl ]], [[;]])],[cpp_type=ansi],[AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional]) 2041 dnl ]], [[;]])],[cpp_type=ansi],[AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional])
1888 dnl AC_MSG_RESULT($cpp_type) 2042 dnl AC_MSG_RESULT($cpp_type)
1889 2043
1890 # checks for header files 2044 # checks for header files
1891 AC_HEADER_STDC 2045 AC_HEADER_STDC
1892 AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \ 2046 AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \
1893 fcntl.h grp.h \ 2047 fcntl.h grp.h \
1894 ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ 2048 ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
1895 sched.h shadow.h signal.h stdint.h stropts.h termios.h \ 2049 sched.h shadow.h signal.h stropts.h termios.h \
1896 unistd.h utime.h \ 2050 unistd.h utime.h \
1897 poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ 2051 poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
1898 sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \ 2052 sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
1899 sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \ 2053 sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \
1900 sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ 2054 sys/param.h sys/random.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
1901 sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \ 2055 sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
1902 sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \ 2056 sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
1903 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ 2057 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
1904 bluetooth/bluetooth.h linux/tipc.h linux/random.h spawn.h util.h alloca.h endian .h \ 2058 linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
1905 sys/endian.h) 2059 sys/endian.h)
1906 AC_HEADER_DIRENT 2060 AC_HEADER_DIRENT
1907 AC_HEADER_MAJOR 2061 AC_HEADER_MAJOR
2062
2063 # bluetooth/bluetooth.h has been known to not compile with -std=c99.
2064 # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
2065 SAVE_CFLAGS=$CFLAGS
2066 CFLAGS="-std=c99 $CFLAGS"
2067 AC_CHECK_HEADERS(bluetooth/bluetooth.h)
2068 CFLAGS=$SAVE_CFLAGS
1908 2069
1909 # On Darwin (OS X) net/if.h requires sys/socket.h to be imported first. 2070 # On Darwin (OS X) net/if.h requires sys/socket.h to be imported first.
1910 AC_CHECK_HEADERS([net/if.h], [], [], 2071 AC_CHECK_HEADERS([net/if.h], [], [],
1911 [#include <stdio.h> 2072 [#include <stdio.h>
1912 #ifdef STDC_HEADERS 2073 #ifdef STDC_HEADERS
1913 # include <stdlib.h> 2074 # include <stdlib.h>
1914 # include <stddef.h> 2075 # include <stddef.h>
1915 #else 2076 #else
1916 # ifdef HAVE_STDLIB_H 2077 # ifdef HAVE_STDLIB_H
1917 # include <stdlib.h> 2078 # include <stdlib.h>
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 EOF 2188 EOF
2028 2189
2029 # Type availability checks 2190 # Type availability checks
2030 AC_TYPE_MODE_T 2191 AC_TYPE_MODE_T
2031 AC_TYPE_OFF_T 2192 AC_TYPE_OFF_T
2032 AC_TYPE_PID_T 2193 AC_TYPE_PID_T
2033 AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void]) 2194 AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void])
2034 AC_TYPE_SIZE_T 2195 AC_TYPE_SIZE_T
2035 AC_TYPE_UID_T 2196 AC_TYPE_UID_T
2036 2197
2037 # There are two separate checks for each of the exact-width integer types we
2038 # need. First we check whether the type is available using the usual
2039 # AC_CHECK_TYPE macro with the default includes (which includes <inttypes.h>
2040 # and <stdint.h> where available). We then also use the special type checks of
2041 # the form AC_TYPE_UINT32_T, which in the case that uint32_t is not available
2042 # directly, #define's uint32_t to be a suitable type.
2043
2044 AC_CHECK_TYPE(uint32_t,
2045 AC_DEFINE(HAVE_UINT32_T, 1, [Define if your compiler provides uint32_t.]),,)
2046 AC_TYPE_UINT32_T
2047
2048 AC_CHECK_TYPE(uint64_t,
2049 AC_DEFINE(HAVE_UINT64_T, 1, [Define if your compiler provides uint64_t.]),,)
2050 AC_TYPE_UINT64_T
2051
2052 AC_CHECK_TYPE(int32_t,
2053 AC_DEFINE(HAVE_INT32_T, 1, [Define if your compiler provides int32_t.]),,)
2054 AC_TYPE_INT32_T
2055
2056 AC_CHECK_TYPE(int64_t,
2057 AC_DEFINE(HAVE_INT64_T, 1, [Define if your compiler provides int64_t.]),,)
2058 AC_TYPE_INT64_T
2059
2060 AC_CHECK_TYPE(ssize_t, 2198 AC_CHECK_TYPE(ssize_t,
2061 AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,) 2199 AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,)
2062 AC_CHECK_TYPE(__uint128_t, 2200 AC_CHECK_TYPE(__uint128_t,
2063 AC_DEFINE(HAVE_GCC_UINT128_T, 1, [Define if your compiler provides __uint128_t ]),,) 2201 AC_DEFINE(HAVE_GCC_UINT128_T, 1, [Define if your compiler provides __uint128_t ]),,)
2064 2202
2065 # Sizes of various common basic types 2203 # Sizes of various common basic types
2066 # ANSI C requires sizeof(char) == 1, so no need to check it 2204 # ANSI C requires sizeof(char) == 1, so no need to check it
2067 AC_CHECK_SIZEOF(int, 4) 2205 AC_CHECK_SIZEOF(int, 4)
2068 AC_CHECK_SIZEOF(long, 4) 2206 AC_CHECK_SIZEOF(long, 4)
2207 AC_CHECK_SIZEOF(long long, 8)
2069 AC_CHECK_SIZEOF(void *, 4) 2208 AC_CHECK_SIZEOF(void *, 4)
2070 AC_CHECK_SIZEOF(short, 2) 2209 AC_CHECK_SIZEOF(short, 2)
2071 AC_CHECK_SIZEOF(float, 4) 2210 AC_CHECK_SIZEOF(float, 4)
2072 AC_CHECK_SIZEOF(double, 8) 2211 AC_CHECK_SIZEOF(double, 8)
2073 AC_CHECK_SIZEOF(fpos_t, 4) 2212 AC_CHECK_SIZEOF(fpos_t, 4)
2074 AC_CHECK_SIZEOF(size_t, 4) 2213 AC_CHECK_SIZEOF(size_t, 4)
2075 AC_CHECK_SIZEOF(pid_t, 4) 2214 AC_CHECK_SIZEOF(pid_t, 4)
2076 2215 AC_CHECK_SIZEOF(uintptr_t)
2077 AC_MSG_CHECKING(for long long support)
2078 have_long_long=no
2079 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[
2080 AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
2081 have_long_long=yes
2082 ],[])
2083 AC_MSG_RESULT($have_long_long)
2084 if test "$have_long_long" = yes ; then
2085 AC_CHECK_SIZEOF(long long, 8)
2086 fi
2087 2216
2088 AC_MSG_CHECKING(for long double support) 2217 AC_MSG_CHECKING(for long double support)
2089 have_long_double=no 2218 have_long_double=no
2090 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]]) ],[ 2219 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]]) ],[
2091 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.] ) 2220 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.] )
2092 have_long_double=yes 2221 have_long_double=yes
2093 ],[]) 2222 ],[])
2094 AC_MSG_RESULT($have_long_double) 2223 AC_MSG_RESULT($have_long_double)
2095 if test "$have_long_double" = yes ; then 2224 if test "$have_long_double" = yes ; then
2096 AC_CHECK_SIZEOF(long double, 16) 2225 AC_CHECK_SIZEOF(long double, 16)
2097 fi 2226 fi
2098 2227
2099
2100 AC_MSG_CHECKING(for _Bool support)
2101 have_c99_bool=no
2102 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Bool x; x = (_Bool)0;]])],[
2103 AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.])
2104 have_c99_bool=yes
2105 ],[])
2106 AC_MSG_RESULT($have_c99_bool)
2107 if test "$have_c99_bool" = yes ; then
2108 AC_CHECK_SIZEOF(_Bool, 1) 2228 AC_CHECK_SIZEOF(_Bool, 1)
2109 fi
2110
2111 AC_CHECK_TYPES(uintptr_t,
2112 [AC_CHECK_SIZEOF(uintptr_t, 4)],
2113 [], [#ifdef HAVE_STDINT_H
2114 #include <stdint.h>
2115 #endif
2116 #ifdef HAVE_INTTYPES_H
2117 #include <inttypes.h>
2118 #endif])
2119 2229
2120 AC_CHECK_SIZEOF(off_t, [], [ 2230 AC_CHECK_SIZEOF(off_t, [], [
2121 #ifdef HAVE_SYS_TYPES_H 2231 #ifdef HAVE_SYS_TYPES_H
2122 #include <sys/types.h> 2232 #include <sys/types.h>
2123 #endif 2233 #endif
2124 ]) 2234 ])
2125 2235
2126 AC_MSG_CHECKING(whether to enable large file support) 2236 AC_MSG_CHECKING(whether to enable large file support)
2127 if test "$have_long_long" = yes
2128 then
2129 if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ 2237 if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
2130 "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then 2238 "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
2131 AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1, 2239 AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
2132 [Defined to enable large file support when an off_t is bigger than a long 2240 [Defined to enable large file support when an off_t is bigger than a long
2133 and long long is available and at least as big as an off_t. You may need 2241 and long long is available and at least as big as an off_t. You may need
2134 to add some flags for configuration and compilation to enable this mode. 2242 to add some flags for configuration and compilation to enable this mode.
2135 (For Solaris and Linux, the necessary defines are already defined.)]) 2243 (For Solaris and Linux, the necessary defines are already defined.)])
2136 AC_MSG_RESULT(yes) 2244 AC_MSG_RESULT(yes)
2137 else
2138 AC_MSG_RESULT(no)
2139 fi
2140 else 2245 else
2141 AC_MSG_RESULT(no) 2246 AC_MSG_RESULT(no)
2142 fi 2247 fi
2143 2248
2144 AC_CHECK_SIZEOF(time_t, [], [ 2249 AC_CHECK_SIZEOF(time_t, [], [
2145 #ifdef HAVE_SYS_TYPES_H 2250 #ifdef HAVE_SYS_TYPES_H
2146 #include <sys/types.h> 2251 #include <sys/types.h>
2147 #endif 2252 #endif
2148 #ifdef HAVE_TIME_H 2253 #ifdef HAVE_TIME_H
2149 #include <time.h> 2254 #include <time.h>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 2412
2308 # LDSHARED is the ld *command* used to create shared library 2413 # LDSHARED is the ld *command* used to create shared library
2309 # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 2414 # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
2310 # (Shared libraries in this instance are shared modules to be loaded into 2415 # (Shared libraries in this instance are shared modules to be loaded into
2311 # Python, as opposed to building Python itself as a shared library.) 2416 # Python, as opposed to building Python itself as a shared library.)
2312 AC_MSG_CHECKING(LDSHARED) 2417 AC_MSG_CHECKING(LDSHARED)
2313 if test -z "$LDSHARED" 2418 if test -z "$LDSHARED"
2314 then 2419 then
2315 case $ac_sys_system/$ac_sys_release in 2420 case $ac_sys_system/$ac_sys_release in
2316 AIX*) 2421 AIX*)
2317 » » BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Mo dules/python.exp" 2422 » » BLDSHARED="Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
2318 » » LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDE ST)/config/python.exp" 2423 » » LDSHARED="\$(LIBPL)/ld_so_aix \$(CC) -bI:\$(LIBPL)/python.exp"
2319 ;; 2424 ;;
2320 IRIX/5*) LDSHARED="ld -shared";; 2425 IRIX/5*) LDSHARED="ld -shared";;
2321 IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; 2426 IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
2322 SunOS/5*) 2427 SunOS/5*)
2323 if test "$GCC" = "yes" ; then 2428 if test "$GCC" = "yes" ; then
2324 LDSHARED='$(CC) -shared' 2429 LDSHARED='$(CC) -shared'
2325 LDCXXSHARED='$(CXX) -shared' 2430 LDCXXSHARED='$(CXX) -shared'
2326 else 2431 else
2327 LDSHARED='$(CC) -G' 2432 LDSHARED='$(CC) -G'
2328 LDCXXSHARED='$(CXX) -G' 2433 LDCXXSHARED='$(CXX) -G'
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2455 SunOS*) if test "$GCC" = yes; 2560 SunOS*) if test "$GCC" = yes;
2456 then CCSHARED="-fPIC"; 2561 then CCSHARED="-fPIC";
2457 elif test `uname -p` = sparc; 2562 elif test `uname -p` = sparc;
2458 then CCSHARED="-xcode=pic32"; 2563 then CCSHARED="-xcode=pic32";
2459 else CCSHARED="-Kpic"; 2564 else CCSHARED="-Kpic";
2460 fi;; 2565 fi;;
2461 hp*|HP*) if test "$GCC" = yes; 2566 hp*|HP*) if test "$GCC" = yes;
2462 then CCSHARED="-fPIC"; 2567 then CCSHARED="-fPIC";
2463 else CCSHARED="+z"; 2568 else CCSHARED="+z";
2464 fi;; 2569 fi;;
2570 Linux-android*) ;;
2465 Linux*|GNU*) CCSHARED="-fPIC";; 2571 Linux*|GNU*) CCSHARED="-fPIC";;
2466 BSD/OS*/4*) CCSHARED="-fpic";; 2572 BSD/OS*/4*) CCSHARED="-fpic";;
2467 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; 2573 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
2468 OpenUNIX*|UnixWare*) 2574 OpenUNIX*|UnixWare*)
2469 if test "$GCC" = "yes" 2575 if test "$GCC" = "yes"
2470 then CCSHARED="-fPIC" 2576 then CCSHARED="-fPIC"
2471 else CCSHARED="-KPIC" 2577 else CCSHARED="-KPIC"
2472 fi;; 2578 fi;;
2473 SCO_SV*) 2579 SCO_SV*)
2474 if test "$GCC" = "yes" 2580 if test "$GCC" = "yes"
(...skipping 11 matching lines...) Expand all
2486 # the python executable -- this is only needed for a few systems 2592 # the python executable -- this is only needed for a few systems
2487 AC_MSG_CHECKING(LINKFORSHARED) 2593 AC_MSG_CHECKING(LINKFORSHARED)
2488 if test -z "$LINKFORSHARED" 2594 if test -z "$LINKFORSHARED"
2489 then 2595 then
2490 case $ac_sys_system/$ac_sys_release in 2596 case $ac_sys_system/$ac_sys_release in
2491 AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';; 2597 AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
2492 hp*|HP*) 2598 hp*|HP*)
2493 LINKFORSHARED="-Wl,-E -Wl,+s";; 2599 LINKFORSHARED="-Wl,-E -Wl,+s";;
2494 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; 2600 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
2495 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; 2601 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
2602 Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
2496 Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; 2603 Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
2497 # -u libsys_s pulls in all symbols in libsys 2604 # -u libsys_s pulls in all symbols in libsys
2498 Darwin/*) 2605 Darwin/*)
2499 LINKFORSHARED="$extra_undefs -framework CoreFoundation" 2606 LINKFORSHARED="$extra_undefs -framework CoreFoundation"
2500 2607
2501 # Issue #18075: the default maximum stack size (8MBytes) is too 2608 # Issue #18075: the default maximum stack size (8MBytes) is too
2502 # small for the default recursion limit. Increase the stack size 2609 # small for the default recursion limit. Increase the stack size
2503 # to ensure that tests don't crash 2610 # to ensure that tests don't crash
2504 LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED" 2611 LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED"
2505 2612
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2691 AC_ARG_WITH(system_expat, 2798 AC_ARG_WITH(system_expat,
2692 AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]), 2799 AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]),
2693 [], 2800 [],
2694 [with_system_expat="no"]) 2801 [with_system_expat="no"])
2695 2802
2696 AC_MSG_RESULT($with_system_expat) 2803 AC_MSG_RESULT($with_system_expat)
2697 2804
2698 # Check for use of the system libffi library 2805 # Check for use of the system libffi library
2699 AC_MSG_CHECKING(for --with-system-ffi) 2806 AC_MSG_CHECKING(for --with-system-ffi)
2700 AC_ARG_WITH(system_ffi, 2807 AC_ARG_WITH(system_ffi,
2701 AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an i nstalled ffi library]), 2808 AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an i nstalled ffi library]),,,)
2702 [], 2809
2703 [with_system_ffi="no"]) 2810 if test "$ac_sys_system" = "Darwin"
2811 then
2812 case "$with_system_ffi" in
2813 "")
2814 with_system_ffi="no"
2815 ;;
2816 yes|no)
2817 ;;
2818 *)
2819 AC_MSG_ERROR([--with-system-ffi accepts no arguments])
2820 ;;
2821 esac
2822 AC_MSG_RESULT($with_system_ffi)
2823 else
2824 AC_MSG_RESULT(yes)
2825 if test "$with_system_ffi" != ""
2826 then
2827 AC_MSG_WARN([--with(out)-system-ffi is ignored on this platform])
2828 fi
2829 with_system_ffi="yes"
2830 fi
2704 2831
2705 if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then 2832 if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
2706 LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed - e 's/^-I//;s/ *$//'`" 2833 LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed - e 's/^-I//;s/ *$//'`"
2707 else 2834 else
2708 LIBFFI_INCLUDEDIR="" 2835 LIBFFI_INCLUDEDIR=""
2709 fi 2836 fi
2710 AC_SUBST(LIBFFI_INCLUDEDIR) 2837 AC_SUBST(LIBFFI_INCLUDEDIR)
2711
2712 AC_MSG_RESULT($with_system_ffi)
2713 2838
2714 # Check for use of the system libmpdec library 2839 # Check for use of the system libmpdec library
2715 AC_MSG_CHECKING(for --with-system-libmpdec) 2840 AC_MSG_CHECKING(for --with-system-libmpdec)
2716 AC_ARG_WITH(system_libmpdec, 2841 AC_ARG_WITH(system_libmpdec,
2717 AS_HELP_STRING([--with-system-libmpdec], [build _decimal module usin g an installed libmpdec library]), 2842 AS_HELP_STRING([--with-system-libmpdec], [build _decimal module usin g an installed libmpdec library]),
2718 [], 2843 [],
2719 [with_system_libmpdec="no"]) 2844 [with_system_libmpdec="no"])
2720 2845
2721 AC_MSG_RESULT($with_system_libmpdec) 2846 AC_MSG_RESULT($with_system_libmpdec)
2722 2847
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2767 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...]) 2892 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...])
2768 else 2893 else
2769 for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do 2894 for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do
2770 if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb 2895 if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb
2771 then 2896 then
2772 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...]) 2897 AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...])
2773 fi 2898 fi
2774 done 2899 done
2775 fi]) 2900 fi])
2776 AC_MSG_RESULT($with_dbmliborder) 2901 AC_MSG_RESULT($with_dbmliborder)
2777
2778 # Determine if signalmodule should be used.
2779 AC_SUBST(USE_SIGNAL_MODULE)
2780 AC_SUBST(SIGNAL_OBJS)
2781 AC_MSG_CHECKING(for --with-signal-module)
2782 AC_ARG_WITH(signal-module,
2783 AS_HELP_STRING([--with-signal-module], [disable/enable signal module ]))
2784
2785 if test -z "$with_signal_module"
2786 then with_signal_module="yes"
2787 fi
2788 AC_MSG_RESULT($with_signal_module)
2789
2790 if test "${with_signal_module}" = "yes"; then
2791 USE_SIGNAL_MODULE=""
2792 SIGNAL_OBJS=""
2793 else
2794 USE_SIGNAL_MODULE="#"
2795 SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o"
2796 fi
2797 2902
2798 # This is used to generate Setup.config 2903 # This is used to generate Setup.config
2799 AC_SUBST(USE_THREAD_MODULE) 2904 AC_SUBST(USE_THREAD_MODULE)
2800 USE_THREAD_MODULE="" 2905 USE_THREAD_MODULE=""
2801 2906
2802 AC_SUBST(LDLAST) 2907 AC_SUBST(LDLAST)
2803 2908
2804 # Templates for things AC_DEFINEd more than once. 2909 # Templates for things AC_DEFINEd more than once.
2805 # For a single AC_DEFINE, no template is needed. 2910 # For a single AC_DEFINE, no template is needed.
2806 AH_TEMPLATE(_REENTRANT, 2911 AH_TEMPLATE(_REENTRANT,
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
3157 AC_MSG_CHECKING(for CAN_RAW_FD_FRAMES) 3262 AC_MSG_CHECKING(for CAN_RAW_FD_FRAMES)
3158 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* CAN_RAW_FD_FRAMES available check */ 3263 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* CAN_RAW_FD_FRAMES available check */
3159 #include <linux/can/raw.h>]], 3264 #include <linux/can/raw.h>]],
3160 [[int can_raw_fd_frames = CAN_RAW_FD_FRAMES;]])],[ 3265 [[int can_raw_fd_frames = CAN_RAW_FD_FRAMES;]])],[
3161 AC_DEFINE(HAVE_LINUX_CAN_RAW_FD_FRAMES, 1, [Define if compiling using Linux 3. 6 or later.]) 3266 AC_DEFINE(HAVE_LINUX_CAN_RAW_FD_FRAMES, 1, [Define if compiling using Linux 3. 6 or later.])
3162 AC_MSG_RESULT(yes) 3267 AC_MSG_RESULT(yes)
3163 ],[ 3268 ],[
3164 AC_MSG_RESULT(no) 3269 AC_MSG_RESULT(no)
3165 ]) 3270 ])
3166 3271
3167 AC_MSG_CHECKING(for OSX 10.5 SDK or later)
3168 AC_COMPILE_IFELSE([
3169 AC_LANG_PROGRAM([[#include <Carbon/Carbon.h>]], [[FSIORefNum fRef = 0]])
3170 ],[
3171 AC_DEFINE(HAVE_OSX105_SDK, 1, [Define if compiling using MacOS X 10.5 SDK or l ater.])
3172 AC_MSG_RESULT(yes)
3173 ],[
3174 AC_MSG_RESULT(no)
3175 ])
3176
3177 # Check for --with-doc-strings 3272 # Check for --with-doc-strings
3178 AC_MSG_CHECKING(for --with-doc-strings) 3273 AC_MSG_CHECKING(for --with-doc-strings)
3179 AC_ARG_WITH(doc-strings, 3274 AC_ARG_WITH(doc-strings,
3180 AS_HELP_STRING([--with(out)-doc-strings], [disable/enable documentat ion strings])) 3275 AS_HELP_STRING([--with(out)-doc-strings], [disable/enable documentat ion strings]))
3181 3276
3182 if test -z "$with_doc_strings" 3277 if test -z "$with_doc_strings"
3183 then with_doc_strings="yes" 3278 then with_doc_strings="yes"
3184 fi 3279 fi
3185 if test "$with_doc_strings" != "no" 3280 if test "$with_doc_strings" != "no"
3186 then 3281 then
3187 AC_DEFINE(WITH_DOC_STRINGS, 1, 3282 AC_DEFINE(WITH_DOC_STRINGS, 1,
3188 [Define if you want documentation strings in extension modules]) 3283 [Define if you want documentation strings in extension modules])
3189 fi 3284 fi
3190 AC_MSG_RESULT($with_doc_strings) 3285 AC_MSG_RESULT($with_doc_strings)
3191
3192 # Check if eval loop should use timestamp counter profiling
3193 AC_MSG_CHECKING(for --with-tsc)
3194 AC_ARG_WITH(tsc,
3195 AS_HELP_STRING([--with(out)-tsc],[enable/disable timestamp counter p rofile]),[
3196 if test "$withval" != no
3197 then
3198 AC_DEFINE(WITH_TSC, 1,
3199 [Define to profile with the Pentium timestamp counter])
3200 AC_MSG_RESULT(yes)
3201 else AC_MSG_RESULT(no)
3202 fi],
3203 [AC_MSG_RESULT(no)])
3204 3286
3205 # Check for Python-specific malloc support 3287 # Check for Python-specific malloc support
3206 AC_MSG_CHECKING(for --with-pymalloc) 3288 AC_MSG_CHECKING(for --with-pymalloc)
3207 AC_ARG_WITH(pymalloc, 3289 AC_ARG_WITH(pymalloc,
3208 AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized m allocs])) 3290 AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized m allocs]))
3209 3291
3210 if test -z "$with_pymalloc" 3292 if test -z "$with_pymalloc"
3211 then 3293 then
3212 with_pymalloc="yes" 3294 with_pymalloc="yes"
3213 fi 3295 fi
(...skipping 10 matching lines...) Expand all
3224 AC_ARG_WITH([valgrind], 3306 AC_ARG_WITH([valgrind],
3225 AS_HELP_STRING([--with-valgrind], [Enable Valgrind support]),, 3307 AS_HELP_STRING([--with-valgrind], [Enable Valgrind support]),,
3226 with_valgrind=no) 3308 with_valgrind=no)
3227 AC_MSG_RESULT([$with_valgrind]) 3309 AC_MSG_RESULT([$with_valgrind])
3228 if test "$with_valgrind" != no; then 3310 if test "$with_valgrind" != no; then
3229 AC_CHECK_HEADER([valgrind/valgrind.h], 3311 AC_CHECK_HEADER([valgrind/valgrind.h],
3230 [AC_DEFINE([WITH_VALGRIND], 1, [Define if you want pymalloc to be disabled when running under valgrind])], 3312 [AC_DEFINE([WITH_VALGRIND], 1, [Define if you want pymalloc to be disabled when running under valgrind])],
3231 [AC_MSG_ERROR([Valgrind support requested but headers not available])] 3313 [AC_MSG_ERROR([Valgrind support requested but headers not available])]
3232 ) 3314 )
3233 OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" 3315 OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
3316 fi
3317
3318 # Check for DTrace support
3319 AC_MSG_CHECKING(for --with-dtrace)
3320 AC_ARG_WITH(dtrace,
3321 AC_HELP_STRING(--with(out)-dtrace, [disable/enable DTrace support]),,
3322 with_dtrace=no)
3323 AC_MSG_RESULT($with_dtrace)
3324
3325 AC_SUBST(DTRACE)
3326 AC_SUBST(DFLAGS)
3327 AC_SUBST(DTRACE_HEADERS)
3328 AC_SUBST(DTRACE_OBJS)
3329 DTRACE=
3330 DFLAGS=
3331 DTRACE_HEADERS=
3332 DTRACE_OBJS=
3333
3334 if test "$with_dtrace" = "yes"
3335 then
3336 AC_PATH_PROG(DTRACE, [dtrace], [not found])
3337 if test "$DTRACE" = "not found"; then
3338 AC_MSG_ERROR([dtrace command not found on \$PATH])
3339 fi
3340 AC_DEFINE(WITH_DTRACE, 1, [Define if you want to compile in DTrace support])
3341 DTRACE_HEADERS="Include/pydtrace_probes.h"
3342
3343 # On OS X, DTrace providers do not need to be explicitly compiled and
3344 # linked into the binary. Correspondingly, dtrace(1) is missing the ELF
3345 # generation flag '-G'. We check for presence of this flag, rather than
3346 # hardcoding support by OS, in the interest of robustness.
3347 AC_CACHE_CHECK([whether DTrace probes require linking],
3348 [ac_cv_dtrace_link], [dnl
3349 ac_cv_dtrace_link=no
3350 echo 'BEGIN' > conftest.d
3351 "$DTRACE" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
3352 ac_cv_dtrace_link=yes
3353 ])
3354 if test "$ac_cv_dtrace_link" = "yes"; then
3355 DTRACE_OBJS="Python/pydtrace.o"
3356 fi
3234 fi 3357 fi
3235 3358
3236 # -I${DLINCLDIR} is added to the compile rule for importdl.o 3359 # -I${DLINCLDIR} is added to the compile rule for importdl.o
3237 AC_SUBST(DLINCLDIR) 3360 AC_SUBST(DLINCLDIR)
3238 DLINCLDIR=. 3361 DLINCLDIR=.
3239 3362
3240 # the dlopen() function means we might want to use dynload_shlib.o. some 3363 # the dlopen() function means we might want to use dynload_shlib.o. some
3241 # platforms, such as AIX, have dlopen(), but don't want to use it. 3364 # platforms, such as AIX, have dlopen(), but don't want to use it.
3242 AC_CHECK_FUNCS(dlopen) 3365 AC_CHECK_FUNCS(dlopen)
3243 3366
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
3290 AC_MSG_RESULT([$MACHDEP_OBJS]) 3413 AC_MSG_RESULT([$MACHDEP_OBJS])
3291 fi 3414 fi
3292 3415
3293 # checks for library functions 3416 # checks for library functions
3294 AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ 3417 AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
3295 clock confstr ctermid dup3 execv faccessat fchmod fchmodat fchown fchownat \ 3418 clock confstr ctermid dup3 execv faccessat fchmod fchmodat fchown fchownat \
3296 fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \ 3419 fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
3297 futimens futimes gai_strerror getentropy \ 3420 futimens futimes gai_strerror getentropy \
3298 getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ 3421 getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
3299 getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \ 3422 getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
3300 if_nameindex \ 3423 initgroups kill killpg lchmod lchown linkat lstat lutimes mmap \
3301 initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
3302 memrchr mbrtowc mkdirat mkfifo \ 3424 memrchr mbrtowc mkdirat mkfifo \
3303 mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock pol l \ 3425 mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock pol l \
3304 posix_fallocate posix_fadvise pread \ 3426 posix_fallocate posix_fadvise pread \
3305 pthread_init pthread_kill putenv pwrite readlink readlinkat readv realpath rena meat \ 3427 pthread_init pthread_kill putenv pwrite readlink readlinkat readv realpath rena meat \
3306 select sem_open sem_timedwait sem_getvalue sem_unlink sendfile setegid seteuid \ 3428 select sem_open sem_timedwait sem_getvalue sem_unlink sendfile setegid seteuid \
3307 setgid sethostname \ 3429 setgid sethostname \
3308 setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setprior ity setuid setvbuf \ 3430 setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setprior ity setuid setvbuf \
3309 sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \ 3431 sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \
3310 sched_rr_get_interval \ 3432 sched_rr_get_interval \
3311 sigaction sigaltstack siginterrupt sigpending sigrelse \ 3433 sigaction sigaltstack siginterrupt sigpending sigrelse \
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
3425 3547
3426 AC_MSG_CHECKING(for getpagesize) 3548 AC_MSG_CHECKING(for getpagesize)
3427 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 3549 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3428 #include <unistd.h> 3550 #include <unistd.h>
3429 ]], [[void* p = getpagesize]])], 3551 ]], [[void* p = getpagesize]])],
3430 [AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function. ) 3552 [AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function. )
3431 AC_MSG_RESULT(yes)], 3553 AC_MSG_RESULT(yes)],
3432 [AC_MSG_RESULT(no) 3554 [AC_MSG_RESULT(no)
3433 ]) 3555 ])
3434 3556
3435 AC_MSG_CHECKING(for crypt)
3436 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=crypt]])],
3437 [AC_DEFINE(HAVE_CRYPT, 1, Define if you have the 'crypt' function.)
3438 AC_MSG_RESULT(yes)],
3439 [AC_MSG_RESULT(no)
3440 ])
3441
3442 AC_MSG_CHECKING(for broken unsetenv) 3557 AC_MSG_CHECKING(for broken unsetenv)
3443 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 3558 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3444 #include <stdlib.h> 3559 #include <stdlib.h>
3445 ]], [[int res = unsetenv("DUMMY")]])], 3560 ]], [[int res = unsetenv("DUMMY")]])],
3446 [AC_MSG_RESULT(no)], 3561 [AC_MSG_RESULT(no)],
3447 [AC_DEFINE(HAVE_BROKEN_UNSETENV, 1, Define if `unsetenv` does not return an in t.) 3562 [AC_DEFINE(HAVE_BROKEN_UNSETENV, 1, Define if `unsetenv` does not return an in t.)
3448 AC_MSG_RESULT(yes) 3563 AC_MSG_RESULT(yes)
3449 ]) 3564 ])
3450 3565
3451 dnl check for true 3566 dnl check for true
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
3625 [Library needed by timemodule.c: librt may be needed for clock _gettime()]) 3740 [Library needed by timemodule.c: librt may be needed for clock _gettime()])
3626 ]) 3741 ])
3627 ]) 3742 ])
3628 3743
3629 AC_CHECK_FUNCS(clock_getres, [], [ 3744 AC_CHECK_FUNCS(clock_getres, [], [
3630 AC_CHECK_LIB(rt, clock_getres, [ 3745 AC_CHECK_LIB(rt, clock_getres, [
3631 AC_DEFINE(HAVE_CLOCK_GETRES, 1) 3746 AC_DEFINE(HAVE_CLOCK_GETRES, 1)
3632 ]) 3747 ])
3633 ]) 3748 ])
3634 3749
3750 AC_CHECK_FUNCS(clock_settime, [], [
3751 AC_CHECK_LIB(rt, clock_settime, [
3752 AC_DEFINE(HAVE_CLOCK_SETTIME, 1)
3753 ])
3754 ])
3755
3635 AC_MSG_CHECKING(for major, minor, and makedev) 3756 AC_MSG_CHECKING(for major, minor, and makedev)
3636 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 3757 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3637 #if defined(MAJOR_IN_MKDEV) 3758 #if defined(MAJOR_IN_MKDEV)
3638 #include <sys/mkdev.h> 3759 #include <sys/mkdev.h>
3639 #elif defined(MAJOR_IN_SYSMACROS) 3760 #elif defined(MAJOR_IN_SYSMACROS)
3640 #include <sys/sysmacros.h> 3761 #include <sys/sysmacros.h>
3641 #else 3762 #else
3642 #include <sys/types.h> 3763 #include <sys/types.h>
3643 #endif 3764 #endif
3644 ]], [[ 3765 ]], [[
3645 makedev(major(0),minor(0)); 3766 makedev(major(0),minor(0));
3646 ]])],[ 3767 ]])],[
3647 AC_DEFINE(HAVE_DEVICE_MACROS, 1, 3768 AC_DEFINE(HAVE_DEVICE_MACROS, 1,
3648 [Define to 1 if you have the device macros.]) 3769 [Define to 1 if you have the device macros.])
3649 AC_MSG_RESULT(yes) 3770 AC_MSG_RESULT(yes)
3650 ],[ 3771 ],[
3651 AC_MSG_RESULT(no) 3772 AC_MSG_RESULT(no)
3773 ])
3774
3775 # On Android API level 24 with android-ndk-r13, if_nameindex() is available,
3776 # but the if_nameindex structure is not defined.
3777 AC_MSG_CHECKING(for if_nameindex)
3778 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3779 #include <stdio.h>
3780 #ifdef STDC_HEADERS
3781 # include <stdlib.h>
3782 # include <stddef.h>
3783 #else
3784 # ifdef HAVE_STDLIB_H
3785 # include <stdlib.h>
3786 # endif
3787 #endif
3788 #ifdef HAVE_SYS_SOCKET_H
3789 # include <sys/socket.h>
3790 #endif
3791 #ifdef HAVE_NET_IF_H
3792 # include <net/if.h>
3793 #endif
3794 ]], [[struct if_nameindex *ni = if_nameindex(); int x = ni[0].if_index;]])],
3795 [AC_DEFINE(HAVE_IF_NAMEINDEX, 1, Define to 1 if you have the 'if_nameindex' fu nction.)
3796 AC_MSG_RESULT(yes)],
3797 [AC_MSG_RESULT(no)
3798 ])
3799
3800 # Issue #28762: lockf() is available on Android API level 24, but the F_LOCK
3801 # macro is not defined in android-ndk-r13.
3802 AC_MSG_CHECKING(for lockf)
3803 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h> ]],[[lockf(0, F_LOCK, 0);] ])],
3804 [AC_DEFINE(HAVE_LOCKF, 1, Define to 1 if you have the 'lockf' function and the F_LOCK macro.)
3805 AC_MSG_RESULT(yes)],
3806 [AC_MSG_RESULT(no)
3652 ]) 3807 ])
3653 3808
3654 # On OSF/1 V5.1, getaddrinfo is available, but a define 3809 # On OSF/1 V5.1, getaddrinfo is available, but a define
3655 # for [no]getaddrinfo in netdb.h. 3810 # for [no]getaddrinfo in netdb.h.
3656 AC_MSG_CHECKING(for getaddrinfo) 3811 AC_MSG_CHECKING(for getaddrinfo)
3657 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 3812 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3658 #include <sys/types.h> 3813 #include <sys/types.h>
3659 #include <sys/socket.h> 3814 #include <sys/socket.h>
3660 #include <netdb.h> 3815 #include <netdb.h>
3661 #include <stdio.h> 3816 #include <stdio.h>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
3731 inet6++; 3886 inet6++;
3732 break; 3887 break;
3733 case AF_UNSPEC: 3888 case AF_UNSPEC:
3734 goto bad; 3889 goto bad;
3735 break; 3890 break;
3736 default: 3891 default:
3737 /* another family support? */ 3892 /* another family support? */
3738 break; 3893 break;
3739 } 3894 }
3740 } 3895 }
3896 freeaddrinfo(aitop);
3897 aitop = NULL;
3741 } 3898 }
3742 3899
3743 if (!(inet4 == 0 || inet4 == 2)) 3900 if (!(inet4 == 0 || inet4 == 2))
3744 goto bad; 3901 goto bad;
3745 if (!(inet6 == 0 || inet6 == 2)) 3902 if (!(inet6 == 0 || inet6 == 2))
3746 goto bad; 3903 goto bad;
3747 3904
3748 if (aitop) 3905 if (aitop)
3749 freeaddrinfo(aitop); 3906 freeaddrinfo(aitop);
3750 return 0; 3907 return 0;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
3788 AC_CHECK_MEMBERS([struct stat.st_rdev]) 3945 AC_CHECK_MEMBERS([struct stat.st_rdev])
3789 AC_CHECK_MEMBERS([struct stat.st_blksize]) 3946 AC_CHECK_MEMBERS([struct stat.st_blksize])
3790 AC_CHECK_MEMBERS([struct stat.st_flags]) 3947 AC_CHECK_MEMBERS([struct stat.st_flags])
3791 AC_CHECK_MEMBERS([struct stat.st_gen]) 3948 AC_CHECK_MEMBERS([struct stat.st_gen])
3792 AC_CHECK_MEMBERS([struct stat.st_birthtime]) 3949 AC_CHECK_MEMBERS([struct stat.st_birthtime])
3793 AC_CHECK_MEMBERS([struct stat.st_blocks]) 3950 AC_CHECK_MEMBERS([struct stat.st_blocks])
3794 AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_passwd], [], [], [[ 3951 AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_passwd], [], [], [[
3795 #include <sys/types.h> 3952 #include <sys/types.h>
3796 #include <pwd.h> 3953 #include <pwd.h>
3797 ]]) 3954 ]])
3955 # Issue #21085: In Cygwin, siginfo_t does not have si_band field.
3956 AC_CHECK_MEMBERS([siginfo_t.si_band], [], [], [[#include <signal.h>]])
3798 3957
3799 AC_MSG_CHECKING(for time.h that defines altzone) 3958 AC_MSG_CHECKING(for time.h that defines altzone)
3800 AC_CACHE_VAL(ac_cv_header_time_altzone,[ 3959 AC_CACHE_VAL(ac_cv_header_time_altzone,[
3801 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[return altzone;]]) ], 3960 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[return altzone;]]) ],
3802 [ac_cv_header_time_altzone=yes], 3961 [ac_cv_header_time_altzone=yes],
3803 [ac_cv_header_time_altzone=no]) 3962 [ac_cv_header_time_altzone=no])
3804 ]) 3963 ])
3805 AC_MSG_RESULT($ac_cv_header_time_altzone) 3964 AC_MSG_RESULT($ac_cv_header_time_altzone)
3806 if test $ac_cv_header_time_altzone = yes; then 3965 if test $ac_cv_header_time_altzone = yes; then
3807 AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.]) 3966 AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.])
(...skipping 26 matching lines...) Expand all
3834 AC_MSG_CHECKING(for sockaddr_storage) 3993 AC_MSG_CHECKING(for sockaddr_storage)
3835 AC_CACHE_VAL(ac_cv_struct_sockaddr_storage, 3994 AC_CACHE_VAL(ac_cv_struct_sockaddr_storage,
3836 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 3995 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3837 # include <sys/types.h> 3996 # include <sys/types.h>
3838 # include <sys/socket.h>]], [[struct sockaddr_storage s]])], 3997 # include <sys/socket.h>]], [[struct sockaddr_storage s]])],
3839 [ac_cv_struct_sockaddr_storage=yes], 3998 [ac_cv_struct_sockaddr_storage=yes],
3840 [ac_cv_struct_sockaddr_storage=no])) 3999 [ac_cv_struct_sockaddr_storage=no]))
3841 AC_MSG_RESULT($ac_cv_struct_sockaddr_storage) 4000 AC_MSG_RESULT($ac_cv_struct_sockaddr_storage)
3842 if test $ac_cv_struct_sockaddr_storage = yes; then 4001 if test $ac_cv_struct_sockaddr_storage = yes; then
3843 AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket .h)]) 4002 AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket .h)])
4003 fi
4004
4005 AC_MSG_CHECKING(for sockaddr_alg)
4006 AC_CACHE_VAL(ac_cv_struct_sockaddr_alg,
4007 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4008 # include <sys/types.h>
4009 # include <sys/socket.h>
4010 # include <linux/if_alg.h>]], [[struct sockaddr_alg s]])],
4011 [ac_cv_struct_sockaddr_alg=yes],
4012 [ac_cv_struct_sockaddr_alg=no]))
4013 AC_MSG_RESULT($ac_cv_struct_sockaddr_alg)
4014 if test $ac_cv_struct_sockaddr_alg = yes; then
4015 AC_DEFINE(HAVE_SOCKADDR_ALG, 1, [struct sockaddr_alg (linux/if_alg.h)])
3844 fi 4016 fi
3845 4017
3846 # checks for compiler characteristics 4018 # checks for compiler characteristics
3847 4019
3848 AC_C_CHAR_UNSIGNED 4020 AC_C_CHAR_UNSIGNED
3849 AC_C_CONST 4021 AC_C_CONST
3850 4022
3851 works=no 4023 works=no
3852 AC_MSG_CHECKING(for working volatile) 4024 AC_MSG_CHECKING(for working volatile)
3853 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[volatile int x; x = 0;]])], 4025 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[volatile int x; x = 0;]])],
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
3907 4079
3908 # check if sockaddr has sa_len member 4080 # check if sockaddr has sa_len member
3909 AC_MSG_CHECKING(if sockaddr has sa_len member) 4081 AC_MSG_CHECKING(if sockaddr has sa_len member)
3910 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> 4082 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
3911 #include <sys/socket.h>]], [[struct sockaddr x; 4083 #include <sys/socket.h>]], [[struct sockaddr x;
3912 x.sa_len = 0;]])], 4084 x.sa_len = 0;]])],
3913 [AC_MSG_RESULT(yes) 4085 [AC_MSG_RESULT(yes)
3914 AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member])], 4086 AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member])],
3915 [AC_MSG_RESULT(no)] 4087 [AC_MSG_RESULT(no)]
3916 ) 4088 )
3917
3918 va_list_is_array=no
3919 AC_MSG_CHECKING(whether va_list is an array)
3920 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3921 #ifdef HAVE_STDARG_PROTOTYPES
3922 #include <stdarg.h>
3923 #else
3924 #include <varargs.h>
3925 #endif
3926 ]], [[va_list list1, list2; list1 = list2;]])],[],[
3927 AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
3928 va_list_is_array=yes
3929 ])
3930 AC_MSG_RESULT($va_list_is_array)
3931 4089
3932 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( 4090 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
3933 AH_TEMPLATE(HAVE_GETHOSTBYNAME_R, 4091 AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
3934 [Define this if you have some version of gethostbyname_r()]) 4092 [Define this if you have some version of gethostbyname_r()])
3935 4093
3936 AC_CHECK_FUNC(gethostbyname_r, [ 4094 AC_CHECK_FUNC(gethostbyname_r, [
3937 AC_DEFINE(HAVE_GETHOSTBYNAME_R) 4095 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
3938 AC_MSG_CHECKING([gethostbyname_r with 6 args]) 4096 AC_MSG_CHECKING([gethostbyname_r with 6 args])
3939 OLD_CFLAGS=$CFLAGS 4097 OLD_CFLAGS=$CFLAGS
3940 CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" 4098 CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
4791 [ac_cv_stat_tv_nsec2=no])) 4949 [ac_cv_stat_tv_nsec2=no]))
4792 AC_MSG_RESULT($ac_cv_stat_tv_nsec2) 4950 AC_MSG_RESULT($ac_cv_stat_tv_nsec2)
4793 if test "$ac_cv_stat_tv_nsec2" = yes 4951 if test "$ac_cv_stat_tv_nsec2" = yes
4794 then 4952 then
4795 AC_DEFINE(HAVE_STAT_TV_NSEC2, 1, 4953 AC_DEFINE(HAVE_STAT_TV_NSEC2, 1,
4796 [Define if you have struct stat.st_mtimensec]) 4954 [Define if you have struct stat.st_mtimensec])
4797 fi 4955 fi
4798 4956
4799 # first curses header check 4957 # first curses header check
4800 ac_save_cppflags="$CPPFLAGS" 4958 ac_save_cppflags="$CPPFLAGS"
4801 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" 4959 if test "$cross_compiling" = no; then
4960 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
4961 fi
4802 4962
4803 AC_CHECK_HEADERS(curses.h ncurses.h) 4963 AC_CHECK_HEADERS(curses.h ncurses.h)
4804 4964
4805 # On Solaris, term.h requires curses.h 4965 # On Solaris, term.h requires curses.h
4806 AC_CHECK_HEADERS(term.h,,,[ 4966 AC_CHECK_HEADERS(term.h,,,[
4807 #ifdef HAVE_CURSES_H 4967 #ifdef HAVE_CURSES_H
4808 #include <curses.h> 4968 #include <curses.h>
4809 #endif 4969 #endif
4810 ]) 4970 ])
4811 4971
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
4884 5044
4885 AC_CHECK_FILE(/dev/ptmx, [], []) 5045 AC_CHECK_FILE(/dev/ptmx, [], [])
4886 if test "x$ac_cv_file__dev_ptmx" = xyes; then 5046 if test "x$ac_cv_file__dev_ptmx" = xyes; then
4887 AC_DEFINE(HAVE_DEV_PTMX, 1, 5047 AC_DEFINE(HAVE_DEV_PTMX, 1,
4888 [Define to 1 if you have the /dev/ptmx device file.]) 5048 [Define to 1 if you have the /dev/ptmx device file.])
4889 fi 5049 fi
4890 AC_CHECK_FILE(/dev/ptc, [], []) 5050 AC_CHECK_FILE(/dev/ptc, [], [])
4891 if test "x$ac_cv_file__dev_ptc" = xyes; then 5051 if test "x$ac_cv_file__dev_ptc" = xyes; then
4892 AC_DEFINE(HAVE_DEV_PTC, 1, 5052 AC_DEFINE(HAVE_DEV_PTC, 1,
4893 [Define to 1 if you have the /dev/ptc device file.]) 5053 [Define to 1 if you have the /dev/ptc device file.])
4894 fi
4895
4896 if test "$have_long_long" = yes
4897 then
4898 AC_MSG_CHECKING(for %lld and %llu printf() format support)
4899 AC_CACHE_VAL(ac_cv_have_long_long_format,
4900 AC_RUN_IFELSE([AC_LANG_SOURCE([[[
4901 #include <stdio.h>
4902 #include <stddef.h>
4903 #include <string.h>
4904
4905 #ifdef HAVE_SYS_TYPES_H
4906 #include <sys/types.h>
4907 #endif
4908
4909 int main()
4910 {
4911 char buffer[256];
4912
4913 if (sprintf(buffer, "%lld", (long long)123) < 0)
4914 return 1;
4915 if (strcmp(buffer, "123"))
4916 return 1;
4917
4918 if (sprintf(buffer, "%lld", (long long)-123) < 0)
4919 return 1;
4920 if (strcmp(buffer, "-123"))
4921 return 1;
4922
4923 if (sprintf(buffer, "%llu", (unsigned long long)123) < 0)
4924 return 1;
4925 if (strcmp(buffer, "123"))
4926 return 1;
4927
4928 return 0;
4929 }
4930 ]]])],
4931 [ac_cv_have_long_long_format=yes],
4932 [ac_cv_have_long_long_format=no],
4933 [ac_cv_have_long_long_format="cross -- assuming no"
4934 if test x$GCC = xyes; then
4935 save_CFLAGS=$CFLAGS
4936 CFLAGS="$CFLAGS -Werror -Wformat"
4937 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4938 #include <stdio.h>
4939 #include <stddef.h>
4940 ]], [[
4941 char *buffer;
4942 sprintf(buffer, "%lld", (long long)123);
4943 sprintf(buffer, "%lld", (long long)-123);
4944 sprintf(buffer, "%llu", (unsigned long long)123);
4945 ]])],
4946 ac_cv_have_long_long_format=yes
4947 )
4948 CFLAGS=$save_CFLAGS
4949 fi])
4950 )
4951 AC_MSG_RESULT($ac_cv_have_long_long_format)
4952 fi
4953
4954 if test "$ac_cv_have_long_long_format" = yes
4955 then
4956 AC_DEFINE(PY_FORMAT_LONG_LONG, "ll",
4957 [Define to printf format modifier for long long type])
4958 fi 5054 fi
4959 5055
4960 if test $ac_sys_system = Darwin 5056 if test $ac_sys_system = Darwin
4961 then 5057 then
4962 LIBS="$LIBS -framework CoreFoundation" 5058 LIBS="$LIBS -framework CoreFoundation"
4963 fi 5059 fi
4964 5060
4965 AC_CACHE_CHECK([for %zd printf() format support], ac_cv_have_size_t_format, [dnl 5061 AC_CACHE_CHECK([for %zd printf() format support], ac_cv_have_size_t_format, [dnl
4966 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 5062 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4967 #include <stdio.h> 5063 #include <stdio.h>
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
5338 if test ! -f Modules/Setup.local 5434 if test ! -f Modules/Setup.local
5339 then 5435 then
5340 echo "# Edit this file for local setup changes" >Modules/Setup.local 5436 echo "# Edit this file for local setup changes" >Modules/Setup.local
5341 fi 5437 fi
5342 5438
5343 echo "creating Makefile" >&AS_MESSAGE_FD 5439 echo "creating Makefile" >&AS_MESSAGE_FD
5344 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ 5440 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
5345 -s Modules Modules/Setup.config \ 5441 -s Modules Modules/Setup.config \
5346 Modules/Setup.local Modules/Setup 5442 Modules/Setup.local Modules/Setup
5347 mv config.c Modules 5443 mv config.c Modules
5444
5445 if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
5446 echo "" >&AS_MESSAGE_FD
5447 echo "" >&AS_MESSAGE_FD
5448 echo "If you want a release build with all optimizations active (LTO, PGO, e tc)," >&AS_MESSAGE_FD
5449 echo "please run ./configure --enable-optimizations" >&AS_MESSAGE_FD
5450 echo "" >&AS_MESSAGE_FD
5451 echo "" >&AS_MESSAGE_FD
5452 fi
5453
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+