1 dnl Process this file with autoconf 2.0 or later to make a configure script.
3 # Set VERSION so we only need to edit in one place (i.e., here)
4 m4_define(PYTHON_VERSION, 2.6)
6 AC_REVISION($Revision$)
8 AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
9 AC_CONFIG_SRCDIR([Include/object.h])
10 AC_CONFIG_HEADER(pyconfig.h)
12 dnl This is for stuff that absolutely must end up in pyconfig.h.
13 dnl Please use pyport.h instead, if possible.
19 /* Define the macros needed if on a UnixWare 7.x system. */
20 #if defined(__USLC__) && defined(__SCO_VERSION__)
21 #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
24 #endif /*Py_PYCONFIG_H*/
27 # We don't use PACKAGE_ variables, and they cause conflicts
28 # with other autoconf-based packages that include Python.h
29 grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new
31 mv confdefs.h.new confdefs.h
34 VERSION=PYTHON_VERSION
39 # The later defininition of _XOPEN_SOURCE disables certain features
40 # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
41 AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features])
43 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
44 # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
46 AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
48 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
49 # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
51 AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
53 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
54 # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
55 AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
57 define_xopen_source=yes
59 # Arguments passed to configure.
61 CONFIG_ARGS="$ac_configure_args"
63 AC_ARG_ENABLE(universalsdk,
64 AC_HELP_STRING(--enable-universalsdk@<:@=SDKDIR@:>@, Build against Mac OS X 10.4u SDK (ppc/i386)),
68 enableval=/Developer/SDKs/MacOSX10.4u.sdk
77 UNIVERSALSDK=$enableval
84 AC_SUBST(UNIVERSALSDK)
86 AC_ARG_WITH(framework-name,
87 AC_HELP_STRING(--with-framework-name=FRAMEWORK,
88 specify an alternate name of the framework built with --enable-framework),
90 PYTHONFRAMEWORK=${withval}
91 PYTHONFRAMEWORKDIR=${withval}.framework
92 PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr '[A-Z]' '[a-z]'`
94 PYTHONFRAMEWORK=Python
95 PYTHONFRAMEWORKDIR=Python.framework
96 PYTHONFRAMEWORKIDENTIFIER=org.python.python
98 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
99 AC_ARG_ENABLE(framework,
100 AC_HELP_STRING(--enable-framework@<:@=INSTALLDIR@:>@, Build (MacOSX|Darwin) framework),
104 enableval=/Library/Frameworks
109 PYTHONFRAMEWORKDIR=no-framework
110 PYTHONFRAMEWORKPREFIX=
111 PYTHONFRAMEWORKINSTALLDIR=
112 FRAMEWORKINSTALLFIRST=
113 FRAMEWORKINSTALLLAST=
114 FRAMEWORKALTINSTALLFIRST=
115 FRAMEWORKALTINSTALLLAST=
116 if test "x${prefix}" = "xNONE"; then
117 FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
119 FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
124 PYTHONFRAMEWORKPREFIX=$enableval
125 PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
126 FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
127 FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
128 FRAMEWORKALTINSTALLFIRST="${FRAMEWORKINSTALLFIRST} bininstall maninstall"
129 FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
130 if test "x${prefix}" = "xNONE" ; then
131 FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
133 FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
135 prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
137 # Add files for Mac specific code to the list of output
139 AC_CONFIG_FILES(Mac/Makefile)
140 AC_CONFIG_FILES(Mac/PythonLauncher/Makefile)
141 AC_CONFIG_FILES(Mac/IDLE/Makefile)
142 AC_CONFIG_FILES(Mac/Resources/framework/Info.plist)
143 AC_CONFIG_FILES(Mac/Resources/app/Info.plist)
147 PYTHONFRAMEWORKDIR=no-framework
148 PYTHONFRAMEWORKPREFIX=
149 PYTHONFRAMEWORKINSTALLDIR=
150 FRAMEWORKINSTALLFIRST=
151 FRAMEWORKINSTALLLAST=
152 FRAMEWORKALTINSTALLFIRST=
153 FRAMEWORKALTINSTALLLAST=
154 if test "x${prefix}" = "xNONE" ; then
155 FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
157 FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
161 AC_SUBST(PYTHONFRAMEWORK)
162 AC_SUBST(PYTHONFRAMEWORKIDENTIFIER)
163 AC_SUBST(PYTHONFRAMEWORKDIR)
164 AC_SUBST(PYTHONFRAMEWORKPREFIX)
165 AC_SUBST(PYTHONFRAMEWORKINSTALLDIR)
166 AC_SUBST(FRAMEWORKINSTALLFIRST)
167 AC_SUBST(FRAMEWORKINSTALLLAST)
168 AC_SUBST(FRAMEWORKALTINSTALLFIRST)
169 AC_SUBST(FRAMEWORKALTINSTALLLAST)
170 AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
173 ## AC_HELP_STRING(--with-dyld,
174 ## Use (OpenStep|Rhapsody) dynamic linker))
176 # Set name for machine-dependent library files
178 AC_MSG_CHECKING(MACHDEP)
179 if test -z "$MACHDEP"
181 ac_sys_system=`uname -s`
182 if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
183 -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
184 ac_sys_release=`uname -v`
186 ac_sys_release=`uname -r`
188 ac_md_system=`echo $ac_sys_system |
189 tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
190 ac_md_release=`echo $ac_sys_release |
191 tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
192 MACHDEP="$ac_md_system$ac_md_release"
195 cygwin*) MACHDEP="cygwin";;
196 darwin*) MACHDEP="darwin";;
197 atheos*) MACHDEP="atheos";;
198 irix646) MACHDEP="irix6";;
199 '') MACHDEP="unknown";;
203 # Some systems cannot stand _XOPEN_SOURCE being defined at all; they
204 # disable features if it is defined, without any means to access these
205 # features as extensions. For these systems, we skip the definition of
206 # _XOPEN_SOURCE. Before adding a system to the list to gain access to
207 # some feature, make sure there is no alternative way to access this
208 # feature. Also, when using wildcards, make sure you have verified the
209 # need for not defining _XOPEN_SOURCE on all systems matching the
210 # wildcard, and that the wildcard does not include future systems
211 # (which may remove their limitations).
212 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
213 case $ac_sys_system/$ac_sys_release in
214 # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
215 # even though select is a POSIX function. Reported by J. Ribbens.
216 # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
217 OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0@:>@)
218 define_xopen_source=no
219 # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
220 # also defined. This can be overridden by defining _BSD_SOURCE
221 # As this has a different meaning on Linux, only define it on OpenBSD
222 AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
224 # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
225 # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
227 NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S])
228 define_xopen_source=no;;
229 # On Solaris 2.6, sys/wait.h is inconsistent in the usage
230 # of union __?sigval. Reported by Stuart Bishop.
232 define_xopen_source=no;;
233 # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
234 # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
235 # Reconfirmed for 7.1.4 by Martin v. Loewis.
236 OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
237 define_xopen_source=no;;
238 # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
239 # but used in struct sockaddr.sa_family. Reported by Tim Rice.
241 define_xopen_source=no;;
242 # On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that
243 # it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently,
244 # this is fixed in 10.3, which identifies itself as Darwin/7.*
245 # This should hopefully be fixed in FreeBSD 4.9
246 FreeBSD/4.8* | Darwin/6* )
247 define_xopen_source=no;;
248 # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
249 # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
250 # or has another value. By not (re)defining it, the defaults come in place.
252 define_xopen_source=no;;
254 if test `uname -r` -eq 1; then
255 define_xopen_source=no
258 # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
259 # disables platform specific features beyond repair.
260 # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
261 # has no effect, don't bother defining them
262 Darwin/@<:@789@:>@.*)
263 define_xopen_source=no
268 if test $define_xopen_source = yes
270 # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
271 # defined precisely as g++ defines it
272 # Furthermore, on Solaris 10, XPG6 requires the use of a C99
274 case $ac_sys_system/$ac_sys_release in
275 SunOS/5.8|SunOS/5.9|SunOS/5.10)
276 AC_DEFINE(_XOPEN_SOURCE, 500,
277 Define to the level of X/Open that your system supports)
280 AC_DEFINE(_XOPEN_SOURCE, 600,
281 Define to the level of X/Open that your system supports)
285 # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
286 # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
287 # several APIs are not declared. Since this is also needed in some
288 # cases for HP-UX, we define it globally.
289 # except for Solaris 10, where it must not be defined,
290 # as it implies XPG4.2
291 case $ac_sys_system/$ac_sys_release in
295 AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
296 Define to activate Unix95-and-earlier features)
300 AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
305 # SGI compilers allow the specification of the both the ABI and the
306 # ISA on the command line. Depending on the values of these switches,
307 # different and often incompatable code will be generated.
309 # The SGI_ABI variable can be used to modify the CC and LDFLAGS and
310 # thus supply support for various ABI/ISA combinations. The MACHDEP
311 # variable is also adjusted.
314 if test ! -z "$SGI_ABI"
317 LDFLAGS="$SGI_ABI $LDFLAGS"
318 MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
320 AC_MSG_RESULT($MACHDEP)
322 # And add extra plat-mac for darwin
323 AC_SUBST(EXTRAPLATDIR)
324 AC_SUBST(EXTRAMACHDEPPATH)
325 AC_MSG_CHECKING(EXTRAPLATDIR)
326 if test -z "$EXTRAPLATDIR"
330 EXTRAPLATDIR="\$(PLATMACDIRS)"
331 EXTRAMACHDEPPATH="\$(PLATMACPATH)"
339 AC_MSG_RESULT($EXTRAPLATDIR)
341 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
342 # it may influence the way we can build extensions, so distutils
344 AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
345 AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
346 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
347 EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
349 AC_MSG_CHECKING(machine type as reported by uname -m)
350 ac_sys_machine=`uname -m`
351 AC_MSG_RESULT($ac_sys_machine)
353 # checks for alternative programs
355 # compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
356 # for debug/optimization stuff. BASECFLAGS is for flags that are required
357 # just to get things to compile and link. Users are free to override OPT
358 # when running configure or make. The build should not break if they do.
359 # BASECFLAGS should generally not be messed with, however.
361 # XXX shouldn't some/most/all of this code be merged with the stuff later
362 # on that fiddles with OPT and BASECFLAGS?
363 AC_MSG_CHECKING(for --without-gcc)
365 AC_HELP_STRING(--without-gcc,never use gcc),
373 without_gcc=$withval;;
375 case $ac_sys_system in
383 BASECFLAGS="$BASECFLAGS -export pragma"
385 LDFLAGS="$LDFLAGS -nodup"
393 AC_MSG_ERROR([Unknown BeOS platform "$BE_HOST_CPU"])
396 AR="\$(srcdir)/Modules/ar_beos"
404 AC_MSG_RESULT($without_gcc)
406 # If the user switches compilers, we can't believe the cache
407 if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
409 AC_MSG_ERROR([cached CC is different -- throw away $cache_file
410 (it is also a good idea to do 'make clean' before compiling)])
417 AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
418 AC_ARG_WITH(cxx_main,
419 AC_HELP_STRING([--with-cxx-main=<compiler>],
420 [compile main() and link python executable with C++ compiler]),
426 yes) with_cxx_main=yes
438 AC_MSG_RESULT($with_cxx_main)
444 gcc) AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;;
445 cc) AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;;
447 if test "$CXX" = "notfound"
454 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
455 if test "$CXX" = "notfound"
460 if test "$preset_cxx" != "$CXX"
464 By default, distutils will build C++ extension modules with "$CXX".
465 If this is not intended, then set CXX on the configure command line.
470 # checks for UNIX variants that set C preprocessor variables
473 # Check for unsupported systems
474 case $ac_sys_system/$ac_sys_release in
476 echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
477 echo See README for details.
482 AC_MSG_CHECKING(for --with-suffix)
484 AC_HELP_STRING(--with-suffix=.exe, set executable suffix),
491 AC_MSG_RESULT($EXEEXT)
493 # Test whether we're running on a non-case-sensitive system, in which
494 # case we give a warning if no ext is given
495 AC_SUBST(BUILDEXEEXT)
496 AC_MSG_CHECKING(for case-insensitive build directory)
497 if test ! -d CaseSensitiveTestDir; then
498 mkdir CaseSensitiveTestDir
501 if test -d casesensitivetestdir
509 rmdir CaseSensitiveTestDir
514 gcc) CC="$CC -D_HAVE_BSDI";;
518 case $ac_sys_system in
521 cc|*/cc) CC="$CC -Ae";;
525 cc) CC="$CC -Wl,-Bexport";;
528 # Some functions have a prototype only with that define, e.g. confstr
529 AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
535 AC_MSG_CHECKING(LIBRARY)
536 if test -z "$LIBRARY"
538 LIBRARY='libpython$(VERSION).a'
540 AC_MSG_RESULT($LIBRARY)
542 # LDLIBRARY is the name of the library to link against (as opposed to the
543 # name of the library into which to insert object files). BLDLIBRARY is also
544 # the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
545 # is blank as the main program is not linked directly against LDLIBRARY.
546 # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
547 # systems without shared libraries, LDLIBRARY is the same as LIBRARY
548 # (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,
549 # DLLLIBRARY is the shared (i.e., DLL) library.
551 # RUNSHARED is used to run shared python without installed libraries
553 # INSTSONAME is the name of the shared library that will be use to install
554 # on the system - some systems like version suffix, others don't
558 AC_SUBST(LDLIBRARYDIR)
562 BLDLIBRARY='$(LDLIBRARY)'
563 INSTSONAME='$(LDLIBRARY)'
568 # LINKCC is the command that links the python executable -- default is $(CC).
569 # If CXX is set, and if it is needed to link a main function that was
570 # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
571 # python might then depend on the C++ runtime
572 # This is altered for AIX in order to build the export list before
575 AC_MSG_CHECKING(LINKCC)
578 LINKCC='$(PURIFY) $(MAINCC)'
579 case $ac_sys_system in
582 if test $ac_sys_release -ge 5 -o \
583 $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then
586 LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
588 LINKCC="$LINKCC -L/usr/lib/ia64l64";;
591 AC_MSG_RESULT($LINKCC)
593 AC_MSG_CHECKING(for --enable-shared)
594 AC_ARG_ENABLE(shared,
595 AC_HELP_STRING(--enable-shared, disable/enable building shared python library))
597 if test -z "$enable_shared"
599 case $ac_sys_system in
601 enable_shared="yes";;
606 AC_MSG_RESULT($enable_shared)
608 AC_MSG_CHECKING(for --enable-profiling)
609 AC_ARG_ENABLE(profiling,
610 AC_HELP_STRING(--enable-profiling, enable C-level code profiling),
613 AC_TRY_RUN([int main() { return 0; }],
614 ac_enable_profiling="yes",
615 ac_enable_profiling="no",
616 ac_enable_profiling="no")
618 AC_MSG_RESULT($ac_enable_profiling)
620 case "$ac_enable_profiling" in
622 BASECFLAGS="-pg $BASECFLAGS"
623 LDFLAGS="-pg $LDFLAGS"
627 AC_MSG_CHECKING(LDLIBRARY)
629 # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
630 # library that we build, but we do not want to link against it (we
631 # will find it with a -framework option). For this reason there is an
632 # extra variable BLDLIBRARY against which Python and the extension
633 # modules are linked, BLDLIBRARY. This is normally the same as
634 # LDLIBRARY, but empty for MacOSX framework builds.
635 if test "$enable_framework"
637 LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
638 RUNSHARED=DYLD_FRAMEWORK_PATH="`pwd`:$DYLD_FRAMEWORK_PATH"
641 BLDLIBRARY='$(LDLIBRARY)'
644 # Other platforms follow
645 if test $enable_shared = "yes"; then
646 AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
647 case $ac_sys_system in
649 LDLIBRARY='libpython$(VERSION).so'
652 LDLIBRARY='libpython$(VERSION).dll.a'
653 DLLLIBRARY='libpython$(VERSION).dll'
656 LDLIBRARY='libpython$(VERSION).so'
657 BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
658 RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
659 INSTSONAME="$LDLIBRARY".$SOVERSION
661 Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
662 LDLIBRARY='libpython$(VERSION).so'
663 BLDLIBRARY='-L. -lpython$(VERSION)'
664 RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
665 case $ac_sys_system in
667 SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
670 INSTSONAME="$LDLIBRARY".$SOVERSION
675 LDLIBRARY='libpython$(VERSION).so'
678 LDLIBRARY='libpython$(VERSION).sl'
681 BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)'
682 RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH}
685 LDLIBRARY='libpython$(VERSION).so'
686 BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
687 RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
690 LDLIBRARY='libpython$(VERSION).so'
691 BLDLIBRARY='-L. -lpython$(VERSION)'
692 RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
695 else # shared is disabled
696 case $ac_sys_system in
698 BLDLIBRARY='$(LIBRARY)'
699 LDLIBRARY='libpython$(VERSION).dll.a'
704 AC_MSG_RESULT($LDLIBRARY)
708 AC_CHECK_PROGS(AR, ar aal, ar)
711 AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
712 if test $SVNVERSION = found
714 SVNVERSION="svnversion \$(srcdir)"
716 SVNVERSION="echo exported"
721 # install -d does not work on BSDI or HP-UX
722 if test -z "$INSTALL"
724 INSTALL="${srcdir}/install-sh -c"
729 # Not every filesystem supports hard links
731 if test -z "$LN" ; then
732 case $ac_sys_system in
734 CYGWIN*) LN="ln -s";;
735 atheos*) LN="ln -s";;
740 # Check for --with-pydebug
741 AC_MSG_CHECKING(for --with-pydebug)
743 AC_HELP_STRING(--with-pydebug, build with Py_DEBUG defined),
745 if test "$withval" != no
747 AC_DEFINE(Py_DEBUG, 1,
748 [Define if you want to build an interpreter with many run-time checks.])
751 else AC_MSG_RESULT(no); Py_DEBUG='false'
755 # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
756 # merged with this chunk of code?
758 # Optimizer/debugger flags
759 # ------------------------
760 # (The following bit of code is complicated enough - please keep things
761 # indented properly. Just pretend you're editing Python code. ;-)
763 # There are two parallel sets of case statements below, one that checks to
764 # see if OPT was set and one that does BASECFLAGS setting based upon
765 # compiler and platform. BASECFLAGS tweaks need to be made even if the
768 # tweak OPT based on compiler and platform, only if the user didn't set
769 # it on the command line
775 if test "$CC" != 'g++' ; then
776 STRICT_PROTO="-Wstrict-prototypes"
778 # For gcc 4.x we need to use -fwrapv so lets check if its supported
779 if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
782 case $ac_cv_prog_cc_g in
784 if test "$Py_DEBUG" = 'true' ; then
785 # Optimization messes up debuggers, so turn it off for
787 OPT="-g -Wall $STRICT_PROTO"
789 OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
793 OPT="-O3 -Wall $STRICT_PROTO"
796 case $ac_sys_system in
797 SCO_SV*) OPT="$OPT -m486 -DSCO5"
807 # The current (beta) Monterey compiler dies with optimizations
808 # XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
809 case $ac_sys_system in
818 # tweak BASECFLAGS based on compiler and platform
821 # Python violates C99 rules, by casting between incompatible
822 # pointer types. GCC may generate bad code as a result of that,
823 # so use -fno-strict-aliasing if supported.
824 AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
826 CC="$CC -fno-strict-aliasing"
827 AC_TRY_RUN([int main() { return 0; }],
828 ac_cv_no_strict_aliasing_ok=yes,
829 ac_cv_no_strict_aliasing_ok=no,
830 ac_cv_no_strict_aliasing_ok=no)
832 AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
833 if test $ac_cv_no_strict_aliasing_ok = yes
835 BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
838 # if using gcc on alpha, use -mieee to get (near) full IEEE 754
839 # support. Without this, treatment of subnormals doesn't follow
841 case $ac_sys_machine in
843 BASECFLAGS="$BASECFLAGS -mieee"
847 case $ac_sys_system in
849 BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
851 # is there any other compiler on Darwin besides gcc?
853 # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
854 # used to be here, but non-Apple gcc doesn't accept them.
855 if test "${enable_universalsdk}"; then
856 BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
861 BASECFLAGS="$BASECFLAGS -mieee"
867 case $ac_sys_system in
869 BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
872 BASECFLAGS="$BASECFLAGS -ieee -std"
875 BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
881 if test "$Py_DEBUG" = 'true'; then
887 if test "$ac_arch_flags"
889 BASECFLAGS="$BASECFLAGS $ac_arch_flags"
892 # disable check for icc since it seems to pass, but generates a warning
895 ac_cv_opt_olimit_ok=no
898 AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
899 AC_CACHE_VAL(ac_cv_opt_olimit_ok,
901 CC="$CC -OPT:Olimit=0"
902 AC_TRY_RUN([int main() { return 0; }],
903 ac_cv_opt_olimit_ok=yes,
904 ac_cv_opt_olimit_ok=no,
905 ac_cv_opt_olimit_ok=no)
907 AC_MSG_RESULT($ac_cv_opt_olimit_ok)
908 if test $ac_cv_opt_olimit_ok = yes; then
909 case $ac_sys_system in
910 # XXX is this branch needed? On MacOSX 10.2.2 the result of the
911 # olimit_ok test is "no". Is it "yes" in some other Darwin-esque
916 BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
920 AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
921 AC_CACHE_VAL(ac_cv_olimit_ok,
923 CC="$CC -Olimit 1500"
924 AC_TRY_RUN([int main() { return 0; }],
929 AC_MSG_RESULT($ac_cv_olimit_ok)
930 if test $ac_cv_olimit_ok = yes; then
931 BASECFLAGS="$BASECFLAGS -Olimit 1500"
935 # Check whether GCC supports PyArg_ParseTuple format
936 if test "$GCC" = "yes"
938 AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
940 CFLAGS="$CFLAGS -Werror"
942 void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
944 AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1, [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
951 # On some compilers, pthreads are available without further options
952 # (e.g. MacOS X). On some of these systems, the compiler will not
953 # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
954 # So we have to see first whether pthreads are available without
955 # options before we can check whether -Kpthread improves anything.
956 AC_MSG_CHECKING(whether pthreads are available without options)
957 AC_CACHE_VAL(ac_cv_pthread_is_default,
961 void* routine(void* p){return NULL;}
965 if(pthread_create(&p,NULL,routine,NULL)!=0)
967 (void)pthread_detach(p);
972 ac_cv_pthread_is_default=yes
976 ac_cv_pthread_is_default=no,
977 ac_cv_pthread_is_default=no)
979 AC_MSG_RESULT($ac_cv_pthread_is_default)
982 if test $ac_cv_pthread_is_default = yes
986 # -Kpthread, if available, provides the right #defines
987 # and linker options to make pthread_create available
988 # Some compilers won't report that they do not support -Kpthread,
989 # so we need to run a program to see whether it really made the
990 # function available.
991 AC_MSG_CHECKING(whether $CC accepts -Kpthread)
992 AC_CACHE_VAL(ac_cv_kpthread,
998 void* routine(void* p){return NULL;}
1002 if(pthread_create(&p,NULL,routine,NULL)!=0)
1004 (void)pthread_detach(p);
1012 AC_MSG_RESULT($ac_cv_kpthread)
1015 if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
1017 # -Kthread, if available, provides the right #defines
1018 # and linker options to make pthread_create available
1019 # Some compilers won't report that they do not support -Kthread,
1020 # so we need to run a program to see whether it really made the
1021 # function available.
1022 AC_MSG_CHECKING(whether $CC accepts -Kthread)
1023 AC_CACHE_VAL(ac_cv_kthread,
1027 #include <pthread.h>
1029 void* routine(void* p){return NULL;}
1033 if(pthread_create(&p,NULL,routine,NULL)!=0)
1035 (void)pthread_detach(p);
1043 AC_MSG_RESULT($ac_cv_kthread)
1046 if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
1048 # -pthread, if available, provides the right #defines
1049 # and linker options to make pthread_create available
1050 # Some compilers won't report that they do not support -pthread,
1051 # so we need to run a program to see whether it really made the
1052 # function available.
1053 AC_MSG_CHECKING(whether $CC accepts -pthread)
1054 AC_CACHE_VAL(ac_cv_thread,
1058 #include <pthread.h>
1060 void* routine(void* p){return NULL;}
1064 if(pthread_create(&p,NULL,routine,NULL)!=0)
1066 (void)pthread_detach(p);
1074 AC_MSG_RESULT($ac_cv_pthread)
1077 # If we have set a CC compiler flag for thread support then
1078 # check if it works for CXX, too.
1082 AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
1085 if test "$ac_cv_kpthread" = "yes"
1087 CXX="$CXX -Kpthread"
1088 ac_cv_cxx_thread=yes
1089 elif test "$ac_cv_kthread" = "yes"
1092 ac_cv_cxx_thread=yes
1093 elif test "$ac_cv_pthread" = "yes"
1096 ac_cv_cxx_thread=yes
1099 if test $ac_cv_cxx_thread = yes
1101 echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext
1102 $CXX -c conftest.$ac_ext 2>&5
1103 if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
1104 && test -s conftest$ac_exeext && ./conftest$ac_exeext
1106 ac_cv_cxx_thread=yes
1112 AC_MSG_RESULT($ac_cv_cxx_thread)
1116 dnl # check for ANSI or K&R ("traditional") preprocessor
1117 dnl AC_MSG_CHECKING(for C preprocessor type)
1118 dnl AC_TRY_COMPILE([
1119 dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
1121 dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
1122 dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional)
1123 dnl AC_MSG_RESULT($cpp_type)
1125 # checks for header files
1127 AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
1129 ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
1130 shadow.h signal.h stdint.h stropts.h termios.h thread.h \
1132 sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
1133 sys/lock.h sys/mkdev.h sys/modem.h \
1134 sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
1136 sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
1137 sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
1138 bluetooth/bluetooth.h linux/tipc.h)
1142 # On Solaris, term.h requires curses.h
1143 AC_CHECK_HEADERS(term.h,,,[
1144 #ifdef HAVE_CURSES_H
1149 # On Linux, netlink.h requires asm/types.h
1150 AC_CHECK_HEADERS(linux/netlink.h,,,[
1151 #ifdef HAVE_ASM_TYPES_H
1152 #include <asm/types.h>
1154 #ifdef HAVE_SYS_SOCKET_H
1155 #include <sys/socket.h>
1159 # checks for typedefs
1161 AC_MSG_CHECKING(for clock_t in time.h)
1162 AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
1163 AC_DEFINE(clock_t, long, [Define to 'long' if <time.h> doesn't define.])
1165 AC_MSG_RESULT($was_it_defined)
1167 # Check whether using makedev requires defining _OSF_SOURCE
1168 AC_MSG_CHECKING(for makedev)
1169 AC_TRY_LINK([#include <sys/types.h> ],
1171 ac_cv_has_makedev=yes,
1172 ac_cv_has_makedev=no)
1173 if test "$ac_cv_has_makedev" = "no"; then
1174 # we didn't link, try if _OSF_SOURCE will allow us to link
1176 #define _OSF_SOURCE 1
1177 #include <sys/types.h>
1180 ac_cv_has_makedev=yes,
1181 ac_cv_has_makedev=no)
1182 if test "$ac_cv_has_makedev" = "yes"; then
1183 AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
1186 AC_MSG_RESULT($ac_cv_has_makedev)
1187 if test "$ac_cv_has_makedev" = "yes"; then
1188 AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
1191 # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in
1192 # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are
1193 # defined, but the compiler does not support pragma redefine_extname,
1194 # and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit
1195 # structures (such as rlimit64) without declaring them. As a
1196 # work-around, disable LFS on such configurations
1199 AC_MSG_CHECKING(Solaris LFS bug)
1201 #define _LARGEFILE_SOURCE 1
1202 #define _FILE_OFFSET_BITS 64
1203 #include <sys/resource.h>
1204 ],struct rlimit foo;,sol_lfs_bug=no,sol_lfs_bug=yes)
1205 AC_MSG_RESULT($sol_lfs_bug)
1206 if test "$sol_lfs_bug" = "yes"; then
1210 if test "$use_lfs" = "yes"; then
1211 # Two defines needed to enable largefile support on various platforms
1212 # These may affect some typedefs
1213 AC_DEFINE(_LARGEFILE_SOURCE, 1,
1214 [This must be defined on some systems to enable large file support.])
1215 AC_DEFINE(_FILE_OFFSET_BITS, 64,
1216 [This must be set to 64 on some systems to enable large file support.])
1219 # Add some code to confdefs.h so that the test for off_t works on SCO
1220 cat >> confdefs.h <<\EOF
1226 # Type availability checks
1233 AC_CHECK_TYPE(ssize_t,
1234 AC_DEFINE(HAVE_SSIZE_T, 1, Define if your compiler provides ssize_t),,)
1236 # Sizes of various common basic types
1237 # ANSI C requires sizeof(char) == 1, so no need to check it
1238 AC_CHECK_SIZEOF(int, 4)
1239 AC_CHECK_SIZEOF(long, 4)
1240 AC_CHECK_SIZEOF(void *, 4)
1241 AC_CHECK_SIZEOF(short, 2)
1242 AC_CHECK_SIZEOF(float, 4)
1243 AC_CHECK_SIZEOF(double, 8)
1244 AC_CHECK_SIZEOF(fpos_t, 4)
1245 AC_CHECK_SIZEOF(size_t, 4)
1246 AC_CHECK_SIZEOF(pid_t, 4)
1248 AC_MSG_CHECKING(for long long support)
1250 AC_TRY_COMPILE([], [long long x; x = (long long)0;], [
1251 AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
1254 AC_MSG_RESULT($have_long_long)
1255 if test "$have_long_long" = yes ; then
1256 AC_CHECK_SIZEOF(long long, 8)
1259 AC_MSG_CHECKING(for _Bool support)
1261 AC_TRY_COMPILE([], [_Bool x; x = (_Bool)0;], [
1262 AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.])
1265 AC_MSG_RESULT($have_c99_bool)
1266 if test "$have_c99_bool" = yes ; then
1267 AC_CHECK_SIZEOF(_Bool, 1)
1270 AC_CHECK_TYPES(uintptr_t,
1271 [AC_CHECK_SIZEOF(uintptr_t, 4)],
1272 [], [#ifdef HAVE_STDINT_H
1277 # Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
1278 AC_MSG_CHECKING(size of off_t)
1279 AC_CACHE_VAL(ac_cv_sizeof_off_t,
1280 [AC_TRY_RUN([#include <stdio.h>
1281 #include <sys/types.h>
1284 FILE *f=fopen("conftestval", "w");
1286 fprintf(f, "%d\n", sizeof(off_t));
1289 ac_cv_sizeof_off_t=`cat conftestval`,
1290 ac_cv_sizeof_off_t=0,
1291 ac_cv_sizeof_off_t=4)
1293 AC_MSG_RESULT($ac_cv_sizeof_off_t)
1294 AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
1295 [The number of bytes in an off_t.])
1297 AC_MSG_CHECKING(whether to enable large file support)
1298 if test "$have_long_long" = yes -a \
1299 "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
1300 "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
1301 AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
1302 [Defined to enable large file support when an off_t is bigger than a long
1303 and long long is available and at least as big as an off_t. You may need
1304 to add some flags for configuration and compilation to enable this mode.
1305 (For Solaris and Linux, the necessary defines are already defined.)])
1311 # AC_CHECK_SIZEOF() doesn't include <time.h>.
1312 AC_MSG_CHECKING(size of time_t)
1313 AC_CACHE_VAL(ac_cv_sizeof_time_t,
1314 [AC_TRY_RUN([#include <stdio.h>
1318 FILE *f=fopen("conftestval", "w");
1320 fprintf(f, "%d\n", sizeof(time_t));
1323 ac_cv_sizeof_time_t=`cat conftestval`,
1324 ac_cv_sizeof_time_t=0,
1325 ac_cv_sizeof_time_t=4)
1327 AC_MSG_RESULT($ac_cv_sizeof_time_t)
1328 AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
1329 [The number of bytes in a time_t.])
1332 # if have pthread_t then define SIZEOF_PTHREAD_T
1334 if test "$ac_cv_kpthread" = "yes"
1335 then CC="$CC -Kpthread"
1336 elif test "$ac_cv_kthread" = "yes"
1337 then CC="$CC -Kthread"
1338 elif test "$ac_cv_pthread" = "yes"
1339 then CC="$CC -pthread"
1341 AC_MSG_CHECKING(for pthread_t)
1343 AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
1344 AC_MSG_RESULT($have_pthread_t)
1345 if test "$have_pthread_t" = yes ; then
1346 # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
1347 AC_MSG_CHECKING(size of pthread_t)
1348 AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
1349 [AC_TRY_RUN([#include <stdio.h>
1350 #include <pthread.h>
1353 FILE *f=fopen("conftestval", "w");
1355 fprintf(f, "%d\n", sizeof(pthread_t));
1358 ac_cv_sizeof_pthread_t=`cat conftestval`,
1359 ac_cv_sizeof_pthread_t=0,
1360 ac_cv_sizeof_pthread_t=4)
1362 AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
1363 AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
1364 [The number of bytes in a pthread_t.])
1368 AC_MSG_CHECKING(for --enable-toolbox-glue)
1369 AC_ARG_ENABLE(toolbox-glue,
1370 AC_HELP_STRING(--enable-toolbox-glue, disable/enable MacOSX glue code for extensions))
1372 if test -z "$enable_toolbox_glue"
1374 case $ac_sys_system/$ac_sys_release in
1376 enable_toolbox_glue="yes";;
1378 enable_toolbox_glue="no";;
1381 case "$enable_toolbox_glue" in
1383 extra_machdep_objs="Python/mactoolboxglue.o"
1384 extra_undefs="-u _PyMac_Error"
1385 AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE, 1,
1386 [Define if you want to use MacPython modules on MacOSX in unix-Python.])
1389 extra_machdep_objs=""
1393 AC_MSG_RESULT($enable_toolbox_glue)
1395 AC_SUBST(OTHER_LIBTOOL_OPT)
1396 case $ac_sys_system/$ac_sys_release in
1397 Darwin/@<:@01567@:>@\..*)
1398 OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
1401 OTHER_LIBTOOL_OPT=""
1405 AC_SUBST(LIBTOOL_CRUFT)
1406 case $ac_sys_system/$ac_sys_release in
1407 Darwin/@<:@01567@:>@\..*)
1408 LIBTOOL_CRUFT="-framework System -lcc_dynamic"
1409 if test "${enable_universalsdk}"; then
1412 LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
1414 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1415 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
1417 gcc_version=`gcc -v 2>&1 | grep version | cut -d\ -f3`
1418 if test ${gcc_version} '<' 4.0
1420 LIBTOOL_CRUFT="-lcc_dynamic"
1424 LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
1425 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1426 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
1429 AC_MSG_CHECKING(for --enable-framework)
1430 if test "$enable_framework"
1432 BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
1433 # -F. is needed to allow linking to the framework while
1434 # in the build location.
1435 AC_DEFINE(WITH_NEXT_FRAMEWORK, 1,
1436 [Define if you want to produce an OpenStep/Rhapsody framework
1437 (shared library plus accessory files).])
1443 AC_MSG_CHECKING(for dyld)
1444 case $ac_sys_system/$ac_sys_release in
1446 AC_DEFINE(WITH_DYLD, 1,
1447 [Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
1448 dynamic linker (dyld) instead of the old-style (NextStep) dynamic
1449 linker (rld). Dyld is necessary to support frameworks.])
1450 AC_MSG_RESULT(always on for Darwin)
1457 # Set info about shared libraries.
1462 AC_SUBST(LINKFORSHARED)
1463 # SO is the extension of shared libraries `(including the dot!)
1464 # -- usually .so, .sl on HP-UX, .dll on Cygwin
1468 case $ac_sys_system in
1479 # this might also be a termcap variable, see #610332
1481 echo '====================================================================='
1483 echo '+ WARNING: You have set SO in your environment. +'
1484 echo '+ Do you really mean to change the extension for shared libraries? +'
1485 echo '+ Continuing in 10 seconds to let you to ponder. +'
1487 echo '====================================================================='
1491 AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
1492 # LDSHARED is the ld *command* used to create shared library
1493 # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
1494 # (Shared libraries in this instance are shared modules to be loaded into
1495 # Python, as opposed to building Python itself as a shared library.)
1496 AC_MSG_CHECKING(LDSHARED)
1497 if test -z "$LDSHARED"
1499 case $ac_sys_system/$ac_sys_release in
1501 BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
1502 LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
1505 BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
1506 LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
1508 IRIX/5*) LDSHARED="ld -shared";;
1509 IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
1511 if test "$GCC" = "yes"
1512 then LDSHARED='$(CC) -shared'
1513 else LDSHARED='$(CC) -G';
1516 if test "$GCC" = "yes"
1517 then LDSHARED='$(CC) -shared'
1518 else LDSHARED='ld -b';
1520 OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
1522 LDSHARED='$(CC) $(LDFLAGS) -bundle'
1523 if test "$enable_framework" ; then
1524 # Link against the framework. All externals should be defined.
1525 BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1526 LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1528 # No framework. Ignore undefined symbols, assuming they come from Python
1529 LDSHARED="$LDSHARED -undefined suppress"
1531 Darwin/1.4*|Darwin/5.*|Darwin/6.*)
1532 LDSHARED='$(CC) $(LDFLAGS) -bundle'
1533 if test "$enable_framework" ; then
1534 # Link against the framework. All externals should be defined.
1535 BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1536 LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1538 # No framework, use the Python app as bundle-loader
1539 BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
1540 LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
1543 # Use -undefined dynamic_lookup whenever possible (10.3 and later).
1544 # This allows an extension to be used in any Python
1545 cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
1546 if test ${cur_target} '>' 10.2; then
1549 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
1551 # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
1552 # environment with a value that is the same as what we'll use
1553 # in the Makefile to ensure that we'll get the same compiler
1554 # environment during configure and build time.
1555 MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
1556 export MACOSX_DEPLOYMENT_TARGET
1558 EXPORT_MACOSX_DEPLOYMENT_TARGET=''
1559 if test ${MACOSX_DEPLOYMENT_TARGET-${cur_target}} '>' 10.2
1561 if test "${enable_universalsdk}"; then
1562 LDFLAGS="-arch i386 -arch ppc -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
1564 LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
1565 BLDSHARED="$LDSHARED"
1567 LDSHARED='$(CC) $(LDFLAGS) -bundle'
1568 if test "$enable_framework" ; then
1569 # Link against the framework. All externals should be defined.
1570 BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1571 LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1573 # No framework, use the Python app as bundle-loader
1574 BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
1575 LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
1579 Linux*|GNU*) LDSHARED='$(CC) -shared';;
1580 BSD/OS*/4*) LDSHARED="gcc -shared";;
1582 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
1584 LDSHARED="$CC -shared ${LDFLAGS}"
1586 LDSHARED="ld -Bshareable ${LDFLAGS}"
1589 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
1591 LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
1594 [[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
1595 LDSHARED="ld -Bshareable ${LDFLAGS}"
1598 LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
1602 NetBSD*|DragonFly*) LDSHARED="cc -shared ${LDFLAGS}";;
1603 OpenUNIX*|UnixWare*)
1604 if test "$GCC" = "yes"
1605 then LDSHARED='$(CC) -shared'
1606 else LDSHARED='$(CC) -G'
1608 SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
1609 Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
1610 CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
1611 atheos*) LDSHARED="gcc -shared";;
1615 AC_MSG_RESULT($LDSHARED)
1616 BLDSHARED=${BLDSHARED-$LDSHARED}
1617 # CCSHARED are the C *flags* used to create objects to go into a shared
1618 # library (module) -- this is only needed for a few systems
1619 AC_MSG_CHECKING(CCSHARED)
1620 if test -z "$CCSHARED"
1622 case $ac_sys_system/$ac_sys_release in
1623 SunOS*) if test "$GCC" = yes;
1624 then CCSHARED="-fPIC";
1625 elif test `uname -p` = sparc;
1626 then CCSHARED="-xcode=pic32";
1627 else CCSHARED="-Kpic";
1629 hp*|HP*) if test "$GCC" = yes;
1630 then CCSHARED="-fPIC";
1633 Linux*|GNU*) CCSHARED="-fPIC";;
1634 BSD/OS*/4*) CCSHARED="-fpic";;
1635 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
1636 OpenUNIX*|UnixWare*)
1637 if test "$GCC" = "yes"
1638 then CCSHARED="-fPIC"
1639 else CCSHARED="-KPIC"
1642 if test "$GCC" = "yes"
1643 then CCSHARED="-fPIC"
1644 else CCSHARED="-Kpic -belf"
1646 Monterey*) CCSHARED="-G";;
1647 IRIX*/6*) case $CC in
1648 *gcc*) CCSHARED="-shared";;
1651 atheos*) CCSHARED="-fPIC";;
1654 AC_MSG_RESULT($CCSHARED)
1655 # LINKFORSHARED are the flags passed to the $(CC) command that links
1656 # the python executable -- this is only needed for a few systems
1657 AC_MSG_CHECKING(LINKFORSHARED)
1658 if test -z "$LINKFORSHARED"
1660 case $ac_sys_system/$ac_sys_release in
1661 AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
1663 LINKFORSHARED="-Wl,-E -Wl,+s";;
1664 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
1665 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
1666 Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
1667 # -u libsys_s pulls in all symbols in libsys
1669 # -u _PyMac_Error is needed to pull in the mac toolbox glue,
1671 # not used by the core itself but which needs to be in the core so
1672 # that dynamically loaded extension modules have access to it.
1673 # -prebind is no longer used, because it actually seems to give a
1674 # slowdown in stead of a speedup, maybe due to the large number of
1675 # dynamic loads Python does.
1677 LINKFORSHARED="$extra_undefs"
1678 if test "$enable_framework"
1680 LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1682 LINKFORSHARED="$LINKFORSHARED";;
1683 OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
1684 SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
1685 ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
1686 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*)
1687 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
1689 LINKFORSHARED="-Wl,--export-dynamic"
1691 SunOS/5*) case $CC in
1693 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
1695 LINKFORSHARED="-Xlinker --export-dynamic"
1699 if test $enable_shared = "no"
1701 LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
1705 AC_MSG_RESULT($LINKFORSHARED)
1707 AC_SUBST(CFLAGSFORSHARED)
1708 AC_MSG_CHECKING(CFLAGSFORSHARED)
1709 if test ! "$LIBRARY" = "$LDLIBRARY"
1711 case $ac_sys_system in
1713 # Cygwin needs CCSHARED when building extension DLLs
1714 # but not when building the interpreter DLL.
1715 CFLAGSFORSHARED='';;
1717 CFLAGSFORSHARED='$(CCSHARED)'
1720 AC_MSG_RESULT($CFLAGSFORSHARED)
1722 # SHLIBS are libraries (except -lc and -lm) to link to the python shared
1723 # library (with --enable-shared).
1724 # For platforms on which shared libraries are not allowed to have unresolved
1725 # symbols, this must be set to $(LIBS) (expanded by make). We do this even
1726 # if it is not required, since it creates a dependency of the shared library
1727 # to LIBS. This, in turn, means that applications linking the shared libpython
1728 # don't need to link LIBS explicitly. The default should be only changed
1729 # on systems where this approach causes problems.
1731 AC_MSG_CHECKING(SHLIBS)
1732 case "$ac_sys_system" in
1736 AC_MSG_RESULT($SHLIBS)
1739 # checks for libraries
1740 AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
1741 AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
1743 # only check for sem_ini if thread support is requested
1744 if test "$with_threads" = "yes" -o -z "$with_threads"; then
1745 AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
1746 # posix4 on Solaris 2.6
1747 # pthread (first!) on Linux
1750 # check if we need libintl for locale functions
1751 AC_CHECK_LIB(intl, textdomain,
1752 AC_DEFINE(WITH_LIBINTL, 1,
1753 [Define to 1 if libintl is needed for locale functions.]))
1755 # checks for system dependent C++ extensions support
1756 case "$ac_sys_system" in
1757 AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support)
1758 AC_TRY_LINK([#include "/usr/lpp/xlC/include/load.h"],
1759 [loadAndInit("", 0, "")],
1760 [AC_DEFINE(AIX_GENUINE_CPLUSPLUS, 1,
1761 [Define for AIX if your compiler is a genuine IBM xlC/xlC_r
1762 and you want support for AIX C++ shared extension modules.])
1763 AC_MSG_RESULT(yes)],
1764 [AC_MSG_RESULT(no)]);;
1768 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
1769 # BeOS' sockets are stashed in libnet.
1770 AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
1771 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
1773 case "$ac_sys_system" in
1775 AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
1779 AC_MSG_CHECKING(for --with-libs)
1781 AC_HELP_STRING(--with-libs='lib1 ...', link against additional libs),
1783 AC_MSG_RESULT($withval)
1784 LIBS="$withval $LIBS"
1786 [AC_MSG_RESULT(no)])
1788 # Check for use of the system libffi library
1789 AC_MSG_CHECKING(for --with-system-ffi)
1790 AC_ARG_WITH(system_ffi,
1791 AC_HELP_STRING(--with-system-ffi, build _ctypes module using an installed ffi library))
1793 AC_MSG_RESULT($with_system_ffi)
1795 # Determine if signalmodule should be used.
1796 AC_SUBST(USE_SIGNAL_MODULE)
1797 AC_SUBST(SIGNAL_OBJS)
1798 AC_MSG_CHECKING(for --with-signal-module)
1799 AC_ARG_WITH(signal-module,
1800 AC_HELP_STRING(--with-signal-module, disable/enable signal module))
1802 if test -z "$with_signal_module"
1803 then with_signal_module="yes"
1805 AC_MSG_RESULT($with_signal_module)
1807 if test "${with_signal_module}" = "yes"; then
1808 USE_SIGNAL_MODULE=""
1811 USE_SIGNAL_MODULE="#"
1812 SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o"
1815 # This is used to generate Setup.config
1816 AC_SUBST(USE_THREAD_MODULE)
1817 USE_THREAD_MODULE=""
1819 AC_MSG_CHECKING(for --with-dec-threads)
1821 AC_ARG_WITH(dec-threads,
1822 AC_HELP_STRING(--with-dec-threads, use DEC Alpha/OSF1 thread-safe libraries),
1824 AC_MSG_RESULT($withval)
1826 if test "${with_thread+set}" != set; then
1827 with_thread="$withval";
1829 [AC_MSG_RESULT(no)])
1831 # Templates for things AC_DEFINEd more than once.
1832 # For a single AC_DEFINE, no template is needed.
1833 AH_TEMPLATE(C_THREADS,[Define if you have the Mach cthreads package])
1834 AH_TEMPLATE(_REENTRANT,
1835 [Define to force use of thread-safe errno, h_errno, and other functions])
1836 AH_TEMPLATE(WITH_THREAD,
1837 [Define if you want to compile in rudimentary thread support])
1839 AC_MSG_CHECKING(for --with-threads)
1840 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
1841 AC_ARG_WITH(threads,
1842 AC_HELP_STRING(--with(out)-threads@<:@=DIRECTORY@:>@, disable/enable thread support))
1844 # --with-thread is deprecated, but check for it anyway
1845 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
1847 AC_HELP_STRING(--with(out)-thread@<:@=DIRECTORY@:>@, deprecated; use --with(out)-threads),
1848 [with_threads=$with_thread])
1850 if test -z "$with_threads"
1851 then with_threads="yes"
1853 AC_MSG_RESULT($with_threads)
1856 if test "$with_threads" = "no"
1858 USE_THREAD_MODULE="#"
1859 elif test "$ac_cv_pthread_is_default" = yes
1861 AC_DEFINE(WITH_THREAD)
1862 # Defining _REENTRANT on system with POSIX threads should not hurt.
1863 AC_DEFINE(_REENTRANT)
1865 THREADOBJ="Python/thread.o"
1866 elif test "$ac_cv_kpthread" = "yes"
1869 if test "$ac_cv_cxx_thread" = "yes"; then
1870 CXX="$CXX -Kpthread"
1872 AC_DEFINE(WITH_THREAD)
1874 THREADOBJ="Python/thread.o"
1875 elif test "$ac_cv_kthread" = "yes"
1878 if test "$ac_cv_cxx_thread" = "yes"; then
1881 AC_DEFINE(WITH_THREAD)
1883 THREADOBJ="Python/thread.o"
1884 elif test "$ac_cv_pthread" = "yes"
1887 if test "$ac_cv_cxx_thread" = "yes"; then
1890 AC_DEFINE(WITH_THREAD)
1892 THREADOBJ="Python/thread.o"
1894 if test ! -z "$with_threads" -a -d "$with_threads"
1895 then LDFLAGS="$LDFLAGS -L$with_threads"
1897 if test ! -z "$withval" -a -d "$withval"
1898 then LDFLAGS="$LDFLAGS -L$withval"
1901 # According to the POSIX spec, a pthreads implementation must
1902 # define _POSIX_THREADS in unistd.h. Some apparently don't
1903 # (e.g. gnu pth with pthread emulation)
1904 AC_MSG_CHECKING(for _POSIX_THREADS in unistd.h)
1908 #ifdef _POSIX_THREADS
1911 ], unistd_defines_pthreads=yes, unistd_defines_pthreads=no)
1912 AC_MSG_RESULT($unistd_defines_pthreads)
1914 AC_DEFINE(_REENTRANT)
1915 AC_CHECK_HEADER(cthreads.h, [AC_DEFINE(WITH_THREAD)
1916 AC_DEFINE(C_THREADS)
1917 AC_DEFINE(HURD_C_THREADS, 1,
1918 [Define if you are using Mach cthreads directly under /include])
1919 LIBS="$LIBS -lthreads"
1920 THREADOBJ="Python/thread.o"],[
1921 AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
1922 AC_DEFINE(C_THREADS)
1923 AC_DEFINE(MACH_C_THREADS, 1,
1924 [Define if you are using Mach cthreads under mach /])
1925 THREADOBJ="Python/thread.o"],[
1926 AC_MSG_CHECKING(for --with-pth)
1928 AC_HELP_STRING(--with-pth, use GNU pth threading libraries),
1929 [AC_MSG_RESULT($withval)
1930 AC_DEFINE([WITH_THREAD])
1931 AC_DEFINE([HAVE_PTH], 1,
1932 [Define if you have GNU PTH threads.])
1934 THREADOBJ="Python/thread.o"],
1937 # Just looking for pthread_create in libpthread is not enough:
1938 # on HP/UX, pthread.h renames pthread_create to a different symbol name.
1939 # So we really have to include pthread.h, and then link.
1941 LIBS="$LIBS -lpthread"
1942 AC_MSG_CHECKING([for pthread_create in -lpthread])
1943 AC_TRY_LINK([#include <pthread.h>
1945 void * start_routine (void *arg) { exit (0); }], [
1946 pthread_create (NULL, NULL, start_routine, NULL)], [
1948 AC_DEFINE(WITH_THREAD)
1950 THREADOBJ="Python/thread.o"],[
1952 AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
1954 THREADOBJ="Python/thread.o"],[
1955 AC_CHECK_HEADER(atheos/threads.h, [AC_DEFINE(WITH_THREAD)
1956 AC_DEFINE(ATHEOS_THREADS, 1,
1957 [Define this if you have AtheOS threads.])
1958 THREADOBJ="Python/thread.o"],[
1959 AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
1960 AC_DEFINE(BEOS_THREADS, 1,
1961 [Define this if you have BeOS threads.])
1962 THREADOBJ="Python/thread.o"],[
1963 AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
1965 LIBS="$LIBS -lpthreads"
1966 THREADOBJ="Python/thread.o"], [
1967 AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
1970 THREADOBJ="Python/thread.o"], [
1971 AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
1973 LIBS="$LIBS -lpthread"
1974 THREADOBJ="Python/thread.o"], [
1975 AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
1978 THREADOBJ="Python/thread.o"],[
1979 USE_THREAD_MODULE="#"])
1980 ])])])])])])])])])])
1982 AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
1984 THREADOBJ="Python/thread.o"
1985 USE_THREAD_MODULE=""])
1987 if test "$posix_threads" != "yes"; then
1988 AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
1989 LIBS="$LIBS -lthread"
1990 THREADOBJ="Python/thread.o"
1991 USE_THREAD_MODULE=""])
1994 if test "$USE_THREAD_MODULE" != "#"
1996 # If the above checks didn't disable threads, (at least) OSF1
1997 # needs this '-threads' argument during linking.
1998 case $ac_sys_system in
1999 OSF1) LDLAST=-threads;;
2004 if test "$posix_threads" = "yes"; then
2005 if test "$unistd_defines_pthreads" = "no"; then
2006 AC_DEFINE(_POSIX_THREADS, 1,
2007 [Define if you have POSIX threads,
2008 and your system does not define that.])
2011 # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
2012 case $ac_sys_system/$ac_sys_release in
2013 SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1,
2014 Defined for Solaris 2.6 bug in pthread header.)
2016 SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
2017 Define if the Posix semaphores do not work on your system)
2019 AIX/5) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
2020 Define if the Posix semaphores do not work on your system)
2024 AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
2025 AC_CACHE_VAL(ac_cv_pthread_system_supported,
2026 [AC_TRY_RUN([#include <pthread.h>
2027 void *foo(void *parm) {
2031 pthread_attr_t attr;
2033 if (pthread_attr_init(&attr)) exit(-1);
2034 if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
2035 if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
2038 ac_cv_pthread_system_supported=yes,
2039 ac_cv_pthread_system_supported=no,
2040 ac_cv_pthread_system_supported=no)
2042 AC_MSG_RESULT($ac_cv_pthread_system_supported)
2043 if test "$ac_cv_pthread_system_supported" = "yes"; then
2044 AC_DEFINE(PTHREAD_SYSTEM_SCHED_SUPPORTED, 1, [Defined if PTHREAD_SCOPE_SYSTEM supported.])
2046 AC_CHECK_FUNCS(pthread_sigmask,
2047 [case $ac_sys_system in
2049 AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1,
2050 [Define if pthread_sigmask() does not work on your system.])
2056 # Check for enable-ipv6
2057 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
2058 AC_MSG_CHECKING([if --enable-ipv6 is specified])
2060 [ --enable-ipv6 Enable ipv6 (with ipv4) support
2061 --disable-ipv6 Disable ipv6 support],
2062 [ case "$enableval" in
2067 *) AC_MSG_RESULT(yes)
2068 AC_DEFINE(ENABLE_IPV6)
2074 dnl the check does not work on cross compilation case...
2075 AC_TRY_RUN([ /* AF_INET6 available check */
2076 #include <sys/types.h>
2077 #include <sys/socket.h>
2080 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
2094 if test "$ipv6" = "yes"; then
2095 AC_MSG_CHECKING(if RFC2553 API is available)
2096 AC_TRY_COMPILE([#include <sys/types.h>
2097 #include <netinet/in.h>],
2098 [struct sockaddr_in6 x;
2102 AC_MSG_RESULT(no, IPv6 disabled)
2106 if test "$ipv6" = "yes"; then
2107 AC_DEFINE(ENABLE_IPV6)
2115 if test "$ipv6" = "yes"; then
2116 AC_MSG_CHECKING([ipv6 stack type])
2117 for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
2121 dnl http://www.kame.net/
2123 #include <netinet/in.h>
2124 #ifdef IPV6_INRIA_VERSION
2130 dnl http://www.kame.net/
2132 #include <netinet/in.h>
2138 ipv6libdir=/usr/local/v6/lib
2142 dnl http://www.v6.linux.or.jp/
2144 #include <features.h>
2145 #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2))
2152 dnl http://www.v6.linux.or.jp/
2153 if test -d /usr/inet6; then
2156 ipv6libdir=/usr/inet6/lib
2157 BASECFLAGS="-I/usr/inet6/include $BASECFLAGS"
2161 if test -f /etc/netconfig; then
2162 if /usr/xpg4/bin/grep -q tcp6 /etc/netconfig; then
2170 #include <sys/param.h>
2171 #ifdef _TOSHIBA_INET6
2176 ipv6libdir=/usr/local/v6/lib])
2180 #include </usr/local/v6/include/sys/v6config.h>
2186 ipv6libdir=/usr/local/v6/lib;
2187 BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"])
2191 #include <sys/param.h>
2192 #ifdef _ZETA_MINAMI_INET6
2197 ipv6libdir=/usr/local/v6/lib])
2200 if test "$ipv6type" != "unknown"; then
2204 AC_MSG_RESULT($ipv6type)
2207 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
2208 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
2209 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
2210 echo "using lib$ipv6lib"
2212 if test $ipv6trylibc = "yes"; then
2215 echo 'Fatal: no $ipv6lib library found. cannot continue.'
2216 echo "You need to fetch lib$ipv6lib.a from appropriate"
2217 echo 'ipv6 kit and compile beforehand.'
2223 # Check for --with-doc-strings
2224 AC_MSG_CHECKING(for --with-doc-strings)
2225 AC_ARG_WITH(doc-strings,
2226 AC_HELP_STRING(--with(out)-doc-strings, disable/enable documentation strings))
2228 if test -z "$with_doc_strings"
2229 then with_doc_strings="yes"
2231 if test "$with_doc_strings" != "no"
2233 AC_DEFINE(WITH_DOC_STRINGS, 1,
2234 [Define if you want documentation strings in extension modules])
2236 AC_MSG_RESULT($with_doc_strings)
2238 # Check for Python-specific malloc support
2239 AC_MSG_CHECKING(for --with-tsc)
2241 [ --with(out)-tsc enable/disable timestamp counter profile], [
2242 if test "$withval" != no
2244 AC_DEFINE(WITH_TSC, 1,
2245 [Define to profile with the Pentium timestamp counter])
2247 else AC_MSG_RESULT(no)
2249 [AC_MSG_RESULT(no)])
2251 # Check for Python-specific malloc support
2252 AC_MSG_CHECKING(for --with-pymalloc)
2253 AC_ARG_WITH(pymalloc,
2254 AC_HELP_STRING(--with(out)-pymalloc, disable/enable specialized mallocs))
2256 if test -z "$with_pymalloc"
2257 then with_pymalloc="yes"
2259 if test "$with_pymalloc" != "no"
2261 AC_DEFINE(WITH_PYMALLOC, 1,
2262 [Define if you want to compile in Python-specific mallocs])
2264 AC_MSG_RESULT($with_pymalloc)
2266 # Check for --with-wctype-functions
2267 AC_MSG_CHECKING(for --with-wctype-functions)
2268 AC_ARG_WITH(wctype-functions,
2269 AC_HELP_STRING(--with-wctype-functions, use wctype.h functions),
2271 if test "$withval" != no
2273 AC_DEFINE(WANT_WCTYPE_FUNCTIONS, 1,
2274 [Define if you want wctype.h functions to be used instead of the
2275 one supplied by Python itself. (see Include/unicodectype.h).])
2277 else AC_MSG_RESULT(no)
2279 [AC_MSG_RESULT(no)])
2281 # -I${DLINCLDIR} is added to the compile rule for importdl.o
2285 # the dlopen() function means we might want to use dynload_shlib.o. some
2286 # platforms, such as AIX, have dlopen(), but don't want to use it.
2287 AC_CHECK_FUNCS(dlopen)
2289 # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic
2290 # loading of modules.
2291 AC_SUBST(DYNLOADFILE)
2292 AC_MSG_CHECKING(DYNLOADFILE)
2293 if test -z "$DYNLOADFILE"
2295 case $ac_sys_system/$ac_sys_release in
2296 AIX*) # Use dynload_shlib.c and dlopen() if we have it; otherwise dynload_aix.c
2297 if test "$ac_cv_func_dlopen" = yes
2298 then DYNLOADFILE="dynload_shlib.o"
2299 else DYNLOADFILE="dynload_aix.o"
2302 BeOS*) DYNLOADFILE="dynload_beos.o";;
2303 hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
2304 # Use dynload_next.c only on 10.2 and below, which don't have native dlopen()
2305 Darwin/@<:@0156@:>@\..*) DYNLOADFILE="dynload_next.o";;
2306 atheos*) DYNLOADFILE="dynload_atheos.o";;
2308 # use dynload_shlib.c and dlopen() if we have it; otherwise stub
2309 # out any dynamic loading
2310 if test "$ac_cv_func_dlopen" = yes
2311 then DYNLOADFILE="dynload_shlib.o"
2312 else DYNLOADFILE="dynload_stub.o"
2317 AC_MSG_RESULT($DYNLOADFILE)
2318 if test "$DYNLOADFILE" != "dynload_stub.o"
2320 AC_DEFINE(HAVE_DYNAMIC_LOADING, 1,
2321 [Defined when any dynamic module loading is enabled.])
2324 # MACHDEP_OBJS can be set to platform-specific object files needed by Python
2326 AC_SUBST(MACHDEP_OBJS)
2327 AC_MSG_CHECKING(MACHDEP_OBJS)
2328 if test -z "$MACHDEP_OBJS"
2330 MACHDEP_OBJS=$extra_machdep_objs
2332 MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs"
2334 AC_MSG_RESULT(MACHDEP_OBJS)
2336 # checks for library functions
2337 AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
2338 clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
2339 gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
2340 getpriority getpwent getspnam getspent getsid getwd \
2341 kill killpg lchmod lchown lstat mkfifo mknod mktime \
2342 mremap nice pathconf pause plock poll pthread_init \
2343 putenv readlink realpath \
2344 select setegid seteuid setgid \
2345 setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \
2346 sigaction siginterrupt sigrelse strftime \
2347 sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
2348 truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll _getpty)
2350 # For some functions, having a definition is not sufficient, since
2351 # we want to take their address.
2352 AC_MSG_CHECKING(for chroot)
2353 AC_TRY_COMPILE([#include <unistd.h>], void *x=chroot,
2354 AC_DEFINE(HAVE_CHROOT, 1, Define if you have the 'chroot' function.)
2358 AC_MSG_CHECKING(for link)
2359 AC_TRY_COMPILE([#include <unistd.h>], void *x=link,
2360 AC_DEFINE(HAVE_LINK, 1, Define if you have the 'link' function.)
2364 AC_MSG_CHECKING(for symlink)
2365 AC_TRY_COMPILE([#include <unistd.h>], void *x=symlink,
2366 AC_DEFINE(HAVE_SYMLINK, 1, Define if you have the 'symlink' function.)
2370 AC_MSG_CHECKING(for fchdir)
2371 AC_TRY_COMPILE([#include <unistd.h>], void *x=fchdir,
2372 AC_DEFINE(HAVE_FCHDIR, 1, Define if you have the 'fchdir' function.)
2376 AC_MSG_CHECKING(for fsync)
2377 AC_TRY_COMPILE([#include <unistd.h>], void *x=fsync,
2378 AC_DEFINE(HAVE_FSYNC, 1, Define if you have the 'fsync' function.)
2382 AC_MSG_CHECKING(for fdatasync)
2383 AC_TRY_COMPILE([#include <unistd.h>], void *x=fdatasync,
2384 AC_DEFINE(HAVE_FDATASYNC, 1, Define if you have the 'fdatasync' function.)
2388 AC_MSG_CHECKING(for epoll)
2389 AC_TRY_COMPILE([#include <sys/epoll.h>], void *x=epoll_create,
2390 AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.)
2394 AC_MSG_CHECKING(for kqueue)
2396 #include <sys/types.h>
2397 #include <sys/event.h>
2399 AC_DEFINE(HAVE_KQUEUE, 1, Define if you have the 'kqueue' functions.)
2403 # On some systems (eg. FreeBSD 5), we would find a definition of the
2404 # functions ctermid_r, setgroups in the library, but no prototype
2405 # (e.g. because we use _XOPEN_SOURCE). See whether we can take their
2406 # address to avoid compiler warnings and potential miscompilations
2407 # because of the missing prototypes.
2409 AC_MSG_CHECKING(for ctermid_r)
2411 #include "confdefs.h"
2413 ], void* p = ctermid_r,
2414 AC_DEFINE(HAVE_CTERMID_R, 1, Define if you have the 'ctermid_r' function.)
2419 AC_MSG_CHECKING(for flock)
2421 #include "confdefs.h"
2422 #include <sys/file.h>
2424 AC_DEFINE(HAVE_FLOCK, 1, Define if you have the 'flock' function.)
2429 AC_MSG_CHECKING(for getpagesize)
2431 #include "confdefs.h"
2433 ], void* p = getpagesize,
2434 AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function.)
2440 AC_CHECK_PROGS(TRUE, true, /bin/true)
2442 dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
2443 dnl On others, they are in the C library, so we to take no action
2444 AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
2445 AC_CHECK_LIB(resolv, inet_aton)
2448 # On Tru64, chflags seems to be present, but calling it will
2450 AC_MSG_CHECKING(for chflags)
2452 #include <sys/stat.h>
2454 int main(int argc, char*argv[])
2456 if(chflags(argv[0], 0) != 0)
2460 ],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
2465 AC_MSG_CHECKING(for lchflags)
2467 #include <sys/stat.h>
2469 int main(int argc, char*argv[])
2471 if(lchflags(argv[0], 0) != 0)
2475 ],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
2480 dnl Check if system zlib has *Copy() functions
2482 dnl On MacOSX the linker will search for dylibs on the entire linker path
2483 dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first
2484 dnl to revert to a more traditional unix behaviour and make it possible to
2485 dnl override the system libz with a local static library of libz. Temporarily
2486 dnl add that flag to our CFLAGS as well to ensure that we check the version
2487 dnl of libz that will be used by setup.py.
2488 dnl The -L/usr/local/lib is needed as wel to get the same compilation
2489 dnl environment as setup.py (and leaving it out can cause configure to use the
2490 dnl wrong version of the library)
2491 case $ac_sys_system/$ac_sys_release in
2493 _CUR_CFLAGS="${CFLAGS}"
2494 _CUR_LDFLAGS="${LDFLAGS}"
2495 CFLAGS="${CFLAGS} -Wl,-search_paths_first"
2496 LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
2500 AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, Define if the zlib library has inflateCopy))
2502 case $ac_sys_system/$ac_sys_release in
2504 CFLAGS="${_CUR_CFLAGS}"
2505 LDFLAGS="${_CUR_LDFLAGS}"
2509 AC_MSG_CHECKING(for hstrerror)
2511 #include "confdefs.h"
2513 ], void* p = hstrerror; hstrerror(0),
2514 AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.)
2519 AC_MSG_CHECKING(for inet_aton)
2521 #include "confdefs.h"
2522 #include <sys/types.h>
2523 #include <sys/socket.h>
2524 #include <netinet/in.h>
2525 #include <arpa/inet.h>
2526 ], void* p = inet_aton;inet_aton(0,0),
2527 AC_DEFINE(HAVE_INET_ATON, 1, Define if you have the 'inet_aton' function.)
2532 AC_MSG_CHECKING(for inet_pton)
2534 #include "confdefs.h"
2535 #include <sys/types.h>
2536 #include <sys/socket.h>
2537 #include <netinet/in.h>
2538 #include <arpa/inet.h>
2539 ], void* p = inet_pton,
2540 AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.)
2545 # On some systems, setgroups is in unistd.h, on others, in grp.h
2546 AC_MSG_CHECKING(for setgroups)
2548 #include "confdefs.h"
2554 void* p = setgroups,
2555 AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.)
2560 # check for openpty and forkpty
2562 AC_CHECK_FUNCS(openpty,,
2563 AC_CHECK_LIB(util,openpty,
2564 [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"],
2565 AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"])
2568 AC_CHECK_FUNCS(forkpty,,
2569 AC_CHECK_LIB(util,forkpty,
2570 [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"],
2571 AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"])
2576 AC_CHECK_FUNCS(memmove)
2578 # check for long file support functions
2579 AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)
2581 AC_REPLACE_FUNCS(dup2 getcwd strdup)
2582 AC_CHECK_FUNCS(getpgrp,
2583 AC_TRY_COMPILE([#include <unistd.h>],
2585 AC_DEFINE(GETPGRP_HAVE_ARG, 1,
2586 [Define if getpgrp() must be called as getpgrp(0).])
2589 AC_CHECK_FUNCS(setpgrp,
2590 AC_TRY_COMPILE([#include <unistd.h>],
2592 AC_DEFINE(SETPGRP_HAVE_ARG, 1,
2593 [Define if setpgrp() must be called as setpgrp(0, 0).])
2596 AC_CHECK_FUNCS(gettimeofday,
2597 AC_TRY_COMPILE([#include <sys/time.h>],
2598 [gettimeofday((struct timeval*)0,(struct timezone*)0);], ,
2599 AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1,
2600 [Define if gettimeofday() does not have second (timezone) argument
2601 This is the case on Motorola V4 (R40V4.2)])
2605 AC_MSG_CHECKING(for major, minor, and makedev)
2607 #if defined(MAJOR_IN_MKDEV)
2608 #include <sys/mkdev.h>
2609 #elif defined(MAJOR_IN_SYSMACROS)
2610 #include <sys/sysmacros.h>
2612 #include <sys/types.h>
2615 makedev(major(0),minor(0));
2617 AC_DEFINE(HAVE_DEVICE_MACROS, 1,
2618 [Define to 1 if you have the device macros.])
2624 # On OSF/1 V5.1, getaddrinfo is available, but a define
2625 # for [no]getaddrinfo in netdb.h.
2626 AC_MSG_CHECKING(for getaddrinfo)
2628 #include <sys/types.h>
2629 #include <sys/socket.h>
2633 getaddrinfo(NULL, NULL, NULL, NULL);
2636 AC_MSG_CHECKING(getaddrinfo bug)
2638 #include <sys/types.h>
2641 #include <sys/socket.h>
2642 #include <netinet/in.h>
2646 int passive, gaierr, inet4 = 0, inet6 = 0;
2647 struct addrinfo hints, *ai, *aitop;
2648 char straddr[INET6_ADDRSTRLEN], strport[16];
2650 for (passive = 0; passive <= 1; passive++) {
2651 memset(&hints, 0, sizeof(hints));
2652 hints.ai_family = AF_UNSPEC;
2653 hints.ai_flags = passive ? AI_PASSIVE : 0;
2654 hints.ai_socktype = SOCK_STREAM;
2655 hints.ai_protocol = IPPROTO_TCP;
2656 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
2657 (void)gai_strerror(gaierr);
2660 for (ai = aitop; ai; ai = ai->ai_next) {
2661 if (ai->ai_addr == NULL ||
2662 ai->ai_addrlen == 0 ||
2663 getnameinfo(ai->ai_addr, ai->ai_addrlen,
2664 straddr, sizeof(straddr), strport, sizeof(strport),
2665 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
2668 switch (ai->ai_family) {
2670 if (strcmp(strport, "54321") != 0) {
2674 if (strcmp(straddr, "0.0.0.0") != 0) {
2678 if (strcmp(straddr, "127.0.0.1") != 0) {
2685 if (strcmp(strport, "54321") != 0) {
2689 if (strcmp(straddr, "::") != 0) {
2693 if (strcmp(straddr, "::1") != 0) {
2703 /* another family support? */
2709 if (!(inet4 == 0 || inet4 == 2))
2711 if (!(inet6 == 0 || inet6 == 2))
2715 freeaddrinfo(aitop);
2720 freeaddrinfo(aitop);
2725 buggygetaddrinfo=no,
2726 AC_MSG_RESULT(buggy)
2727 buggygetaddrinfo=yes,
2728 AC_MSG_RESULT(buggy)
2729 buggygetaddrinfo=yes)], [
2731 buggygetaddrinfo=yes
2734 if test "$buggygetaddrinfo" = "yes"; then
2735 if test "$ipv6" = "yes"; then
2736 echo 'Fatal: You must get working getaddrinfo() function.'
2737 echo ' or you can specify "--disable-ipv6"'.
2741 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.])
2743 AC_CHECK_FUNCS(getnameinfo)
2745 # checks for structures
2749 AC_CHECK_MEMBERS([struct stat.st_rdev])
2750 AC_CHECK_MEMBERS([struct stat.st_blksize])
2751 AC_CHECK_MEMBERS([struct stat.st_flags])
2752 AC_CHECK_MEMBERS([struct stat.st_gen])
2753 AC_CHECK_MEMBERS([struct stat.st_birthtime])
2756 AC_MSG_CHECKING(for time.h that defines altzone)
2757 AC_CACHE_VAL(ac_cv_header_time_altzone,
2758 [AC_TRY_COMPILE([#include <time.h>], [return altzone;],
2759 ac_cv_header_time_altzone=yes,
2760 ac_cv_header_time_altzone=no)])
2761 AC_MSG_RESULT($ac_cv_header_time_altzone)
2762 if test $ac_cv_header_time_altzone = yes; then
2763 AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.])
2767 AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included)
2769 #include <sys/types.h>
2770 #include <sys/select.h>
2771 #include <sys/time.h>
2773 AC_DEFINE(SYS_SELECT_WITH_SYS_TIME, 1,
2774 [Define if you can safely include both <sys/select.h> and <sys/time.h>
2775 (which you can't on SCO ODT 3.0).])
2778 AC_MSG_RESULT($was_it_defined)
2780 AC_MSG_CHECKING(for addrinfo)
2781 AC_CACHE_VAL(ac_cv_struct_addrinfo,
2783 # include <netdb.h>],
2784 [struct addrinfo a],
2785 ac_cv_struct_addrinfo=yes,
2786 ac_cv_struct_addrinfo=no))
2787 AC_MSG_RESULT($ac_cv_struct_addrinfo)
2788 if test $ac_cv_struct_addrinfo = yes; then
2789 AC_DEFINE(HAVE_ADDRINFO, 1, [struct addrinfo (netdb.h)])
2792 AC_MSG_CHECKING(for sockaddr_storage)
2793 AC_CACHE_VAL(ac_cv_struct_sockaddr_storage,
2795 # include <sys/types.h>
2796 # include <sys/socket.h>],
2797 [struct sockaddr_storage s],
2798 ac_cv_struct_sockaddr_storage=yes,
2799 ac_cv_struct_sockaddr_storage=no))
2800 AC_MSG_RESULT($ac_cv_struct_sockaddr_storage)
2801 if test $ac_cv_struct_sockaddr_storage = yes; then
2802 AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket.h)])
2805 # checks for compiler characteristics
2811 AC_MSG_CHECKING(for working volatile)
2812 AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes,
2813 AC_DEFINE(volatile, [], [Define to empty if the keyword does not work.])
2815 AC_MSG_RESULT($works)
2818 AC_MSG_CHECKING(for working signed char)
2819 AC_TRY_COMPILE([], [signed char c;], works=yes,
2820 AC_DEFINE(signed, [], [Define to empty if the keyword does not work.])
2822 AC_MSG_RESULT($works)
2825 AC_MSG_CHECKING(for prototypes)
2826 AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],[
2827 AC_DEFINE(HAVE_PROTOTYPES, 1,
2828 [Define if your compiler supports function prototype])
2831 AC_MSG_RESULT($have_prototypes)
2834 AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
2837 int foo(int x, ...) {
2845 ], [return foo(10, "", 3.14);], [
2846 AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1,
2847 [Define if your compiler supports variable length function prototypes
2848 (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>])
2851 AC_MSG_RESULT($works)
2853 # check for socketpair
2854 AC_MSG_CHECKING(for socketpair)
2856 #include <sys/types.h>
2857 #include <sys/socket.h>
2858 ], void *x=socketpair,
2859 AC_DEFINE(HAVE_SOCKETPAIR, 1, Define if you have the 'socketpair' function.)
2864 # check if sockaddr has sa_len member
2865 AC_MSG_CHECKING(if sockaddr has sa_len member)
2866 AC_TRY_COMPILE([#include <sys/types.h>
2867 #include <sys/socket.h>],
2871 AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member]),
2875 AC_MSG_CHECKING(whether va_list is an array)
2877 #ifdef HAVE_STDARG_PROTOTYPES
2880 #include <varargs.h>
2882 ], [va_list list1, list2; list1 = list2;], , [
2883 AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
2884 va_list_is_array=yes
2886 AC_MSG_RESULT($va_list_is_array)
2888 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
2889 AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
2890 [Define this if you have some version of gethostbyname_r()])
2892 AC_CHECK_FUNC(gethostbyname_r, [
2893 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2894 AC_MSG_CHECKING([gethostbyname_r with 6 args])
2896 CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
2901 struct hostent *he, *res;
2906 (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
2908 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2909 AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
2910 [Define this if you have the 6-arg version of gethostbyname_r().])
2914 AC_MSG_CHECKING([gethostbyname_r with 5 args])
2924 (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
2926 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2927 AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
2928 [Define this if you have the 5-arg version of gethostbyname_r().])
2932 AC_MSG_CHECKING([gethostbyname_r with 3 args])
2938 struct hostent_data data;
2940 (void) gethostbyname_r(name, he, &data);
2942 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2943 AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
2944 [Define this if you have the 3-arg version of gethostbyname_r().])
2953 AC_CHECK_FUNCS(gethostbyname)
2955 AC_SUBST(HAVE_GETHOSTBYNAME_R_6_ARG)
2956 AC_SUBST(HAVE_GETHOSTBYNAME_R_5_ARG)
2957 AC_SUBST(HAVE_GETHOSTBYNAME_R_3_ARG)
2958 AC_SUBST(HAVE_GETHOSTBYNAME_R)
2959 AC_SUBST(HAVE_GETHOSTBYNAME)
2961 # checks for system services
2964 # Linux requires this for correct f.p. operations
2965 AC_CHECK_FUNC(__fpu_control,
2967 [AC_CHECK_LIB(ieee, __fpu_control)
2970 # Check for --with-fpectl
2971 AC_MSG_CHECKING(for --with-fpectl)
2973 AC_HELP_STRING(--with-fpectl, enable SIGFPE catching),
2975 if test "$withval" != no
2977 AC_DEFINE(WANT_SIGFPE_HANDLER, 1,
2978 [Define if you want SIGFPE handled (see Include/pyfpe.h).])
2980 else AC_MSG_RESULT(no)
2982 [AC_MSG_RESULT(no)])
2984 # check for --with-libm=...
2986 case $ac_sys_system in
2991 AC_MSG_CHECKING(for --with-libm=STRING)
2993 AC_HELP_STRING(--with-libm=STRING, math library),
2995 if test "$withval" = no
2997 AC_MSG_RESULT(force LIBM empty)
2998 elif test "$withval" != yes
3000 AC_MSG_RESULT(set LIBM="$withval")
3001 else AC_MSG_ERROR([proper usage is --with-libm=STRING])
3003 [AC_MSG_RESULT(default LIBM="$LIBM")])
3005 # check for --with-libc=...
3007 AC_MSG_CHECKING(for --with-libc=STRING)
3009 AC_HELP_STRING(--with-libc=STRING, C library),
3011 if test "$withval" = no
3013 AC_MSG_RESULT(force LIBC empty)
3014 elif test "$withval" != yes
3016 AC_MSG_RESULT(set LIBC="$withval")
3017 else AC_MSG_ERROR([proper usage is --with-libc=STRING])
3019 [AC_MSG_RESULT(default LIBC="$LIBC")])
3021 # ************************************
3022 # * Check for mathematical functions *
3023 # ************************************
3028 # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
3029 # -0. on some architectures.
3030 AC_MSG_CHECKING(whether tanh preserves the sign of zero)
3031 AC_CACHE_VAL(ac_cv_tanh_preserves_zero_sign, [
3036 /* return 0 if either negative zeros don't exist
3037 on this platform or if negative zeros exist
3038 and tanh(-0.) == -0. */
3039 if (atan2(0., -1.) == atan2(-0., -1.) ||
3040 atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
3044 ac_cv_tanh_preserves_zero_sign=yes,
3045 ac_cv_tanh_preserves_zero_sign=no,
3046 ac_cv_tanh_preserves_zero_sign=no)])
3047 AC_MSG_RESULT($ac_cv_tanh_preserves_zero_sign)
3048 if test "$ac_cv_tanh_preserves_zero_sign" = yes
3050 AC_DEFINE(TANH_PRESERVES_ZERO_SIGN, 1,
3051 [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
3054 AC_REPLACE_FUNCS(hypot)
3056 AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p)
3061 AC_CHECK_HEADER(wchar.h, [
3062 AC_DEFINE(HAVE_WCHAR_H, 1,
3063 [Define if the compiler provides a wchar.h header file.])
3069 # determine wchar_t size
3070 if test "$wchar_h" = yes
3072 AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
3075 AC_MSG_CHECKING(for UCS-4 tcl)
3079 #if TCL_UTF_MAX != 6
3080 # error "NOT UCS4_TCL"
3082 AC_DEFINE(HAVE_UCS4_TCL, 1, [Define this if you have tcl and TCL_UTF_MAX==6])
3085 AC_MSG_RESULT($have_ucs4_tcl)
3087 # check whether wchar_t is signed or not
3088 if test "$wchar_h" = yes
3090 # check whether wchar_t is signed or not
3091 AC_MSG_CHECKING(whether wchar_t is signed)
3092 AC_CACHE_VAL(ac_cv_wchar_t_signed, [
3097 /* Success: exit code 0 */
3098 exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
3101 ac_cv_wchar_t_signed=yes,
3102 ac_cv_wchar_t_signed=no,
3103 ac_cv_wchar_t_signed=yes)])
3104 AC_MSG_RESULT($ac_cv_wchar_t_signed)
3107 AC_MSG_CHECKING(what type to use for unicode)
3108 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
3109 AC_ARG_ENABLE(unicode,
3110 AC_HELP_STRING(--enable-unicode@<:@=ucs@<:@24@:>@@:>@, Enable Unicode strings (default is yes)),
3112 [enable_unicode=yes])
3114 if test $enable_unicode = yes
3116 # Without any arguments, Py_UNICODE defaults to two-byte mode
3117 case "$have_ucs4_tcl" in
3118 yes) enable_unicode="ucs4"
3120 *) enable_unicode="ucs2"
3125 AH_TEMPLATE(Py_UNICODE_SIZE,
3126 [Define as the size of the unicode type.])
3127 case "$enable_unicode" in
3128 ucs2) unicode_size="2"
3129 AC_DEFINE(Py_UNICODE_SIZE,2)
3131 ucs4) unicode_size="4"
3132 AC_DEFINE(Py_UNICODE_SIZE,4)
3136 AH_TEMPLATE(PY_UNICODE_TYPE,
3137 [Define as the integral type used for Unicode representation.])
3139 AC_SUBST(UNICODE_OBJS)
3140 if test "$enable_unicode" = "no"
3143 AC_MSG_RESULT(not used)
3145 UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o"
3146 AC_DEFINE(Py_USING_UNICODE, 1,
3147 [Define if you want to have a Unicode type.])
3149 # wchar_t is only usable if it maps to an unsigned type
3150 if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \
3151 -a "$ac_cv_wchar_t_signed" = "no"
3153 PY_UNICODE_TYPE="wchar_t"
3154 AC_DEFINE(HAVE_USABLE_WCHAR_T, 1,
3155 [Define if you have a useable wchar_t type defined in wchar.h; useable
3156 means wchar_t must be an unsigned type with at least 16 bits. (see
3157 Include/unicodeobject.h).])
3158 AC_DEFINE(PY_UNICODE_TYPE,wchar_t)
3159 elif test "$ac_cv_sizeof_short" = "$unicode_size"
3161 PY_UNICODE_TYPE="unsigned short"
3162 AC_DEFINE(PY_UNICODE_TYPE,unsigned short)
3163 elif test "$ac_cv_sizeof_long" = "$unicode_size"
3165 PY_UNICODE_TYPE="unsigned long"
3166 AC_DEFINE(PY_UNICODE_TYPE,unsigned long)
3168 PY_UNICODE_TYPE="no type found"
3170 AC_MSG_RESULT($PY_UNICODE_TYPE)
3173 # check for endianness
3175 AH_VERBATIM([WORDS_BIGENDIAN],
3177 /* Define to 1 if your processor stores words with the most significant byte
3178 first (like Motorola and SPARC, unlike Intel and VAX).
3180 The block below does compile-time checking for endianness on platforms
3181 that use GCC and therefore allows compiling fat binaries on OSX by using
3182 '-arch ppc -arch i386' as the compile flags. The phrasing was choosen
3183 such that the configure-result is used on systems that don't use GCC.
3185 #ifdef __BIG_ENDIAN__
3186 #define WORDS_BIGENDIAN 1
3188 #ifndef __LITTLE_ENDIAN__
3189 #undef WORDS_BIGENDIAN
3193 # Check whether right shifting a negative integer extends the sign bit
3194 # or fills with zeros (like the Cray J90, according to Tim Peters).
3195 AC_MSG_CHECKING(whether right shift extends the sign bit)
3196 AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
3200 exit(((-1)>>3 == -1) ? 0 : 1);
3203 ac_cv_rshift_extends_sign=yes,
3204 ac_cv_rshift_extends_sign=no,
3205 ac_cv_rshift_extends_sign=yes)])
3206 AC_MSG_RESULT($ac_cv_rshift_extends_sign)
3207 if test "$ac_cv_rshift_extends_sign" = no
3209 AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS, 1,
3210 [Define if i>>j for signed int i does not extend the sign bit
3214 # check for getc_unlocked and related locking functions
3215 AC_MSG_CHECKING(for getc_unlocked() and friends)
3216 AC_CACHE_VAL(ac_cv_have_getc_unlocked, [
3217 AC_TRY_LINK([#include <stdio.h>],[
3218 FILE *f = fopen("/dev/null", "r");
3222 ], ac_cv_have_getc_unlocked=yes, ac_cv_have_getc_unlocked=no)])
3223 AC_MSG_RESULT($ac_cv_have_getc_unlocked)
3224 if test "$ac_cv_have_getc_unlocked" = yes
3226 AC_DEFINE(HAVE_GETC_UNLOCKED, 1,
3227 [Define this if you have flockfile(), getc_unlocked(), and funlockfile()])
3230 # check where readline lives
3231 # save the value of LIBS so we don't actually link Python with readline
3232 LIBS_no_readline=$LIBS
3233 AC_CHECK_LIB(readline, readline)
3234 if test "$ac_cv_have_readline_readline" = no
3236 AC_CHECK_LIB(termcap, readline)
3239 # check for readline 2.1
3240 AC_CHECK_LIB(readline, rl_callback_handler_install,
3241 AC_DEFINE(HAVE_RL_CALLBACK, 1,
3242 [Define if you have readline 2.1]), , )
3244 # check for readline 2.2
3245 AC_TRY_CPP([#include <readline/readline.h>],
3246 have_readline=yes, have_readline=no)
3247 if test $have_readline = yes
3249 AC_EGREP_HEADER([extern int rl_completion_append_character;],
3250 [readline/readline.h],
3251 AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
3252 [Define if you have readline 2.2]), )
3255 # check for readline 4.0
3256 AC_CHECK_LIB(readline, rl_pre_input_hook,
3257 AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1,
3258 [Define if you have readline 4.0]), , )
3261 AC_CHECK_LIB(readline, rl_completion_display_matches_hook,
3262 AC_DEFINE(HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK, 1,
3263 [Define if you have readline 4.0]), , )
3265 # check for readline 4.2
3266 AC_CHECK_LIB(readline, rl_completion_matches,
3267 AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1,
3268 [Define if you have readline 4.2]), , )
3270 # also in readline 4.2
3271 AC_TRY_CPP([#include <readline/readline.h>],
3272 have_readline=yes, have_readline=no)
3273 if test $have_readline = yes
3275 AC_EGREP_HEADER([extern int rl_catch_signals;],
3276 [readline/readline.h],
3277 AC_DEFINE(HAVE_RL_CATCH_SIGNAL, 1,
3278 [Define if you can turn off readline's signal handling.]), )
3281 # End of readline checks: restore LIBS
3282 LIBS=$LIBS_no_readline
3284 AC_MSG_CHECKING(for broken nice())
3285 AC_CACHE_VAL(ac_cv_broken_nice, [
3290 if (val1 != -1 && val1 == nice(2))
3295 ac_cv_broken_nice=yes,
3296 ac_cv_broken_nice=no,
3297 ac_cv_broken_nice=no)])
3298 AC_MSG_RESULT($ac_cv_broken_nice)
3299 if test "$ac_cv_broken_nice" = yes
3301 AC_DEFINE(HAVE_BROKEN_NICE, 1,
3302 [Define if nice() returns success/failure instead of the new priority.])
3305 AC_MSG_CHECKING(for broken poll())
3311 struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
3315 int poll_test = poll (&poll_struct, 1, 0);
3321 else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
3331 ac_cv_broken_poll=yes,
3332 ac_cv_broken_poll=no,
3333 ac_cv_broken_poll=no)
3334 AC_MSG_RESULT($ac_cv_broken_poll)
3335 if test "$ac_cv_broken_poll" = yes
3337 AC_DEFINE(HAVE_BROKEN_POLL, 1,
3338 [Define if poll() sets errno on invalid file descriptors.])
3341 # Before we can test tzset, we need to check if struct tm has a tm_zone
3342 # (which is not required by ISO C or UNIX spec) and/or if we support
3346 # check tzset(3) exists and works like we expect it to
3347 AC_MSG_CHECKING(for working tzset())
3348 AC_CACHE_VAL(ac_cv_working_tzset, [
3355 extern char *tzname[];
3360 /* Note that we need to ensure that not only does tzset(3)
3361 do 'something' with localtime, but it works as documented
3362 in the library reference and as expected by the test suite.
3363 This includes making sure that tzname is set properly if
3364 tm->tm_zone does not exist since it is the alternative way
3365 of getting timezone info.
3367 Red Hat 6.2 doesn't understand the southern hemisphere
3368 after New Year's Day.
3371 time_t groundhogday = 1044144000; /* GMT-based */
3372 time_t midyear = groundhogday + (365 * 24 * 3600 / 2);
3376 if (localtime(&groundhogday)->tm_hour != 0)
3379 /* For UTC, tzname[1] is sometimes "", sometimes " " */
3380 if (strcmp(tzname[0], "UTC") ||
3381 (tzname[1][0] != 0 && tzname[1][0] != ' '))
3385 putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
3387 if (localtime(&groundhogday)->tm_hour != 19)
3390 if (strcmp(tzname[0], "EST") || strcmp(tzname[1], "EDT"))
3394 putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
3396 if (localtime(&groundhogday)->tm_hour != 11)
3399 if (strcmp(tzname[0], "AEST") || strcmp(tzname[1], "AEDT"))
3403 #if HAVE_STRUCT_TM_TM_ZONE
3404 if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
3406 if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
3413 ac_cv_working_tzset=yes,
3414 ac_cv_working_tzset=no,
3415 ac_cv_working_tzset=no)])
3416 AC_MSG_RESULT($ac_cv_working_tzset)
3417 if test "$ac_cv_working_tzset" = yes
3419 AC_DEFINE(HAVE_WORKING_TZSET, 1,
3420 [Define if tzset() actually switches the local timezone in a meaningful way.])
3423 # Look for subsecond timestamps in struct stat
3424 AC_MSG_CHECKING(for tv_nsec in struct stat)
3425 AC_CACHE_VAL(ac_cv_stat_tv_nsec,
3426 AC_TRY_COMPILE([#include <sys/stat.h>], [
3428 st.st_mtim.tv_nsec = 1;
3430 ac_cv_stat_tv_nsec=yes,
3431 ac_cv_stat_tv_nsec=no,
3432 ac_cv_stat_tv_nsec=no))
3433 AC_MSG_RESULT($ac_cv_stat_tv_nsec)
3434 if test "$ac_cv_stat_tv_nsec" = yes
3436 AC_DEFINE(HAVE_STAT_TV_NSEC, 1,
3437 [Define if you have struct stat.st_mtim.tv_nsec])
3440 # Look for BSD style subsecond timestamps in struct stat
3441 AC_MSG_CHECKING(for tv_nsec2 in struct stat)
3442 AC_CACHE_VAL(ac_cv_stat_tv_nsec2,
3443 AC_TRY_COMPILE([#include <sys/stat.h>], [
3445 st.st_mtimespec.tv_nsec = 1;
3447 ac_cv_stat_tv_nsec2=yes,
3448 ac_cv_stat_tv_nsec2=no,
3449 ac_cv_stat_tv_nsec2=no))
3450 AC_MSG_RESULT($ac_cv_stat_tv_nsec2)
3451 if test "$ac_cv_stat_tv_nsec2" = yes
3453 AC_DEFINE(HAVE_STAT_TV_NSEC2, 1,
3454 [Define if you have struct stat.st_mtimensec])
3457 # On HP/UX 11.0, mvwdelch is a block with a return statement
3458 AC_MSG_CHECKING(whether mvwdelch is an expression)
3459 AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,
3460 AC_TRY_COMPILE([#include <curses.h>], [
3462 rtn = mvwdelch(0,0,0);
3463 ], ac_cv_mvwdelch_is_expression=yes,
3464 ac_cv_mvwdelch_is_expression=no,
3465 ac_cv_mvwdelch_is_expression=yes))
3466 AC_MSG_RESULT($ac_cv_mvwdelch_is_expression)
3468 if test "$ac_cv_mvwdelch_is_expression" = yes
3470 AC_DEFINE(MVWDELCH_IS_EXPRESSION, 1,
3471 [Define if mvwdelch in curses.h is an expression.])
3474 AC_MSG_CHECKING(whether WINDOW has _flags)
3475 AC_CACHE_VAL(ac_cv_window_has_flags,
3476 AC_TRY_COMPILE([#include <curses.h>], [
3479 ], ac_cv_window_has_flags=yes,
3480 ac_cv_window_has_flags=no,
3481 ac_cv_window_has_flags=no))
3482 AC_MSG_RESULT($ac_cv_window_has_flags)
3485 if test "$ac_cv_window_has_flags" = yes
3487 AC_DEFINE(WINDOW_HAS_FLAGS, 1,
3488 [Define if WINDOW in curses.h offers a field _flags.])
3491 AC_MSG_CHECKING(for is_term_resized)
3492 AC_TRY_COMPILE([#include <curses.h>], void *x=is_term_resized,
3493 AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_resized' function.)
3498 AC_MSG_CHECKING(for resize_term)
3499 AC_TRY_COMPILE([#include <curses.h>], void *x=resize_term,
3500 AC_DEFINE(HAVE_CURSES_RESIZE_TERM, 1, Define if you have the 'resize_term' function.)
3505 AC_MSG_CHECKING(for resizeterm)
3506 AC_TRY_COMPILE([#include <curses.h>], void *x=resizeterm,
3507 AC_DEFINE(HAVE_CURSES_RESIZETERM, 1, Define if you have the 'resizeterm' function.)
3512 AC_MSG_CHECKING(for /dev/ptmx)
3514 if test -r /dev/ptmx
3517 AC_DEFINE(HAVE_DEV_PTMX, 1,
3518 [Define if we have /dev/ptmx.])
3523 AC_MSG_CHECKING(for /dev/ptc)
3528 AC_DEFINE(HAVE_DEV_PTC, 1,
3529 [Define if we have /dev/ptc.])
3534 AC_MSG_CHECKING(for %zd printf() format support)
3535 AC_TRY_RUN([#include <stdio.h>
3539 #ifdef HAVE_SYS_TYPES_H
3540 #include <sys/types.h>
3544 typedef ssize_t Py_ssize_t;
3545 #elif SIZEOF_VOID_P == SIZEOF_LONG
3546 typedef long Py_ssize_t;
3548 typedef int Py_ssize_t;
3555 if(sprintf(buffer, "%zd", (size_t)123) < 0)
3558 if (strcmp(buffer, "123"))
3561 if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
3564 if (strcmp(buffer, "-123"))
3570 AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
3573 AC_CHECK_TYPE(socklen_t,,
3574 AC_DEFINE(socklen_t,int,
3575 Define to `int' if <sys/socket.h> does not define.),[
3576 #ifdef HAVE_SYS_TYPES_H
3577 #include <sys/types.h>
3579 #ifdef HAVE_SYS_SOCKET_H
3580 #include <sys/socket.h>
3584 AC_SUBST(THREADHEADERS)
3586 for h in `(cd $srcdir;echo Python/thread_*.h)`
3588 THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
3592 SRCDIRS="Parser Grammar Objects Python Modules Mac"
3593 AC_MSG_CHECKING(for build directories)
3594 for dir in $SRCDIRS; do
3595 if test ! -d $dir; then
3601 # generate output files
3602 AC_CONFIG_FILES(Makefile.pre Modules/Setup.config)
3605 echo "creating Modules/Setup"
3606 if test ! -f Modules/Setup
3608 cp $srcdir/Modules/Setup.dist Modules/Setup
3611 echo "creating Modules/Setup.local"
3612 if test ! -f Modules/Setup.local
3614 echo "# Edit this file for local setup changes" >Modules/Setup.local
3617 echo "creating Makefile"
3618 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
3619 -s Modules Modules/Setup.config \
3620 Modules/Setup.local Modules/Setup
3622 case $ac_sys_system in
3626 Support for BeOS is deprecated as of Python 2.6.
3627 See PEP 11 for the gory details.