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

Delta Between Two Patch Sets: configure.ac

Issue 26826: Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()
Left Patch Set: Created 3 years, 7 months ago
Right Patch Set: Created 3 years, 7 months 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 | Doc/library/os.rst » ('j') | 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.4) 6 m4_define(PYTHON_VERSION, 3.6)
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, http://bugs.python.org/)
11 11
12 AC_SUBST(BASECPPFLAGS) 12 AC_SUBST(BASECPPFLAGS)
13 if test "$abs_srcdir" != "$abs_builddir"; then 13 if test "$abs_srcdir" != "$abs_builddir"; 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
(...skipping 25 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)
52 AC_CANONICAL_HOST 53 AC_CANONICAL_HOST
53 AC_SUBST(build) 54 AC_SUBST(build)
54 AC_SUBST(host) 55 AC_SUBST(host)
55 56
56 # pybuilddir.txt will be created by --generate-posix-vars in the Makefile 57 # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
57 rm -f pybuilddir.txt 58 rm -f pybuilddir.txt
58 59
59 if test "$cross_compiling" = yes; then 60 if test "$cross_compiling" = yes; then
60 AC_MSG_CHECKING([for python interpreter for cross build]) 61 AC_MSG_CHECKING([for python interpreter for cross build])
61 if test -z "$PYTHON_FOR_BUILD"; then 62 if test -z "$PYTHON_FOR_BUILD"; then
(...skipping 17 matching lines...) Expand all
79 fi 80 fi
80 AC_SUBST(PYTHON_FOR_BUILD) 81 AC_SUBST(PYTHON_FOR_BUILD)
81 82
82 dnl Ensure that if prefix is specified, it does not end in a slash. If 83 dnl Ensure that if prefix is specified, it does not end in a slash. If
83 dnl it does, we get path names containing '//' which is both ugly and 84 dnl it does, we get path names containing '//' which is both ugly and
84 dnl can cause trouble. 85 dnl can cause trouble.
85 86
86 dnl Last slash shouldn't be stripped if prefix=/ 87 dnl Last slash shouldn't be stripped if prefix=/
87 if test "$prefix" != "/"; then 88 if test "$prefix" != "/"; then
88 prefix=`echo "$prefix" | sed -e 's/\/$//g'` 89 prefix=`echo "$prefix" | sed -e 's/\/$//g'`
89 fi 90 fi
90 91
91 dnl This is for stuff that absolutely must end up in pyconfig.h. 92 dnl This is for stuff that absolutely must end up in pyconfig.h.
92 dnl Please use pyport.h instead, if possible. 93 dnl Please use pyport.h instead, if possible.
93 AH_TOP([ 94 AH_TOP([
94 #ifndef Py_PYCONFIG_H 95 #ifndef Py_PYCONFIG_H
95 #define Py_PYCONFIG_H 96 #define Py_PYCONFIG_H
96 ]) 97 ])
97 AH_BOTTOM([ 98 AH_BOTTOM([
98 /* Define the macros needed if on a UnixWare 7.x system. */ 99 /* Define the macros needed if on a UnixWare 7.x system. */
99 #if defined(__USLC__) && defined(__SCO_VERSION__) 100 #if defined(__USLC__) && defined(__SCO_VERSION__)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 enable_universalsdk= 172 enable_universalsdk=
172 ;; 173 ;;
173 *) 174 *)
174 UNIVERSALSDK=$enableval 175 UNIVERSALSDK=$enableval
175 if test ! -d "${UNIVERSALSDK}" 176 if test ! -d "${UNIVERSALSDK}"
176 then 177 then
177 AC_MSG_ERROR([--enable-universalsdk specifies non-existi ng SDK: ${UNIVERSALSDK}]) 178 AC_MSG_ERROR([--enable-universalsdk specifies non-existi ng SDK: ${UNIVERSALSDK}])
178 fi 179 fi
179 ;; 180 ;;
180 esac 181 esac
181 » 182
182 ],[ 183 ],[
183 UNIVERSALSDK= 184 UNIVERSALSDK=
184 enable_universalsdk= 185 enable_universalsdk=
185 ]) 186 ])
186 if test -n "${UNIVERSALSDK}" 187 if test -n "${UNIVERSALSDK}"
187 then 188 then
188 AC_MSG_RESULT(${UNIVERSALSDK}) 189 AC_MSG_RESULT(${UNIVERSALSDK})
189 else 190 else
190 AC_MSG_RESULT(no) 191 AC_MSG_RESULT(no)
191 fi 192 fi
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 ],[ 234 ],[
234 PYTHONFRAMEWORK=Python 235 PYTHONFRAMEWORK=Python
235 PYTHONFRAMEWORKDIR=Python.framework 236 PYTHONFRAMEWORKDIR=Python.framework
236 PYTHONFRAMEWORKIDENTIFIER=org.python.python 237 PYTHONFRAMEWORKIDENTIFIER=org.python.python
237 ]) 238 ])
238 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output 239 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
239 AC_ARG_ENABLE(framework, 240 AC_ARG_ENABLE(framework,
240 AS_HELP_STRING([--enable-framework@<:@=INSTALLDIR@:>@], [Build (Ma cOSX|Darwin) framework]), 241 AS_HELP_STRING([--enable-framework@<:@=INSTALLDIR@:>@], [Build (Ma cOSX|Darwin) framework]),
241 [ 242 [
242 case $enableval in 243 case $enableval in
243 » yes) 244 » yes)
244 enableval=/Library/Frameworks 245 enableval=/Library/Frameworks
245 esac 246 esac
246 case $enableval in 247 case $enableval in
247 no) 248 no)
248 PYTHONFRAMEWORK= 249 PYTHONFRAMEWORK=
249 PYTHONFRAMEWORKDIR=no-framework 250 PYTHONFRAMEWORKDIR=no-framework
250 PYTHONFRAMEWORKPREFIX= 251 PYTHONFRAMEWORKPREFIX=
251 PYTHONFRAMEWORKINSTALLDIR= 252 PYTHONFRAMEWORKINSTALLDIR=
252 FRAMEWORKINSTALLFIRST= 253 FRAMEWORKINSTALLFIRST=
253 FRAMEWORKINSTALLLAST= 254 FRAMEWORKINSTALLLAST=
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 /Library*) 291 /Library*)
291 FRAMEWORKINSTALLAPPSPREFIX="/Applications" 292 FRAMEWORKINSTALLAPPSPREFIX="/Applications"
292 ;; 293 ;;
293 294
294 */Library/Frameworks) 295 */Library/Frameworks)
295 MDIR="`dirname "${enableval}"`" 296 MDIR="`dirname "${enableval}"`"
296 MDIR="`dirname "${MDIR}"`" 297 MDIR="`dirname "${MDIR}"`"
297 FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications" 298 FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
298 299
299 if test "${prefix}" = "NONE"; then 300 if test "${prefix}" = "NONE"; then
300 » » » » # User hasn't specified the 301 » » » » # User hasn't specified the
301 # --prefix option, but wants to install 302 # --prefix option, but wants to install
302 # the framework in a non-default location, 303 # the framework in a non-default location,
303 # ensure that the compatibility links get 304 # ensure that the compatibility links get
304 # installed relative to that prefix as well 305 # installed relative to that prefix as well
305 # instead of in /usr/local. 306 # instead of in /usr/local.
306 FRAMEWORKUNIXTOOLSPREFIX="${MDIR}" 307 FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
307 fi 308 fi
308 ;; 309 ;;
309 310
310 *) 311 *)
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 *-*-cygwin*) 419 *-*-cygwin*)
419 _host_cpu= 420 _host_cpu=
420 ;; 421 ;;
421 *) 422 *)
422 # for now, limit cross builds to known configurations 423 # for now, limit cross builds to known configurations
423 MACHDEP="unknown" 424 MACHDEP="unknown"
424 AC_MSG_ERROR([cross build not supported for $host]) 425 AC_MSG_ERROR([cross build not supported for $host])
425 esac 426 esac
426 _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}" 427 _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
427 fi 428 fi
428 » 429
429 # Some systems cannot stand _XOPEN_SOURCE being defined at all; they 430 # Some systems cannot stand _XOPEN_SOURCE being defined at all; they
430 # disable features if it is defined, without any means to access these 431 # disable features if it is defined, without any means to access these
431 # features as extensions. For these systems, we skip the definition of 432 # features as extensions. For these systems, we skip the definition of
432 # _XOPEN_SOURCE. Before adding a system to the list to gain access to 433 # _XOPEN_SOURCE. Before adding a system to the list to gain access to
433 # some feature, make sure there is no alternative way to access this 434 # some feature, make sure there is no alternative way to access this
434 # feature. Also, when using wildcards, make sure you have verified the 435 # feature. Also, when using wildcards, make sure you have verified the
435 # need for not defining _XOPEN_SOURCE on all systems matching the 436 # need for not defining _XOPEN_SOURCE on all systems matching the
436 # wildcard, and that the wildcard does not include future systems 437 # wildcard, and that the wildcard does not include future systems
437 # (which may remove their limitations). 438 # (which may remove their limitations).
438 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output 439 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
439 case $ac_sys_system/$ac_sys_release in 440 case $ac_sys_system/$ac_sys_release in
440 # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, 441 # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
441 # even though select is a POSIX function. Reported by J. Ribbens. 442 # even though select is a POSIX function. Reported by J. Ribbens.
442 # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. 443 # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
443 # In addition, Stefan Krah confirms that issue #1244610 exists through 444 # In addition, Stefan Krah confirms that issue #1244610 exists through
444 # OpenBSD 4.6, but is fixed in 4.7. 445 # OpenBSD 4.6, but is fixed in 4.7.
445 OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.@<:@0123456@:>@) 446 OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.@<:@0123456@:>@)
446 define_xopen_source=no 447 define_xopen_source=no
447 # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is 448 # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
448 # also defined. This can be overridden by defining _BSD_SOURCE 449 # also defined. This can be overridden by defining _BSD_SOURCE
449 # As this has a different meaning on Linux, only define it on OpenBSD 450 # As this has a different meaning on Linux, only define it on OpenBSD
450 AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library feature s]) 451 AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library feature s])
451 ;; 452 ;;
452 OpenBSD/*) 453 OpenBSD/*)
453 # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is 454 # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
454 # also defined. This can be overridden by defining _BSD_SOURCE 455 # also defined. This can be overridden by defining _BSD_SOURCE
455 # As this has a different meaning on Linux, only define it on OpenBSD 456 # As this has a different meaning on Linux, only define it on OpenBSD
(...skipping 17 matching lines...) Expand all
473 OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@) 474 OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
474 define_xopen_source=no;; 475 define_xopen_source=no;;
475 # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE, 476 # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
476 # but used in struct sockaddr.sa_family. Reported by Tim Rice. 477 # but used in struct sockaddr.sa_family. Reported by Tim Rice.
477 SCO_SV/3.2) 478 SCO_SV/3.2)
478 define_xopen_source=no;; 479 define_xopen_source=no;;
479 # On FreeBSD 4, the math functions C89 does not cover are never defined 480 # On FreeBSD 4, the math functions C89 does not cover are never defined
480 # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them. 481 # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
481 FreeBSD/4.*) 482 FreeBSD/4.*)
482 define_xopen_source=no;; 483 define_xopen_source=no;;
483 # On MacOS X 10.2, a bug in ncurses.h means that it craps out if 484 # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
484 # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which 485 # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
485 # identifies itself as Darwin/7.* 486 # identifies itself as Darwin/7.*
486 # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE 487 # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
487 # disables platform specific features beyond repair. 488 # disables platform specific features beyond repair.
488 # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE 489 # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
489 # has no effect, don't bother defining them 490 # has no effect, don't bother defining them
490 Darwin/@<:@6789@:>@.*) 491 Darwin/@<:@6789@:>@.*)
491 define_xopen_source=no;; 492 define_xopen_source=no;;
492 Darwin/1@<:@0-9@:>@.*) 493 Darwin/1@<:@0-9@:>@.*)
493 define_xopen_source=no;; 494 define_xopen_source=no;;
494 # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but 495 # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
495 # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined 496 # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
496 # or has another value. By not (re)defining it, the defaults come in place. 497 # or has another value. By not (re)defining it, the defaults come in place.
497 AIX/4) 498 AIX/4)
498 define_xopen_source=no;; 499 define_xopen_source=no;;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 esac 535 esac
535 536
536 if test $define_stdc_a1 = yes 537 if test $define_stdc_a1 = yes
537 then 538 then
538 AC_DEFINE(_INCLUDE__STDC_A1_SOURCE, 1, Define to include mbstate_t for mbrtowc ) 539 AC_DEFINE(_INCLUDE__STDC_A1_SOURCE, 1, Define to include mbstate_t for mbrtowc )
539 fi 540 fi
540 541
541 # 542 #
542 # SGI compilers allow the specification of the both the ABI and the 543 # SGI compilers allow the specification of the both the ABI and the
543 # ISA on the command line. Depending on the values of these switches, 544 # ISA on the command line. Depending on the values of these switches,
544 # different and often incompatable code will be generated. 545 # different and often incompatible code will be generated.
545 # 546 #
546 # The SGI_ABI variable can be used to modify the CC and LDFLAGS and 547 # The SGI_ABI variable can be used to modify the CC and LDFLAGS and
547 # thus supply support for various ABI/ISA combinations. The MACHDEP 548 # thus supply support for various ABI/ISA combinations. The MACHDEP
548 # variable is also adjusted. 549 # variable is also adjusted.
549 # 550 #
550 AC_SUBST(SGI_ABI) 551 AC_SUBST(SGI_ABI)
551 if test ! -z "$SGI_ABI" 552 if test ! -z "$SGI_ABI"
552 then 553 then
553 CC="cc $SGI_ABI" 554 CC="cc $SGI_ABI"
554 LDFLAGS="$SGI_ABI $LDFLAGS" 555 LDFLAGS="$SGI_ABI $LDFLAGS"
555 MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` 556 MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
556 fi 557 fi
557 AC_MSG_RESULT($MACHDEP) 558 AC_MSG_RESULT($MACHDEP)
558
559 AC_SUBST(PLATDIR)
560 PLATDIR=plat-$MACHDEP
561 559
562 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, 560 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
563 # it may influence the way we can build extensions, so distutils 561 # it may influence the way we can build extensions, so distutils
564 # needs to check it 562 # needs to check it
565 AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET) 563 AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
566 AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET) 564 AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
567 CONFIGURE_MACOSX_DEPLOYMENT_TARGET= 565 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
568 EXPORT_MACOSX_DEPLOYMENT_TARGET='#' 566 EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
569 567
570 # checks for alternative programs 568 # checks for alternative programs
(...skipping 17 matching lines...) Expand all
588 without_gcc=no;; 586 without_gcc=no;;
589 *) CC=$withval 587 *) CC=$withval
590 without_gcc=$withval;; 588 without_gcc=$withval;;
591 esac], [ 589 esac], [
592 case $ac_sys_system in 590 case $ac_sys_system in
593 AIX*) CC=${CC:-xlc_r} 591 AIX*) CC=${CC:-xlc_r}
594 without_gcc=;; 592 without_gcc=;;
595 *) without_gcc=no;; 593 *) without_gcc=no;;
596 esac]) 594 esac])
597 AC_MSG_RESULT($without_gcc) 595 AC_MSG_RESULT($without_gcc)
596
597 AC_MSG_CHECKING(for --with-icc)
598 AC_ARG_WITH(icc,
599 AS_HELP_STRING([--with-icc], [build with icc]),
600 [
601 case $withval in
602 no) CC=${CC:-cc}
603 with_icc=no;;
604 yes) CC=icc
605 CXX=icpc
606 with_icc=yes;;
607 *) CC=$withval
608 with_icc=$withval;;
609 esac], [
610 with_icc=no])
611 AC_MSG_RESULT($with_icc)
598 612
599 # If the user switches compilers, we can't believe the cache 613 # If the user switches compilers, we can't believe the cache
600 if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" 614 if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
601 then 615 then
602 AC_MSG_ERROR([cached CC is different -- throw away $cache_file 616 AC_MSG_ERROR([cached CC is different -- throw away $cache_file
603 (it is also a good idea to do 'make clean' before compiling)]) 617 (it is also a good idea to do 'make clean' before compiling)])
604 fi 618 fi
605 619
606 # Don't let AC_PROG_CC set the default CFLAGS. It normally sets -g -O2 620 # Don't let AC_PROG_CC set the default CFLAGS. It normally sets -g -O2
607 # when the compiler supports them, but we don't always want -O2, and 621 # when the compiler supports them, but we don't always want -O2, and
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 AC_MSG_NOTICE([Using clang from Xcode.app]) 674 AC_MSG_NOTICE([Using clang from Xcode.app])
661 CC="${found_clang}" 675 CC="${found_clang}"
662 CXX="`/usr/bin/xcrun -find clang++`" 676 CXX="`/usr/bin/xcrun -find clang++`"
663 677
664 # else: use default behaviour 678 # else: use default behaviour
665 fi 679 fi
666 fi 680 fi
667 fi 681 fi
668 fi 682 fi
669 AC_PROG_CC 683 AC_PROG_CC
684 AC_PROG_CPP
685 AC_PROG_GREP
670 686
671 AC_SUBST(CXX) 687 AC_SUBST(CXX)
672 AC_SUBST(MAINCC) 688 AC_SUBST(MAINCC)
673 AC_MSG_CHECKING(for --with-cxx-main=<compiler>) 689 AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
674 AC_ARG_WITH(cxx_main, 690 AC_ARG_WITH(cxx_main,
675 AS_HELP_STRING([--with-cxx-main=<compiler>], 691 AS_HELP_STRING([--with-cxx-main=<compiler>],
676 [compile main() and link python executable with C++ c ompiler]), 692 [compile main() and link python executable with C++ c ompiler]),
677 [ 693 [
678 » 694
679 case $withval in 695 case $withval in
680 no) with_cxx_main=no 696 no) with_cxx_main=no
681 MAINCC='$(CC)';; 697 MAINCC='$(CC)';;
682 yes) with_cxx_main=yes 698 yes) with_cxx_main=yes
683 MAINCC='$(CXX)';; 699 MAINCC='$(CXX)';;
684 *) with_cxx_main=yes 700 *) with_cxx_main=yes
685 MAINCC=$withval 701 MAINCC=$withval
686 if test -z "$CXX" 702 if test -z "$CXX"
687 then 703 then
688 CXX=$withval 704 CXX=$withval
689 fi;; 705 fi;;
690 esac], [ 706 esac], [
691 with_cxx_main=no 707 with_cxx_main=no
692 MAINCC='$(CC)' 708 MAINCC='$(CC)'
693 ]) 709 ])
694 AC_MSG_RESULT($with_cxx_main) 710 AC_MSG_RESULT($with_cxx_main)
695 711
696 preset_cxx="$CXX" 712 preset_cxx="$CXX"
697 if test -z "$CXX" 713 if test -z "$CXX"
698 then 714 then
699 case "$CC" in 715 case "$CC" in
700 gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;; 716 gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
701 cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;; 717 cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
702 clang|*/clang) AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ; ; 718 clang|*/clang) AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ; ;
719 icc|*/icc) AC_PATH_TOOL(CXX, [icpc], [icpc], [notfound]) ;;
703 esac 720 esac
704 if test "$CXX" = "notfound" 721 if test "$CXX" = "notfound"
705 then 722 then
706 CXX="" 723 CXX=""
707 fi 724 fi
708 fi 725 fi
709 if test -z "$CXX" 726 if test -z "$CXX"
710 then 727 then
711 AC_CHECK_TOOLS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound) 728 AC_CHECK_TOOLS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
712 if test "$CXX" = "notfound" 729 if test "$CXX" = "notfound"
713 then 730 then
714 CXX="" 731 CXX=""
715 fi 732 fi
716 fi 733 fi
717 if test "$preset_cxx" != "$CXX" 734 if test "$preset_cxx" != "$CXX"
718 then 735 then
719 AC_MSG_NOTICE([ 736 AC_MSG_NOTICE([
720 737
721 By default, distutils will build C++ extension modules with "$CXX". 738 By default, distutils will build C++ extension modules with "$CXX".
722 If this is not intended, then set CXX on the configure command line. 739 If this is not intended, then set CXX on the configure command line.
723 ]) 740 ])
724 fi 741 fi
742
743
744 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
745 AC_SUBST(MULTIARCH)
746
747 AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
748 cat >> conftest.c <<EOF
749 #undef bfin
750 #undef cris
751 #undef fr30
752 #undef linux
753 #undef hppa
754 #undef hpux
755 #undef i386
756 #undef mips
757 #undef powerpc
758 #undef sparc
759 #undef unix
760 #if defined(__linux__)
761 # if defined(__x86_64__) && defined(__LP64__)
762 x86_64-linux-gnu
763 # elif defined(__x86_64__) && defined(__ILP32__)
764 x86_64-linux-gnux32
765 # elif defined(__i386__)
766 i386-linux-gnu
767 # elif defined(__aarch64__) && defined(__AARCH64EL__)
768 # if defined(__ILP32__)
769 aarch64_ilp32-linux-gnu
770 # else
771 aarch64-linux-gnu
772 # endif
773 # elif defined(__aarch64__) && defined(__AARCH64EB__)
774 # if defined(__ILP32__)
775 aarch64_be_ilp32-linux-gnu
776 # else
777 aarch64_be-linux-gnu
778 # endif
779 # elif defined(__alpha__)
780 alpha-linux-gnu
781 # elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP)
782 # if defined(__ARMEL__)
783 arm-linux-gnueabihf
784 # else
785 armeb-linux-gnueabihf
786 # endif
787 # elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)
788 # if defined(__ARMEL__)
789 arm-linux-gnueabi
790 # else
791 armeb-linux-gnueabi
792 # endif
793 # elif defined(__hppa__)
794 hppa-linux-gnu
795 # elif defined(__ia64__)
796 ia64-linux-gnu
797 # elif defined(__m68k__) && !defined(__mcoldfire__)
798 m68k-linux-gnu
799 # elif defined(__mips_hard_float) && defined(_MIPSEL)
800 # if _MIPS_SIM == _ABIO32
801 mipsel-linux-gnu
802 # elif _MIPS_SIM == _ABIN32
803 mips64el-linux-gnuabin32
804 # elif _MIPS_SIM == _ABI64
805 mips64el-linux-gnuabi64
806 # else
807 # error unknown platform triplet
808 # endif
809 # elif defined(__mips_hard_float)
810 # if _MIPS_SIM == _ABIO32
811 mips-linux-gnu
812 # elif _MIPS_SIM == _ABIN32
813 mips64-linux-gnuabin32
814 # elif _MIPS_SIM == _ABI64
815 mips64-linux-gnuabi64
816 # else
817 # error unknown platform triplet
818 # endif
819 # elif defined(__or1k__)
820 or1k-linux-gnu
821 # elif defined(__powerpc__) && defined(__SPE__)
822 powerpc-linux-gnuspe
823 # elif defined(__powerpc64__)
824 # if defined(__LITTLE_ENDIAN__)
825 powerpc64le-linux-gnu
826 # else
827 powerpc64-linux-gnu
828 # endif
829 # elif defined(__powerpc__)
830 powerpc-linux-gnu
831 # elif defined(__s390x__)
832 s390x-linux-gnu
833 # elif defined(__s390__)
834 s390-linux-gnu
835 # elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
836 sh4-linux-gnu
837 # elif defined(__sparc__) && defined(__arch64__)
838 sparc64-linux-gnu
839 # elif defined(__sparc__)
840 sparc-linux-gnu
841 # else
842 # error unknown platform triplet
843 # endif
844 #elif defined(__FreeBSD_kernel__)
845 # if defined(__LP64__)
846 x86_64-kfreebsd-gnu
847 # elif defined(__i386__)
848 i386-kfreebsd-gnu
849 # else
850 # error unknown platform triplet
851 # endif
852 #elif defined(__gnu_hurd__)
853 i386-gnu
854 #elif defined(__APPLE__)
855 darwin
856 #else
857 # error unknown platform triplet
858 #endif
859
860 EOF
861
862 if $CPP conftest.c >conftest.out 2>/dev/null; then
863 PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
864 AC_MSG_RESULT([$PLATFORM_TRIPLET])
865 else
866 AC_MSG_RESULT([none])
867 fi
868 rm -f conftest.c conftest.out
869
870 if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
871 if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
872 AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
873 fi
874 fi
875 PLATDIR=plat-$MACHDEP
876 AC_SUBST(PLATDIR)
877 AC_SUBST(PLATFORM_TRIPLET)
725 878
726 879
727 AC_MSG_CHECKING([for -Wl,--no-as-needed]) 880 AC_MSG_CHECKING([for -Wl,--no-as-needed])
728 save_LDFLAGS="$LDFLAGS" 881 save_LDFLAGS="$LDFLAGS"
729 LDFLAGS="$LDFLAGS -Wl,--no-as-needed" 882 LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
730 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], 883 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
731 [NO_AS_NEEDED="-Wl,--no-as-needed" 884 [NO_AS_NEEDED="-Wl,--no-as-needed"
732 AC_MSG_RESULT([yes])], 885 AC_MSG_RESULT([yes])],
733 [NO_AS_NEEDED="" 886 [NO_AS_NEEDED=""
734 AC_MSG_RESULT([no])]) 887 AC_MSG_RESULT([no])])
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 esac;; 937 esac;;
785 esac 938 esac
786 939
787 case $ac_sys_system in 940 case $ac_sys_system in
788 hp*|HP*) 941 hp*|HP*)
789 case $CC in 942 case $CC in
790 cc|*/cc) CC="$CC -Ae";; 943 cc|*/cc) CC="$CC -Ae";;
791 esac;; 944 esac;;
792 esac 945 esac
793 946
794 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
795 AC_SUBST(MULTIARCH)
796
797
798 AC_SUBST(LIBRARY) 947 AC_SUBST(LIBRARY)
799 AC_MSG_CHECKING(LIBRARY) 948 AC_MSG_CHECKING(LIBRARY)
800 if test -z "$LIBRARY" 949 if test -z "$LIBRARY"
801 then 950 then
802 LIBRARY='libpython$(VERSION)$(ABIFLAGS).a' 951 LIBRARY='libpython$(VERSION)$(ABIFLAGS).a'
803 fi 952 fi
804 AC_MSG_RESULT($LIBRARY) 953 AC_MSG_RESULT($LIBRARY)
805 954
806 # LDLIBRARY is the name of the library to link against (as opposed to the 955 # LDLIBRARY is the name of the library to link against (as opposed to the
807 # name of the library into which to insert object files). BLDLIBRARY is also 956 # name of the library into which to insert object files). BLDLIBRARY is also
808 # the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY 957 # the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
809 # is blank as the main program is not linked directly against LDLIBRARY. 958 # is blank as the main program is not linked directly against LDLIBRARY.
810 # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On 959 # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
811 # systems without shared libraries, LDLIBRARY is the same as LIBRARY 960 # systems without shared libraries, LDLIBRARY is the same as LIBRARY
812 # (defined in the Makefiles). On Cygwin LDLIBRARY is the import library, 961 # (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,
813 # DLLLIBRARY is the shared (i.e., DLL) library. 962 # DLLLIBRARY is the shared (i.e., DLL) library.
814 # 963 #
815 # RUNSHARED is used to run shared python without installed libraries 964 # RUNSHARED is used to run shared python without installed libraries
816 # 965 #
817 # INSTSONAME is the name of the shared library that will be use to install 966 # INSTSONAME is the name of the shared library that will be use to install
818 # on the system - some systems like version suffix, others don't 967 # on the system - some systems like version suffix, others don't
819 # 968 #
820 # LDVERSION is the shared library version number, normally the Python version 969 # LDVERSION is the shared library version number, normally the Python version
821 # with the ABI build flags appended. 970 # with the ABI build flags appended.
822 AC_SUBST(LDLIBRARY) 971 AC_SUBST(LDLIBRARY)
823 AC_SUBST(DLLLIBRARY) 972 AC_SUBST(DLLLIBRARY)
824 AC_SUBST(BLDLIBRARY) 973 AC_SUBST(BLDLIBRARY)
825 AC_SUBST(PY3LIBRARY) 974 AC_SUBST(PY3LIBRARY)
826 AC_SUBST(LDLIBRARYDIR) 975 AC_SUBST(LDLIBRARYDIR)
827 AC_SUBST(INSTSONAME) 976 AC_SUBST(INSTSONAME)
828 AC_SUBST(RUNSHARED) 977 AC_SUBST(RUNSHARED)
829 AC_SUBST(LDVERSION) 978 AC_SUBST(LDVERSION)
830 LDLIBRARY="$LIBRARY" 979 LDLIBRARY="$LIBRARY"
831 BLDLIBRARY='$(LDLIBRARY)' 980 BLDLIBRARY='$(LDLIBRARY)'
832 INSTSONAME='$(LDLIBRARY)' 981 INSTSONAME='$(LDLIBRARY)'
833 DLLLIBRARY='' 982 DLLLIBRARY=''
834 LDLIBRARYDIR='' 983 LDLIBRARYDIR=''
835 RUNSHARED='' 984 RUNSHARED=''
836 LDVERSION="$VERSION" 985 LDVERSION="$VERSION"
837 986
838 # LINKCC is the command that links the python executable -- default is $(CC). 987 # LINKCC is the command that links the python executable -- default is $(CC).
839 # If CXX is set, and if it is needed to link a main function that was 988 # If CXX is set, and if it is needed to link a main function that was
840 # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable: 989 # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
841 # python might then depend on the C++ runtime 990 # python might then depend on the C++ runtime
842 # This is altered for AIX in order to build the export list before 991 # This is altered for AIX in order to build the export list before
843 # linking. 992 # linking.
844 AC_SUBST(LINKCC) 993 AC_SUBST(LINKCC)
845 AC_MSG_CHECKING(LINKCC) 994 AC_MSG_CHECKING(LINKCC)
846 if test -z "$LINKCC" 995 if test -z "$LINKCC"
847 then 996 then
848 LINKCC='$(PURIFY) $(MAINCC)' 997 LINKCC='$(PURIFY) $(MAINCC)'
849 case $ac_sys_system in 998 case $ac_sys_system in
850 AIX*) 999 AIX*)
851 exp_extra="\"\"" 1000 exp_extra="\"\""
852 if test $ac_sys_release -ge 5 -o \ 1001 if test $ac_sys_release -ge 5 -o \
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 AC_DEFINE(USE_INLINE, 1, [Define to use the C99 inline keyword.]) 1035 AC_DEFINE(USE_INLINE, 1, [Define to use the C99 inline keyword.])
887 AC_SUBST(USE_INLINE) 1036 AC_SUBST(USE_INLINE)
888 fi 1037 fi
889 1038
890 1039
891 AC_MSG_CHECKING(for --enable-shared) 1040 AC_MSG_CHECKING(for --enable-shared)
892 AC_ARG_ENABLE(shared, 1041 AC_ARG_ENABLE(shared,
893 AS_HELP_STRING([--enable-shared], [disable/enable building shared python library])) 1042 AS_HELP_STRING([--enable-shared], [disable/enable building shared python library]))
894 1043
895 if test -z "$enable_shared" 1044 if test -z "$enable_shared"
896 then 1045 then
897 case $ac_sys_system in 1046 case $ac_sys_system in
898 CYGWIN*) 1047 CYGWIN*)
899 enable_shared="yes";; 1048 enable_shared="yes";;
900 *) 1049 *)
901 enable_shared="no";; 1050 enable_shared="no";;
902 esac 1051 esac
903 fi 1052 fi
904 AC_MSG_RESULT($enable_shared) 1053 AC_MSG_RESULT($enable_shared)
905 1054
906 AC_MSG_CHECKING(for --enable-profiling) 1055 AC_MSG_CHECKING(for --enable-profiling)
(...skipping 24 matching lines...) Expand all
931 # extra variable BLDLIBRARY against which Python and the extension 1080 # extra variable BLDLIBRARY against which Python and the extension
932 # modules are linked, BLDLIBRARY. This is normally the same as 1081 # modules are linked, BLDLIBRARY. This is normally the same as
933 # LDLIBRARY, but empty for MacOSX framework builds. 1082 # LDLIBRARY, but empty for MacOSX framework builds.
934 if test "$enable_framework" 1083 if test "$enable_framework"
935 then 1084 then
936 LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' 1085 LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
937 RUNSHARED=DYLD_FRAMEWORK_PATH=`pwd`${DYLD_FRAMEWORK_PATH:+:${DYLD_FRAMEWORK_PA TH}} 1086 RUNSHARED=DYLD_FRAMEWORK_PATH=`pwd`${DYLD_FRAMEWORK_PATH:+:${DYLD_FRAMEWORK_PA TH}}
938 BLDLIBRARY='' 1087 BLDLIBRARY=''
939 else 1088 else
940 BLDLIBRARY='$(LDLIBRARY)' 1089 BLDLIBRARY='$(LDLIBRARY)'
941 fi 1090 fi
942 1091
943 # Other platforms follow 1092 # Other platforms follow
944 if test $enable_shared = "yes"; then 1093 if test $enable_shared = "yes"; then
945 PY_ENABLE_SHARED=1 1094 PY_ENABLE_SHARED=1
946 AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library .]) 1095 AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library .])
947 case $ac_sys_system in 1096 case $ac_sys_system in
948 CYGWIN*) 1097 CYGWIN*)
949 LDLIBRARY='libpython$(LDVERSION).dll.a' 1098 LDLIBRARY='libpython$(LDVERSION).dll.a'
950 DLLLIBRARY='libpython$(LDVERSION).dll' 1099 DLLLIBRARY='libpython$(LDVERSION).dll'
951 ;; 1100 ;;
952 SunOS*) 1101 SunOS*)
953 LDLIBRARY='libpython$(LDVERSION).so' 1102 LDLIBRARY='libpython$(LDVERSION).so'
954 BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' 1103 BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
955 RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} 1104 RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
956 INSTSONAME="$LDLIBRARY".$SOVERSION 1105 INSTSONAME="$LDLIBRARY".$SOVERSION
957 if test "$with_pydebug" != yes 1106 if test "$with_pydebug" != yes
958 then 1107 then
959 PY3LIBRARY=libpython3.so 1108 PY3LIBRARY=libpython3.so
960 fi 1109 fi
961 ;; 1110 ;;
962 Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) 1111 Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
963 LDLIBRARY='libpython$(LDVERSION).so' 1112 LDLIBRARY='libpython$(LDVERSION).so'
964 BLDLIBRARY='-L. -lpython$(LDVERSION)' 1113 BLDLIBRARY='-L. -lpython$(LDVERSION)'
965 RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} 1114 RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
966 case $ac_sys_system in
967 FreeBSD*)
968 SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
969 ;;
970 esac
971 INSTSONAME="$LDLIBRARY".$SOVERSION 1115 INSTSONAME="$LDLIBRARY".$SOVERSION
972 if test "$with_pydebug" != yes 1116 if test "$with_pydebug" != yes
973 then 1117 then
974 PY3LIBRARY=libpython3.so 1118 PY3LIBRARY=libpython3.so
975 fi 1119 fi
976 ;; 1120 ;;
977 hp*|HP*) 1121 hp*|HP*)
978 case `uname -m` in 1122 case `uname -m` in
979 ia64) 1123 ia64)
980 LDLIBRARY='libpython$(LDVERSION).so' 1124 LDLIBRARY='libpython$(LDVERSION).so'
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 AC_SUBST(READELF) 1179 AC_SUBST(READELF)
1036 1180
1037 AC_SUBST(ASDLGEN) 1181 AC_SUBST(ASDLGEN)
1038 AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found) 1182 AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found)
1039 if test "$PYTHON" = not-found; then 1183 if test "$PYTHON" = not-found; then
1040 ASDLGEN="@echo python: $PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #" 1184 ASDLGEN="@echo python: $PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
1041 else 1185 else
1042 ASDLGEN="$PYTHON" 1186 ASDLGEN="$PYTHON"
1043 fi 1187 fi
1044 1188
1189 AC_SUBST(OPCODEHGEN)
1190 AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found)
1191 if test "$PYTHON" = not-found; then
1192 OPCODEHGEN="@echo python: $PYTHON! cannot run Tools/scripts/generate_opcode_ h.py"
1193 else
1194 OPCODEHGEN="$PYTHON"
1195 fi
1196
1197
1045 1198
1046 case $MACHDEP in 1199 case $MACHDEP in
1047 bsdos*|hp*|HP*) 1200 bsdos*|hp*|HP*)
1048 # install -d does not work on BSDI or HP-UX 1201 # install -d does not work on BSDI or HP-UX
1049 if test -z "$INSTALL" 1202 if test -z "$INSTALL"
1050 then 1203 then
1051 INSTALL="${srcdir}/install-sh -c" 1204 INSTALL="${srcdir}/install-sh -c"
1052 fi 1205 fi
1053 esac 1206 esac
1054 AC_PROG_INSTALL 1207 AC_PROG_INSTALL
1055 AC_PROG_MKDIR_P 1208 AC_PROG_MKDIR_P
1056 1209
1057 # Not every filesystem supports hard links 1210 # Not every filesystem supports hard links
1058 AC_SUBST(LN) 1211 AC_SUBST(LN)
1059 if test -z "$LN" ; then 1212 if test -z "$LN" ; then
1060 case $ac_sys_system in 1213 case $ac_sys_system in
1061 CYGWIN*) LN="ln -s";; 1214 CYGWIN*) LN="ln -s";;
1062 *) LN=ln;; 1215 *) LN=ln;;
1063 esac 1216 esac
1064 fi 1217 fi
1065 1218
1066 # For calculating the .so ABI tag. 1219 # For calculating the .so ABI tag.
1067 AC_SUBST(ABIFLAGS) 1220 AC_SUBST(ABIFLAGS)
1068 ABIFLAGS="" 1221 ABIFLAGS=""
1069 1222
1070 # Check for --with-pydebug 1223 # Check for --with-pydebug
1071 AC_MSG_CHECKING(for --with-pydebug) 1224 AC_MSG_CHECKING(for --with-pydebug)
1072 AC_ARG_WITH(pydebug, 1225 AC_ARG_WITH(pydebug,
1073 AS_HELP_STRING([--with-pydebug], [build with Py_DEBUG defined]), 1226 AS_HELP_STRING([--with-pydebug], [build with Py_DEBUG defined]),
1074 [ 1227 [
1075 if test "$withval" != no 1228 if test "$withval" != no
1076 then 1229 then
1077 AC_DEFINE(Py_DEBUG, 1, 1230 AC_DEFINE(Py_DEBUG, 1,
1078 [Define if you want to build an interpreter with many run-time checks.]) 1231 [Define if you want to build an interpreter with many run-time checks.])
1079 AC_MSG_RESULT(yes); 1232 AC_MSG_RESULT(yes);
1080 Py_DEBUG='true' 1233 Py_DEBUG='true'
1081 ABIFLAGS="${ABIFLAGS}d" 1234 ABIFLAGS="${ABIFLAGS}d"
1082 else AC_MSG_RESULT(no); Py_DEBUG='false' 1235 else AC_MSG_RESULT(no); Py_DEBUG='false'
1083 fi], 1236 fi],
1084 [AC_MSG_RESULT(no)]) 1237 [AC_MSG_RESULT(no)])
1238
1239 # Enable LTO flags
1240 AC_SUBST(LTOFLAGS)
1241 AC_MSG_CHECKING(for --with-lto)
1242 AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in PGO builds. Disabled by default.]),
1243 [
1244 if test "$withval" != no
1245 then
1246 Py_LTO='true'
1247 AC_MSG_RESULT(yes);
1248 else
1249 Py_LTO='false'
1250 AC_MSG_RESULT(no);
1251 fi],
1252 [AC_MSG_RESULT(no)])
1253 if test "$Py_LTO" = 'true' ; then
1254 case $CC in
1255 *clang*)
1256 # Any changes made here should be reflected in the GCC+Darwin case below
1257 LTOFLAGS="-flto"
1258 ;;
1259 *gcc*)
1260 case $ac_sys_system in
1261 Darwin*)
1262 LTOFLAGS="-flto"
1263 ;;
1264 *)
1265 LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition= none"
1266 ;;
1267 esac
1268 ;;
1269 esac
1270 fi
1271
1272 # Enable PGO flags.
1273 AC_SUBST(PGO_PROF_GEN_FLAG)
1274 AC_SUBST(PGO_PROF_USE_FLAG)
1275 AC_SUBST(LLVM_PROF_MERGER)
1276 AC_SUBST(LLVM_PROF_FILE)
1277 AC_SUBST(LLVM_PROF_ERR)
1278 AC_SUBST(LLVM_PROF_FOUND)
1279 AC_CHECK_PROG(LLVM_PROF_FOUND, llvm-profdata, found, not-found)
1280 LLVM_PROF_ERR=no
1281 case $CC in
1282 *clang*)
1283 # Any changes made here should be reflected in the GCC+Darwin case below
1284 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
1285 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
1286 LLVM_PROF_MERGER="llvm-profdata merge -output=code.profclangd *.profclangr"
1287 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\""
1288 if test $LLVM_PROF_FOUND = not-found
1289 then
1290 LLVM_PROF_ERR=yes
1291 fi
1292 ;;
1293 *gcc*)
1294 case $ac_sys_system in
1295 Darwin*)
1296 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
1297 PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd"
1298 LLVM_PROF_MERGER="llvm-profdata merge -output=code.profclangd *.profclan gr"
1299 LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\""
1300 if test $LLVM_PROF_FOUND = not-found
1301 then
1302 LLVM_PROF_ERR=yes
1303 fi
1304 ;;
1305 *)
1306 PGO_PROF_GEN_FLAG="-fprofile-generate"
1307 PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction"
1308 LLVM_PROF_MERGER="true"
1309 LLVM_PROF_FILE=""
1310 ;;
1311 esac
1312 ;;
1313 *icc*)
1314 PGO_PROF_GEN_FLAG="-prof-gen"
1315 PGO_PROF_USE_FLAG="-prof-use"
1316 LLVM_PROF_MERGER="true"
1317 LLVM_PROF_FILE=""
1318 ;;
1319 esac
1085 1320
1086 # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be 1321 # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
1087 # merged with this chunk of code? 1322 # merged with this chunk of code?
1088 1323
1089 # Optimizer/debugger flags 1324 # Optimizer/debugger flags
1090 # ------------------------ 1325 # ------------------------
1091 # (The following bit of code is complicated enough - please keep things 1326 # (The following bit of code is complicated enough - please keep things
1092 # indented properly. Just pretend you're editing Python code. ;-) 1327 # indented properly. Just pretend you're editing Python code. ;-)
1093 1328
1094 # There are two parallel sets of case statements below, one that checks to 1329 # There are two parallel sets of case statements below, one that checks to
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 ac_cv_no_strict_aliasing=no 1420 ac_cv_no_strict_aliasing=no
1186 ])) 1421 ]))
1187 CFLAGS="$save_CFLAGS" 1422 CFLAGS="$save_CFLAGS"
1188 CC="$ac_save_cc" 1423 CC="$ac_save_cc"
1189 AC_MSG_RESULT($ac_cv_no_strict_aliasing) 1424 AC_MSG_RESULT($ac_cv_no_strict_aliasing)
1190 if test $ac_cv_no_strict_aliasing = yes 1425 if test $ac_cv_no_strict_aliasing = yes
1191 then 1426 then
1192 BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" 1427 BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
1193 fi 1428 fi
1194 1429
1430 # ICC doesn't recognize the option, but only emits a warning
1431 ## XXX does it emit an unused result warning and can it be disabled?
1432 case "$CC" in
1433 *icc*)
1434 ac_cv_disable_unused_result_warning=no
1435 ;;
1436 *)
1195 AC_MSG_CHECKING(if we can turn off $CC unused result warning) 1437 AC_MSG_CHECKING(if we can turn off $CC unused result warning)
1196 ac_save_cc="$CC" 1438 ac_save_cc="$CC"
1197 CC="$CC -Wunused-result -Werror" 1439 CC="$CC -Wunused-result -Werror"
1198 save_CFLAGS="$CFLAGS" 1440 save_CFLAGS="$CFLAGS"
1199 AC_CACHE_VAL(ac_cv_disable_unused_result_warning, 1441 AC_CACHE_VAL(ac_cv_disable_unused_result_warning,
1200 AC_COMPILE_IFELSE( 1442 AC_COMPILE_IFELSE(
1201 [ 1443 [
1202 AC_LANG_PROGRAM([[]], [[]]) 1444 AC_LANG_PROGRAM([[]], [[]])
1203 ],[ 1445 ],[
1204 ac_cv_disable_unused_result_warning=yes 1446 ac_cv_disable_unused_result_warning=yes
1205 ],[ 1447 ],[
1206 ac_cv_disable_unused_result_warning=no 1448 ac_cv_disable_unused_result_warning=no
1207 ])) 1449 ]))
1208 CFLAGS="$save_CFLAGS" 1450 CFLAGS="$save_CFLAGS"
1209 CC="$ac_save_cc" 1451 CC="$ac_save_cc"
1210 AC_MSG_RESULT($ac_cv_disable_unused_result_warning) 1452 AC_MSG_RESULT($ac_cv_disable_unused_result_warning)
1453 ;;
1454 esac
1211 1455
1212 if test $ac_cv_disable_unused_result_warning = yes 1456 if test $ac_cv_disable_unused_result_warning = yes
1213 then 1457 then
1214 BASECFLAGS="$BASECFLAGS -Wno-unused-result" 1458 BASECFLAGS="$BASECFLAGS -Wno-unused-result"
1215 fi 1459 fi
1216 1460
1217 AC_MSG_CHECKING(for -Werror=declaration-after-statement) 1461 AC_MSG_CHECKING(for -Werror=declaration-after-statement)
1218 ac_save_cc="$CC" 1462 ac_save_cc="$CC"
1219 CC="$CC -Werror=declaration-after-statement" 1463 CC="$CC -Werror=declaration-after-statement"
1220 save_CFLAGS="$CFLAGS" 1464 save_CFLAGS="$CFLAGS"
1221 AC_CACHE_VAL(ac_cv_declaration_after_statement_warning, 1465 AC_CACHE_VAL(ac_cv_declaration_after_statement_warning,
1222 AC_COMPILE_IFELSE( 1466 AC_COMPILE_IFELSE(
1223 [ 1467 [
1224 AC_LANG_PROGRAM([[]], [[]]) 1468 AC_LANG_PROGRAM([[]], [[]])
1225 ],[ 1469 ],[
1226 ac_cv_declaration_after_statement_warning=yes 1470 ac_cv_declaration_after_statement_warning=yes
1227 ],[ 1471 ],[
1228 ac_cv_declaration_after_statement_warning=no 1472 ac_cv_declaration_after_statement_warning=no
1229 ])) 1473 ]))
1230 CFLAGS="$save_CFLAGS" 1474 CFLAGS="$save_CFLAGS"
1231 CC="$ac_save_cc" 1475 CC="$ac_save_cc"
1232 AC_MSG_RESULT($ac_cv_declaration_after_statement_warning) 1476 AC_MSG_RESULT($ac_cv_declaration_after_statement_warning)
1233 1477
1234 if test $ac_cv_declaration_after_statement_warning = yes 1478 if test $ac_cv_declaration_after_statement_warning = yes
1235 then 1479 then
1236 CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement" 1480 CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
1237 fi 1481 fi
1482
1483 AC_MSG_CHECKING(if we can turn on $CC mixed sign comparison warning)
1484 ac_save_cc="$CC"
1485 CC="$CC -Wsign-compare"
1486 save_CFLAGS="$CFLAGS"
1487 AC_CACHE_VAL(ac_cv_enable_sign_compare_warning,
1488 AC_COMPILE_IFELSE(
1489 [
1490 AC_LANG_PROGRAM([[]], [[]])
1491 ],[
1492 ac_cv_enable_sign_compare_warning=yes
1493 ],[
1494 ac_cv_enable_sign_compare_warning=no
1495 ]))
1496 CFLAGS="$save_CFLAGS"
1497 CC="$ac_save_cc"
1498 AC_MSG_RESULT($ac_cv_enable_sign_compare_warning)
1499
1500 if test $ac_cv_enable_sign_compare_warning = yes
1501 then
1502 BASECFLAGS="$BASECFLAGS -Wsign-compare"
1503 fi
1504
1505 AC_MSG_CHECKING(if we can turn on $CC unreachable code warning)
1506 ac_save_cc="$CC"
1507 CC="$CC -Wunreachable-code"
1508 save_CFLAGS="$CFLAGS"
1509 AC_CACHE_VAL(ac_cv_enable_unreachable_code_warning,
1510 AC_COMPILE_IFELSE(
1511 [
1512 AC_LANG_PROGRAM([[]], [[]])
1513 ],[
1514 ac_cv_enable_unreachable_code_warning=yes
1515 ],[
1516 ac_cv_enable_unreachable_code_warning=no
1517 ]))
1518 CFLAGS="$save_CFLAGS"
1519 CC="$ac_save_cc"
1520
1521 # Don't enable unreachable code warning in debug mode, since it usually
1522 # results in non-standard code paths.
1523 # Issue #24324: Unfortunately, the unreachable code warning does not work
1524 # correctly on gcc and has been silently removed from the compiler.
1525 # It is supported on clang but on OS X systems gcc may be an alias
1526 # for clang. Try to determine if the compiler is not really gcc and,
1527 # if so, only then enable the warning.
1528 if test $ac_cv_enable_unreachable_code_warning = yes && \
1529 test "$Py_DEBUG" != "true" && \
1530 test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`"
1531 then
1532 BASECFLAGS="$BASECFLAGS -Wunreachable-code"
1533 else
1534 ac_cv_enable_unreachable_code_warning=no
1535 fi
1536 AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning)
1238 1537
1239 # if using gcc on alpha, use -mieee to get (near) full IEEE 754 1538 # if using gcc on alpha, use -mieee to get (near) full IEEE 754
1240 # support. Without this, treatment of subnormals doesn't follow 1539 # support. Without this, treatment of subnormals doesn't follow
1241 # the standard. 1540 # the standard.
1242 case $host in 1541 case $host in
1243 alpha*) 1542 alpha*)
1244 BASECFLAGS="$BASECFLAGS -mieee" 1543 BASECFLAGS="$BASECFLAGS -mieee"
1245 ;; 1544 ;;
1246 esac 1545 esac
1247 1546
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 OpenUNIX*|UnixWare*) 1676 OpenUNIX*|UnixWare*)
1378 BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca " 1677 BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
1379 ;; 1678 ;;
1380 SCO_SV*) 1679 SCO_SV*)
1381 BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5" 1680 BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
1382 ;; 1681 ;;
1383 esac 1682 esac
1384 ;; 1683 ;;
1385 esac 1684 esac
1386 1685
1686 # ICC needs -fp-model strict or floats behave badly
1687 case "$CC" in
1688 *icc*)
1689 CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
1690 ;;
1691 esac
1692
1387 if test "$Py_DEBUG" = 'true'; then 1693 if test "$Py_DEBUG" = 'true'; then
1388 : 1694 :
1389 else 1695 else
1390 OPT="-DNDEBUG $OPT" 1696 OPT="-DNDEBUG $OPT"
1391 fi 1697 fi
1392 1698
1393 if test "$ac_arch_flags" 1699 if test "$ac_arch_flags"
1394 then 1700 then
1395 BASECFLAGS="$BASECFLAGS $ac_arch_flags" 1701 BASECFLAGS="$BASECFLAGS $ac_arch_flags"
1396 fi 1702 fi
(...skipping 20 matching lines...) Expand all
1417 } 1723 }
1418 ]])],[ 1724 ]])],[
1419 ac_cv_pthread_is_default=yes 1725 ac_cv_pthread_is_default=yes
1420 ac_cv_kthread=no 1726 ac_cv_kthread=no
1421 ac_cv_pthread=no 1727 ac_cv_pthread=no
1422 ],[ac_cv_pthread_is_default=no],[ac_cv_pthread_is_default=no]) 1728 ],[ac_cv_pthread_is_default=no],[ac_cv_pthread_is_default=no])
1423 ]) 1729 ])
1424 AC_MSG_RESULT($ac_cv_pthread_is_default) 1730 AC_MSG_RESULT($ac_cv_pthread_is_default)
1425 1731
1426 1732
1427 if test $ac_cv_pthread_is_default = yes 1733 if test $ac_cv_pthread_is_default = yes
1428 then 1734 then
1429 ac_cv_kpthread=no 1735 ac_cv_kpthread=no
1430 else 1736 else
1431 # -Kpthread, if available, provides the right #defines 1737 # -Kpthread, if available, provides the right #defines
1432 # and linker options to make pthread_create available 1738 # and linker options to make pthread_create available
1433 # Some compilers won't report that they do not support -Kpthread, 1739 # Some compilers won't report that they do not support -Kpthread,
1434 # so we need to run a program to see whether it really made the 1740 # so we need to run a program to see whether it really made the
1435 # function available. 1741 # function available.
1436 AC_MSG_CHECKING(whether $CC accepts -Kpthread) 1742 AC_MSG_CHECKING(whether $CC accepts -Kpthread)
1437 AC_CACHE_VAL(ac_cv_kpthread, 1743 AC_CACHE_VAL(ac_cv_kpthread,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 # If we have set a CC compiler flag for thread support then 1822 # If we have set a CC compiler flag for thread support then
1517 # check if it works for CXX, too. 1823 # check if it works for CXX, too.
1518 ac_cv_cxx_thread=no 1824 ac_cv_cxx_thread=no
1519 if test ! -z "$CXX" 1825 if test ! -z "$CXX"
1520 then 1826 then
1521 AC_MSG_CHECKING(whether $CXX also accepts flags for thread support) 1827 AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
1522 ac_save_cxx="$CXX" 1828 ac_save_cxx="$CXX"
1523 1829
1524 if test "$ac_cv_kpthread" = "yes" 1830 if test "$ac_cv_kpthread" = "yes"
1525 then 1831 then
1526 CXX="$CXX -Kpthread" 1832 CXX="$CXX -Kpthread"
1527 ac_cv_cxx_thread=yes 1833 ac_cv_cxx_thread=yes
1528 elif test "$ac_cv_kthread" = "yes" 1834 elif test "$ac_cv_kthread" = "yes"
1529 then 1835 then
1530 CXX="$CXX -Kthread" 1836 CXX="$CXX -Kthread"
1531 ac_cv_cxx_thread=yes 1837 ac_cv_cxx_thread=yes
1532 elif test "$ac_cv_pthread" = "yes" 1838 elif test "$ac_cv_pthread" = "yes"
1533 then 1839 then
1534 CXX="$CXX -pthread" 1840 CXX="$CXX -pthread"
1535 ac_cv_cxx_thread=yes 1841 ac_cv_cxx_thread=yes
1536 fi 1842 fi
1537 1843
1538 if test $ac_cv_cxx_thread = yes 1844 if test $ac_cv_cxx_thread = yes
1539 then 1845 then
1540 echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext 1846 echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext
1541 $CXX -c conftest.$ac_ext 2>&5 1847 $CXX -c conftest.$ac_ext 2>&5
1542 if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \ 1848 if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
1543 && test -s conftest$ac_exeext && ./conftest$ac_exeext 1849 && test -s conftest$ac_exeext && ./conftest$ac_exeext
(...skipping 24 matching lines...) Expand all
1568 ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ 1874 ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
1569 sched.h shadow.h signal.h stdint.h stropts.h termios.h \ 1875 sched.h shadow.h signal.h stdint.h stropts.h termios.h \
1570 unistd.h utime.h \ 1876 unistd.h utime.h \
1571 poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ 1877 poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
1572 sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \ 1878 sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
1573 sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \ 1879 sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \
1574 sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ 1880 sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
1575 sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \ 1881 sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
1576 sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \ 1882 sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
1577 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ 1883 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
1578 bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h endian.h \ 1884 bluetooth/bluetooth.h linux/tipc.h linux/random.h spawn.h util.h alloca.h endian .h \
1579 sys/endian.h) 1885 sys/endian.h)
1580 AC_HEADER_DIRENT 1886 AC_HEADER_DIRENT
1581 AC_HEADER_MAJOR 1887 AC_HEADER_MAJOR
1582 1888
1583 # On Darwin (OS X) net/if.h requires sys/socket.h to be imported first. 1889 # On Darwin (OS X) net/if.h requires sys/socket.h to be imported first.
1584 AC_CHECK_HEADERS([net/if.h], [], [], 1890 AC_CHECK_HEADERS([net/if.h], [], [],
1585 [#include <stdio.h> 1891 [#include <stdio.h>
1586 #ifdef STDC_HEADERS 1892 #ifdef STDC_HEADERS
1587 # include <stdlib.h> 1893 # include <stdlib.h>
1588 # include <stddef.h> 1894 # include <stddef.h>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 AC_MSG_RESULT($sol_lfs_bug) 1977 AC_MSG_RESULT($sol_lfs_bug)
1672 if test "$sol_lfs_bug" = "yes"; then 1978 if test "$sol_lfs_bug" = "yes"; then
1673 use_lfs=no 1979 use_lfs=no
1674 fi 1980 fi
1675 1981
1676 if test "$use_lfs" = "yes"; then 1982 if test "$use_lfs" = "yes"; then
1677 # Two defines needed to enable largefile support on various platforms 1983 # Two defines needed to enable largefile support on various platforms
1678 # These may affect some typedefs 1984 # These may affect some typedefs
1679 case $ac_sys_system/$ac_sys_release in 1985 case $ac_sys_system/$ac_sys_release in
1680 AIX*) 1986 AIX*)
1681 AC_DEFINE(_LARGE_FILES, 1, 1987 AC_DEFINE(_LARGE_FILES, 1,
1682 [This must be defined on AIX systems to enable large file support.]) 1988 [This must be defined on AIX systems to enable large file support.])
1683 ;; 1989 ;;
1684 esac 1990 esac
1685 AC_DEFINE(_LARGEFILE_SOURCE, 1, 1991 AC_DEFINE(_LARGEFILE_SOURCE, 1,
1686 [This must be defined on some systems to enable large file support.]) 1992 [This must be defined on some systems to enable large file support.])
1687 AC_DEFINE(_FILE_OFFSET_BITS, 64, 1993 AC_DEFINE(_FILE_OFFSET_BITS, 64,
1688 [This must be set to 64 on some systems to enable large file support.]) 1994 [This must be set to 64 on some systems to enable large file support.])
1689 fi 1995 fi
1690 1996
1691 # Add some code to confdefs.h so that the test for off_t works on SCO 1997 # Add some code to confdefs.h so that the test for off_t works on SCO
1692 cat >> confdefs.h <<\EOF 1998 cat >> confdefs.h <<\EOF
1693 #if defined(SCO_DS) 1999 #if defined(SCO_DS)
1694 #undef _OFF_T 2000 #undef _OFF_T
1695 #endif 2001 #endif
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 AC_CHECK_SIZEOF(short, 2) 2045 AC_CHECK_SIZEOF(short, 2)
1740 AC_CHECK_SIZEOF(float, 4) 2046 AC_CHECK_SIZEOF(float, 4)
1741 AC_CHECK_SIZEOF(double, 8) 2047 AC_CHECK_SIZEOF(double, 8)
1742 AC_CHECK_SIZEOF(fpos_t, 4) 2048 AC_CHECK_SIZEOF(fpos_t, 4)
1743 AC_CHECK_SIZEOF(size_t, 4) 2049 AC_CHECK_SIZEOF(size_t, 4)
1744 AC_CHECK_SIZEOF(pid_t, 4) 2050 AC_CHECK_SIZEOF(pid_t, 4)
1745 2051
1746 AC_MSG_CHECKING(for long long support) 2052 AC_MSG_CHECKING(for long long support)
1747 have_long_long=no 2053 have_long_long=no
1748 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[ 2054 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[
1749 AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.]) 2055 AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
1750 have_long_long=yes 2056 have_long_long=yes
1751 ],[]) 2057 ],[])
1752 AC_MSG_RESULT($have_long_long) 2058 AC_MSG_RESULT($have_long_long)
1753 if test "$have_long_long" = yes ; then 2059 if test "$have_long_long" = yes ; then
1754 AC_CHECK_SIZEOF(long long, 8) 2060 AC_CHECK_SIZEOF(long long, 8)
1755 fi 2061 fi
1756 2062
1757 AC_MSG_CHECKING(for long double support) 2063 AC_MSG_CHECKING(for long double support)
1758 have_long_double=no 2064 have_long_double=no
1759 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]]) ],[ 2065 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]]) ],[
1760 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.] ) 2066 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.] )
1761 have_long_double=yes 2067 have_long_double=yes
1762 ],[]) 2068 ],[])
1763 AC_MSG_RESULT($have_long_double) 2069 AC_MSG_RESULT($have_long_double)
1764 if test "$have_long_double" = yes ; then 2070 if test "$have_long_double" = yes ; then
1765 AC_CHECK_SIZEOF(long double, 16) 2071 AC_CHECK_SIZEOF(long double, 16)
1766 fi 2072 fi
1767 2073
1768 2074
1769 AC_MSG_CHECKING(for _Bool support) 2075 AC_MSG_CHECKING(for _Bool support)
1770 have_c99_bool=no 2076 have_c99_bool=no
1771 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Bool x; x = (_Bool)0;]])],[ 2077 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Bool x; x = (_Bool)0;]])],[
1772 AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.]) 2078 AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.])
1773 have_c99_bool=yes 2079 have_c99_bool=yes
1774 ],[]) 2080 ],[])
1775 AC_MSG_RESULT($have_c99_bool) 2081 AC_MSG_RESULT($have_c99_bool)
1776 if test "$have_c99_bool" = yes ; then 2082 if test "$have_c99_bool" = yes ; then
1777 AC_CHECK_SIZEOF(_Bool, 1) 2083 AC_CHECK_SIZEOF(_Bool, 1)
1778 fi 2084 fi
1779 2085
1780 AC_CHECK_TYPES(uintptr_t, 2086 AC_CHECK_TYPES(uintptr_t,
1781 [AC_CHECK_SIZEOF(uintptr_t, 4)], 2087 [AC_CHECK_SIZEOF(uintptr_t, 4)],
1782 [], [#ifdef HAVE_STDINT_H 2088 [], [#ifdef HAVE_STDINT_H
1783 #include <stdint.h> 2089 #include <stdint.h>
1784 #endif 2090 #endif
1785 #ifdef HAVE_INTTYPES_H 2091 #ifdef HAVE_INTTYPES_H
1786 #include <inttypes.h> 2092 #include <inttypes.h>
1787 #endif]) 2093 #endif])
1788 2094
1789 AC_CHECK_SIZEOF(off_t, [], [ 2095 AC_CHECK_SIZEOF(off_t, [], [
1790 #ifdef HAVE_SYS_TYPES_H 2096 #ifdef HAVE_SYS_TYPES_H
1791 #include <sys/types.h> 2097 #include <sys/types.h>
1792 #endif 2098 #endif
1793 ]) 2099 ])
1794 2100
1795 AC_MSG_CHECKING(whether to enable large file support) 2101 AC_MSG_CHECKING(whether to enable large file support)
1796 if test "$have_long_long" = yes 2102 if test "$have_long_long" = yes
1797 then 2103 then
1798 if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ 2104 if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
1799 "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then 2105 "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
1800 AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1, 2106 AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
1801 [Defined to enable large file support when an off_t is bigger than a long 2107 [Defined to enable large file support when an off_t is bigger than a long
1802 and long long is available and at least as big as an off_t. You may need 2108 and long long is available and at least as big as an off_t. You may need
1803 to add some flags for configuration and compilation to enable this mode. 2109 to add some flags for configuration and compilation to enable this mode.
1804 (For Solaris and Linux, the necessary defines are already defined.)]) 2110 (For Solaris and Linux, the necessary defines are already defined.)])
1805 AC_MSG_RESULT(yes) 2111 AC_MSG_RESULT(yes)
1806 else 2112 else
1807 AC_MSG_RESULT(no) 2113 AC_MSG_RESULT(no)
1808 fi 2114 fi
1809 else 2115 else
1810 AC_MSG_RESULT(no) 2116 AC_MSG_RESULT(no)
(...skipping 28 matching lines...) Expand all
1839 AC_CHECK_SIZEOF(pthread_t, [], [ 2145 AC_CHECK_SIZEOF(pthread_t, [], [
1840 #ifdef HAVE_PTHREAD_H 2146 #ifdef HAVE_PTHREAD_H
1841 #include <pthread.h> 2147 #include <pthread.h>
1842 #endif 2148 #endif
1843 ]) 2149 ])
1844 fi 2150 fi
1845 CC="$ac_save_cc" 2151 CC="$ac_save_cc"
1846 2152
1847 AC_SUBST(OTHER_LIBTOOL_OPT) 2153 AC_SUBST(OTHER_LIBTOOL_OPT)
1848 case $ac_sys_system/$ac_sys_release in 2154 case $ac_sys_system/$ac_sys_release in
1849 Darwin/@<:@01567@:>@\..*) 2155 Darwin/@<:@01567@:>@\..*)
1850 OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000" 2156 OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
1851 ;; 2157 ;;
1852 Darwin/*) 2158 Darwin/*)
1853 OTHER_LIBTOOL_OPT="" 2159 OTHER_LIBTOOL_OPT=""
1854 ;; 2160 ;;
1855 esac 2161 esac
1856 2162
1857 2163
1858 AC_SUBST(LIBTOOL_CRUFT) 2164 AC_SUBST(LIBTOOL_CRUFT)
1859 case $ac_sys_system/$ac_sys_release in 2165 case $ac_sys_system/$ac_sys_release in
1860 Darwin/@<:@01567@:>@\..*) 2166 Darwin/@<:@01567@:>@\..*)
1861 LIBTOOL_CRUFT="-framework System -lcc_dynamic" 2167 LIBTOOL_CRUFT="-framework System -lcc_dynamic"
1862 if test "${enable_universalsdk}"; then 2168 if test "${enable_universalsdk}"; then
1863 : 2169 :
1864 else 2170 else
1865 LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `/usr/bin/arch`" 2171 LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `/usr/bin/arch`"
1866 fi 2172 fi
1867 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Ver sions/$(VERSION)/$(PYTHONFRAMEWORK)' 2173 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Ver sions/$(VERSION)/$(PYTHONFRAMEWORK)'
1868 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_ver sion $(VERSION)';; 2174 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_ver sion $(VERSION)';;
1869 Darwin/*) 2175 Darwin/*)
1870 gcc_version=`gcc -dumpversion` 2176 gcc_version=`gcc -dumpversion`
1871 if test ${gcc_version} '<' 4.0 2177 if test ${gcc_version} '<' 4.0
1872 then 2178 then
1873 LIBTOOL_CRUFT="-lcc_dynamic" 2179 LIBTOOL_CRUFT="-lcc_dynamic"
1874 else 2180 else
1875 LIBTOOL_CRUFT="" 2181 LIBTOOL_CRUFT=""
1876 fi 2182 fi
1877 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 2183 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1878 #include <unistd.h> 2184 #include <unistd.h>
1879 int main(int argc, char*argv[]) 2185 int main(int argc, char*argv[])
1880 { 2186 {
1881 if (sizeof(long) == 4) { 2187 if (sizeof(long) == 4) {
1882 return 0; 2188 return 0;
1883 } else { 2189 } else {
1884 return 1; 2190 return 1;
1885 } 2191 }
1886 } 2192 }
1887 ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes]) 2193 ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes])
1888 2194
1889 if test "${ac_osx_32bit}" = "yes"; then 2195 if test "${ac_osx_32bit}" = "yes"; then
1890 case `/usr/bin/arch` in 2196 case `/usr/bin/arch` in
1891 » i386) 2197 » i386)
1892 » » MACOSX_DEFAULT_ARCH="i386" 2198 » » MACOSX_DEFAULT_ARCH="i386"
1893 ;; 2199 ;;
1894 » ppc) 2200 » ppc)
1895 » » MACOSX_DEFAULT_ARCH="ppc" 2201 » » MACOSX_DEFAULT_ARCH="ppc"
1896 ;; 2202 ;;
1897 *) 2203 *)
1898 AC_MSG_ERROR([Unexpected output of 'arch' on OSX]) 2204 AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
1899 ;; 2205 ;;
1900 esac 2206 esac
1901 else 2207 else
1902 case `/usr/bin/arch` in 2208 case `/usr/bin/arch` in
1903 » i386) 2209 » i386)
1904 » » MACOSX_DEFAULT_ARCH="x86_64" 2210 » » MACOSX_DEFAULT_ARCH="x86_64"
1905 ;; 2211 ;;
1906 » ppc) 2212 » ppc)
1907 » » MACOSX_DEFAULT_ARCH="ppc64" 2213 » » MACOSX_DEFAULT_ARCH="ppc64"
1908 ;; 2214 ;;
1909 *) 2215 *)
1910 AC_MSG_ERROR([Unexpected output of 'arch' on OSX]) 2216 AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
1911 ;; 2217 ;;
1912 esac 2218 esac
1913 2219
1914 fi 2220 fi
1915 2221
1916 LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEF AULT_ARCH}" 2222 LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEF AULT_ARCH}"
1917 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Ver sions/$(VERSION)/$(PYTHONFRAMEWORK)' 2223 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Ver sions/$(VERSION)/$(PYTHONFRAMEWORK)'
1918 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_ver sion $(VERSION)';; 2224 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_ver sion $(VERSION)';;
1919 esac 2225 esac
1920 AC_MSG_CHECKING(for --enable-framework) 2226 AC_MSG_CHECKING(for --enable-framework)
1921 if test "$enable_framework" 2227 if test "$enable_framework"
1922 then 2228 then
1923 BASECFLAGS="$BASECFLAGS -fno-common -dynamic" 2229 BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
1924 » # -F. is needed to allow linking to the framework while 2230 » # -F. is needed to allow linking to the framework while
1925 # in the build location. 2231 # in the build location.
1926 » AC_DEFINE(WITH_NEXT_FRAMEWORK, 1, 2232 » AC_DEFINE(WITH_NEXT_FRAMEWORK, 1,
1927 [Define if you want to produce an OpenStep/Rhapsody framework 2233 [Define if you want to produce an OpenStep/Rhapsody framework
1928 (shared library plus accessory files).]) 2234 (shared library plus accessory files).])
1929 AC_MSG_RESULT(yes) 2235 AC_MSG_RESULT(yes)
1930 if test $enable_shared = "yes" 2236 if test $enable_shared = "yes"
1931 then 2237 then
1932 AC_MSG_ERROR([Specifying both --enable-shared and --enable-frame work is not supported, use only --enable-framework instead]) 2238 AC_MSG_ERROR([Specifying both --enable-shared and --enable-frame work is not supported, use only --enable-framework instead])
1933 fi 2239 fi
1934 else 2240 else
1935 AC_MSG_RESULT(no) 2241 AC_MSG_RESULT(no)
1936 fi 2242 fi
1937 2243
1938 AC_MSG_CHECKING(for dyld) 2244 AC_MSG_CHECKING(for dyld)
1939 case $ac_sys_system/$ac_sys_release in 2245 case $ac_sys_system/$ac_sys_release in
1940 Darwin/*) 2246 Darwin/*)
1941 » AC_DEFINE(WITH_DYLD, 1, 2247 » AC_DEFINE(WITH_DYLD, 1,
1942 [Define if you want to use the new-style (Openstep, Rhapsody, MacOS) 2248 [Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
1943 dynamic linker (dyld) instead of the old-style (NextStep) dynamic 2249 dynamic linker (dyld) instead of the old-style (NextStep) dynamic
1944 linker (rld). Dyld is necessary to support frameworks.]) 2250 linker (rld). Dyld is necessary to support frameworks.])
1945 AC_MSG_RESULT(always on for Darwin) 2251 AC_MSG_RESULT(always on for Darwin)
1946 ;; 2252 ;;
1947 *) 2253 *)
1948 AC_MSG_RESULT(no) 2254 AC_MSG_RESULT(no)
1949 ;; 2255 ;;
1950 esac 2256 esac
1951 2257
(...skipping 29 matching lines...) Expand all
1981 AC_MSG_CHECKING(LDSHARED) 2287 AC_MSG_CHECKING(LDSHARED)
1982 if test -z "$LDSHARED" 2288 if test -z "$LDSHARED"
1983 then 2289 then
1984 case $ac_sys_system/$ac_sys_release in 2290 case $ac_sys_system/$ac_sys_release in
1985 AIX*) 2291 AIX*)
1986 BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Mo dules/python.exp" 2292 BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Mo dules/python.exp"
1987 LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDE ST)/config/python.exp" 2293 LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDE ST)/config/python.exp"
1988 ;; 2294 ;;
1989 IRIX/5*) LDSHARED="ld -shared";; 2295 IRIX/5*) LDSHARED="ld -shared";;
1990 IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; 2296 IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
1991 » SunOS/5*) 2297 » SunOS/5*)
1992 if test "$GCC" = "yes" ; then 2298 if test "$GCC" = "yes" ; then
1993 LDSHARED='$(CC) -shared' 2299 LDSHARED='$(CC) -shared'
1994 LDCXXSHARED='$(CXX) -shared' 2300 LDCXXSHARED='$(CXX) -shared'
1995 else 2301 else
1996 LDSHARED='$(CC) -G' 2302 LDSHARED='$(CC) -G'
1997 LDCXXSHARED='$(CXX) -G' 2303 LDCXXSHARED='$(CXX) -G'
1998 fi ;; 2304 fi ;;
1999 hp*|HP*) 2305 hp*|HP*)
2000 if test "$GCC" = "yes" ; then 2306 if test "$GCC" = "yes" ; then
2001 LDSHARED='$(CC) -shared' 2307 LDSHARED='$(CC) -shared'
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 if test -z "$LINKFORSHARED" 2463 if test -z "$LINKFORSHARED"
2158 then 2464 then
2159 case $ac_sys_system/$ac_sys_release in 2465 case $ac_sys_system/$ac_sys_release in
2160 AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';; 2466 AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
2161 hp*|HP*) 2467 hp*|HP*)
2162 LINKFORSHARED="-Wl,-E -Wl,+s";; 2468 LINKFORSHARED="-Wl,-E -Wl,+s";;
2163 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; 2469 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
2164 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; 2470 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
2165 Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; 2471 Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
2166 # -u libsys_s pulls in all symbols in libsys 2472 # -u libsys_s pulls in all symbols in libsys
2167 » Darwin/*) 2473 » Darwin/*)
2168 LINKFORSHARED="$extra_undefs -framework CoreFoundation" 2474 LINKFORSHARED="$extra_undefs -framework CoreFoundation"
2169 2475
2170 # Issue #18075: the default maximum stack size (8MBytes) is too 2476 # Issue #18075: the default maximum stack size (8MBytes) is too
2171 # small for the default recursion limit. Increase the stack size 2477 # small for the default recursion limit. Increase the stack size
2172 # to ensure that tests don't crash 2478 # to ensure that tests don't crash
2173 LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED" 2479 LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED"
2174 2480
2175 if test "$enable_framework" 2481 if test "$enable_framework"
2176 then 2482 then
2177 LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Ve rsions/$(VERSION)/$(PYTHONFRAMEWORK)' 2483 LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Ve rsions/$(VERSION)/$(PYTHONFRAMEWORK)'
2178 fi 2484 fi
2179 LINKFORSHARED="$LINKFORSHARED";; 2485 LINKFORSHARED="$LINKFORSHARED";;
2180 OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";; 2486 OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
2181 SCO_SV*) LINKFORSHARED="-Wl,-Bexport";; 2487 SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
2182 ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; 2488 ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
2183 » FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) 2489 » FreeBSD*|NetBSD*|OpenBSD*|DragonFly*)
2184 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] 2490 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
2185 then 2491 then
2186 LINKFORSHARED="-Wl,--export-dynamic" 2492 LINKFORSHARED="-Wl,--export-dynamic"
2187 fi;; 2493 fi;;
2188 SunOS/5*) case $CC in 2494 SunOS/5*) case $CC in
2189 *gcc*) 2495 *gcc*)
2190 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null 2496 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
2191 then 2497 then
2192 LINKFORSHARED="-Xlinker --export-dynamic" 2498 LINKFORSHARED="-Xlinker --export-dynamic"
2193 fi;; 2499 fi;;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2325 fnv) 2631 fnv)
2326 AC_DEFINE(Py_HASH_ALGORITHM, 2) 2632 AC_DEFINE(Py_HASH_ALGORITHM, 2)
2327 ;; 2633 ;;
2328 *) 2634 *)
2329 AC_MSG_ERROR([unknown hash algorithm '$withval']) 2635 AC_MSG_ERROR([unknown hash algorithm '$withval'])
2330 ;; 2636 ;;
2331 esac 2637 esac
2332 ], 2638 ],
2333 [AC_MSG_RESULT(default)]) 2639 [AC_MSG_RESULT(default)])
2334 2640
2641 AC_MSG_CHECKING(for --with-address-sanitizer)
2642 AC_ARG_WITH(address_sanitizer,
2643 AS_HELP_STRING([--with-address-sanitizer],
2644 [enable AddressSanitizer]),
2645 [
2646 AC_MSG_RESULT($withval)
2647 BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
2648 LDFLAGS="-fsanitize=address $LDFLAGS"
2649 ],
2650 [AC_MSG_RESULT(no)])
2651
2335 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. 2652 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
2336 AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 2653 AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
2337 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets 2654 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
2338 2655
2339 AC_MSG_CHECKING(for --with-libs) 2656 AC_MSG_CHECKING(for --with-libs)
2340 AC_ARG_WITH(libs, 2657 AC_ARG_WITH(libs,
2341 AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional li bs]), 2658 AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional li bs]),
2342 [ 2659 [
2343 AC_MSG_RESULT($withval) 2660 AC_MSG_RESULT($withval)
2344 LIBS="$withval $LIBS" 2661 LIBS="$withval $LIBS"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 AC_SUBST(THREADOBJ) 2805 AC_SUBST(THREADOBJ)
2489 if test "$with_threads" = "no" 2806 if test "$with_threads" = "no"
2490 then 2807 then
2491 USE_THREAD_MODULE="#" 2808 USE_THREAD_MODULE="#"
2492 elif test "$ac_cv_pthread_is_default" = yes 2809 elif test "$ac_cv_pthread_is_default" = yes
2493 then 2810 then
2494 AC_DEFINE(WITH_THREAD) 2811 AC_DEFINE(WITH_THREAD)
2495 # Defining _REENTRANT on system with POSIX threads should not hurt. 2812 # Defining _REENTRANT on system with POSIX threads should not hurt.
2496 AC_DEFINE(_REENTRANT) 2813 AC_DEFINE(_REENTRANT)
2497 posix_threads=yes 2814 posix_threads=yes
2498 THREADOBJ="Python/thread.o" 2815 THREADOBJ="Python/thread.o"
2499 elif test "$ac_cv_kpthread" = "yes" 2816 elif test "$ac_cv_kpthread" = "yes"
2500 then 2817 then
2501 CC="$CC -Kpthread" 2818 CC="$CC -Kpthread"
2502 if test "$ac_cv_cxx_thread" = "yes"; then 2819 if test "$ac_cv_cxx_thread" = "yes"; then
2503 CXX="$CXX -Kpthread" 2820 CXX="$CXX -Kpthread"
2504 fi 2821 fi
2505 AC_DEFINE(WITH_THREAD) 2822 AC_DEFINE(WITH_THREAD)
2506 posix_threads=yes 2823 posix_threads=yes
2507 THREADOBJ="Python/thread.o" 2824 THREADOBJ="Python/thread.o"
2508 elif test "$ac_cv_kthread" = "yes" 2825 elif test "$ac_cv_kthread" = "yes"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 LIBS="$LIBS -lcma" 2899 LIBS="$LIBS -lcma"
2583 THREADOBJ="Python/thread.o"],[ 2900 THREADOBJ="Python/thread.o"],[
2584 USE_THREAD_MODULE="#"]) 2901 USE_THREAD_MODULE="#"])
2585 ])])])])]) 2902 ])])])])])
2586 2903
2587 AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) 2904 AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
2588 LIBS="$LIBS -lmpc" 2905 LIBS="$LIBS -lmpc"
2589 THREADOBJ="Python/thread.o" 2906 THREADOBJ="Python/thread.o"
2590 USE_THREAD_MODULE=""]) 2907 USE_THREAD_MODULE=""])
2591 2908
2592 if test "$posix_threads" != "yes"; then 2909 if test "$posix_threads" != "yes"; then
2593 AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD) 2910 AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
2594 LIBS="$LIBS -lthread" 2911 LIBS="$LIBS -lthread"
2595 THREADOBJ="Python/thread.o" 2912 THREADOBJ="Python/thread.o"
2596 USE_THREAD_MODULE=""]) 2913 USE_THREAD_MODULE=""])
2597 fi 2914 fi
2598 fi 2915 fi
2599 2916
2600 if test "$posix_threads" = "yes"; then 2917 if test "$posix_threads" = "yes"; then
2601 if test "$unistd_defines_pthreads" = "no"; then 2918 if test "$unistd_defines_pthreads" = "no"; then
2602 AC_DEFINE(_POSIX_THREADS, 1, 2919 AC_DEFINE(_POSIX_THREADS, 1,
2603 [Define if you have POSIX threads, 2920 [Define if you have POSIX threads,
2604 and your system does not define that.]) 2921 and your system does not define that.])
2605 fi 2922 fi
2606 2923
2607 # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8. 2924 # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
2608 case $ac_sys_system/$ac_sys_release in 2925 case $ac_sys_system/$ac_sys_release in
2609 SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1, 2926 SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1,
2610 [Defined for Solaris 2.6 bug in pthread header.]) 2927 [Defined for Solaris 2.6 bug in pthread header.])
2611 ;; 2928 ;;
2612 SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, 2929 SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
2613 [Define if the Posix semaphores do not work on your syste m]) 2930 [Define if the Posix semaphores do not work on your syste m])
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2808 echo "using libc" 3125 echo "using libc"
2809 else 3126 else
2810 echo 'Fatal: no $ipv6lib library found. cannot continue .' 3127 echo 'Fatal: no $ipv6lib library found. cannot continue .'
2811 echo "You need to fetch lib$ipv6lib.a from appropriate" 3128 echo "You need to fetch lib$ipv6lib.a from appropriate"
2812 echo 'ipv6 kit and compile beforehand.' 3129 echo 'ipv6 kit and compile beforehand.'
2813 exit 1 3130 exit 1
2814 fi 3131 fi
2815 fi 3132 fi
2816 fi 3133 fi
2817 3134
3135 AC_MSG_CHECKING(for CAN_RAW_FD_FRAMES)
3136 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* CAN_RAW_FD_FRAMES available check */
3137 #include <linux/can/raw.h>]],
3138 [[int can_raw_fd_frames = CAN_RAW_FD_FRAMES;]])],[
3139 AC_DEFINE(HAVE_LINUX_CAN_RAW_FD_FRAMES, 1, [Define if compiling using Linux 3. 6 or later.])
3140 AC_MSG_RESULT(yes)
3141 ],[
3142 AC_MSG_RESULT(no)
3143 ])
3144
2818 AC_MSG_CHECKING(for OSX 10.5 SDK or later) 3145 AC_MSG_CHECKING(for OSX 10.5 SDK or later)
2819 AC_COMPILE_IFELSE([ 3146 AC_COMPILE_IFELSE([
2820 AC_LANG_PROGRAM([[#include <Carbon/Carbon.h>]], [[FSIORefNum fRef = 0]]) 3147 AC_LANG_PROGRAM([[#include <Carbon/Carbon.h>]], [[FSIORefNum fRef = 0]])
2821 ],[ 3148 ],[
2822 AC_DEFINE(HAVE_OSX105_SDK, 1, [Define if compiling using MacOS X 10.5 SDK or l ater.]) 3149 AC_DEFINE(HAVE_OSX105_SDK, 1, [Define if compiling using MacOS X 10.5 SDK or l ater.])
2823 AC_MSG_RESULT(yes) 3150 AC_MSG_RESULT(yes)
2824 ],[ 3151 ],[
2825 AC_MSG_RESULT(no) 3152 AC_MSG_RESULT(no)
2826 ]) 3153 ])
2827 3154
(...skipping 10 matching lines...) Expand all
2838 AC_DEFINE(WITH_DOC_STRINGS, 1, 3165 AC_DEFINE(WITH_DOC_STRINGS, 1,
2839 [Define if you want documentation strings in extension modules]) 3166 [Define if you want documentation strings in extension modules])
2840 fi 3167 fi
2841 AC_MSG_RESULT($with_doc_strings) 3168 AC_MSG_RESULT($with_doc_strings)
2842 3169
2843 # Check if eval loop should use timestamp counter profiling 3170 # Check if eval loop should use timestamp counter profiling
2844 AC_MSG_CHECKING(for --with-tsc) 3171 AC_MSG_CHECKING(for --with-tsc)
2845 AC_ARG_WITH(tsc, 3172 AC_ARG_WITH(tsc,
2846 AS_HELP_STRING([--with(out)-tsc],[enable/disable timestamp counter p rofile]),[ 3173 AS_HELP_STRING([--with(out)-tsc],[enable/disable timestamp counter p rofile]),[
2847 if test "$withval" != no 3174 if test "$withval" != no
2848 then 3175 then
2849 AC_DEFINE(WITH_TSC, 1, 3176 AC_DEFINE(WITH_TSC, 1,
2850 [Define to profile with the Pentium timestamp counter]) 3177 [Define to profile with the Pentium timestamp counter])
2851 AC_MSG_RESULT(yes) 3178 AC_MSG_RESULT(yes)
2852 else AC_MSG_RESULT(no) 3179 else AC_MSG_RESULT(no)
2853 fi], 3180 fi],
2854 [AC_MSG_RESULT(no)]) 3181 [AC_MSG_RESULT(no)])
2855 3182
2856 # Check for Python-specific malloc support 3183 # Check for Python-specific malloc support
2857 AC_MSG_CHECKING(for --with-pymalloc) 3184 AC_MSG_CHECKING(for --with-pymalloc)
2858 AC_ARG_WITH(pymalloc, 3185 AC_ARG_WITH(pymalloc,
2859 AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized m allocs])) 3186 AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized m allocs]))
2860 3187
2861 if test -z "$with_pymalloc" 3188 if test -z "$with_pymalloc"
2862 then 3189 then
2863 with_pymalloc="yes" 3190 with_pymalloc="yes"
2864 fi 3191 fi
2865 if test "$with_pymalloc" != "no" 3192 if test "$with_pymalloc" != "no"
2866 then 3193 then
2867 AC_DEFINE(WITH_PYMALLOC, 1, 3194 AC_DEFINE(WITH_PYMALLOC, 1,
2868 [Define if you want to compile in Python-specific mallocs]) 3195 [Define if you want to compile in Python-specific mallocs])
2869 ABIFLAGS="${ABIFLAGS}m" 3196 ABIFLAGS="${ABIFLAGS}m"
2870 fi 3197 fi
2871 AC_MSG_RESULT($with_pymalloc) 3198 AC_MSG_RESULT($with_pymalloc)
2872 3199
2873 # Check for Valgrind support 3200 # Check for Valgrind support
2874 AC_MSG_CHECKING([for --with-valgrind]) 3201 AC_MSG_CHECKING([for --with-valgrind])
2875 AC_ARG_WITH([valgrind], 3202 AC_ARG_WITH([valgrind],
2876 AS_HELP_STRING([--with-valgrind], [Enable Valgrind support]),, 3203 AS_HELP_STRING([--with-valgrind], [Enable Valgrind support]),,
2877 with_valgrind=no) 3204 with_valgrind=no)
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
3150 AC_DEFINE(HAVE_LCHFLAGS, 1, [Define to 1 if you have the 'lchflags' function.] ) 3477 AC_DEFINE(HAVE_LCHFLAGS, 1, [Define to 1 if you have the 'lchflags' function.] )
3151 fi 3478 fi
3152 3479
3153 dnl Check if system zlib has *Copy() functions 3480 dnl Check if system zlib has *Copy() functions
3154 dnl 3481 dnl
3155 dnl On MacOSX the linker will search for dylibs on the entire linker path 3482 dnl On MacOSX the linker will search for dylibs on the entire linker path
3156 dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first 3483 dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first
3157 dnl to revert to a more traditional unix behaviour and make it possible to 3484 dnl to revert to a more traditional unix behaviour and make it possible to
3158 dnl override the system libz with a local static library of libz. Temporarily 3485 dnl override the system libz with a local static library of libz. Temporarily
3159 dnl add that flag to our CFLAGS as well to ensure that we check the version 3486 dnl add that flag to our CFLAGS as well to ensure that we check the version
3160 dnl of libz that will be used by setup.py. 3487 dnl of libz that will be used by setup.py.
3161 dnl The -L/usr/local/lib is needed as wel to get the same compilation 3488 dnl The -L/usr/local/lib is needed as wel to get the same compilation
3162 dnl environment as setup.py (and leaving it out can cause configure to use the 3489 dnl environment as setup.py (and leaving it out can cause configure to use the
3163 dnl wrong version of the library) 3490 dnl wrong version of the library)
3164 case $ac_sys_system/$ac_sys_release in 3491 case $ac_sys_system/$ac_sys_release in
3165 Darwin/*) 3492 Darwin/*)
3166 _CUR_CFLAGS="${CFLAGS}" 3493 _CUR_CFLAGS="${CFLAGS}"
3167 _CUR_LDFLAGS="${LDFLAGS}" 3494 _CUR_LDFLAGS="${LDFLAGS}"
3168 CFLAGS="${CFLAGS} -Wl,-search_paths_first" 3495 CFLAGS="${CFLAGS} -Wl,-search_paths_first"
3169 LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib" 3496 LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
3170 ;; 3497 ;;
3171 esac 3498 esac
3172 3499
3173 AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, [Define if the zlib li brary has inflateCopy])) 3500 AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, [Define if the zlib li brary has inflateCopy]))
3174 3501
3175 case $ac_sys_system/$ac_sys_release in 3502 case $ac_sys_system/$ac_sys_release in
3176 Darwin/*) 3503 Darwin/*)
3177 CFLAGS="${_CUR_CFLAGS}" 3504 CFLAGS="${_CUR_CFLAGS}"
3178 LDFLAGS="${_CUR_LDFLAGS}" 3505 LDFLAGS="${_CUR_LDFLAGS}"
3179 ;; 3506 ;;
3180 esac 3507 esac
3181 3508
3182 AC_MSG_CHECKING(for hstrerror) 3509 AC_MSG_CHECKING(for hstrerror)
3183 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 3510 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3184 #include <netdb.h> 3511 #include <netdb.h>
3185 ]], [[void* p = hstrerror; hstrerror(0)]])], 3512 ]], [[void* p = hstrerror; hstrerror(0)]])],
3186 [AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.) 3513 [AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
3220 #include <grp.h> 3547 #include <grp.h>
3221 #endif 3548 #endif
3222 ]], [[void* p = setgroups]])], 3549 ]], [[void* p = setgroups]])],
3223 [AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.) 3550 [AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.)
3224 AC_MSG_RESULT(yes)], 3551 AC_MSG_RESULT(yes)],
3225 [AC_MSG_RESULT(no) 3552 [AC_MSG_RESULT(no)
3226 ]) 3553 ])
3227 3554
3228 # check for openpty and forkpty 3555 # check for openpty and forkpty
3229 3556
3230 AC_CHECK_FUNCS(openpty,, 3557 AC_CHECK_FUNCS(openpty,,
3231 AC_CHECK_LIB(util,openpty, 3558 AC_CHECK_LIB(util,openpty,
3232 [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"], 3559 [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"],
3233 AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"]) 3560 AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"])
3234 ) 3561 )
3235 ) 3562 )
3236 AC_CHECK_FUNCS(forkpty,, 3563 AC_CHECK_FUNCS(forkpty,,
3237 AC_CHECK_LIB(util,forkpty, 3564 AC_CHECK_LIB(util,forkpty,
3238 [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"], 3565 [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"],
3239 AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"]) 3566 AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"])
3240 ) 3567 )
3241 ) 3568 )
3242 3569
3243 # Stuff for expat. 3570 # Stuff for expat.
3244 AC_CHECK_FUNCS(memmove) 3571 AC_CHECK_FUNCS(memmove)
3245 3572
3246 # check for long file support functions 3573 # check for long file support functions
3247 AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs) 3574 AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)
3248 3575
3249 AC_REPLACE_FUNCS(dup2 strdup) 3576 AC_REPLACE_FUNCS(dup2 strdup)
3250 AC_CHECK_FUNCS(getpgrp, 3577 AC_CHECK_FUNCS(getpgrp,
3251 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[getpgrp(0);]])], 3578 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[getpgrp(0);]])],
3252 [AC_DEFINE(GETPGRP_HAVE_ARG, 1, [Define if getpgrp() must be called as getpg rp(0).])], 3579 [AC_DEFINE(GETPGRP_HAVE_ARG, 1, [Define if getpgrp() must be called as getpg rp(0).])],
3253 []) 3580 [])
3254 ) 3581 )
3255 AC_CHECK_FUNCS(setpgrp, 3582 AC_CHECK_FUNCS(setpgrp,
3256 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[setpgrp(0,0);]]) ], 3583 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[setpgrp(0,0);]]) ],
3257 [AC_DEFINE(SETPGRP_HAVE_ARG, 1, [Define if setpgrp() must be called as setpg rp(0, 0).])], 3584 [AC_DEFINE(SETPGRP_HAVE_ARG, 1, [Define if setpgrp() must be called as setpg rp(0, 0).])],
3258 []) 3585 [])
3259 ) 3586 )
3260 AC_CHECK_FUNCS(gettimeofday, 3587 AC_CHECK_FUNCS(gettimeofday,
3261 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], 3588 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]],
3262 [[gettimeofday((struct timeval*)0,(struct t imezone*)0);]])], 3589 [[gettimeofday((struct timeval*)0,(struct t imezone*)0);]])],
3263 [], 3590 [],
3264 [AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1, 3591 [AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1,
3265 [Define if gettimeofday() does not have second (timezone) argument 3592 [Define if gettimeofday() does not have second (timezone) argument
3266 This is the case on Motorola V4 (R40V4.2)]) 3593 This is the case on Motorola V4 (R40V4.2)])
3267 ]) 3594 ])
3268 ) 3595 )
3269 3596
3270 AC_CHECK_FUNCS(clock_gettime, [], [ 3597 AC_CHECK_FUNCS(clock_gettime, [], [
3271 AC_CHECK_LIB(rt, clock_gettime, [ 3598 AC_CHECK_LIB(rt, clock_gettime, [
3599 LIBS="$LIBS -lrt"
3272 AC_DEFINE(HAVE_CLOCK_GETTIME, 1) 3600 AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
3273 AC_DEFINE(TIMEMODULE_LIB, [rt], 3601 AC_DEFINE(TIMEMODULE_LIB, [rt],
3274 [Library needed by timemodule.c: librt may be needed for clock _gettime()]) 3602 [Library needed by timemodule.c: librt may be needed for clock _gettime()])
3275 ]) 3603 ])
3276 ]) 3604 ])
3277 3605
3278 AC_CHECK_FUNCS(clock_getres, [], [ 3606 AC_CHECK_FUNCS(clock_getres, [], [
3279 AC_CHECK_LIB(rt, clock_getres, [ 3607 AC_CHECK_LIB(rt, clock_getres, [
3280 AC_DEFINE(HAVE_CLOCK_GETRES, 1) 3608 AC_DEFINE(HAVE_CLOCK_GETRES, 1)
3281 ]) 3609 ])
(...skipping 12 matching lines...) Expand all
3294 makedev(major(0),minor(0)); 3622 makedev(major(0),minor(0));
3295 ]])],[ 3623 ]])],[
3296 AC_DEFINE(HAVE_DEVICE_MACROS, 1, 3624 AC_DEFINE(HAVE_DEVICE_MACROS, 1,
3297 [Define to 1 if you have the device macros.]) 3625 [Define to 1 if you have the device macros.])
3298 AC_MSG_RESULT(yes) 3626 AC_MSG_RESULT(yes)
3299 ],[ 3627 ],[
3300 AC_MSG_RESULT(no) 3628 AC_MSG_RESULT(no)
3301 ]) 3629 ])
3302 3630
3303 # On OSF/1 V5.1, getaddrinfo is available, but a define 3631 # On OSF/1 V5.1, getaddrinfo is available, but a define
3304 # for [no]getaddrinfo in netdb.h. 3632 # for [no]getaddrinfo in netdb.h.
3305 AC_MSG_CHECKING(for getaddrinfo) 3633 AC_MSG_CHECKING(for getaddrinfo)
3306 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 3634 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3307 #include <sys/types.h> 3635 #include <sys/types.h>
3308 #include <sys/socket.h> 3636 #include <sys/socket.h>
3309 #include <netdb.h> 3637 #include <netdb.h>
3310 #include <stdio.h> 3638 #include <stdio.h>
3311 ]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], 3639 ]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])],
3312 [have_getaddrinfo=yes], 3640 [have_getaddrinfo=yes],
3313 [have_getaddrinfo=no]) 3641 [have_getaddrinfo=no])
3314 AC_MSG_RESULT($have_getaddrinfo) 3642 AC_MSG_RESULT($have_getaddrinfo)
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
3432 3760
3433 # checks for structures 3761 # checks for structures
3434 AC_HEADER_TIME 3762 AC_HEADER_TIME
3435 AC_STRUCT_TM 3763 AC_STRUCT_TM
3436 AC_STRUCT_TIMEZONE 3764 AC_STRUCT_TIMEZONE
3437 AC_CHECK_MEMBERS([struct stat.st_rdev]) 3765 AC_CHECK_MEMBERS([struct stat.st_rdev])
3438 AC_CHECK_MEMBERS([struct stat.st_blksize]) 3766 AC_CHECK_MEMBERS([struct stat.st_blksize])
3439 AC_CHECK_MEMBERS([struct stat.st_flags]) 3767 AC_CHECK_MEMBERS([struct stat.st_flags])
3440 AC_CHECK_MEMBERS([struct stat.st_gen]) 3768 AC_CHECK_MEMBERS([struct stat.st_gen])
3441 AC_CHECK_MEMBERS([struct stat.st_birthtime]) 3769 AC_CHECK_MEMBERS([struct stat.st_birthtime])
3442 AC_STRUCT_ST_BLOCKS 3770 AC_CHECK_MEMBERS([struct stat.st_blocks])
3771 AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_passwd], [], [], [[
3772 #include <sys/types.h>
3773 #include <pwd.h>
3774 ]])
3443 3775
3444 AC_MSG_CHECKING(for time.h that defines altzone) 3776 AC_MSG_CHECKING(for time.h that defines altzone)
3445 AC_CACHE_VAL(ac_cv_header_time_altzone,[ 3777 AC_CACHE_VAL(ac_cv_header_time_altzone,[
3446 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[return altzone;]]) ], 3778 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[return altzone;]]) ],
3447 [ac_cv_header_time_altzone=yes], 3779 [ac_cv_header_time_altzone=yes],
3448 [ac_cv_header_time_altzone=no]) 3780 [ac_cv_header_time_altzone=no])
3449 ]) 3781 ])
3450 AC_MSG_RESULT($ac_cv_header_time_altzone) 3782 AC_MSG_RESULT($ac_cv_header_time_altzone)
3451 if test $ac_cv_header_time_altzone = yes; then 3783 if test $ac_cv_header_time_altzone = yes; then
3452 AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.]) 3784 AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.])
3453 fi 3785 fi
3454 3786
3455 was_it_defined=no 3787 was_it_defined=no
3456 AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included) 3788 AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included)
3457 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 3789 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3458 #include <sys/types.h> 3790 #include <sys/types.h>
3459 #include <sys/select.h> 3791 #include <sys/select.h>
3460 #include <sys/time.h> 3792 #include <sys/time.h>
3461 ]], [[;]])],[ 3793 ]], [[;]])],[
3462 AC_DEFINE(SYS_SELECT_WITH_SYS_TIME, 1, 3794 AC_DEFINE(SYS_SELECT_WITH_SYS_TIME, 1,
3463 [Define if you can safely include both <sys/select.h> and <sys/time.h> 3795 [Define if you can safely include both <sys/select.h> and <sys/time.h>
3464 (which you can't on SCO ODT 3.0).]) 3796 (which you can't on SCO ODT 3.0).])
3465 was_it_defined=yes 3797 was_it_defined=yes
3466 ],[]) 3798 ],[])
3467 AC_MSG_RESULT($was_it_defined) 3799 AC_MSG_RESULT($was_it_defined)
3468 3800
3469 AC_MSG_CHECKING(for addrinfo) 3801 AC_MSG_CHECKING(for addrinfo)
3470 AC_CACHE_VAL(ac_cv_struct_addrinfo, 3802 AC_CACHE_VAL(ac_cv_struct_addrinfo,
3471 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[struct addrinfo a]] )], 3803 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[struct addrinfo a]] )],
3472 [ac_cv_struct_addrinfo=yes], 3804 [ac_cv_struct_addrinfo=yes],
3473 [ac_cv_struct_addrinfo=no])) 3805 [ac_cv_struct_addrinfo=no]))
3474 AC_MSG_RESULT($ac_cv_struct_addrinfo) 3806 AC_MSG_RESULT($ac_cv_struct_addrinfo)
(...skipping 30 matching lines...) Expand all
3505 AC_MSG_CHECKING(for working signed char) 3837 AC_MSG_CHECKING(for working signed char)
3506 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char c;]])], 3838 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char c;]])],
3507 [works=yes], 3839 [works=yes],
3508 [AC_DEFINE(signed, , [Define to empty if the keyword does not work.])] 3840 [AC_DEFINE(signed, , [Define to empty if the keyword does not work.])]
3509 ) 3841 )
3510 AC_MSG_RESULT($works) 3842 AC_MSG_RESULT($works)
3511 3843
3512 have_prototypes=no 3844 have_prototypes=no
3513 AC_MSG_CHECKING(for prototypes) 3845 AC_MSG_CHECKING(for prototypes)
3514 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(int x) { return 0; }]], [[return fo o(10);]])], 3846 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(int x) { return 0; }]], [[return fo o(10);]])],
3515 [AC_DEFINE(HAVE_PROTOTYPES, 1, 3847 [AC_DEFINE(HAVE_PROTOTYPES, 1,
3516 [Define if your compiler supports function prototype]) 3848 [Define if your compiler supports function prototype])
3517 have_prototypes=yes], 3849 have_prototypes=yes],
3518 [] 3850 []
3519 ) 3851 )
3520 AC_MSG_RESULT($have_prototypes) 3852 AC_MSG_RESULT($have_prototypes)
3521 3853
3522 works=no 3854 works=no
3523 AC_MSG_CHECKING(for variable length prototypes and stdarg.h) 3855 AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
3524 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 3856 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3525 #include <stdarg.h> 3857 #include <stdarg.h>
3526 int foo(int x, ...) { 3858 int foo(int x, ...) {
3527 va_list va; 3859 va_list va;
3528 va_start(va, x); 3860 va_start(va, x);
3529 va_arg(va, int); 3861 va_arg(va, int);
3530 va_arg(va, char *); 3862 va_arg(va, char *);
3531 va_arg(va, double); 3863 va_arg(va, double);
3532 return 0; 3864 return 0;
3533 } 3865 }
3534 ]], [[return foo(10, "", 3.14);]])],[ 3866 ]], [[return foo(10, "", 3.14);]])],[
3535 AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1, 3867 AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1,
3536 [Define if your compiler supports variable length function prototypes 3868 [Define if your compiler supports variable length function prototypes
3537 (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>]) 3869 (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>])
3538 works=yes 3870 works=yes
3539 ],[]) 3871 ],[])
3540 AC_MSG_RESULT($works) 3872 AC_MSG_RESULT($works)
3541 3873
3542 # check for socketpair 3874 # check for socketpair
3543 AC_MSG_CHECKING(for socketpair) 3875 AC_MSG_CHECKING(for socketpair)
3544 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 3876 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3545 #include <sys/types.h> 3877 #include <sys/types.h>
3546 #include <sys/socket.h> 3878 #include <sys/socket.h>
3547 ]], [[void *x=socketpair]])], 3879 ]], [[void *x=socketpair]])],
(...skipping 14 matching lines...) Expand all
3562 3894
3563 va_list_is_array=no 3895 va_list_is_array=no
3564 AC_MSG_CHECKING(whether va_list is an array) 3896 AC_MSG_CHECKING(whether va_list is an array)
3565 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 3897 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3566 #ifdef HAVE_STDARG_PROTOTYPES 3898 #ifdef HAVE_STDARG_PROTOTYPES
3567 #include <stdarg.h> 3899 #include <stdarg.h>
3568 #else 3900 #else
3569 #include <varargs.h> 3901 #include <varargs.h>
3570 #endif 3902 #endif
3571 ]], [[va_list list1, list2; list1 = list2;]])],[],[ 3903 ]], [[va_list list1, list2; list1 = list2;]])],[],[
3572 AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind]) 3904 AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
3573 va_list_is_array=yes 3905 va_list_is_array=yes
3574 ]) 3906 ])
3575 AC_MSG_RESULT($va_list_is_array) 3907 AC_MSG_RESULT($va_list_is_array)
3576 3908
3577 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( 3909 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
3578 AH_TEMPLATE(HAVE_GETHOSTBYNAME_R, 3910 AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
3579 [Define this if you have some version of gethostbyname_r()]) 3911 [Define this if you have some version of gethostbyname_r()])
3580 3912
3581 AC_CHECK_FUNC(gethostbyname_r, [ 3913 AC_CHECK_FUNC(gethostbyname_r, [
3582 AC_DEFINE(HAVE_GETHOSTBYNAME_R) 3914 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
3657 [], 3989 [],
3658 [AC_CHECK_LIB(ieee, __fpu_control) 3990 [AC_CHECK_LIB(ieee, __fpu_control)
3659 ]) 3991 ])
3660 3992
3661 # Check for --with-fpectl 3993 # Check for --with-fpectl
3662 AC_MSG_CHECKING(for --with-fpectl) 3994 AC_MSG_CHECKING(for --with-fpectl)
3663 AC_ARG_WITH(fpectl, 3995 AC_ARG_WITH(fpectl,
3664 AS_HELP_STRING([--with-fpectl], [enable SIGFPE catching]), 3996 AS_HELP_STRING([--with-fpectl], [enable SIGFPE catching]),
3665 [ 3997 [
3666 if test "$withval" != no 3998 if test "$withval" != no
3667 then 3999 then
3668 AC_DEFINE(WANT_SIGFPE_HANDLER, 1, 4000 AC_DEFINE(WANT_SIGFPE_HANDLER, 1,
3669 [Define if you want SIGFPE handled (see Include/pyfpe.h).]) 4001 [Define if you want SIGFPE handled (see Include/pyfpe.h).])
3670 AC_MSG_RESULT(yes) 4002 AC_MSG_RESULT(yes)
3671 else AC_MSG_RESULT(no) 4003 else AC_MSG_RESULT(no)
3672 fi], 4004 fi],
3673 [AC_MSG_RESULT(no)]) 4005 [AC_MSG_RESULT(no)])
3674 4006
3675 # check for --with-libm=... 4007 # check for --with-libm=...
3676 AC_SUBST(LIBM) 4008 AC_SUBST(LIBM)
3677 case $ac_sys_system in 4009 case $ac_sys_system in
3678 Darwin) ;; 4010 Darwin) ;;
3679 *) LIBM=-lm 4011 *) LIBM=-lm
(...skipping 26 matching lines...) Expand all
3706 AC_MSG_RESULT(set LIBC="$withval") 4038 AC_MSG_RESULT(set LIBC="$withval")
3707 else AC_MSG_ERROR([proper usage is --with-libc=STRING]) 4039 else AC_MSG_ERROR([proper usage is --with-libc=STRING])
3708 fi], 4040 fi],
3709 [AC_MSG_RESULT(default LIBC="$LIBC")]) 4041 [AC_MSG_RESULT(default LIBC="$LIBC")])
3710 4042
3711 # ************************************** 4043 # **************************************
3712 # * Check for gcc x64 inline assembler * 4044 # * Check for gcc x64 inline assembler *
3713 # ************************************** 4045 # **************************************
3714 4046
3715 AC_MSG_CHECKING(for x64 gcc inline assembler) 4047 AC_MSG_CHECKING(for x64 gcc inline assembler)
3716 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ 4048 AC_LINK_IFELSE( [AC_LANG_PROGRAM([[]], [[
3717 __asm__ __volatile__ ("movq %rcx, %rax"); 4049 __asm__ __volatile__ ("movq %rcx, %rax");
3718 ]])],[have_gcc_asm_for_x64=yes],[have_gcc_asm_for_x64=no]) 4050 ]])],[have_gcc_asm_for_x64=yes],[have_gcc_asm_for_x64=no])
3719 AC_MSG_RESULT($have_gcc_asm_for_x64) 4051 AC_MSG_RESULT($have_gcc_asm_for_x64)
3720 if test "$have_gcc_asm_for_x64" = yes 4052 if test "$have_gcc_asm_for_x64" = yes
3721 then 4053 then
3722 AC_DEFINE(HAVE_GCC_ASM_FOR_X64, 1, 4054 AC_DEFINE(HAVE_GCC_ASM_FOR_X64, 1,
3723 [Define if we can use x64 gcc inline assembler]) 4055 [Define if we can use x64 gcc inline assembler])
3724 fi 4056 fi
3725 4057
3726 # ************************************************** 4058 # **************************************************
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
3804 # correctly-rounded string <-> double conversion functions from 4136 # correctly-rounded string <-> double conversion functions from
3805 # Python/dtoa.c, which in turn require that the FPU uses 53-bit 4137 # Python/dtoa.c, which in turn require that the FPU uses 53-bit
3806 # rounding; this is a problem on x86, where the x87 FPU has a default 4138 # rounding; this is a problem on x86, where the x87 FPU has a default
3807 # rounding precision of 64 bits. For gcc/x86, we can fix this by 4139 # rounding precision of 64 bits. For gcc/x86, we can fix this by
3808 # using inline assembler to get and set the x87 FPU control word. 4140 # using inline assembler to get and set the x87 FPU control word.
3809 4141
3810 # This inline assembler syntax may also work for suncc and icc, 4142 # This inline assembler syntax may also work for suncc and icc,
3811 # so we try it on all platforms. 4143 # so we try it on all platforms.
3812 4144
3813 AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set x87 contr ol word) 4145 AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set x87 contr ol word)
3814 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ 4146 AC_LINK_IFELSE( [AC_LANG_PROGRAM([[]], [[
3815 unsigned short cw; 4147 unsigned short cw;
3816 __asm__ __volatile__ ("fnstcw %0" : "=m" (cw)); 4148 __asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
3817 __asm__ __volatile__ ("fldcw %0" : : "m" (cw)); 4149 __asm__ __volatile__ ("fldcw %0" : : "m" (cw));
3818 ]])],[have_gcc_asm_for_x87=yes],[have_gcc_asm_for_x87=no]) 4150 ]])],[have_gcc_asm_for_x87=yes],[have_gcc_asm_for_x87=no])
3819 AC_MSG_RESULT($have_gcc_asm_for_x87) 4151 AC_MSG_RESULT($have_gcc_asm_for_x87)
3820 if test "$have_gcc_asm_for_x87" = yes 4152 if test "$have_gcc_asm_for_x87" = yes
3821 then 4153 then
3822 AC_DEFINE(HAVE_GCC_ASM_FOR_X87, 1, 4154 AC_DEFINE(HAVE_GCC_ASM_FOR_X87, 1,
3823 [Define if we can use gcc inline assembler to get and set x87 control word]) 4155 [Define if we can use gcc inline assembler to get and set x87 control word])
4156 fi
4157
4158 AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set mc68881 f pcr)
4159 AC_LINK_IFELSE( [AC_LANG_PROGRAM([[]], [[
4160 unsigned int fpcr;
4161 __asm__ __volatile__ ("fmove.l %%fpcr,%0" : "=g" (fpcr));
4162 __asm__ __volatile__ ("fmove.l %0,%%fpcr" : : "g" (fpcr));
4163 ]])],[have_gcc_asm_for_mc68881=yes],[have_gcc_asm_for_mc68881=no])
4164 AC_MSG_RESULT($have_gcc_asm_for_mc68881)
4165 if test "$have_gcc_asm_for_mc68881" = yes
4166 then
4167 AC_DEFINE(HAVE_GCC_ASM_FOR_MC68881, 1,
4168 [Define if we can use gcc inline assembler to get and set mc68881 fpcr])
3824 fi 4169 fi
3825 4170
3826 # Detect whether system arithmetic is subject to x87-style double 4171 # Detect whether system arithmetic is subject to x87-style double
3827 # rounding issues. The result of this test has little meaning on non 4172 # rounding issues. The result of this test has little meaning on non
3828 # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding 4173 # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding
3829 # mode is round-to-nearest and double rounding issues are present, and 4174 # mode is round-to-nearest and double rounding issues are present, and
3830 # 0 otherwise. See http://bugs.python.org/issue2937 for more info. 4175 # 0 otherwise. See http://bugs.python.org/issue2937 for more info.
3831 AC_MSG_CHECKING(for x87-style double rounding) 4176 AC_MSG_CHECKING(for x87-style double rounding)
3832 # $BASECFLAGS may affect the result 4177 # $BASECFLAGS may affect the result
3833 ac_save_cc="$CC" 4178 ac_save_cc="$CC"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
3996 [ac_cv_broken_sem_getvalue=yes], 4341 [ac_cv_broken_sem_getvalue=yes],
3997 [ac_cv_broken_sem_getvalue=yes]) 4342 [ac_cv_broken_sem_getvalue=yes])
3998 ) 4343 )
3999 AC_MSG_RESULT($ac_cv_broken_sem_getvalue) 4344 AC_MSG_RESULT($ac_cv_broken_sem_getvalue)
4000 if test $ac_cv_broken_sem_getvalue = yes 4345 if test $ac_cv_broken_sem_getvalue = yes
4001 then 4346 then
4002 AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, 4347 AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1,
4003 [define to 1 if your sem_getvalue is broken.]) 4348 [define to 1 if your sem_getvalue is broken.])
4004 fi 4349 fi
4005 4350
4351 AC_CHECK_DECLS([RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, RTLD_LOCAL, RTLD_NODELETE, RTL D_NOLOAD, RTLD_DEEPBIND], [], [], [[#include <dlfcn.h>]])
4352
4006 # determine what size digit to use for Python's longs 4353 # determine what size digit to use for Python's longs
4007 AC_MSG_CHECKING([digit size for Python's longs]) 4354 AC_MSG_CHECKING([digit size for Python's longs])
4008 AC_ARG_ENABLE(big-digits, 4355 AC_ARG_ENABLE(big-digits,
4009 AS_HELP_STRING([--enable-big-digits@<:@=BITS@:>@],[use big digits for Python lon gs [[BITS=30]]]), 4356 AS_HELP_STRING([--enable-big-digits@<:@=BITS@:>@],[use big digits for Python lon gs [[BITS=30]]]),
4010 [case $enable_big_digits in 4357 [case $enable_big_digits in
4011 yes) 4358 yes)
4012 enable_big_digits=30 ;; 4359 enable_big_digits=30 ;;
4013 no) 4360 no)
4014 enable_big_digits=15 ;; 4361 enable_big_digits=15 ;;
4015 [15|30]) 4362 [15|30])
4016 ;; 4363 ;;
4017 *) 4364 *)
4018 AC_MSG_ERROR([bad value $enable_big_digits for --enable-big-digits; value shou ld be 15 or 30]) ;; 4365 AC_MSG_ERROR([bad value $enable_big_digits for --enable-big-digits; value shou ld be 15 or 30]) ;;
4019 esac 4366 esac
4020 AC_MSG_RESULT($enable_big_digits) 4367 AC_MSG_RESULT($enable_big_digits)
4021 AC_DEFINE_UNQUOTED(PYLONG_BITS_IN_DIGIT, $enable_big_digits, [Define as the pref erred size in bits of long digits]) 4368 AC_DEFINE_UNQUOTED(PYLONG_BITS_IN_DIGIT, $enable_big_digits, [Define as the pref erred size in bits of long digits])
4022 ], 4369 ],
4023 [AC_MSG_RESULT(no value specified)]) 4370 [AC_MSG_RESULT(no value specified)])
4024 4371
4025 # check for wchar.h 4372 # check for wchar.h
4026 AC_CHECK_HEADER(wchar.h, [ 4373 AC_CHECK_HEADER(wchar.h, [
4027 AC_DEFINE(HAVE_WCHAR_H, 1, 4374 AC_DEFINE(HAVE_WCHAR_H, 1,
4028 [Define if the compiler provides a wchar.h header file.]) 4375 [Define if the compiler provides a wchar.h header file.])
4029 wchar_h="yes" 4376 wchar_h="yes"
4030 ], 4377 ],
4031 wchar_h="no" 4378 wchar_h="no"
4032 ) 4379 )
4033 4380
4034 # determine wchar_t size 4381 # determine wchar_t size
4035 if test "$wchar_h" = yes 4382 if test "$wchar_h" = yes
4036 then 4383 then
4037 AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>]) 4384 AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
4038 fi 4385 fi
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
4097 # * --with-pymalloc (adds a 'm') 4444 # * --with-pymalloc (adds a 'm')
4098 # * --with-wide-unicode (adds a 'u') 4445 # * --with-wide-unicode (adds a 'u')
4099 # 4446 #
4100 # Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc, 4447 # Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
4101 # would get a shared library ABI version tag of 'cpython-32dmu' and shared 4448 # would get a shared library ABI version tag of 'cpython-32dmu' and shared
4102 # libraries would be named 'foo.cpython-32dmu.so'. 4449 # libraries would be named 'foo.cpython-32dmu.so'.
4103 AC_SUBST(SOABI) 4450 AC_SUBST(SOABI)
4104 AC_MSG_CHECKING(ABIFLAGS) 4451 AC_MSG_CHECKING(ABIFLAGS)
4105 AC_MSG_RESULT($ABIFLAGS) 4452 AC_MSG_RESULT($ABIFLAGS)
4106 AC_MSG_CHECKING(SOABI) 4453 AC_MSG_CHECKING(SOABI)
4107 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS} 4454 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFO RM_TRIPLET}
4108 AC_MSG_RESULT($SOABI) 4455 AC_MSG_RESULT($SOABI)
4109 4456
4110 AC_SUBST(EXT_SUFFIX) 4457 AC_SUBST(EXT_SUFFIX)
4111 case $ac_sys_system in 4458 case $ac_sys_system in
4112 Linux*|GNU*) 4459 Linux*|GNU*|Darwin)
4113 EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};; 4460 EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};;
4114 *) 4461 *)
4115 EXT_SUFFIX=${SHLIB_SUFFIX};; 4462 EXT_SUFFIX=${SHLIB_SUFFIX};;
4116 esac 4463 esac
4117 4464
4118 AC_MSG_CHECKING(LDVERSION) 4465 AC_MSG_CHECKING(LDVERSION)
4119 LDVERSION='$(VERSION)$(ABIFLAGS)' 4466 LDVERSION='$(VERSION)$(ABIFLAGS)'
4120 AC_MSG_RESULT($LDVERSION) 4467 AC_MSG_RESULT($LDVERSION)
4121 4468
4122 dnl define LIBPL after ABIFLAGS and LDVERSION is defined. 4469 dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
4219 # check for readline 4.0 4566 # check for readline 4.0
4220 AC_CHECK_LIB(readline, rl_pre_input_hook, 4567 AC_CHECK_LIB(readline, rl_pre_input_hook,
4221 AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1, 4568 AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1,
4222 [Define if you have readline 4.0]), ,$READLINE_LIBS) 4569 [Define if you have readline 4.0]), ,$READLINE_LIBS)
4223 4570
4224 # also in 4.0 4571 # also in 4.0
4225 AC_CHECK_LIB(readline, rl_completion_display_matches_hook, 4572 AC_CHECK_LIB(readline, rl_completion_display_matches_hook,
4226 AC_DEFINE(HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK, 1, 4573 AC_DEFINE(HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK, 1,
4227 [Define if you have readline 4.0]), ,$READLINE_LIBS) 4574 [Define if you have readline 4.0]), ,$READLINE_LIBS)
4228 4575
4576 # also in 4.0, but not in editline
4577 AC_CHECK_LIB(readline, rl_resize_terminal,
4578 AC_DEFINE(HAVE_RL_RESIZE_TERMINAL, 1,
4579 [Define if you have readline 4.0]), ,$READLINE_LIBS)
4580
4229 # check for readline 4.2 4581 # check for readline 4.2
4230 AC_CHECK_LIB(readline, rl_completion_matches, 4582 AC_CHECK_LIB(readline, rl_completion_matches,
4231 AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1, 4583 AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1,
4232 [Define if you have readline 4.2]), ,$READLINE_LIBS) 4584 [Define if you have readline 4.2]), ,$READLINE_LIBS)
4233 4585
4234 # also in readline 4.2 4586 # also in readline 4.2
4235 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <readline/readline.h>]])], 4587 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <readline/readline.h>]])],
4236 [have_readline=yes], 4588 [have_readline=yes],
4237 [have_readline=no] 4589 [have_readline=no]
4238 ) 4590 )
4239 if test $have_readline = yes 4591 if test $have_readline = yes
4240 then 4592 then
4241 AC_EGREP_HEADER([extern int rl_catch_signals;], 4593 AC_EGREP_HEADER([extern int rl_catch_signals;],
4242 [readline/readline.h], 4594 [readline/readline.h],
4243 AC_DEFINE(HAVE_RL_CATCH_SIGNAL, 1, 4595 AC_DEFINE(HAVE_RL_CATCH_SIGNAL, 1,
4244 [Define if you can turn off readline's signal handling.]), ) 4596 [Define if you can turn off readline's signal handling.]), )
4245 fi 4597 fi
4598
4599 AC_CHECK_LIB(readline, append_history,
4600 AC_DEFINE(HAVE_RL_APPEND_HISTORY, 1,
4601 [Define if readline supports append_history]), ,$READLINE_LIBS)
4246 4602
4247 # End of readline checks: restore LIBS 4603 # End of readline checks: restore LIBS
4248 LIBS=$LIBS_no_readline 4604 LIBS=$LIBS_no_readline
4249 4605
4250 AC_MSG_CHECKING(for broken nice()) 4606 AC_MSG_CHECKING(for broken nice())
4251 AC_CACHE_VAL(ac_cv_broken_nice, [ 4607 AC_CACHE_VAL(ac_cv_broken_nice, [
4252 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 4608 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4253 int main() 4609 int main()
4254 { 4610 {
4255 int val1 = nice(1); 4611 int val1 = nice(1);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
4292 [ac_cv_broken_poll=yes], 4648 [ac_cv_broken_poll=yes],
4293 [ac_cv_broken_poll=no], 4649 [ac_cv_broken_poll=no],
4294 [ac_cv_broken_poll=no])) 4650 [ac_cv_broken_poll=no]))
4295 AC_MSG_RESULT($ac_cv_broken_poll) 4651 AC_MSG_RESULT($ac_cv_broken_poll)
4296 if test "$ac_cv_broken_poll" = yes 4652 if test "$ac_cv_broken_poll" = yes
4297 then 4653 then
4298 AC_DEFINE(HAVE_BROKEN_POLL, 1, 4654 AC_DEFINE(HAVE_BROKEN_POLL, 1,
4299 [Define if poll() sets errno on invalid file descriptors.]) 4655 [Define if poll() sets errno on invalid file descriptors.])
4300 fi 4656 fi
4301 4657
4302 # Before we can test tzset, we need to check if struct tm has a tm_zone 4658 # Before we can test tzset, we need to check if struct tm has a tm_zone
4303 # (which is not required by ISO C or UNIX spec) and/or if we support 4659 # (which is not required by ISO C or UNIX spec) and/or if we support
4304 # tzname[] 4660 # tzname[]
4305 AC_STRUCT_TIMEZONE 4661 AC_STRUCT_TIMEZONE
4306 4662
4307 # check tzset(3) exists and works like we expect it to 4663 # check tzset(3) exists and works like we expect it to
4308 AC_MSG_CHECKING(for working tzset()) 4664 AC_MSG_CHECKING(for working tzset())
4309 AC_CACHE_VAL(ac_cv_working_tzset, [ 4665 AC_CACHE_VAL(ac_cv_working_tzset, [
4310 AC_RUN_IFELSE([AC_LANG_SOURCE([[ 4666 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4311 #include <stdlib.h> 4667 #include <stdlib.h>
4312 #include <time.h> 4668 #include <time.h>
4313 #include <string.h> 4669 #include <string.h>
4314 4670
4315 #if HAVE_TZNAME 4671 #if HAVE_TZNAME
4316 extern char *tzname[]; 4672 extern char *tzname[];
4317 #endif 4673 #endif
4318 4674
4319 int main() 4675 int main()
4320 { 4676 {
4321 /* Note that we need to ensure that not only does tzset(3) 4677 /* Note that we need to ensure that not only does tzset(3)
4322 do 'something' with localtime, but it works as documented 4678 do 'something' with localtime, but it works as documented
4323 in the library reference and as expected by the test suite. 4679 in the library reference and as expected by the test suite.
4324 This includes making sure that tzname is set properly if 4680 This includes making sure that tzname is set properly if
4325 tm->tm_zone does not exist since it is the alternative way 4681 tm->tm_zone does not exist since it is the alternative way
4326 of getting timezone info. 4682 of getting timezone info.
4327 4683
4328 » Red Hat 6.2 doesn't understand the southern hemisphere 4684 » Red Hat 6.2 doesn't understand the southern hemisphere
4329 after New Year's Day. 4685 after New Year's Day.
4330 */ 4686 */
4331 4687
4332 time_t groundhogday = 1044144000; /* GMT-based */ 4688 time_t groundhogday = 1044144000; /* GMT-based */
4333 time_t midyear = groundhogday + (365 * 24 * 3600 / 2); 4689 time_t midyear = groundhogday + (365 * 24 * 3600 / 2);
4334 4690
4335 putenv("TZ=UTC+0"); 4691 putenv("TZ=UTC+0");
4336 tzset(); 4692 tzset();
4337 if (localtime(&groundhogday)->tm_hour != 0) 4693 if (localtime(&groundhogday)->tm_hour != 0)
4338 exit(1); 4694 exit(1);
4339 #if HAVE_TZNAME 4695 #if HAVE_TZNAME
4340 /* For UTC, tzname[1] is sometimes "", sometimes " " */ 4696 /* For UTC, tzname[1] is sometimes "", sometimes " " */
4341 » if (strcmp(tzname[0], "UTC") || 4697 » if (strcmp(tzname[0], "UTC") ||
4342 (tzname[1][0] != 0 && tzname[1][0] != ' ')) 4698 (tzname[1][0] != 0 && tzname[1][0] != ' '))
4343 exit(1); 4699 exit(1);
4344 #endif 4700 #endif
4345 4701
4346 putenv("TZ=EST+5EDT,M4.1.0,M10.5.0"); 4702 putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
4347 tzset(); 4703 tzset();
4348 if (localtime(&groundhogday)->tm_hour != 19) 4704 if (localtime(&groundhogday)->tm_hour != 19)
4349 exit(1); 4705 exit(1);
4350 #if HAVE_TZNAME 4706 #if HAVE_TZNAME
4351 if (strcmp(tzname[0], "EST") || strcmp(tzname[1], "EDT")) 4707 if (strcmp(tzname[0], "EST") || strcmp(tzname[1], "EDT"))
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
4449 WINDOW *w; 4805 WINDOW *w;
4450 w->_flags = 0; 4806 w->_flags = 0;
4451 ]])], 4807 ]])],
4452 [ac_cv_window_has_flags=yes], 4808 [ac_cv_window_has_flags=yes],
4453 [ac_cv_window_has_flags=no])) 4809 [ac_cv_window_has_flags=no]))
4454 AC_MSG_RESULT($ac_cv_window_has_flags) 4810 AC_MSG_RESULT($ac_cv_window_has_flags)
4455 4811
4456 4812
4457 if test "$ac_cv_window_has_flags" = yes 4813 if test "$ac_cv_window_has_flags" = yes
4458 then 4814 then
4459 AC_DEFINE(WINDOW_HAS_FLAGS, 1, 4815 AC_DEFINE(WINDOW_HAS_FLAGS, 1,
4460 [Define if WINDOW in curses.h offers a field _flags.]) 4816 [Define if WINDOW in curses.h offers a field _flags.])
4461 fi 4817 fi
4462 4818
4463 AC_MSG_CHECKING(for is_term_resized) 4819 AC_MSG_CHECKING(for is_term_resized)
4464 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=is_term_re sized]])], 4820 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=is_term_re sized]])],
4465 [AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_res ized' function.) 4821 [AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_res ized' function.)
4466 AC_MSG_RESULT(yes)], 4822 AC_MSG_RESULT(yes)],
4467 [AC_MSG_RESULT(no)] 4823 [AC_MSG_RESULT(no)]
4468 ) 4824 )
4469 4825
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
4648 return (len != 4); 5004 return (len != 4);
4649 } 5005 }
4650 ]])], 5006 ]])],
4651 [ac_cv_broken_mbstowcs=no], 5007 [ac_cv_broken_mbstowcs=no],
4652 [ac_cv_broken_mbstowcs=yes], 5008 [ac_cv_broken_mbstowcs=yes],
4653 [ac_cv_broken_mbstowcs=no])) 5009 [ac_cv_broken_mbstowcs=no]))
4654 AC_MSG_RESULT($ac_cv_broken_mbstowcs) 5010 AC_MSG_RESULT($ac_cv_broken_mbstowcs)
4655 if test "$ac_cv_broken_mbstowcs" = yes 5011 if test "$ac_cv_broken_mbstowcs" = yes
4656 then 5012 then
4657 AC_DEFINE(HAVE_BROKEN_MBSTOWCS, 1, 5013 AC_DEFINE(HAVE_BROKEN_MBSTOWCS, 1,
4658 [Define if mbstowcs(NULL, "text", 0) does not return the number of 5014 [Define if mbstowcs(NULL, "text", 0) does not return the number of
4659 wide chars that would be converted.]) 5015 wide chars that would be converted.])
4660 fi 5016 fi
4661 5017
4662 # Check for --with-computed-gotos 5018 # Check for --with-computed-gotos
4663 AC_MSG_CHECKING(for --with-computed-gotos) 5019 AC_MSG_CHECKING(for --with-computed-gotos)
4664 AC_ARG_WITH(computed-gotos, 5020 AC_ARG_WITH(computed-gotos,
4665 AS_HELP_STRING([--with(out)-computed-gotos], 5021 AS_HELP_STRING([--with(out)-computed-gotos],
4666 [Use computed gotos in evaluation loop (enabled by de fault on supported compilers)]), 5022 [Use computed gotos in evaluation loop (enabled by de fault on supported compilers)]),
4667 [ 5023 [
4668 if test "$withval" = yes 5024 if test "$withval" = yes
4669 then 5025 then
4670 AC_DEFINE(USE_COMPUTED_GOTOS, 1, 5026 AC_DEFINE(USE_COMPUTED_GOTOS, 1,
4671 [Define if you want to use computed gotos in ceval.c.]) 5027 [Define if you want to use computed gotos in ceval.c.])
4672 AC_MSG_RESULT(yes) 5028 AC_MSG_RESULT(yes)
4673 fi 5029 fi
4674 if test "$withval" = no 5030 if test "$withval" = no
4675 then 5031 then
4676 AC_DEFINE(USE_COMPUTED_GOTOS, 0, 5032 AC_DEFINE(USE_COMPUTED_GOTOS, 0,
4677 [Define if you want to use computed gotos in ceval.c.]) 5033 [Define if you want to use computed gotos in ceval.c.])
4678 AC_MSG_RESULT(no) 5034 AC_MSG_RESULT(no)
4679 fi 5035 fi
4680 ], 5036 ],
4681 [AC_MSG_RESULT(no value specified)]) 5037 [AC_MSG_RESULT(no value specified)])
4682 5038
4683 AC_MSG_CHECKING(whether $CC supports computed gotos) 5039 AC_MSG_CHECKING(whether $CC supports computed gotos)
4684 AC_CACHE_VAL(ac_cv_computed_gotos, 5040 AC_CACHE_VAL(ac_cv_computed_gotos,
4685 AC_RUN_IFELSE([AC_LANG_SOURCE([[[ 5041 AC_RUN_IFELSE([AC_LANG_SOURCE([[[
4686 int main(int argc, char **argv) 5042 int main(int argc, char **argv)
4687 { 5043 {
(...skipping 13 matching lines...) Expand all
4701 else 5057 else
4702 ac_cv_computed_gotos=no 5058 ac_cv_computed_gotos=no
4703 fi])) 5059 fi]))
4704 AC_MSG_RESULT($ac_cv_computed_gotos) 5060 AC_MSG_RESULT($ac_cv_computed_gotos)
4705 case "$ac_cv_computed_gotos" in yes*) 5061 case "$ac_cv_computed_gotos" in yes*)
4706 AC_DEFINE(HAVE_COMPUTED_GOTOS, 1, 5062 AC_DEFINE(HAVE_COMPUTED_GOTOS, 1,
4707 [Define if the C compiler supports computed gotos.]) 5063 [Define if the C compiler supports computed gotos.])
4708 esac 5064 esac
4709 5065
4710 case $ac_sys_system in 5066 case $ac_sys_system in
4711 AIX*) 5067 AIX*)
4712 AC_DEFINE(HAVE_BROKEN_PIPE_BUF, 1, [Define if the system reports an invalid PI PE_BUF value.]) ;; 5068 AC_DEFINE(HAVE_BROKEN_PIPE_BUF, 1, [Define if the system reports an invalid PI PE_BUF value.]) ;;
4713 esac 5069 esac
4714 5070
4715 5071
4716 AC_SUBST(THREADHEADERS) 5072 AC_SUBST(THREADHEADERS)
4717 5073
4718 for h in `(cd $srcdir;echo Python/thread_*.h)` 5074 for h in `(cd $srcdir;echo Python/thread_*.h)`
4719 do 5075 do
4720 THREADHEADERS="$THREADHEADERS \$(srcdir)/$h" 5076 THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
4721 done 5077 done
4722 5078
4723 AC_SUBST(SRCDIRS) 5079 AC_SUBST(SRCDIRS)
4724 SRCDIRS="Parser Grammar Objects Python Modules Mac" 5080 SRCDIRS="Parser Grammar Objects Python Modules Mac Programs"
4725 AC_MSG_CHECKING(for build directories) 5081 AC_MSG_CHECKING(for build directories)
4726 for dir in $SRCDIRS; do 5082 for dir in $SRCDIRS; do
4727 if test ! -d $dir; then 5083 if test ! -d $dir; then
4728 mkdir $dir 5084 mkdir $dir
4729 fi 5085 fi
4730 done 5086 done
4731 AC_MSG_RESULT(done) 5087 AC_MSG_RESULT(done)
4732 5088
4733 # Availability of -O2: 5089 # Availability of -O2:
4734 AC_MSG_CHECKING(for -O2) 5090 AC_MSG_CHECKING(for -O2)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
4806 CFLAGS="$saved_cflags" 5162 CFLAGS="$saved_cflags"
4807 AC_MSG_RESULT($have_ipa_pure_const_bug) 5163 AC_MSG_RESULT($have_ipa_pure_const_bug)
4808 if test "$have_ipa_pure_const_bug" = yes; then 5164 if test "$have_ipa_pure_const_bug" = yes; then
4809 AC_DEFINE(HAVE_IPA_PURE_CONST_BUG, 1, 5165 AC_DEFINE(HAVE_IPA_PURE_CONST_BUG, 1,
4810 [Define if gcc has the ipa-pure-const bug.]) 5166 [Define if gcc has the ipa-pure-const bug.])
4811 fi 5167 fi
4812 ;; 5168 ;;
4813 esac 5169 esac
4814 fi 5170 fi
4815 5171
5172 # Check for stdatomic.h
5173 AC_MSG_CHECKING(for stdatomic.h)
5174 AC_LINK_IFELSE(
5175 [
5176 AC_LANG_SOURCE([[
5177 #include <stdatomic.h>
5178 atomic_int value = ATOMIC_VAR_INIT(1);
5179 _Atomic void *py_atomic_address = (void*) &value;
5180 int main() {
5181 int loaded_value = atomic_load(&value);
5182 return 0;
5183 }
5184 ]])
5185 ],[have_stdatomic_h=yes],[have_stdatomic_h=no])
5186
5187 AC_MSG_RESULT($have_stdatomic_h)
5188
5189 if test "$have_stdatomic_h" = yes; then
5190 AC_DEFINE(HAVE_STD_ATOMIC, 1,
5191 [Has stdatomic.h, atomic_int and _Atomic void* types work])
5192 fi
5193
5194 # Check for GCC >= 4.7 __atomic builtins
5195 AC_MSG_CHECKING(for GCC >= 4.7 __atomic builtins)
5196 AC_LINK_IFELSE(
5197 [
5198 AC_LANG_SOURCE([[
5199 volatile int val = 1;
5200 int main() {
5201 __atomic_load_n(&val, __ATOMIC_SEQ_CST);
5202 return 0;
5203 }
5204 ]])
5205 ],[have_builtin_atomic=yes],[have_builtin_atomic=no])
5206
5207 AC_MSG_RESULT($have_builtin_atomic)
5208
5209 if test "$have_builtin_atomic" = yes; then
5210 AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Has builtin atomics])
5211 fi
5212
4816 # ensurepip option 5213 # ensurepip option
4817 AC_MSG_CHECKING(for ensurepip) 5214 AC_MSG_CHECKING(for ensurepip)
4818 AC_ARG_WITH(ensurepip, 5215 AC_ARG_WITH(ensurepip,
4819 [AS_HELP_STRING([--with(out)-ensurepip=@<:@=upgrade@:>@], 5216 [AS_HELP_STRING([--with(out)-ensurepip=@<:@=upgrade@:>@],
4820 ["install" or "upgrade" using bundled pip])], 5217 ["install" or "upgrade" using bundled pip])],
4821 [], 5218 [],
4822 [with_ensurepip=upgrade]) 5219 [with_ensurepip=upgrade])
4823 AS_CASE($with_ensurepip, 5220 AS_CASE($with_ensurepip,
4824 [yes|upgrade],[ENSUREPIP=upgrade], 5221 [yes|upgrade],[ENSUREPIP=upgrade],
4825 [install],[ENSUREPIP=install], 5222 [install],[ENSUREPIP=install],
4826 [no],[ENSUREPIP=no], 5223 [no],[ENSUREPIP=no],
4827 [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])]) 5224 [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])])
4828 AC_MSG_RESULT($ENSUREPIP) 5225 AC_MSG_RESULT($ENSUREPIP)
4829 AC_SUBST(ENSUREPIP) 5226 AC_SUBST(ENSUREPIP)
4830 5227
5228 # check if the dirent structure of a d_type field and DT_UNKNOWN is defined
5229 AC_MSG_CHECKING(if the dirent structure of a d_type field)
5230 AC_LINK_IFELSE(
5231 [
5232 AC_LANG_SOURCE([[
5233 #include <dirent.h>
5234
5235 int main() {
5236 struct dirent entry;
5237 return entry.d_type == DT_UNKNOWN;
5238 }
5239 ]])
5240 ],[have_dirent_d_type=yes],[have_dirent_d_type=no])
5241 AC_MSG_RESULT($have_dirent_d_type)
5242
5243 if test "$have_dirent_d_type" = yes; then
5244 AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
5245 [Define to 1 if the dirent structure has a d_type field])
5246 fi
5247
5248 # check if the Linux getrandom() syscall is available
5249 AC_MSG_CHECKING(for the Linux getrandom() syscall)
5250 AC_LINK_IFELSE(
5251 [
5252 AC_LANG_SOURCE([[
5253 #include <unistd.h>
5254 #include <sys/syscall.h>
5255 #include <linux/random.h>
5256
5257 int main() {
5258 char buffer[1];
5259 const size_t buflen = sizeof(buffer);
5260 const int flags = GRND_NONBLOCK;
5261 /* ignore the result, Python checks for ENOSYS and EAGAIN at runtime */
5262 (void)syscall(SYS_getrandom, buffer, buflen, flags);
5263 return 0;
5264 }
5265 ]])
5266 ],[have_getrandom_syscall=yes],[have_getrandom_syscall=no])
5267 AC_MSG_RESULT($have_getrandom_syscall)
5268
5269 if test "$have_getrandom_syscall" = yes; then
5270 AC_DEFINE(HAVE_GETRANDOM_SYSCALL, 1,
5271 [Define to 1 if the Linux getrandom() syscall is available])
5272 fi
5273
5274 # check if the getrandom() function is available
5275 # the test was written for the Solaris function of <sys/random.h>
5276 AC_MSG_CHECKING(for the getrandom() function)
5277 AC_LINK_IFELSE(
5278 [
5279 AC_LANG_SOURCE([[
5280 #include <sys/random.h>
5281
5282 int main() {
5283 char buffer[1];
5284 const size_t buflen = sizeof(buffer);
5285 const int flags = 0;
5286 /* ignore the result, Python checks for ENOSYS at runtime */
5287 (void)getrandom(buffer, buflen, flags);
5288 return 0;
5289 }
5290 ]])
5291 ],[have_getrandom=yes],[have_getrandom=no])
5292 AC_MSG_RESULT($have_getrandom)
5293
5294 if test "$have_getrandom" = yes; then
5295 AC_DEFINE(HAVE_GETRANDOM, 1,
5296 [Define to 1 if the getrandom() function is available])
5297 fi
5298
4831 # generate output files 5299 # generate output files
4832 AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-con fig.sh) 5300 AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-con fig.sh)
4833 AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) 5301 AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
4834 AC_OUTPUT 5302 AC_OUTPUT
4835 5303
4836 echo "creating Modules/Setup" >&AS_MESSAGE_FD 5304 echo "creating Modules/Setup" >&AS_MESSAGE_FD
4837 if test ! -f Modules/Setup 5305 if test ! -f Modules/Setup
4838 then 5306 then
4839 cp $srcdir/Modules/Setup.dist Modules/Setup 5307 cp $srcdir/Modules/Setup.dist Modules/Setup
4840 fi 5308 fi
4841 5309
4842 echo "creating Modules/Setup.local" >&AS_MESSAGE_FD 5310 echo "creating Modules/Setup.local" >&AS_MESSAGE_FD
4843 if test ! -f Modules/Setup.local 5311 if test ! -f Modules/Setup.local
4844 then 5312 then
4845 echo "# Edit this file for local setup changes" >Modules/Setup.local 5313 echo "# Edit this file for local setup changes" >Modules/Setup.local
4846 fi 5314 fi
4847 5315
4848 echo "creating Makefile" >&AS_MESSAGE_FD 5316 echo "creating Makefile" >&AS_MESSAGE_FD
4849 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ 5317 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
4850 -s Modules Modules/Setup.config \ 5318 -s Modules Modules/Setup.config \
4851 Modules/Setup.local Modules/Setup 5319 Modules/Setup.local Modules/Setup
4852 mv config.c Modules 5320 mv config.c Modules
LEFTRIGHT
« no previous file | Doc/library/os.rst » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

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