1 dnl ***********************************************
2 dnl * Please run autoreconf to test your changes! *
3 dnl ***********************************************
4 dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.63).
6 # Set VERSION so we only need to edit in one place (i.e., here)
7 m4_define(PYTHON_VERSION, 2.6)
9 AC_REVISION($Revision$)
11 AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
12 AC_CONFIG_SRCDIR([Include/object.h])
13 AC_CONFIG_HEADER(pyconfig.h)
15 dnl This is for stuff that absolutely must end up in pyconfig.h.
16 dnl Please use pyport.h instead, if possible.
22 /* Define the macros needed if on a UnixWare 7.x system. */
23 #if defined(__USLC__) && defined(__SCO_VERSION__)
24 #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
27 #endif /*Py_PYCONFIG_H*/
30 # We don't use PACKAGE_ variables, and they cause conflicts
31 # with other autoconf-based packages that include Python.h
32 grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new
34 mv confdefs.h.new confdefs.h
37 VERSION=PYTHON_VERSION
42 # The later defininition of _XOPEN_SOURCE disables certain features
43 # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
44 AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features])
46 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
47 # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
49 AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
51 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
52 # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
54 AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
56 # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
57 # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
58 AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
60 define_xopen_source=yes
62 # Arguments passed to configure.
64 CONFIG_ARGS="$ac_configure_args"
66 AC_ARG_ENABLE(universalsdk,
67 AC_HELP_STRING(--enable-universalsdk@<:@=SDKDIR@:>@, Build against Mac OS X 10.4u SDK (ppc/i386)),
71 enableval=/Developer/SDKs/MacOSX10.4u.sdk
80 UNIVERSALSDK=$enableval
87 AC_SUBST(UNIVERSALSDK)
89 AC_ARG_WITH(framework-name,
90 AC_HELP_STRING(--with-framework-name=FRAMEWORK,
91 specify an alternate name of the framework built with --enable-framework),
93 PYTHONFRAMEWORK=${withval}
94 PYTHONFRAMEWORKDIR=${withval}.framework
95 PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr '[A-Z]' '[a-z]'`
97 PYTHONFRAMEWORK=Python
98 PYTHONFRAMEWORKDIR=Python.framework
99 PYTHONFRAMEWORKIDENTIFIER=org.python.python
101 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
102 AC_ARG_ENABLE(framework,
103 AC_HELP_STRING(--enable-framework@<:@=INSTALLDIR@:>@, Build (MacOSX|Darwin) framework),
107 enableval=/Library/Frameworks
112 PYTHONFRAMEWORKDIR=no-framework
113 PYTHONFRAMEWORKPREFIX=
114 PYTHONFRAMEWORKINSTALLDIR=
115 FRAMEWORKINSTALLFIRST=
116 FRAMEWORKINSTALLLAST=
117 FRAMEWORKALTINSTALLFIRST=
118 FRAMEWORKALTINSTALLLAST=
119 if test "x${prefix}" = "xNONE"; then
120 FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
122 FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
127 PYTHONFRAMEWORKPREFIX=$enableval
128 PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
129 FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
130 FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
131 FRAMEWORKALTINSTALLFIRST="${FRAMEWORKINSTALLFIRST} bininstall maninstall"
132 FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
133 if test "x${prefix}" = "xNONE" ; then
134 FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
136 FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
138 prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
140 # Add files for Mac specific code to the list of output
142 AC_CONFIG_FILES(Mac/Makefile)
143 AC_CONFIG_FILES(Mac/PythonLauncher/Makefile)
144 AC_CONFIG_FILES(Mac/IDLE/Makefile)
145 AC_CONFIG_FILES(Mac/Resources/framework/Info.plist)
146 AC_CONFIG_FILES(Mac/Resources/app/Info.plist)
150 PYTHONFRAMEWORKDIR=no-framework
151 PYTHONFRAMEWORKPREFIX=
152 PYTHONFRAMEWORKINSTALLDIR=
153 FRAMEWORKINSTALLFIRST=
154 FRAMEWORKINSTALLLAST=
155 FRAMEWORKALTINSTALLFIRST=
156 FRAMEWORKALTINSTALLLAST=
157 if test "x${prefix}" = "xNONE" ; then
158 FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
160 FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
164 AC_SUBST(PYTHONFRAMEWORK)
165 AC_SUBST(PYTHONFRAMEWORKIDENTIFIER)
166 AC_SUBST(PYTHONFRAMEWORKDIR)
167 AC_SUBST(PYTHONFRAMEWORKPREFIX)
168 AC_SUBST(PYTHONFRAMEWORKINSTALLDIR)
169 AC_SUBST(FRAMEWORKINSTALLFIRST)
170 AC_SUBST(FRAMEWORKINSTALLLAST)
171 AC_SUBST(FRAMEWORKALTINSTALLFIRST)
172 AC_SUBST(FRAMEWORKALTINSTALLLAST)
173 AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
176 ## AC_HELP_STRING(--with-dyld,
177 ## Use (OpenStep|Rhapsody) dynamic linker))
179 # Set name for machine-dependent library files
181 AC_MSG_CHECKING(MACHDEP)
182 if test -z "$MACHDEP"
184 ac_sys_system=`uname -s`
185 if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
186 -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
187 ac_sys_release=`uname -v`
189 ac_sys_release=`uname -r`
191 ac_md_system=`echo $ac_sys_system |
192 tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
193 ac_md_release=`echo $ac_sys_release |
194 tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
195 MACHDEP="$ac_md_system$ac_md_release"
198 cygwin*) MACHDEP="cygwin";;
199 darwin*) MACHDEP="darwin";;
200 atheos*) MACHDEP="atheos";;
201 irix646) MACHDEP="irix6";;
202 '') MACHDEP="unknown";;
206 # Some systems cannot stand _XOPEN_SOURCE being defined at all; they
207 # disable features if it is defined, without any means to access these
208 # features as extensions. For these systems, we skip the definition of
209 # _XOPEN_SOURCE. Before adding a system to the list to gain access to
210 # some feature, make sure there is no alternative way to access this
211 # feature. Also, when using wildcards, make sure you have verified the
212 # need for not defining _XOPEN_SOURCE on all systems matching the
213 # wildcard, and that the wildcard does not include future systems
214 # (which may remove their limitations).
215 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
216 case $ac_sys_system/$ac_sys_release in
217 # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
218 # even though select is a POSIX function. Reported by J. Ribbens.
219 # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
220 OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0@:>@)
221 define_xopen_source=no
222 # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
223 # also defined. This can be overridden by defining _BSD_SOURCE
224 # As this has a different meaning on Linux, only define it on OpenBSD
225 AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
227 # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
228 # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
230 NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S])
231 define_xopen_source=no;;
232 # On Solaris 2.6, sys/wait.h is inconsistent in the usage
233 # of union __?sigval. Reported by Stuart Bishop.
235 define_xopen_source=no;;
236 # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
237 # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
238 # Reconfirmed for 7.1.4 by Martin v. Loewis.
239 OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
240 define_xopen_source=no;;
241 # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
242 # but used in struct sockaddr.sa_family. Reported by Tim Rice.
244 define_xopen_source=no;;
245 # On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that
246 # it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently,
247 # this is fixed in 10.3, which identifies itself as Darwin/7.*
248 # This should hopefully be fixed in FreeBSD 4.9
249 FreeBSD/4.8* | Darwin/6* )
250 define_xopen_source=no;;
251 # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
252 # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
253 # or has another value. By not (re)defining it, the defaults come in place.
255 define_xopen_source=no;;
257 if test `uname -r` -eq 1; then
258 define_xopen_source=no
261 # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
262 # disables platform specific features beyond repair.
263 # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
264 # has no effect, don't bother defining them
265 Darwin/@<:@789@:>@.*)
266 define_xopen_source=no
268 # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
269 # defining NI_NUMERICHOST.
271 define_xopen_source=no
276 if test $define_xopen_source = yes
278 # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
279 # defined precisely as g++ defines it
280 # Furthermore, on Solaris 10, XPG6 requires the use of a C99
282 case $ac_sys_system/$ac_sys_release in
283 SunOS/5.8|SunOS/5.9|SunOS/5.10)
284 AC_DEFINE(_XOPEN_SOURCE, 500,
285 Define to the level of X/Open that your system supports)
288 AC_DEFINE(_XOPEN_SOURCE, 600,
289 Define to the level of X/Open that your system supports)
293 # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
294 # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
295 # several APIs are not declared. Since this is also needed in some
296 # cases for HP-UX, we define it globally.
297 # except for Solaris 10, where it must not be defined,
298 # as it implies XPG4.2
299 case $ac_sys_system/$ac_sys_release in
303 AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
304 Define to activate Unix95-and-earlier features)
308 AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
313 # SGI compilers allow the specification of the both the ABI and the
314 # ISA on the command line. Depending on the values of these switches,
315 # different and often incompatable code will be generated.
317 # The SGI_ABI variable can be used to modify the CC and LDFLAGS and
318 # thus supply support for various ABI/ISA combinations. The MACHDEP
319 # variable is also adjusted.
322 if test ! -z "$SGI_ABI"
325 LDFLAGS="$SGI_ABI $LDFLAGS"
326 MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
328 AC_MSG_RESULT($MACHDEP)
330 # And add extra plat-mac for darwin
331 AC_SUBST(EXTRAPLATDIR)
332 AC_SUBST(EXTRAMACHDEPPATH)
333 AC_MSG_CHECKING(EXTRAPLATDIR)
334 if test -z "$EXTRAPLATDIR"
338 EXTRAPLATDIR="\$(PLATMACDIRS)"
339 EXTRAMACHDEPPATH="\$(PLATMACPATH)"
347 AC_MSG_RESULT($EXTRAPLATDIR)
349 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
350 # it may influence the way we can build extensions, so distutils
352 AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
353 AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
354 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
355 EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
357 AC_MSG_CHECKING(machine type as reported by uname -m)
358 ac_sys_machine=`uname -m`
359 AC_MSG_RESULT($ac_sys_machine)
361 # checks for alternative programs
363 # compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
364 # for debug/optimization stuff. BASECFLAGS is for flags that are required
365 # just to get things to compile and link. Users are free to override OPT
366 # when running configure or make. The build should not break if they do.
367 # BASECFLAGS should generally not be messed with, however.
369 # XXX shouldn't some/most/all of this code be merged with the stuff later
370 # on that fiddles with OPT and BASECFLAGS?
371 AC_MSG_CHECKING(for --without-gcc)
373 AC_HELP_STRING(--without-gcc,never use gcc),
381 without_gcc=$withval;;
383 case $ac_sys_system in
391 BASECFLAGS="$BASECFLAGS -export pragma"
393 LDFLAGS="$LDFLAGS -nodup"
401 AC_MSG_ERROR([Unknown BeOS platform "$BE_HOST_CPU"])
404 AR="\$(srcdir)/Modules/ar_beos"
412 AC_MSG_RESULT($without_gcc)
414 # If the user switches compilers, we can't believe the cache
415 if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
417 AC_MSG_ERROR([cached CC is different -- throw away $cache_file
418 (it is also a good idea to do 'make clean' before compiling)])
425 AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
426 AC_ARG_WITH(cxx_main,
427 AC_HELP_STRING([--with-cxx-main=<compiler>],
428 [compile main() and link python executable with C++ compiler]),
434 yes) with_cxx_main=yes
446 AC_MSG_RESULT($with_cxx_main)
452 gcc) AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;;
453 cc) AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;;
455 if test "$CXX" = "notfound"
462 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
463 if test "$CXX" = "notfound"
468 if test "$preset_cxx" != "$CXX"
472 By default, distutils will build C++ extension modules with "$CXX".
473 If this is not intended, then set CXX on the configure command line.
478 # checks for UNIX variants that set C preprocessor variables
481 # Check for unsupported systems
482 case $ac_sys_system/$ac_sys_release in
484 echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
485 echo See README for details.
490 AC_MSG_CHECKING(for --with-suffix)
492 AC_HELP_STRING(--with-suffix=.exe, set executable suffix),
499 AC_MSG_RESULT($EXEEXT)
501 # Test whether we're running on a non-case-sensitive system, in which
502 # case we give a warning if no ext is given
503 AC_SUBST(BUILDEXEEXT)
504 AC_MSG_CHECKING(for case-insensitive build directory)
505 if test ! -d CaseSensitiveTestDir; then
506 mkdir CaseSensitiveTestDir
509 if test -d casesensitivetestdir
517 rmdir CaseSensitiveTestDir
522 gcc) CC="$CC -D_HAVE_BSDI";;
526 case $ac_sys_system in
529 cc|*/cc) CC="$CC -Ae";;
533 cc) CC="$CC -Wl,-Bexport";;
536 # Some functions have a prototype only with that define, e.g. confstr
537 AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
543 AC_MSG_CHECKING(LIBRARY)
544 if test -z "$LIBRARY"
546 LIBRARY='libpython$(VERSION).a'
548 AC_MSG_RESULT($LIBRARY)
550 # LDLIBRARY is the name of the library to link against (as opposed to the
551 # name of the library into which to insert object files). BLDLIBRARY is also
552 # the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
553 # is blank as the main program is not linked directly against LDLIBRARY.
554 # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
555 # systems without shared libraries, LDLIBRARY is the same as LIBRARY
556 # (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,
557 # DLLLIBRARY is the shared (i.e., DLL) library.
559 # RUNSHARED is used to run shared python without installed libraries
561 # INSTSONAME is the name of the shared library that will be use to install
562 # on the system - some systems like version suffix, others don't
566 AC_SUBST(LDLIBRARYDIR)
570 BLDLIBRARY='$(LDLIBRARY)'
571 INSTSONAME='$(LDLIBRARY)'
576 # LINKCC is the command that links the python executable -- default is $(CC).
577 # If CXX is set, and if it is needed to link a main function that was
578 # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
579 # python might then depend on the C++ runtime
580 # This is altered for AIX in order to build the export list before
583 AC_MSG_CHECKING(LINKCC)
586 LINKCC='$(PURIFY) $(MAINCC)'
587 case $ac_sys_system in
590 if test $ac_sys_release -ge 5 -o \
591 $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then
594 LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
596 LINKCC="$LINKCC -L/usr/lib/ia64l64";;
598 # qcc must be used because the other compilers do not
603 AC_MSG_RESULT($LINKCC)
605 AC_MSG_CHECKING(for --enable-shared)
606 AC_ARG_ENABLE(shared,
607 AC_HELP_STRING(--enable-shared, disable/enable building shared python library))
609 if test -z "$enable_shared"
611 case $ac_sys_system in
613 enable_shared="yes";;
618 AC_MSG_RESULT($enable_shared)
620 AC_MSG_CHECKING(for --enable-profiling)
621 AC_ARG_ENABLE(profiling,
622 AC_HELP_STRING(--enable-profiling, enable C-level code profiling),
625 AC_TRY_RUN([int main() { return 0; }],
626 ac_enable_profiling="yes",
627 ac_enable_profiling="no",
628 ac_enable_profiling="no")
630 AC_MSG_RESULT($ac_enable_profiling)
632 case "$ac_enable_profiling" in
634 BASECFLAGS="-pg $BASECFLAGS"
635 LDFLAGS="-pg $LDFLAGS"
639 AC_MSG_CHECKING(LDLIBRARY)
641 # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
642 # library that we build, but we do not want to link against it (we
643 # will find it with a -framework option). For this reason there is an
644 # extra variable BLDLIBRARY against which Python and the extension
645 # modules are linked, BLDLIBRARY. This is normally the same as
646 # LDLIBRARY, but empty for MacOSX framework builds.
647 if test "$enable_framework"
649 LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
650 RUNSHARED=DYLD_FRAMEWORK_PATH="`pwd`:$DYLD_FRAMEWORK_PATH"
653 BLDLIBRARY='$(LDLIBRARY)'
656 # Other platforms follow
657 if test $enable_shared = "yes"; then
658 AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
659 case $ac_sys_system in
661 LDLIBRARY='libpython$(VERSION).so'
664 LDLIBRARY='libpython$(VERSION).dll.a'
665 DLLLIBRARY='libpython$(VERSION).dll'
668 LDLIBRARY='libpython$(VERSION).so'
669 BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
670 RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
671 INSTSONAME="$LDLIBRARY".$SOVERSION
673 Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
674 LDLIBRARY='libpython$(VERSION).so'
675 BLDLIBRARY='-L. -lpython$(VERSION)'
676 RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
677 case $ac_sys_system in
679 SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
682 INSTSONAME="$LDLIBRARY".$SOVERSION
687 LDLIBRARY='libpython$(VERSION).so'
690 LDLIBRARY='libpython$(VERSION).sl'
693 BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)'
694 RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH}
697 LDLIBRARY='libpython$(VERSION).so'
698 BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
699 RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
702 LDLIBRARY='libpython$(VERSION).so'
703 BLDLIBRARY='-L. -lpython$(VERSION)'
704 RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
707 else # shared is disabled
708 case $ac_sys_system in
710 BLDLIBRARY='$(LIBRARY)'
711 LDLIBRARY='libpython$(VERSION).dll.a'
716 AC_MSG_RESULT($LDLIBRARY)
720 AC_CHECK_PROGS(AR, ar aal, ar)
723 AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
724 if test $SVNVERSION = found
726 SVNVERSION="svnversion \$(srcdir)"
728 SVNVERSION="echo exported"
733 # install -d does not work on BSDI or HP-UX
734 if test -z "$INSTALL"
736 INSTALL="${srcdir}/install-sh -c"
741 # Not every filesystem supports hard links
743 if test -z "$LN" ; then
744 case $ac_sys_system in
746 CYGWIN*) LN="ln -s";;
747 atheos*) LN="ln -s";;
752 # Check for --with-pydebug
753 AC_MSG_CHECKING(for --with-pydebug)
755 AC_HELP_STRING(--with-pydebug, build with Py_DEBUG defined),
757 if test "$withval" != no
759 AC_DEFINE(Py_DEBUG, 1,
760 [Define if you want to build an interpreter with many run-time checks.])
763 else AC_MSG_RESULT(no); Py_DEBUG='false'
767 # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
768 # merged with this chunk of code?
770 # Optimizer/debugger flags
771 # ------------------------
772 # (The following bit of code is complicated enough - please keep things
773 # indented properly. Just pretend you're editing Python code. ;-)
775 # There are two parallel sets of case statements below, one that checks to
776 # see if OPT was set and one that does BASECFLAGS setting based upon
777 # compiler and platform. BASECFLAGS tweaks need to be made even if the
780 # tweak OPT based on compiler and platform, only if the user didn't set
781 # it on the command line
787 if test "$CC" != 'g++' ; then
788 STRICT_PROTO="-Wstrict-prototypes"
790 # For gcc 4.x we need to use -fwrapv so lets check if its supported
791 if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
794 case $ac_cv_prog_cc_g in
796 if test "$Py_DEBUG" = 'true' ; then
797 # Optimization messes up debuggers, so turn it off for
799 OPT="-g -Wall $STRICT_PROTO"
801 OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
805 OPT="-O3 -Wall $STRICT_PROTO"
808 case $ac_sys_system in
809 SCO_SV*) OPT="$OPT -m486 -DSCO5"
819 # The current (beta) Monterey compiler dies with optimizations
820 # XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
821 case $ac_sys_system in
830 # tweak BASECFLAGS based on compiler and platform
833 # Python violates C99 rules, by casting between incompatible
834 # pointer types. GCC may generate bad code as a result of that,
835 # so use -fno-strict-aliasing if supported.
836 AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
838 CC="$CC -fno-strict-aliasing"
839 AC_TRY_RUN([int main() { return 0; }],
840 ac_cv_no_strict_aliasing_ok=yes,
841 ac_cv_no_strict_aliasing_ok=no,
842 ac_cv_no_strict_aliasing_ok=no)
844 AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
845 if test $ac_cv_no_strict_aliasing_ok = yes
847 BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
850 # if using gcc on alpha, use -mieee to get (near) full IEEE 754
851 # support. Without this, treatment of subnormals doesn't follow
853 case $ac_sys_machine in
855 BASECFLAGS="$BASECFLAGS -mieee"
859 case $ac_sys_system in
861 BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
863 # is there any other compiler on Darwin besides gcc?
865 # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
866 # used to be here, but non-Apple gcc doesn't accept them.
867 if test "${enable_universalsdk}"; then
868 BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
873 BASECFLAGS="$BASECFLAGS -mieee"
879 case $ac_sys_system in
881 BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
884 BASECFLAGS="$BASECFLAGS -ieee -std"
887 BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
893 if test "$Py_DEBUG" = 'true'; then
899 if test "$ac_arch_flags"
901 BASECFLAGS="$BASECFLAGS $ac_arch_flags"
904 # disable check for icc since it seems to pass, but generates a warning
907 ac_cv_opt_olimit_ok=no
910 AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
911 AC_CACHE_VAL(ac_cv_opt_olimit_ok,
913 CC="$CC -OPT:Olimit=0"
914 AC_TRY_RUN([int main() { return 0; }],
915 ac_cv_opt_olimit_ok=yes,
916 ac_cv_opt_olimit_ok=no,
917 ac_cv_opt_olimit_ok=no)
919 AC_MSG_RESULT($ac_cv_opt_olimit_ok)
920 if test $ac_cv_opt_olimit_ok = yes; then
921 case $ac_sys_system in
922 # XXX is this branch needed? On MacOSX 10.2.2 the result of the
923 # olimit_ok test is "no". Is it "yes" in some other Darwin-esque
928 BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
932 AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
933 AC_CACHE_VAL(ac_cv_olimit_ok,
935 CC="$CC -Olimit 1500"
936 AC_TRY_RUN([int main() { return 0; }],
941 AC_MSG_RESULT($ac_cv_olimit_ok)
942 if test $ac_cv_olimit_ok = yes; then
943 BASECFLAGS="$BASECFLAGS -Olimit 1500"
947 # Check whether GCC supports PyArg_ParseTuple format
948 if test "$GCC" = "yes"
950 AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
952 CFLAGS="$CFLAGS -Werror"
954 void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
956 AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1, [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
963 # On some compilers, pthreads are available without further options
964 # (e.g. MacOS X). On some of these systems, the compiler will not
965 # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
966 # So we have to see first whether pthreads are available without
967 # options before we can check whether -Kpthread improves anything.
968 AC_MSG_CHECKING(whether pthreads are available without options)
969 AC_CACHE_VAL(ac_cv_pthread_is_default,
973 void* routine(void* p){return NULL;}
977 if(pthread_create(&p,NULL,routine,NULL)!=0)
979 (void)pthread_detach(p);
984 ac_cv_pthread_is_default=yes
988 ac_cv_pthread_is_default=no,
989 ac_cv_pthread_is_default=no)
991 AC_MSG_RESULT($ac_cv_pthread_is_default)
994 if test $ac_cv_pthread_is_default = yes
998 # -Kpthread, if available, provides the right #defines
999 # and linker options to make pthread_create available
1000 # Some compilers won't report that they do not support -Kpthread,
1001 # so we need to run a program to see whether it really made the
1002 # function available.
1003 AC_MSG_CHECKING(whether $CC accepts -Kpthread)
1004 AC_CACHE_VAL(ac_cv_kpthread,
1008 #include <pthread.h>
1010 void* routine(void* p){return NULL;}
1014 if(pthread_create(&p,NULL,routine,NULL)!=0)
1016 (void)pthread_detach(p);
1024 AC_MSG_RESULT($ac_cv_kpthread)
1027 if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
1029 # -Kthread, if available, provides the right #defines
1030 # and linker options to make pthread_create available
1031 # Some compilers won't report that they do not support -Kthread,
1032 # so we need to run a program to see whether it really made the
1033 # function available.
1034 AC_MSG_CHECKING(whether $CC accepts -Kthread)
1035 AC_CACHE_VAL(ac_cv_kthread,
1039 #include <pthread.h>
1041 void* routine(void* p){return NULL;}
1045 if(pthread_create(&p,NULL,routine,NULL)!=0)
1047 (void)pthread_detach(p);
1055 AC_MSG_RESULT($ac_cv_kthread)
1058 if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
1060 # -pthread, if available, provides the right #defines
1061 # and linker options to make pthread_create available
1062 # Some compilers won't report that they do not support -pthread,
1063 # so we need to run a program to see whether it really made the
1064 # function available.
1065 AC_MSG_CHECKING(whether $CC accepts -pthread)
1066 AC_CACHE_VAL(ac_cv_thread,
1070 #include <pthread.h>
1072 void* routine(void* p){return NULL;}
1076 if(pthread_create(&p,NULL,routine,NULL)!=0)
1078 (void)pthread_detach(p);
1086 AC_MSG_RESULT($ac_cv_pthread)
1089 # If we have set a CC compiler flag for thread support then
1090 # check if it works for CXX, too.
1094 AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
1097 if test "$ac_cv_kpthread" = "yes"
1099 CXX="$CXX -Kpthread"
1100 ac_cv_cxx_thread=yes
1101 elif test "$ac_cv_kthread" = "yes"
1104 ac_cv_cxx_thread=yes
1105 elif test "$ac_cv_pthread" = "yes"
1108 ac_cv_cxx_thread=yes
1111 if test $ac_cv_cxx_thread = yes
1113 echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext
1114 $CXX -c conftest.$ac_ext 2>&5
1115 if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
1116 && test -s conftest$ac_exeext && ./conftest$ac_exeext
1118 ac_cv_cxx_thread=yes
1124 AC_MSG_RESULT($ac_cv_cxx_thread)
1128 dnl # check for ANSI or K&R ("traditional") preprocessor
1129 dnl AC_MSG_CHECKING(for C preprocessor type)
1130 dnl AC_TRY_COMPILE([
1131 dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
1133 dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
1134 dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional)
1135 dnl AC_MSG_RESULT($cpp_type)
1137 # checks for header files
1139 AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
1141 ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
1142 shadow.h signal.h stdint.h stropts.h termios.h thread.h \
1144 sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
1145 sys/lock.h sys/mkdev.h sys/modem.h \
1146 sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
1147 sys/termio.h sys/time.h \
1148 sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
1149 sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
1150 bluetooth/bluetooth.h linux/tipc.h)
1154 # On Solaris, term.h requires curses.h
1155 AC_CHECK_HEADERS(term.h,,,[
1156 #ifdef HAVE_CURSES_H
1161 # On Linux, netlink.h requires asm/types.h
1162 AC_CHECK_HEADERS(linux/netlink.h,,,[
1163 #ifdef HAVE_ASM_TYPES_H
1164 #include <asm/types.h>
1166 #ifdef HAVE_SYS_SOCKET_H
1167 #include <sys/socket.h>
1171 # checks for typedefs
1173 AC_MSG_CHECKING(for clock_t in time.h)
1174 AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
1175 AC_DEFINE(clock_t, long, [Define to 'long' if <time.h> doesn't define.])
1177 AC_MSG_RESULT($was_it_defined)
1179 # Check whether using makedev requires defining _OSF_SOURCE
1180 AC_MSG_CHECKING(for makedev)
1181 AC_TRY_LINK([#include <sys/types.h> ],
1183 ac_cv_has_makedev=yes,
1184 ac_cv_has_makedev=no)
1185 if test "$ac_cv_has_makedev" = "no"; then
1186 # we didn't link, try if _OSF_SOURCE will allow us to link
1188 #define _OSF_SOURCE 1
1189 #include <sys/types.h>
1192 ac_cv_has_makedev=yes,
1193 ac_cv_has_makedev=no)
1194 if test "$ac_cv_has_makedev" = "yes"; then
1195 AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
1198 AC_MSG_RESULT($ac_cv_has_makedev)
1199 if test "$ac_cv_has_makedev" = "yes"; then
1200 AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
1203 # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in
1204 # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are
1205 # defined, but the compiler does not support pragma redefine_extname,
1206 # and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit
1207 # structures (such as rlimit64) without declaring them. As a
1208 # work-around, disable LFS on such configurations
1211 AC_MSG_CHECKING(Solaris LFS bug)
1213 #define _LARGEFILE_SOURCE 1
1214 #define _FILE_OFFSET_BITS 64
1215 #include <sys/resource.h>
1216 ],struct rlimit foo;,sol_lfs_bug=no,sol_lfs_bug=yes)
1217 AC_MSG_RESULT($sol_lfs_bug)
1218 if test "$sol_lfs_bug" = "yes"; then
1222 if test "$use_lfs" = "yes"; then
1223 # Two defines needed to enable largefile support on various platforms
1224 # These may affect some typedefs
1225 AC_DEFINE(_LARGEFILE_SOURCE, 1,
1226 [This must be defined on some systems to enable large file support.])
1227 AC_DEFINE(_FILE_OFFSET_BITS, 64,
1228 [This must be set to 64 on some systems to enable large file support.])
1231 # Add some code to confdefs.h so that the test for off_t works on SCO
1232 cat >> confdefs.h <<\EOF
1238 # Type availability checks
1245 AC_CHECK_TYPE(ssize_t,
1246 AC_DEFINE(HAVE_SSIZE_T, 1, Define if your compiler provides ssize_t),,)
1248 # Sizes of various common basic types
1249 # ANSI C requires sizeof(char) == 1, so no need to check it
1250 AC_CHECK_SIZEOF(int, 4)
1251 AC_CHECK_SIZEOF(long, 4)
1252 AC_CHECK_SIZEOF(void *, 4)
1253 AC_CHECK_SIZEOF(short, 2)
1254 AC_CHECK_SIZEOF(float, 4)
1255 AC_CHECK_SIZEOF(double, 8)
1256 AC_CHECK_SIZEOF(fpos_t, 4)
1257 AC_CHECK_SIZEOF(size_t, 4)
1258 AC_CHECK_SIZEOF(pid_t, 4)
1260 AC_MSG_CHECKING(for long long support)
1262 AC_TRY_COMPILE([], [long long x; x = (long long)0;], [
1263 AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
1266 AC_MSG_RESULT($have_long_long)
1267 if test "$have_long_long" = yes ; then
1268 AC_CHECK_SIZEOF(long long, 8)
1271 AC_MSG_CHECKING(for _Bool support)
1273 AC_TRY_COMPILE([], [_Bool x; x = (_Bool)0;], [
1274 AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.])
1277 AC_MSG_RESULT($have_c99_bool)
1278 if test "$have_c99_bool" = yes ; then
1279 AC_CHECK_SIZEOF(_Bool, 1)
1282 AC_CHECK_TYPES(uintptr_t,
1283 [AC_CHECK_SIZEOF(uintptr_t, 4)],
1284 [], [#ifdef HAVE_STDINT_H
1289 # Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
1290 AC_MSG_CHECKING(size of off_t)
1291 AC_CACHE_VAL(ac_cv_sizeof_off_t,
1292 [AC_TRY_RUN([#include <stdio.h>
1293 #include <sys/types.h>
1296 FILE *f=fopen("conftestval", "w");
1298 fprintf(f, "%d\n", sizeof(off_t));
1301 ac_cv_sizeof_off_t=`cat conftestval`,
1302 ac_cv_sizeof_off_t=0,
1303 ac_cv_sizeof_off_t=4)
1305 AC_MSG_RESULT($ac_cv_sizeof_off_t)
1306 AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
1307 [The number of bytes in an off_t.])
1309 AC_MSG_CHECKING(whether to enable large file support)
1310 if test "$have_long_long" = yes -a \
1311 "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
1312 "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
1313 AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
1314 [Defined to enable large file support when an off_t is bigger than a long
1315 and long long is available and at least as big as an off_t. You may need
1316 to add some flags for configuration and compilation to enable this mode.
1317 (For Solaris and Linux, the necessary defines are already defined.)])
1323 # AC_CHECK_SIZEOF() doesn't include <time.h>.
1324 AC_MSG_CHECKING(size of time_t)
1325 AC_CACHE_VAL(ac_cv_sizeof_time_t,
1326 [AC_TRY_RUN([#include <stdio.h>
1330 FILE *f=fopen("conftestval", "w");
1332 fprintf(f, "%d\n", sizeof(time_t));
1335 ac_cv_sizeof_time_t=`cat conftestval`,
1336 ac_cv_sizeof_time_t=0,
1337 ac_cv_sizeof_time_t=4)
1339 AC_MSG_RESULT($ac_cv_sizeof_time_t)
1340 AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
1341 [The number of bytes in a time_t.])
1344 # if have pthread_t then define SIZEOF_PTHREAD_T
1346 if test "$ac_cv_kpthread" = "yes"
1347 then CC="$CC -Kpthread"
1348 elif test "$ac_cv_kthread" = "yes"
1349 then CC="$CC -Kthread"
1350 elif test "$ac_cv_pthread" = "yes"
1351 then CC="$CC -pthread"
1353 AC_MSG_CHECKING(for pthread_t)
1355 AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
1356 AC_MSG_RESULT($have_pthread_t)
1357 if test "$have_pthread_t" = yes ; then
1358 # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
1359 AC_MSG_CHECKING(size of pthread_t)
1360 AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
1361 [AC_TRY_RUN([#include <stdio.h>
1362 #include <pthread.h>
1365 FILE *f=fopen("conftestval", "w");
1367 fprintf(f, "%d\n", sizeof(pthread_t));
1370 ac_cv_sizeof_pthread_t=`cat conftestval`,
1371 ac_cv_sizeof_pthread_t=0,
1372 ac_cv_sizeof_pthread_t=4)
1374 AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
1375 AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
1376 [The number of bytes in a pthread_t.])
1380 AC_MSG_CHECKING(for --enable-toolbox-glue)
1381 AC_ARG_ENABLE(toolbox-glue,
1382 AC_HELP_STRING(--enable-toolbox-glue, disable/enable MacOSX glue code for extensions))
1384 if test -z "$enable_toolbox_glue"
1386 case $ac_sys_system/$ac_sys_release in
1388 enable_toolbox_glue="yes";;
1390 enable_toolbox_glue="no";;
1393 case "$enable_toolbox_glue" in
1395 extra_machdep_objs="Python/mactoolboxglue.o"
1396 extra_undefs="-u _PyMac_Error"
1397 AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE, 1,
1398 [Define if you want to use MacPython modules on MacOSX in unix-Python.])
1401 extra_machdep_objs=""
1405 AC_MSG_RESULT($enable_toolbox_glue)
1407 AC_SUBST(OTHER_LIBTOOL_OPT)
1408 case $ac_sys_system/$ac_sys_release in
1409 Darwin/@<:@01567@:>@\..*)
1410 OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
1413 OTHER_LIBTOOL_OPT=""
1417 AC_SUBST(LIBTOOL_CRUFT)
1418 case $ac_sys_system/$ac_sys_release in
1419 Darwin/@<:@01567@:>@\..*)
1420 LIBTOOL_CRUFT="-framework System -lcc_dynamic"
1421 if test "${enable_universalsdk}"; then
1424 LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
1426 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1427 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
1429 gcc_version=`gcc -v 2>&1 | grep version | cut -d\ -f3`
1430 if test ${gcc_version} '<' 4.0
1432 LIBTOOL_CRUFT="-lcc_dynamic"
1436 LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
1437 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1438 LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
1441 AC_MSG_CHECKING(for --enable-framework)
1442 if test "$enable_framework"
1444 BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
1445 # -F. is needed to allow linking to the framework while
1446 # in the build location.
1447 AC_DEFINE(WITH_NEXT_FRAMEWORK, 1,
1448 [Define if you want to produce an OpenStep/Rhapsody framework
1449 (shared library plus accessory files).])
1455 AC_MSG_CHECKING(for dyld)
1456 case $ac_sys_system/$ac_sys_release in
1458 AC_DEFINE(WITH_DYLD, 1,
1459 [Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
1460 dynamic linker (dyld) instead of the old-style (NextStep) dynamic
1461 linker (rld). Dyld is necessary to support frameworks.])
1462 AC_MSG_RESULT(always on for Darwin)
1469 # Set info about shared libraries.
1474 AC_SUBST(LINKFORSHARED)
1475 # SO is the extension of shared libraries `(including the dot!)
1476 # -- usually .so, .sl on HP-UX, .dll on Cygwin
1480 case $ac_sys_system in
1491 # this might also be a termcap variable, see #610332
1493 echo '====================================================================='
1495 echo '+ WARNING: You have set SO in your environment. +'
1496 echo '+ Do you really mean to change the extension for shared libraries? +'
1497 echo '+ Continuing in 10 seconds to let you to ponder. +'
1499 echo '====================================================================='
1503 AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
1504 # LDSHARED is the ld *command* used to create shared library
1505 # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
1506 # (Shared libraries in this instance are shared modules to be loaded into
1507 # Python, as opposed to building Python itself as a shared library.)
1508 AC_MSG_CHECKING(LDSHARED)
1509 if test -z "$LDSHARED"
1511 case $ac_sys_system/$ac_sys_release in
1513 BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
1514 LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
1517 BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
1518 LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
1520 IRIX/5*) LDSHARED="ld -shared";;
1521 IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
1523 if test "$GCC" = "yes"
1524 then LDSHARED='$(CC) -shared'
1525 else LDSHARED='$(CC) -G';
1528 if test "$GCC" = "yes"
1529 then LDSHARED='$(CC) -shared'
1530 else LDSHARED='ld -b';
1532 OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
1534 LDSHARED='$(CC) $(LDFLAGS) -bundle'
1535 if test "$enable_framework" ; then
1536 # Link against the framework. All externals should be defined.
1537 BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1538 LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1540 # No framework. Ignore undefined symbols, assuming they come from Python
1541 LDSHARED="$LDSHARED -undefined suppress"
1543 Darwin/1.4*|Darwin/5.*|Darwin/6.*)
1544 LDSHARED='$(CC) $(LDFLAGS) -bundle'
1545 if test "$enable_framework" ; then
1546 # Link against the framework. All externals should be defined.
1547 BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1548 LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1550 # No framework, use the Python app as bundle-loader
1551 BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
1552 LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
1555 # Use -undefined dynamic_lookup whenever possible (10.3 and later).
1556 # This allows an extension to be used in any Python
1557 cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
1558 if test ${cur_target} '>' 10.2; then
1561 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
1563 # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
1564 # environment with a value that is the same as what we'll use
1565 # in the Makefile to ensure that we'll get the same compiler
1566 # environment during configure and build time.
1567 MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
1568 export MACOSX_DEPLOYMENT_TARGET
1570 EXPORT_MACOSX_DEPLOYMENT_TARGET=''
1571 if test ${MACOSX_DEPLOYMENT_TARGET-${cur_target}} '>' 10.2
1573 if test "${enable_universalsdk}"; then
1574 LDFLAGS="-arch i386 -arch ppc -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
1576 LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
1577 BLDSHARED="$LDSHARED"
1579 LDSHARED='$(CC) $(LDFLAGS) -bundle'
1580 if test "$enable_framework" ; then
1581 # Link against the framework. All externals should be defined.
1582 BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1583 LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1585 # No framework, use the Python app as bundle-loader
1586 BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
1587 LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
1591 Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
1592 BSD/OS*/4*) LDSHARED="gcc -shared";;
1594 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
1596 LDSHARED="$CC -shared ${LDFLAGS}"
1598 LDSHARED="ld -Bshareable ${LDFLAGS}"
1601 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
1603 LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
1606 [[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
1607 LDSHARED="ld -Bshareable ${LDFLAGS}"
1610 LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
1614 NetBSD*|DragonFly*) LDSHARED="cc -shared ${LDFLAGS}";;
1615 OpenUNIX*|UnixWare*)
1616 if test "$GCC" = "yes"
1617 then LDSHARED='$(CC) -shared'
1618 else LDSHARED='$(CC) -G'
1620 SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
1621 Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
1622 CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
1623 atheos*) LDSHARED="gcc -shared";;
1627 AC_MSG_RESULT($LDSHARED)
1628 BLDSHARED=${BLDSHARED-$LDSHARED}
1629 # CCSHARED are the C *flags* used to create objects to go into a shared
1630 # library (module) -- this is only needed for a few systems
1631 AC_MSG_CHECKING(CCSHARED)
1632 if test -z "$CCSHARED"
1634 case $ac_sys_system/$ac_sys_release in
1635 SunOS*) if test "$GCC" = yes;
1636 then CCSHARED="-fPIC";
1637 elif test `uname -p` = sparc;
1638 then CCSHARED="-xcode=pic32";
1639 else CCSHARED="-Kpic";
1641 hp*|HP*) if test "$GCC" = yes;
1642 then CCSHARED="-fPIC";
1645 Linux*|GNU*) CCSHARED="-fPIC";;
1646 BSD/OS*/4*) CCSHARED="-fpic";;
1647 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
1648 OpenUNIX*|UnixWare*)
1649 if test "$GCC" = "yes"
1650 then CCSHARED="-fPIC"
1651 else CCSHARED="-KPIC"
1654 if test "$GCC" = "yes"
1655 then CCSHARED="-fPIC"
1656 else CCSHARED="-Kpic -belf"
1658 Monterey*) CCSHARED="-G";;
1659 IRIX*/6*) case $CC in
1660 *gcc*) CCSHARED="-shared";;
1663 atheos*) CCSHARED="-fPIC";;
1666 AC_MSG_RESULT($CCSHARED)
1667 # LINKFORSHARED are the flags passed to the $(CC) command that links
1668 # the python executable -- this is only needed for a few systems
1669 AC_MSG_CHECKING(LINKFORSHARED)
1670 if test -z "$LINKFORSHARED"
1672 case $ac_sys_system/$ac_sys_release in
1673 AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
1675 LINKFORSHARED="-Wl,-E -Wl,+s";;
1676 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
1677 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
1678 Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
1679 # -u libsys_s pulls in all symbols in libsys
1681 # -u _PyMac_Error is needed to pull in the mac toolbox glue,
1683 # not used by the core itself but which needs to be in the core so
1684 # that dynamically loaded extension modules have access to it.
1685 # -prebind is no longer used, because it actually seems to give a
1686 # slowdown in stead of a speedup, maybe due to the large number of
1687 # dynamic loads Python does.
1689 LINKFORSHARED="$extra_undefs"
1690 if test "$enable_framework"
1692 LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1694 LINKFORSHARED="$LINKFORSHARED";;
1695 OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
1696 SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
1697 ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
1698 FreeBSD*|NetBSD*|OpenBSD*|DragonFly*)
1699 if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
1701 LINKFORSHARED="-Wl,--export-dynamic"
1703 SunOS/5*) case $CC in
1705 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
1707 LINKFORSHARED="-Xlinker --export-dynamic"
1711 if test $enable_shared = "no"
1713 LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
1716 # -Wl,-E causes the symbols to be added to the dynamic
1717 # symbol table so that they can be found when a module
1718 # is loaded. -N 2048K causes the stack size to be set
1719 # to 2048 kilobytes so that the stack doesn't overflow
1720 # when running test_compile.py.
1721 LINKFORSHARED='-Wl,-E -N 2048K';;
1724 AC_MSG_RESULT($LINKFORSHARED)
1726 AC_SUBST(CFLAGSFORSHARED)
1727 AC_MSG_CHECKING(CFLAGSFORSHARED)
1728 if test ! "$LIBRARY" = "$LDLIBRARY"
1730 case $ac_sys_system in
1732 # Cygwin needs CCSHARED when building extension DLLs
1733 # but not when building the interpreter DLL.
1734 CFLAGSFORSHARED='';;
1736 CFLAGSFORSHARED='$(CCSHARED)'
1739 AC_MSG_RESULT($CFLAGSFORSHARED)
1741 # SHLIBS are libraries (except -lc and -lm) to link to the python shared
1742 # library (with --enable-shared).
1743 # For platforms on which shared libraries are not allowed to have unresolved
1744 # symbols, this must be set to $(LIBS) (expanded by make). We do this even
1745 # if it is not required, since it creates a dependency of the shared library
1746 # to LIBS. This, in turn, means that applications linking the shared libpython
1747 # don't need to link LIBS explicitly. The default should be only changed
1748 # on systems where this approach causes problems.
1750 AC_MSG_CHECKING(SHLIBS)
1751 case "$ac_sys_system" in
1755 AC_MSG_RESULT($SHLIBS)
1758 # checks for libraries
1759 AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
1760 AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
1762 # only check for sem_ini if thread support is requested
1763 if test "$with_threads" = "yes" -o -z "$with_threads"; then
1764 AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
1765 # posix4 on Solaris 2.6
1766 # pthread (first!) on Linux
1769 # check if we need libintl for locale functions
1770 AC_CHECK_LIB(intl, textdomain,
1771 AC_DEFINE(WITH_LIBINTL, 1,
1772 [Define to 1 if libintl is needed for locale functions.]))
1774 # checks for system dependent C++ extensions support
1775 case "$ac_sys_system" in
1776 AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support)
1777 AC_TRY_LINK([#include "/usr/lpp/xlC/include/load.h"],
1778 [loadAndInit("", 0, "")],
1779 [AC_DEFINE(AIX_GENUINE_CPLUSPLUS, 1,
1780 [Define for AIX if your compiler is a genuine IBM xlC/xlC_r
1781 and you want support for AIX C++ shared extension modules.])
1782 AC_MSG_RESULT(yes)],
1783 [AC_MSG_RESULT(no)]);;
1787 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
1788 # BeOS' sockets are stashed in libnet.
1789 AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
1790 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
1792 case "$ac_sys_system" in
1794 AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
1798 AC_MSG_CHECKING(for --with-libs)
1800 AC_HELP_STRING(--with-libs='lib1 ...', link against additional libs),
1802 AC_MSG_RESULT($withval)
1803 LIBS="$withval $LIBS"
1805 [AC_MSG_RESULT(no)])
1807 # Check for use of the system libffi library
1808 AC_MSG_CHECKING(for --with-system-ffi)
1809 AC_ARG_WITH(system_ffi,
1810 AC_HELP_STRING(--with-system-ffi, build _ctypes module using an installed ffi library))
1812 AC_MSG_RESULT($with_system_ffi)
1814 # Determine if signalmodule should be used.
1815 AC_SUBST(USE_SIGNAL_MODULE)
1816 AC_SUBST(SIGNAL_OBJS)
1817 AC_MSG_CHECKING(for --with-signal-module)
1818 AC_ARG_WITH(signal-module,
1819 AC_HELP_STRING(--with-signal-module, disable/enable signal module))
1821 if test -z "$with_signal_module"
1822 then with_signal_module="yes"
1824 AC_MSG_RESULT($with_signal_module)
1826 if test "${with_signal_module}" = "yes"; then
1827 USE_SIGNAL_MODULE=""
1830 USE_SIGNAL_MODULE="#"
1831 SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o"
1834 # This is used to generate Setup.config
1835 AC_SUBST(USE_THREAD_MODULE)
1836 USE_THREAD_MODULE=""
1838 AC_MSG_CHECKING(for --with-dec-threads)
1840 AC_ARG_WITH(dec-threads,
1841 AC_HELP_STRING(--with-dec-threads, use DEC Alpha/OSF1 thread-safe libraries),
1843 AC_MSG_RESULT($withval)
1845 if test "${with_thread+set}" != set; then
1846 with_thread="$withval";
1848 [AC_MSG_RESULT(no)])
1850 # Templates for things AC_DEFINEd more than once.
1851 # For a single AC_DEFINE, no template is needed.
1852 AH_TEMPLATE(C_THREADS,[Define if you have the Mach cthreads package])
1853 AH_TEMPLATE(_REENTRANT,
1854 [Define to force use of thread-safe errno, h_errno, and other functions])
1855 AH_TEMPLATE(WITH_THREAD,
1856 [Define if you want to compile in rudimentary thread support])
1858 AC_MSG_CHECKING(for --with-threads)
1859 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
1860 AC_ARG_WITH(threads,
1861 AC_HELP_STRING(--with(out)-threads@<:@=DIRECTORY@:>@, disable/enable thread support))
1863 # --with-thread is deprecated, but check for it anyway
1864 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
1866 AC_HELP_STRING(--with(out)-thread@<:@=DIRECTORY@:>@, deprecated; use --with(out)-threads),
1867 [with_threads=$with_thread])
1869 if test -z "$with_threads"
1870 then with_threads="yes"
1872 AC_MSG_RESULT($with_threads)
1875 if test "$with_threads" = "no"
1877 USE_THREAD_MODULE="#"
1878 elif test "$ac_cv_pthread_is_default" = yes
1880 AC_DEFINE(WITH_THREAD)
1881 # Defining _REENTRANT on system with POSIX threads should not hurt.
1882 AC_DEFINE(_REENTRANT)
1884 THREADOBJ="Python/thread.o"
1885 elif test "$ac_cv_kpthread" = "yes"
1888 if test "$ac_cv_cxx_thread" = "yes"; then
1889 CXX="$CXX -Kpthread"
1891 AC_DEFINE(WITH_THREAD)
1893 THREADOBJ="Python/thread.o"
1894 elif test "$ac_cv_kthread" = "yes"
1897 if test "$ac_cv_cxx_thread" = "yes"; then
1900 AC_DEFINE(WITH_THREAD)
1902 THREADOBJ="Python/thread.o"
1903 elif test "$ac_cv_pthread" = "yes"
1906 if test "$ac_cv_cxx_thread" = "yes"; then
1909 AC_DEFINE(WITH_THREAD)
1911 THREADOBJ="Python/thread.o"
1913 if test ! -z "$with_threads" -a -d "$with_threads"
1914 then LDFLAGS="$LDFLAGS -L$with_threads"
1916 if test ! -z "$withval" -a -d "$withval"
1917 then LDFLAGS="$LDFLAGS -L$withval"
1920 # According to the POSIX spec, a pthreads implementation must
1921 # define _POSIX_THREADS in unistd.h. Some apparently don't
1922 # (e.g. gnu pth with pthread emulation)
1923 AC_MSG_CHECKING(for _POSIX_THREADS in unistd.h)
1927 #ifdef _POSIX_THREADS
1930 ], unistd_defines_pthreads=yes, unistd_defines_pthreads=no)
1931 AC_MSG_RESULT($unistd_defines_pthreads)
1933 AC_DEFINE(_REENTRANT)
1934 AC_CHECK_HEADER(cthreads.h, [AC_DEFINE(WITH_THREAD)
1935 AC_DEFINE(C_THREADS)
1936 AC_DEFINE(HURD_C_THREADS, 1,
1937 [Define if you are using Mach cthreads directly under /include])
1938 LIBS="$LIBS -lthreads"
1939 THREADOBJ="Python/thread.o"],[
1940 AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
1941 AC_DEFINE(C_THREADS)
1942 AC_DEFINE(MACH_C_THREADS, 1,
1943 [Define if you are using Mach cthreads under mach /])
1944 THREADOBJ="Python/thread.o"],[
1945 AC_MSG_CHECKING(for --with-pth)
1947 AC_HELP_STRING(--with-pth, use GNU pth threading libraries),
1948 [AC_MSG_RESULT($withval)
1949 AC_DEFINE([WITH_THREAD])
1950 AC_DEFINE([HAVE_PTH], 1,
1951 [Define if you have GNU PTH threads.])
1953 THREADOBJ="Python/thread.o"],
1956 # Just looking for pthread_create in libpthread is not enough:
1957 # on HP/UX, pthread.h renames pthread_create to a different symbol name.
1958 # So we really have to include pthread.h, and then link.
1960 LIBS="$LIBS -lpthread"
1961 AC_MSG_CHECKING([for pthread_create in -lpthread])
1962 AC_TRY_LINK([#include <pthread.h>
1964 void * start_routine (void *arg) { exit (0); }], [
1965 pthread_create (NULL, NULL, start_routine, NULL)], [
1967 AC_DEFINE(WITH_THREAD)
1969 THREADOBJ="Python/thread.o"],[
1971 AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
1973 THREADOBJ="Python/thread.o"],[
1974 AC_CHECK_HEADER(atheos/threads.h, [AC_DEFINE(WITH_THREAD)
1975 AC_DEFINE(ATHEOS_THREADS, 1,
1976 [Define this if you have AtheOS threads.])
1977 THREADOBJ="Python/thread.o"],[
1978 AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
1979 AC_DEFINE(BEOS_THREADS, 1,
1980 [Define this if you have BeOS threads.])
1981 THREADOBJ="Python/thread.o"],[
1982 AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
1984 LIBS="$LIBS -lpthreads"
1985 THREADOBJ="Python/thread.o"], [
1986 AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
1989 THREADOBJ="Python/thread.o"], [
1990 AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
1992 LIBS="$LIBS -lpthread"
1993 THREADOBJ="Python/thread.o"], [
1994 AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
1997 THREADOBJ="Python/thread.o"],[
1998 USE_THREAD_MODULE="#"])
1999 ])])])])])])])])])])
2001 AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
2003 THREADOBJ="Python/thread.o"
2004 USE_THREAD_MODULE=""])
2006 if test "$posix_threads" != "yes"; then
2007 AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
2008 LIBS="$LIBS -lthread"
2009 THREADOBJ="Python/thread.o"
2010 USE_THREAD_MODULE=""])
2013 if test "$USE_THREAD_MODULE" != "#"
2015 # If the above checks didn't disable threads, (at least) OSF1
2016 # needs this '-threads' argument during linking.
2017 case $ac_sys_system in
2018 OSF1) LDLAST=-threads;;
2023 if test "$posix_threads" = "yes"; then
2024 if test "$unistd_defines_pthreads" = "no"; then
2025 AC_DEFINE(_POSIX_THREADS, 1,
2026 [Define if you have POSIX threads,
2027 and your system does not define that.])
2030 # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
2031 case $ac_sys_system/$ac_sys_release in
2032 SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1,
2033 Defined for Solaris 2.6 bug in pthread header.)
2035 SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
2036 Define if the Posix semaphores do not work on your system)
2038 AIX/5) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
2039 Define if the Posix semaphores do not work on your system)
2043 AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
2044 AC_CACHE_VAL(ac_cv_pthread_system_supported,
2045 [AC_TRY_RUN([#include <pthread.h>
2046 void *foo(void *parm) {
2050 pthread_attr_t attr;
2052 if (pthread_attr_init(&attr)) exit(-1);
2053 if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
2054 if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
2057 ac_cv_pthread_system_supported=yes,
2058 ac_cv_pthread_system_supported=no,
2059 ac_cv_pthread_system_supported=no)
2061 AC_MSG_RESULT($ac_cv_pthread_system_supported)
2062 if test "$ac_cv_pthread_system_supported" = "yes"; then
2063 AC_DEFINE(PTHREAD_SYSTEM_SCHED_SUPPORTED, 1, [Defined if PTHREAD_SCOPE_SYSTEM supported.])
2065 AC_CHECK_FUNCS(pthread_sigmask,
2066 [case $ac_sys_system in
2068 AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1,
2069 [Define if pthread_sigmask() does not work on your system.])
2075 # Check for enable-ipv6
2076 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
2077 AC_MSG_CHECKING([if --enable-ipv6 is specified])
2079 [ --enable-ipv6 Enable ipv6 (with ipv4) support
2080 --disable-ipv6 Disable ipv6 support],
2081 [ case "$enableval" in
2086 *) AC_MSG_RESULT(yes)
2087 AC_DEFINE(ENABLE_IPV6)
2093 dnl the check does not work on cross compilation case...
2094 AC_TRY_RUN([ /* AF_INET6 available check */
2095 #include <sys/types.h>
2096 #include <sys/socket.h>
2099 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
2113 if test "$ipv6" = "yes"; then
2114 AC_MSG_CHECKING(if RFC2553 API is available)
2115 AC_TRY_COMPILE([#include <sys/types.h>
2116 #include <netinet/in.h>],
2117 [struct sockaddr_in6 x;
2121 AC_MSG_RESULT(no, IPv6 disabled)
2125 if test "$ipv6" = "yes"; then
2126 AC_DEFINE(ENABLE_IPV6)
2134 if test "$ipv6" = "yes"; then
2135 AC_MSG_CHECKING([ipv6 stack type])
2136 for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
2140 dnl http://www.kame.net/
2142 #include <netinet/in.h>
2143 #ifdef IPV6_INRIA_VERSION
2149 dnl http://www.kame.net/
2151 #include <netinet/in.h>
2157 ipv6libdir=/usr/local/v6/lib
2161 dnl http://www.v6.linux.or.jp/
2163 #include <features.h>
2164 #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2))
2171 dnl http://www.v6.linux.or.jp/
2172 if test -d /usr/inet6; then
2175 ipv6libdir=/usr/inet6/lib
2176 BASECFLAGS="-I/usr/inet6/include $BASECFLAGS"
2180 if test -f /etc/netconfig; then
2181 if /usr/xpg4/bin/grep -q tcp6 /etc/netconfig; then
2189 #include <sys/param.h>
2190 #ifdef _TOSHIBA_INET6
2195 ipv6libdir=/usr/local/v6/lib])
2199 #include </usr/local/v6/include/sys/v6config.h>
2205 ipv6libdir=/usr/local/v6/lib;
2206 BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"])
2210 #include <sys/param.h>
2211 #ifdef _ZETA_MINAMI_INET6
2216 ipv6libdir=/usr/local/v6/lib])
2219 if test "$ipv6type" != "unknown"; then
2223 AC_MSG_RESULT($ipv6type)
2226 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
2227 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
2228 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
2229 echo "using lib$ipv6lib"
2231 if test $ipv6trylibc = "yes"; then
2234 echo 'Fatal: no $ipv6lib library found. cannot continue.'
2235 echo "You need to fetch lib$ipv6lib.a from appropriate"
2236 echo 'ipv6 kit and compile beforehand.'
2242 # Check for --with-doc-strings
2243 AC_MSG_CHECKING(for --with-doc-strings)
2244 AC_ARG_WITH(doc-strings,
2245 AC_HELP_STRING(--with(out)-doc-strings, disable/enable documentation strings))
2247 if test -z "$with_doc_strings"
2248 then with_doc_strings="yes"
2250 if test "$with_doc_strings" != "no"
2252 AC_DEFINE(WITH_DOC_STRINGS, 1,
2253 [Define if you want documentation strings in extension modules])
2255 AC_MSG_RESULT($with_doc_strings)
2257 # Check for Python-specific malloc support
2258 AC_MSG_CHECKING(for --with-tsc)
2260 [ --with(out)-tsc enable/disable timestamp counter profile], [
2261 if test "$withval" != no
2263 AC_DEFINE(WITH_TSC, 1,
2264 [Define to profile with the Pentium timestamp counter])
2266 else AC_MSG_RESULT(no)
2268 [AC_MSG_RESULT(no)])
2270 # Check for Python-specific malloc support
2271 AC_MSG_CHECKING(for --with-pymalloc)
2272 AC_ARG_WITH(pymalloc,
2273 AC_HELP_STRING(--with(out)-pymalloc, disable/enable specialized mallocs))
2275 if test -z "$with_pymalloc"
2276 then with_pymalloc="yes"
2278 if test "$with_pymalloc" != "no"
2280 AC_DEFINE(WITH_PYMALLOC, 1,
2281 [Define if you want to compile in Python-specific mallocs])
2283 AC_MSG_RESULT($with_pymalloc)
2285 # Check for --with-wctype-functions
2286 AC_MSG_CHECKING(for --with-wctype-functions)
2287 AC_ARG_WITH(wctype-functions,
2288 AC_HELP_STRING(--with-wctype-functions, use wctype.h functions),
2290 if test "$withval" != no
2292 AC_DEFINE(WANT_WCTYPE_FUNCTIONS, 1,
2293 [Define if you want wctype.h functions to be used instead of the
2294 one supplied by Python itself. (see Include/unicodectype.h).])
2296 else AC_MSG_RESULT(no)
2298 [AC_MSG_RESULT(no)])
2300 # -I${DLINCLDIR} is added to the compile rule for importdl.o
2304 # the dlopen() function means we might want to use dynload_shlib.o. some
2305 # platforms, such as AIX, have dlopen(), but don't want to use it.
2306 AC_CHECK_FUNCS(dlopen)
2308 # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic
2309 # loading of modules.
2310 AC_SUBST(DYNLOADFILE)
2311 AC_MSG_CHECKING(DYNLOADFILE)
2312 if test -z "$DYNLOADFILE"
2314 case $ac_sys_system/$ac_sys_release in
2315 AIX*) # Use dynload_shlib.c and dlopen() if we have it; otherwise dynload_aix.c
2316 if test "$ac_cv_func_dlopen" = yes
2317 then DYNLOADFILE="dynload_shlib.o"
2318 else DYNLOADFILE="dynload_aix.o"
2321 BeOS*) DYNLOADFILE="dynload_beos.o";;
2322 hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
2323 # Use dynload_next.c only on 10.2 and below, which don't have native dlopen()
2324 Darwin/@<:@0156@:>@\..*) DYNLOADFILE="dynload_next.o";;
2325 atheos*) DYNLOADFILE="dynload_atheos.o";;
2327 # use dynload_shlib.c and dlopen() if we have it; otherwise stub
2328 # out any dynamic loading
2329 if test "$ac_cv_func_dlopen" = yes
2330 then DYNLOADFILE="dynload_shlib.o"
2331 else DYNLOADFILE="dynload_stub.o"
2336 AC_MSG_RESULT($DYNLOADFILE)
2337 if test "$DYNLOADFILE" != "dynload_stub.o"
2339 AC_DEFINE(HAVE_DYNAMIC_LOADING, 1,
2340 [Defined when any dynamic module loading is enabled.])
2343 # MACHDEP_OBJS can be set to platform-specific object files needed by Python
2345 AC_SUBST(MACHDEP_OBJS)
2346 AC_MSG_CHECKING(MACHDEP_OBJS)
2347 if test -z "$MACHDEP_OBJS"
2349 MACHDEP_OBJS=$extra_machdep_objs
2351 MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs"
2353 AC_MSG_RESULT(MACHDEP_OBJS)
2355 # checks for library functions
2356 AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
2357 clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
2358 gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
2359 getpriority getpwent getspnam getspent getsid getwd \
2360 kill killpg lchmod lchown lstat mkfifo mknod mktime \
2361 mremap nice pathconf pause plock poll pthread_init \
2362 putenv readlink realpath \
2363 select setegid seteuid setgid \
2364 setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \
2365 sigaction siginterrupt sigrelse strftime \
2366 sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
2367 truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll _getpty)
2369 # For some functions, having a definition is not sufficient, since
2370 # we want to take their address.
2371 AC_MSG_CHECKING(for chroot)
2372 AC_TRY_COMPILE([#include <unistd.h>], void *x=chroot,
2373 AC_DEFINE(HAVE_CHROOT, 1, Define if you have the 'chroot' function.)
2377 AC_MSG_CHECKING(for link)
2378 AC_TRY_COMPILE([#include <unistd.h>], void *x=link,
2379 AC_DEFINE(HAVE_LINK, 1, Define if you have the 'link' function.)
2383 AC_MSG_CHECKING(for symlink)
2384 AC_TRY_COMPILE([#include <unistd.h>], void *x=symlink,
2385 AC_DEFINE(HAVE_SYMLINK, 1, Define if you have the 'symlink' function.)
2389 AC_MSG_CHECKING(for fchdir)
2390 AC_TRY_COMPILE([#include <unistd.h>], void *x=fchdir,
2391 AC_DEFINE(HAVE_FCHDIR, 1, Define if you have the 'fchdir' function.)
2395 AC_MSG_CHECKING(for fsync)
2396 AC_TRY_COMPILE([#include <unistd.h>], void *x=fsync,
2397 AC_DEFINE(HAVE_FSYNC, 1, Define if you have the 'fsync' function.)
2401 AC_MSG_CHECKING(for fdatasync)
2402 AC_TRY_COMPILE([#include <unistd.h>], void *x=fdatasync,
2403 AC_DEFINE(HAVE_FDATASYNC, 1, Define if you have the 'fdatasync' function.)
2407 AC_MSG_CHECKING(for epoll)
2408 AC_TRY_COMPILE([#include <sys/epoll.h>], void *x=epoll_create,
2409 AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.)
2413 AC_MSG_CHECKING(for kqueue)
2415 #include <sys/types.h>
2416 #include <sys/event.h>
2418 AC_DEFINE(HAVE_KQUEUE, 1, Define if you have the 'kqueue' functions.)
2422 # On some systems (eg. FreeBSD 5), we would find a definition of the
2423 # functions ctermid_r, setgroups in the library, but no prototype
2424 # (e.g. because we use _XOPEN_SOURCE). See whether we can take their
2425 # address to avoid compiler warnings and potential miscompilations
2426 # because of the missing prototypes.
2428 AC_MSG_CHECKING(for ctermid_r)
2430 #include "confdefs.h"
2432 ], void* p = ctermid_r,
2433 AC_DEFINE(HAVE_CTERMID_R, 1, Define if you have the 'ctermid_r' function.)
2438 AC_MSG_CHECKING(for flock)
2440 #include "confdefs.h"
2441 #include <sys/file.h>
2443 AC_DEFINE(HAVE_FLOCK, 1, Define if you have the 'flock' function.)
2448 AC_MSG_CHECKING(for getpagesize)
2450 #include "confdefs.h"
2452 ], void* p = getpagesize,
2453 AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function.)
2459 AC_CHECK_PROGS(TRUE, true, /bin/true)
2461 dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
2462 dnl On others, they are in the C library, so we to take no action
2463 AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
2464 AC_CHECK_LIB(resolv, inet_aton)
2467 # On Tru64, chflags seems to be present, but calling it will
2469 AC_MSG_CHECKING(for chflags)
2471 #include <sys/stat.h>
2473 int main(int argc, char*argv[])
2475 if(chflags(argv[0], 0) != 0)
2479 ],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
2484 AC_MSG_CHECKING(for lchflags)
2486 #include <sys/stat.h>
2488 int main(int argc, char*argv[])
2490 if(lchflags(argv[0], 0) != 0)
2494 ],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
2499 dnl Check if system zlib has *Copy() functions
2501 dnl On MacOSX the linker will search for dylibs on the entire linker path
2502 dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first
2503 dnl to revert to a more traditional unix behaviour and make it possible to
2504 dnl override the system libz with a local static library of libz. Temporarily
2505 dnl add that flag to our CFLAGS as well to ensure that we check the version
2506 dnl of libz that will be used by setup.py.
2507 dnl The -L/usr/local/lib is needed as wel to get the same compilation
2508 dnl environment as setup.py (and leaving it out can cause configure to use the
2509 dnl wrong version of the library)
2510 case $ac_sys_system/$ac_sys_release in
2512 _CUR_CFLAGS="${CFLAGS}"
2513 _CUR_LDFLAGS="${LDFLAGS}"
2514 CFLAGS="${CFLAGS} -Wl,-search_paths_first"
2515 LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
2519 AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, Define if the zlib library has inflateCopy))
2521 case $ac_sys_system/$ac_sys_release in
2523 CFLAGS="${_CUR_CFLAGS}"
2524 LDFLAGS="${_CUR_LDFLAGS}"
2528 AC_MSG_CHECKING(for hstrerror)
2530 #include "confdefs.h"
2532 ], void* p = hstrerror; hstrerror(0),
2533 AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.)
2538 AC_MSG_CHECKING(for inet_aton)
2540 #include "confdefs.h"
2541 #include <sys/types.h>
2542 #include <sys/socket.h>
2543 #include <netinet/in.h>
2544 #include <arpa/inet.h>
2545 ], void* p = inet_aton;inet_aton(0,0),
2546 AC_DEFINE(HAVE_INET_ATON, 1, Define if you have the 'inet_aton' function.)
2551 AC_MSG_CHECKING(for inet_pton)
2553 #include "confdefs.h"
2554 #include <sys/types.h>
2555 #include <sys/socket.h>
2556 #include <netinet/in.h>
2557 #include <arpa/inet.h>
2558 ], void* p = inet_pton,
2559 AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.)
2564 # On some systems, setgroups is in unistd.h, on others, in grp.h
2565 AC_MSG_CHECKING(for setgroups)
2567 #include "confdefs.h"
2573 void* p = setgroups,
2574 AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.)
2579 # check for openpty and forkpty
2581 AC_CHECK_FUNCS(openpty,,
2582 AC_CHECK_LIB(util,openpty,
2583 [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"],
2584 AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"])
2587 AC_CHECK_FUNCS(forkpty,,
2588 AC_CHECK_LIB(util,forkpty,
2589 [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"],
2590 AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"])
2595 AC_CHECK_FUNCS(memmove)
2597 # check for long file support functions
2598 AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)
2600 AC_REPLACE_FUNCS(dup2 getcwd strdup)
2601 AC_CHECK_FUNCS(getpgrp,
2602 AC_TRY_COMPILE([#include <unistd.h>],
2604 AC_DEFINE(GETPGRP_HAVE_ARG, 1,
2605 [Define if getpgrp() must be called as getpgrp(0).])
2608 AC_CHECK_FUNCS(setpgrp,
2609 AC_TRY_COMPILE([#include <unistd.h>],
2611 AC_DEFINE(SETPGRP_HAVE_ARG, 1,
2612 [Define if setpgrp() must be called as setpgrp(0, 0).])
2615 AC_CHECK_FUNCS(gettimeofday,
2616 AC_TRY_COMPILE([#include <sys/time.h>],
2617 [gettimeofday((struct timeval*)0,(struct timezone*)0);], ,
2618 AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1,
2619 [Define if gettimeofday() does not have second (timezone) argument
2620 This is the case on Motorola V4 (R40V4.2)])
2624 AC_MSG_CHECKING(for major, minor, and makedev)
2626 #if defined(MAJOR_IN_MKDEV)
2627 #include <sys/mkdev.h>
2628 #elif defined(MAJOR_IN_SYSMACROS)
2629 #include <sys/sysmacros.h>
2631 #include <sys/types.h>
2634 makedev(major(0),minor(0));
2636 AC_DEFINE(HAVE_DEVICE_MACROS, 1,
2637 [Define to 1 if you have the device macros.])
2643 # On OSF/1 V5.1, getaddrinfo is available, but a define
2644 # for [no]getaddrinfo in netdb.h.
2645 AC_MSG_CHECKING(for getaddrinfo)
2647 #include <sys/types.h>
2648 #include <sys/socket.h>
2652 getaddrinfo(NULL, NULL, NULL, NULL);
2655 AC_MSG_CHECKING(getaddrinfo bug)
2657 #include <sys/types.h>
2660 #include <sys/socket.h>
2661 #include <netinet/in.h>
2665 int passive, gaierr, inet4 = 0, inet6 = 0;
2666 struct addrinfo hints, *ai, *aitop;
2667 char straddr[INET6_ADDRSTRLEN], strport[16];
2669 for (passive = 0; passive <= 1; passive++) {
2670 memset(&hints, 0, sizeof(hints));
2671 hints.ai_family = AF_UNSPEC;
2672 hints.ai_flags = passive ? AI_PASSIVE : 0;
2673 hints.ai_socktype = SOCK_STREAM;
2674 hints.ai_protocol = IPPROTO_TCP;
2675 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
2676 (void)gai_strerror(gaierr);
2679 for (ai = aitop; ai; ai = ai->ai_next) {
2680 if (ai->ai_addr == NULL ||
2681 ai->ai_addrlen == 0 ||
2682 getnameinfo(ai->ai_addr, ai->ai_addrlen,
2683 straddr, sizeof(straddr), strport, sizeof(strport),
2684 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
2687 switch (ai->ai_family) {
2689 if (strcmp(strport, "54321") != 0) {
2693 if (strcmp(straddr, "0.0.0.0") != 0) {
2697 if (strcmp(straddr, "127.0.0.1") != 0) {
2704 if (strcmp(strport, "54321") != 0) {
2708 if (strcmp(straddr, "::") != 0) {
2712 if (strcmp(straddr, "::1") != 0) {
2722 /* another family support? */
2728 if (!(inet4 == 0 || inet4 == 2))
2730 if (!(inet6 == 0 || inet6 == 2))
2734 freeaddrinfo(aitop);
2739 freeaddrinfo(aitop);
2744 buggygetaddrinfo=no,
2745 AC_MSG_RESULT(buggy)
2746 buggygetaddrinfo=yes,
2747 AC_MSG_RESULT(buggy)
2748 buggygetaddrinfo=yes)], [
2750 buggygetaddrinfo=yes
2753 if test "$buggygetaddrinfo" = "yes"; then
2754 if test "$ipv6" = "yes"; then
2755 echo 'Fatal: You must get working getaddrinfo() function.'
2756 echo ' or you can specify "--disable-ipv6"'.
2760 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.])
2762 AC_CHECK_FUNCS(getnameinfo)
2764 # checks for structures
2768 AC_CHECK_MEMBERS([struct stat.st_rdev])
2769 AC_CHECK_MEMBERS([struct stat.st_blksize])
2770 AC_CHECK_MEMBERS([struct stat.st_flags])
2771 AC_CHECK_MEMBERS([struct stat.st_gen])
2772 AC_CHECK_MEMBERS([struct stat.st_birthtime])
2775 AC_MSG_CHECKING(for time.h that defines altzone)
2776 AC_CACHE_VAL(ac_cv_header_time_altzone,
2777 [AC_TRY_COMPILE([#include <time.h>], [return altzone;],
2778 ac_cv_header_time_altzone=yes,
2779 ac_cv_header_time_altzone=no)])
2780 AC_MSG_RESULT($ac_cv_header_time_altzone)
2781 if test $ac_cv_header_time_altzone = yes; then
2782 AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.])
2786 AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included)
2788 #include <sys/types.h>
2789 #include <sys/select.h>
2790 #include <sys/time.h>
2792 AC_DEFINE(SYS_SELECT_WITH_SYS_TIME, 1,
2793 [Define if you can safely include both <sys/select.h> and <sys/time.h>
2794 (which you can't on SCO ODT 3.0).])
2797 AC_MSG_RESULT($was_it_defined)
2799 AC_MSG_CHECKING(for addrinfo)
2800 AC_CACHE_VAL(ac_cv_struct_addrinfo,
2802 # include <netdb.h>],
2803 [struct addrinfo a],
2804 ac_cv_struct_addrinfo=yes,
2805 ac_cv_struct_addrinfo=no))
2806 AC_MSG_RESULT($ac_cv_struct_addrinfo)
2807 if test $ac_cv_struct_addrinfo = yes; then
2808 AC_DEFINE(HAVE_ADDRINFO, 1, [struct addrinfo (netdb.h)])
2811 AC_MSG_CHECKING(for sockaddr_storage)
2812 AC_CACHE_VAL(ac_cv_struct_sockaddr_storage,
2814 # include <sys/types.h>
2815 # include <sys/socket.h>],
2816 [struct sockaddr_storage s],
2817 ac_cv_struct_sockaddr_storage=yes,
2818 ac_cv_struct_sockaddr_storage=no))
2819 AC_MSG_RESULT($ac_cv_struct_sockaddr_storage)
2820 if test $ac_cv_struct_sockaddr_storage = yes; then
2821 AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket.h)])
2824 # checks for compiler characteristics
2830 AC_MSG_CHECKING(for working volatile)
2831 AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes,
2832 AC_DEFINE(volatile, [], [Define to empty if the keyword does not work.])
2834 AC_MSG_RESULT($works)
2837 AC_MSG_CHECKING(for working signed char)
2838 AC_TRY_COMPILE([], [signed char c;], works=yes,
2839 AC_DEFINE(signed, [], [Define to empty if the keyword does not work.])
2841 AC_MSG_RESULT($works)
2844 AC_MSG_CHECKING(for prototypes)
2845 AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],[
2846 AC_DEFINE(HAVE_PROTOTYPES, 1,
2847 [Define if your compiler supports function prototype])
2850 AC_MSG_RESULT($have_prototypes)
2853 AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
2856 int foo(int x, ...) {
2864 ], [return foo(10, "", 3.14);], [
2865 AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1,
2866 [Define if your compiler supports variable length function prototypes
2867 (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>])
2870 AC_MSG_RESULT($works)
2872 # check for socketpair
2873 AC_MSG_CHECKING(for socketpair)
2875 #include <sys/types.h>
2876 #include <sys/socket.h>
2877 ], void *x=socketpair,
2878 AC_DEFINE(HAVE_SOCKETPAIR, 1, Define if you have the 'socketpair' function.)
2883 # check if sockaddr has sa_len member
2884 AC_MSG_CHECKING(if sockaddr has sa_len member)
2885 AC_TRY_COMPILE([#include <sys/types.h>
2886 #include <sys/socket.h>],
2890 AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member]),
2894 AC_MSG_CHECKING(whether va_list is an array)
2896 #ifdef HAVE_STDARG_PROTOTYPES
2899 #include <varargs.h>
2901 ], [va_list list1, list2; list1 = list2;], , [
2902 AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
2903 va_list_is_array=yes
2905 AC_MSG_RESULT($va_list_is_array)
2907 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
2908 AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
2909 [Define this if you have some version of gethostbyname_r()])
2911 AC_CHECK_FUNC(gethostbyname_r, [
2912 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2913 AC_MSG_CHECKING([gethostbyname_r with 6 args])
2915 CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
2920 struct hostent *he, *res;
2925 (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
2927 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2928 AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
2929 [Define this if you have the 6-arg version of gethostbyname_r().])
2933 AC_MSG_CHECKING([gethostbyname_r with 5 args])
2943 (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
2945 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2946 AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
2947 [Define this if you have the 5-arg version of gethostbyname_r().])
2951 AC_MSG_CHECKING([gethostbyname_r with 3 args])
2957 struct hostent_data data;
2959 (void) gethostbyname_r(name, he, &data);
2961 AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2962 AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
2963 [Define this if you have the 3-arg version of gethostbyname_r().])
2972 AC_CHECK_FUNCS(gethostbyname)
2974 AC_SUBST(HAVE_GETHOSTBYNAME_R_6_ARG)
2975 AC_SUBST(HAVE_GETHOSTBYNAME_R_5_ARG)
2976 AC_SUBST(HAVE_GETHOSTBYNAME_R_3_ARG)
2977 AC_SUBST(HAVE_GETHOSTBYNAME_R)
2978 AC_SUBST(HAVE_GETHOSTBYNAME)
2980 # checks for system services
2983 # Linux requires this for correct f.p. operations
2984 AC_CHECK_FUNC(__fpu_control,
2986 [AC_CHECK_LIB(ieee, __fpu_control)
2989 # Check for --with-fpectl
2990 AC_MSG_CHECKING(for --with-fpectl)
2992 AC_HELP_STRING(--with-fpectl, enable SIGFPE catching),
2994 if test "$withval" != no
2996 AC_DEFINE(WANT_SIGFPE_HANDLER, 1,
2997 [Define if you want SIGFPE handled (see Include/pyfpe.h).])
2999 else AC_MSG_RESULT(no)
3001 [AC_MSG_RESULT(no)])
3003 # check for --with-libm=...
3005 case $ac_sys_system in
3010 AC_MSG_CHECKING(for --with-libm=STRING)
3012 AC_HELP_STRING(--with-libm=STRING, math library),
3014 if test "$withval" = no
3016 AC_MSG_RESULT(force LIBM empty)
3017 elif test "$withval" != yes
3019 AC_MSG_RESULT(set LIBM="$withval")
3020 else AC_MSG_ERROR([proper usage is --with-libm=STRING])
3022 [AC_MSG_RESULT(default LIBM="$LIBM")])
3024 # check for --with-libc=...
3026 AC_MSG_CHECKING(for --with-libc=STRING)
3028 AC_HELP_STRING(--with-libc=STRING, C library),
3030 if test "$withval" = no
3032 AC_MSG_RESULT(force LIBC empty)
3033 elif test "$withval" != yes
3035 AC_MSG_RESULT(set LIBC="$withval")
3036 else AC_MSG_ERROR([proper usage is --with-libc=STRING])
3038 [AC_MSG_RESULT(default LIBC="$LIBC")])
3040 # ************************************
3041 # * Check for mathematical functions *
3042 # ************************************
3047 # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
3048 # -0. on some architectures.
3049 AC_MSG_CHECKING(whether tanh preserves the sign of zero)
3050 AC_CACHE_VAL(ac_cv_tanh_preserves_zero_sign, [
3055 /* return 0 if either negative zeros don't exist
3056 on this platform or if negative zeros exist
3057 and tanh(-0.) == -0. */
3058 if (atan2(0., -1.) == atan2(-0., -1.) ||
3059 atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
3063 ac_cv_tanh_preserves_zero_sign=yes,
3064 ac_cv_tanh_preserves_zero_sign=no,
3065 ac_cv_tanh_preserves_zero_sign=no)])
3066 AC_MSG_RESULT($ac_cv_tanh_preserves_zero_sign)
3067 if test "$ac_cv_tanh_preserves_zero_sign" = yes
3069 AC_DEFINE(TANH_PRESERVES_ZERO_SIGN, 1,
3070 [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
3073 AC_REPLACE_FUNCS(hypot)
3075 AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p)
3080 AC_CHECK_HEADER(wchar.h, [
3081 AC_DEFINE(HAVE_WCHAR_H, 1,
3082 [Define if the compiler provides a wchar.h header file.])
3088 # determine wchar_t size
3089 if test "$wchar_h" = yes
3091 AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
3094 AC_MSG_CHECKING(for UCS-4 tcl)
3098 #if TCL_UTF_MAX != 6
3099 # error "NOT UCS4_TCL"
3101 AC_DEFINE(HAVE_UCS4_TCL, 1, [Define this if you have tcl and TCL_UTF_MAX==6])
3104 AC_MSG_RESULT($have_ucs4_tcl)
3106 # check whether wchar_t is signed or not
3107 if test "$wchar_h" = yes
3109 # check whether wchar_t is signed or not
3110 AC_MSG_CHECKING(whether wchar_t is signed)
3111 AC_CACHE_VAL(ac_cv_wchar_t_signed, [
3116 /* Success: exit code 0 */
3117 exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
3120 ac_cv_wchar_t_signed=yes,
3121 ac_cv_wchar_t_signed=no,
3122 ac_cv_wchar_t_signed=yes)])
3123 AC_MSG_RESULT($ac_cv_wchar_t_signed)
3126 AC_MSG_CHECKING(what type to use for unicode)
3127 dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
3128 AC_ARG_ENABLE(unicode,
3129 AC_HELP_STRING(--enable-unicode@<:@=ucs@<:@24@:>@@:>@, Enable Unicode strings (default is yes)),
3131 [enable_unicode=yes])
3133 if test $enable_unicode = yes
3135 # Without any arguments, Py_UNICODE defaults to two-byte mode
3136 case "$have_ucs4_tcl" in
3137 yes) enable_unicode="ucs4"
3139 *) enable_unicode="ucs2"
3144 AH_TEMPLATE(Py_UNICODE_SIZE,
3145 [Define as the size of the unicode type.])
3146 case "$enable_unicode" in
3147 ucs2) unicode_size="2"
3148 AC_DEFINE(Py_UNICODE_SIZE,2)
3150 ucs4) unicode_size="4"
3151 AC_DEFINE(Py_UNICODE_SIZE,4)
3155 AH_TEMPLATE(PY_UNICODE_TYPE,
3156 [Define as the integral type used for Unicode representation.])
3158 AC_SUBST(UNICODE_OBJS)
3159 if test "$enable_unicode" = "no"
3162 AC_MSG_RESULT(not used)
3164 UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o"
3165 AC_DEFINE(Py_USING_UNICODE, 1,
3166 [Define if you want to have a Unicode type.])
3168 # wchar_t is only usable if it maps to an unsigned type
3169 if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \
3170 -a "$ac_cv_wchar_t_signed" = "no"
3172 PY_UNICODE_TYPE="wchar_t"
3173 AC_DEFINE(HAVE_USABLE_WCHAR_T, 1,
3174 [Define if you have a useable wchar_t type defined in wchar.h; useable
3175 means wchar_t must be an unsigned type with at least 16 bits. (see
3176 Include/unicodeobject.h).])
3177 AC_DEFINE(PY_UNICODE_TYPE,wchar_t)
3178 elif test "$ac_cv_sizeof_short" = "$unicode_size"
3180 PY_UNICODE_TYPE="unsigned short"
3181 AC_DEFINE(PY_UNICODE_TYPE,unsigned short)
3182 elif test "$ac_cv_sizeof_long" = "$unicode_size"
3184 PY_UNICODE_TYPE="unsigned long"
3185 AC_DEFINE(PY_UNICODE_TYPE,unsigned long)
3187 PY_UNICODE_TYPE="no type found"
3189 AC_MSG_RESULT($PY_UNICODE_TYPE)
3192 # check for endianness
3194 AH_VERBATIM([WORDS_BIGENDIAN],
3196 /* Define to 1 if your processor stores words with the most significant byte
3197 first (like Motorola and SPARC, unlike Intel and VAX).
3199 The block below does compile-time checking for endianness on platforms
3200 that use GCC and therefore allows compiling fat binaries on OSX by using
3201 '-arch ppc -arch i386' as the compile flags. The phrasing was choosen
3202 such that the configure-result is used on systems that don't use GCC.
3204 #ifdef __BIG_ENDIAN__
3205 #define WORDS_BIGENDIAN 1
3207 #ifndef __LITTLE_ENDIAN__
3208 #undef WORDS_BIGENDIAN
3212 # Check whether right shifting a negative integer extends the sign bit
3213 # or fills with zeros (like the Cray J90, according to Tim Peters).
3214 AC_MSG_CHECKING(whether right shift extends the sign bit)
3215 AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
3219 exit(((-1)>>3 == -1) ? 0 : 1);
3222 ac_cv_rshift_extends_sign=yes,
3223 ac_cv_rshift_extends_sign=no,
3224 ac_cv_rshift_extends_sign=yes)])
3225 AC_MSG_RESULT($ac_cv_rshift_extends_sign)
3226 if test "$ac_cv_rshift_extends_sign" = no
3228 AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS, 1,
3229 [Define if i>>j for signed int i does not extend the sign bit
3233 # check for getc_unlocked and related locking functions
3234 AC_MSG_CHECKING(for getc_unlocked() and friends)
3235 AC_CACHE_VAL(ac_cv_have_getc_unlocked, [
3236 AC_TRY_LINK([#include <stdio.h>],[
3237 FILE *f = fopen("/dev/null", "r");
3241 ], ac_cv_have_getc_unlocked=yes, ac_cv_have_getc_unlocked=no)])
3242 AC_MSG_RESULT($ac_cv_have_getc_unlocked)
3243 if test "$ac_cv_have_getc_unlocked" = yes
3245 AC_DEFINE(HAVE_GETC_UNLOCKED, 1,
3246 [Define this if you have flockfile(), getc_unlocked(), and funlockfile()])
3249 # check where readline lives
3250 # save the value of LIBS so we don't actually link Python with readline
3251 LIBS_no_readline=$LIBS
3252 AC_CHECK_LIB(readline, readline)
3253 if test "$ac_cv_have_readline_readline" = no
3255 AC_CHECK_LIB(termcap, readline)
3258 # check for readline 2.1
3259 AC_CHECK_LIB(readline, rl_callback_handler_install,
3260 AC_DEFINE(HAVE_RL_CALLBACK, 1,
3261 [Define if you have readline 2.1]), , )
3263 # check for readline 2.2
3264 AC_TRY_CPP([#include <readline/readline.h>],
3265 have_readline=yes, have_readline=no)
3266 if test $have_readline = yes
3268 AC_EGREP_HEADER([extern int rl_completion_append_character;],
3269 [readline/readline.h],
3270 AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
3271 [Define if you have readline 2.2]), )
3274 # check for readline 4.0
3275 AC_CHECK_LIB(readline, rl_pre_input_hook,
3276 AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1,
3277 [Define if you have readline 4.0]), , )
3280 AC_CHECK_LIB(readline, rl_completion_display_matches_hook,
3281 AC_DEFINE(HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK, 1,
3282 [Define if you have readline 4.0]), , )
3284 # check for readline 4.2
3285 AC_CHECK_LIB(readline, rl_completion_matches,
3286 AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1,
3287 [Define if you have readline 4.2]), , )
3289 # also in readline 4.2
3290 AC_TRY_CPP([#include <readline/readline.h>],
3291 have_readline=yes, have_readline=no)
3292 if test $have_readline = yes
3294 AC_EGREP_HEADER([extern int rl_catch_signals;],
3295 [readline/readline.h],
3296 AC_DEFINE(HAVE_RL_CATCH_SIGNAL, 1,
3297 [Define if you can turn off readline's signal handling.]), )
3300 # End of readline checks: restore LIBS
3301 LIBS=$LIBS_no_readline
3303 AC_MSG_CHECKING(for broken nice())
3304 AC_CACHE_VAL(ac_cv_broken_nice, [
3309 if (val1 != -1 && val1 == nice(2))
3314 ac_cv_broken_nice=yes,
3315 ac_cv_broken_nice=no,
3316 ac_cv_broken_nice=no)])
3317 AC_MSG_RESULT($ac_cv_broken_nice)
3318 if test "$ac_cv_broken_nice" = yes
3320 AC_DEFINE(HAVE_BROKEN_NICE, 1,
3321 [Define if nice() returns success/failure instead of the new priority.])
3324 AC_MSG_CHECKING(for broken poll())
3330 struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
3334 int poll_test = poll (&poll_struct, 1, 0);
3340 else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
3350 ac_cv_broken_poll=yes,
3351 ac_cv_broken_poll=no,
3352 ac_cv_broken_poll=no)
3353 AC_MSG_RESULT($ac_cv_broken_poll)
3354 if test "$ac_cv_broken_poll" = yes
3356 AC_DEFINE(HAVE_BROKEN_POLL, 1,
3357 [Define if poll() sets errno on invalid file descriptors.])
3360 # Before we can test tzset, we need to check if struct tm has a tm_zone
3361 # (which is not required by ISO C or UNIX spec) and/or if we support
3365 # check tzset(3) exists and works like we expect it to
3366 AC_MSG_CHECKING(for working tzset())
3367 AC_CACHE_VAL(ac_cv_working_tzset, [
3374 extern char *tzname[];
3379 /* Note that we need to ensure that not only does tzset(3)
3380 do 'something' with localtime, but it works as documented
3381 in the library reference and as expected by the test suite.
3382 This includes making sure that tzname is set properly if
3383 tm->tm_zone does not exist since it is the alternative way
3384 of getting timezone info.
3386 Red Hat 6.2 doesn't understand the southern hemisphere
3387 after New Year's Day.
3390 time_t groundhogday = 1044144000; /* GMT-based */
3391 time_t midyear = groundhogday + (365 * 24 * 3600 / 2);
3395 if (localtime(&groundhogday)->tm_hour != 0)
3398 /* For UTC, tzname[1] is sometimes "", sometimes " " */
3399 if (strcmp(tzname[0], "UTC") ||
3400 (tzname[1][0] != 0 && tzname[1][0] != ' '))
3404 putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
3406 if (localtime(&groundhogday)->tm_hour != 19)
3409 if (strcmp(tzname[0], "EST") || strcmp(tzname[1], "EDT"))
3413 putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
3415 if (localtime(&groundhogday)->tm_hour != 11)
3418 if (strcmp(tzname[0], "AEST") || strcmp(tzname[1], "AEDT"))
3422 #if HAVE_STRUCT_TM_TM_ZONE
3423 if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
3425 if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
3432 ac_cv_working_tzset=yes,
3433 ac_cv_working_tzset=no,
3434 ac_cv_working_tzset=no)])
3435 AC_MSG_RESULT($ac_cv_working_tzset)
3436 if test "$ac_cv_working_tzset" = yes
3438 AC_DEFINE(HAVE_WORKING_TZSET, 1,
3439 [Define if tzset() actually switches the local timezone in a meaningful way.])
3442 # Look for subsecond timestamps in struct stat
3443 AC_MSG_CHECKING(for tv_nsec in struct stat)
3444 AC_CACHE_VAL(ac_cv_stat_tv_nsec,
3445 AC_TRY_COMPILE([#include <sys/stat.h>], [
3447 st.st_mtim.tv_nsec = 1;
3449 ac_cv_stat_tv_nsec=yes,
3450 ac_cv_stat_tv_nsec=no,
3451 ac_cv_stat_tv_nsec=no))
3452 AC_MSG_RESULT($ac_cv_stat_tv_nsec)
3453 if test "$ac_cv_stat_tv_nsec" = yes
3455 AC_DEFINE(HAVE_STAT_TV_NSEC, 1,
3456 [Define if you have struct stat.st_mtim.tv_nsec])
3459 # Look for BSD style subsecond timestamps in struct stat
3460 AC_MSG_CHECKING(for tv_nsec2 in struct stat)
3461 AC_CACHE_VAL(ac_cv_stat_tv_nsec2,
3462 AC_TRY_COMPILE([#include <sys/stat.h>], [
3464 st.st_mtimespec.tv_nsec = 1;
3466 ac_cv_stat_tv_nsec2=yes,
3467 ac_cv_stat_tv_nsec2=no,
3468 ac_cv_stat_tv_nsec2=no))
3469 AC_MSG_RESULT($ac_cv_stat_tv_nsec2)
3470 if test "$ac_cv_stat_tv_nsec2" = yes
3472 AC_DEFINE(HAVE_STAT_TV_NSEC2, 1,
3473 [Define if you have struct stat.st_mtimensec])
3476 # On HP/UX 11.0, mvwdelch is a block with a return statement
3477 AC_MSG_CHECKING(whether mvwdelch is an expression)
3478 AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,
3479 AC_TRY_COMPILE([#include <curses.h>], [
3481 rtn = mvwdelch(0,0,0);
3482 ], ac_cv_mvwdelch_is_expression=yes,
3483 ac_cv_mvwdelch_is_expression=no,
3484 ac_cv_mvwdelch_is_expression=yes))
3485 AC_MSG_RESULT($ac_cv_mvwdelch_is_expression)
3487 if test "$ac_cv_mvwdelch_is_expression" = yes
3489 AC_DEFINE(MVWDELCH_IS_EXPRESSION, 1,
3490 [Define if mvwdelch in curses.h is an expression.])
3493 AC_MSG_CHECKING(whether WINDOW has _flags)
3494 AC_CACHE_VAL(ac_cv_window_has_flags,
3495 AC_TRY_COMPILE([#include <curses.h>], [
3498 ], ac_cv_window_has_flags=yes,
3499 ac_cv_window_has_flags=no,
3500 ac_cv_window_has_flags=no))
3501 AC_MSG_RESULT($ac_cv_window_has_flags)
3504 if test "$ac_cv_window_has_flags" = yes
3506 AC_DEFINE(WINDOW_HAS_FLAGS, 1,
3507 [Define if WINDOW in curses.h offers a field _flags.])
3510 AC_MSG_CHECKING(for is_term_resized)
3511 AC_TRY_COMPILE([#include <curses.h>], void *x=is_term_resized,
3512 AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_resized' function.)
3517 AC_MSG_CHECKING(for resize_term)
3518 AC_TRY_COMPILE([#include <curses.h>], void *x=resize_term,
3519 AC_DEFINE(HAVE_CURSES_RESIZE_TERM, 1, Define if you have the 'resize_term' function.)
3524 AC_MSG_CHECKING(for resizeterm)
3525 AC_TRY_COMPILE([#include <curses.h>], void *x=resizeterm,
3526 AC_DEFINE(HAVE_CURSES_RESIZETERM, 1, Define if you have the 'resizeterm' function.)
3531 AC_MSG_CHECKING(for /dev/ptmx)
3533 if test -r /dev/ptmx
3536 AC_DEFINE(HAVE_DEV_PTMX, 1,
3537 [Define if we have /dev/ptmx.])
3542 AC_MSG_CHECKING(for /dev/ptc)
3547 AC_DEFINE(HAVE_DEV_PTC, 1,
3548 [Define if we have /dev/ptc.])
3553 AC_MSG_CHECKING(for %zd printf() format support)
3554 AC_TRY_RUN([#include <stdio.h>
3558 #ifdef HAVE_SYS_TYPES_H
3559 #include <sys/types.h>
3563 typedef ssize_t Py_ssize_t;
3564 #elif SIZEOF_VOID_P == SIZEOF_LONG
3565 typedef long Py_ssize_t;
3567 typedef int Py_ssize_t;
3574 if(sprintf(buffer, "%zd", (size_t)123) < 0)
3577 if (strcmp(buffer, "123"))
3580 if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
3583 if (strcmp(buffer, "-123"))
3589 AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
3592 AC_CHECK_TYPE(socklen_t,,
3593 AC_DEFINE(socklen_t,int,
3594 Define to `int' if <sys/socket.h> does not define.),[
3595 #ifdef HAVE_SYS_TYPES_H
3596 #include <sys/types.h>
3598 #ifdef HAVE_SYS_SOCKET_H
3599 #include <sys/socket.h>
3603 AC_SUBST(THREADHEADERS)
3605 for h in `(cd $srcdir;echo Python/thread_*.h)`
3607 THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
3611 SRCDIRS="Parser Grammar Objects Python Modules Mac"
3612 AC_MSG_CHECKING(for build directories)
3613 for dir in $SRCDIRS; do
3614 if test ! -d $dir; then
3620 # generate output files
3621 AC_CONFIG_FILES(Makefile.pre Modules/Setup.config)
3624 echo "creating Modules/Setup"
3625 if test ! -f Modules/Setup
3627 cp $srcdir/Modules/Setup.dist Modules/Setup
3630 echo "creating Modules/Setup.local"
3631 if test ! -f Modules/Setup.local
3633 echo "# Edit this file for local setup changes" >Modules/Setup.local
3636 echo "creating Makefile"
3637 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
3638 -s Modules Modules/Setup.config \
3639 Modules/Setup.local Modules/Setup
3641 case $ac_sys_system in
3645 Support for BeOS is deprecated as of Python 2.6.
3646 See PEP 11 for the gory details.