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.61).
6
# Set VERSION so we only need to edit in one place (i.e., here)
7
m4_define(PYTHON_VERSION, 3.1)
9
AC_REVISION($Revision: 70459 $)
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
# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
61
# certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
63
AC_DEFINE(_DARWIN_C_SOURCE, 1, [Define on Darwin to activate all library features])
66
define_xopen_source=yes
68
# Arguments passed to configure.
70
CONFIG_ARGS="$ac_configure_args"
72
AC_ARG_ENABLE(universalsdk,
73
AC_HELP_STRING(--enable-universalsdk@<:@=SDKDIR@:>@, Build against Mac OS X 10.4u SDK (ppc/i386)),
77
enableval=/Developer/SDKs/MacOSX10.4u.sdk
86
UNIVERSALSDK=$enableval
93
AC_SUBST(UNIVERSALSDK)
96
AC_SUBST(ARCH_RUN_32BIT)
98
UNIVERSAL_ARCHS="32-bit"
99
AC_MSG_CHECKING(for --with-universal-archs)
100
AC_ARG_WITH(universal-archs,
101
AC_HELP_STRING(--with-universal-archs=ARCH, select architectures for universal build ("32-bit", "64-bit" or "all")),
103
AC_MSG_RESULT($withval)
104
UNIVERSAL_ARCHS="$withval"
107
AC_MSG_RESULT(32-bit)
112
AC_ARG_WITH(framework-name,
113
AC_HELP_STRING(--with-framework-name=FRAMEWORK,
114
specify an alternate name of the framework built with --enable-framework),
116
PYTHONFRAMEWORK=${withval}
117
PYTHONFRAMEWORKDIR=${withval}.framework
118
PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr '[A-Z]' '[a-z]'`
120
PYTHONFRAMEWORK=Python
121
PYTHONFRAMEWORKDIR=Python.framework
122
PYTHONFRAMEWORKIDENTIFIER=org.python.python
124
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
125
AC_ARG_ENABLE(framework,
126
AC_HELP_STRING(--enable-framework@<:@=INSTALLDIR@:>@, Build (MacOSX|Darwin) framework),
130
enableval=/Library/Frameworks
135
PYTHONFRAMEWORKDIR=no-framework
136
PYTHONFRAMEWORKPREFIX=
137
PYTHONFRAMEWORKINSTALLDIR=
138
FRAMEWORKINSTALLFIRST=
139
FRAMEWORKINSTALLLAST=
140
FRAMEWORKALTINSTALLFIRST=
141
FRAMEWORKALTINSTALLLAST=
142
if test "x${prefix}" = "xNONE"; then
143
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
145
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
150
PYTHONFRAMEWORKPREFIX=$enableval
151
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
152
FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
153
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
154
if test "$UNIVERSAL_ARCHS" = "all"
156
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkinstallunixtools4way"
158
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
161
if test "x${prefix}" = "xNONE" ; then
162
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
164
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
166
prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
168
# Add files for Mac specific code to the list of output
170
AC_CONFIG_FILES(Mac/Makefile)
171
AC_CONFIG_FILES(Mac/PythonLauncher/Makefile)
172
AC_CONFIG_FILES(Mac/Resources/framework/Info.plist)
173
AC_CONFIG_FILES(Mac/Resources/app/Info.plist)
177
PYTHONFRAMEWORKDIR=no-framework
178
PYTHONFRAMEWORKPREFIX=
179
PYTHONFRAMEWORKINSTALLDIR=
180
FRAMEWORKINSTALLFIRST=
181
FRAMEWORKINSTALLLAST=
182
FRAMEWORKALTINSTALLFIRST=
183
FRAMEWORKALTINSTALLLAST=
184
if test "x${prefix}" = "xNONE" ; then
185
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
187
FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
191
if test "$UNIVERSAL_ARCHS" = "all"
193
FRAMEWORKINSTALLLAST=update4wayuniversal
194
FRAMEWORKALTINSTALLLAST=update4wayuniversal
197
AC_SUBST(PYTHONFRAMEWORK)
198
AC_SUBST(PYTHONFRAMEWORKIDENTIFIER)
199
AC_SUBST(PYTHONFRAMEWORKDIR)
200
AC_SUBST(PYTHONFRAMEWORKPREFIX)
201
AC_SUBST(PYTHONFRAMEWORKINSTALLDIR)
202
AC_SUBST(FRAMEWORKINSTALLFIRST)
203
AC_SUBST(FRAMEWORKINSTALLLAST)
204
AC_SUBST(FRAMEWORKALTINSTALLFIRST)
205
AC_SUBST(FRAMEWORKALTINSTALLLAST)
206
AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
209
## AC_HELP_STRING(--with-dyld,
210
## Use (OpenStep|Rhapsody) dynamic linker))
212
# Set name for machine-dependent library files
214
AC_MSG_CHECKING(MACHDEP)
215
if test -z "$MACHDEP"
217
ac_sys_system=`uname -s`
218
if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
219
-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
220
ac_sys_release=`uname -v`
222
ac_sys_release=`uname -r`
224
ac_md_system=`echo $ac_sys_system |
225
tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
226
ac_md_release=`echo $ac_sys_release |
227
tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
228
MACHDEP="$ac_md_system$ac_md_release"
231
cygwin*) MACHDEP="cygwin";;
232
darwin*) MACHDEP="darwin";;
233
atheos*) MACHDEP="atheos";;
234
irix646) MACHDEP="irix6";;
235
'') MACHDEP="unknown";;
239
# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
240
# disable features if it is defined, without any means to access these
241
# features as extensions. For these systems, we skip the definition of
242
# _XOPEN_SOURCE. Before adding a system to the list to gain access to
243
# some feature, make sure there is no alternative way to access this
244
# feature. Also, when using wildcards, make sure you have verified the
245
# need for not defining _XOPEN_SOURCE on all systems matching the
246
# wildcard, and that the wildcard does not include future systems
247
# (which may remove their limitations).
248
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
249
case $ac_sys_system/$ac_sys_release in
250
# On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
251
# even though select is a POSIX function. Reported by J. Ribbens.
252
# Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
253
OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0123@:>@)
254
define_xopen_source=no
255
# OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
256
# also defined. This can be overridden by defining _BSD_SOURCE
257
# As this has a different meaning on Linux, only define it on OpenBSD
258
AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
260
# Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
261
# _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
263
NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
264
define_xopen_source=no;;
265
# On Solaris 2.6, sys/wait.h is inconsistent in the usage
266
# of union __?sigval. Reported by Stuart Bishop.
268
define_xopen_source=no;;
269
# On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
270
# but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
271
# Reconfirmed for 7.1.4 by Martin v. Loewis.
272
OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
273
define_xopen_source=no;;
274
# On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
275
# but used in struct sockaddr.sa_family. Reported by Tim Rice.
277
define_xopen_source=no;;
278
# On FreeBSD 4, the math functions C89 does not cover are never defined
279
# with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
281
define_xopen_source=no;;
282
# On MacOS X 10.2, a bug in ncurses.h means that it craps out if
283
# _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
284
# identifies itself as Darwin/7.*
285
# On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
286
# disables platform specific features beyond repair.
287
# On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
288
# has no effect, don't bother defining them
289
Darwin/@<:@6789@:>@.*)
290
define_xopen_source=no;;
291
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
292
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
293
# or has another value. By not (re)defining it, the defaults come in place.
295
define_xopen_source=no;;
297
if test `uname -r` -eq 1; then
298
define_xopen_source=no
301
# On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
302
# defining NI_NUMERICHOST.
304
define_xopen_source=no
309
if test $define_xopen_source = yes
311
# On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
312
# defined precisely as g++ defines it
313
# Furthermore, on Solaris 10, XPG6 requires the use of a C99
315
case $ac_sys_system/$ac_sys_release in
316
SunOS/5.8|SunOS/5.9|SunOS/5.10)
317
AC_DEFINE(_XOPEN_SOURCE, 500,
318
Define to the level of X/Open that your system supports)
321
AC_DEFINE(_XOPEN_SOURCE, 600,
322
Define to the level of X/Open that your system supports)
326
# On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
327
# definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
328
# several APIs are not declared. Since this is also needed in some
329
# cases for HP-UX, we define it globally.
330
# except for Solaris 10, where it must not be defined,
331
# as it implies XPG4.2
332
case $ac_sys_system/$ac_sys_release in
336
AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
337
Define to activate Unix95-and-earlier features)
341
AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
346
# SGI compilers allow the specification of the both the ABI and the
347
# ISA on the command line. Depending on the values of these switches,
348
# different and often incompatable code will be generated.
350
# The SGI_ABI variable can be used to modify the CC and LDFLAGS and
351
# thus supply support for various ABI/ISA combinations. The MACHDEP
352
# variable is also adjusted.
355
if test ! -z "$SGI_ABI"
358
LDFLAGS="$SGI_ABI $LDFLAGS"
359
MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
361
AC_MSG_RESULT($MACHDEP)
363
# Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
364
# it may influence the way we can build extensions, so distutils
366
AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
367
AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
368
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
369
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
371
AC_MSG_CHECKING(machine type as reported by uname -m)
372
ac_sys_machine=`uname -m`
373
AC_MSG_RESULT($ac_sys_machine)
375
# checks for alternative programs
377
# compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
378
# for debug/optimization stuff. BASECFLAGS is for flags that are required
379
# just to get things to compile and link. Users are free to override OPT
380
# when running configure or make. The build should not break if they do.
381
# BASECFLAGS should generally not be messed with, however.
383
# XXX shouldn't some/most/all of this code be merged with the stuff later
384
# on that fiddles with OPT and BASECFLAGS?
385
AC_MSG_CHECKING(for --without-gcc)
387
AC_HELP_STRING(--without-gcc,never use gcc),
395
without_gcc=$withval;;
397
case $ac_sys_system in
405
AC_MSG_RESULT($without_gcc)
407
# If the user switches compilers, we can't believe the cache
408
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
410
AC_MSG_ERROR([cached CC is different -- throw away $cache_file
411
(it is also a good idea to do 'make clean' before compiling)])
418
AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
419
AC_ARG_WITH(cxx_main,
420
AC_HELP_STRING([--with-cxx-main=<compiler>],
421
[compile main() and link python executable with C++ compiler]),
427
yes) with_cxx_main=yes
439
AC_MSG_RESULT($with_cxx_main)
445
gcc) AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;;
446
cc) AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;;
448
if test "$CXX" = "notfound"
455
AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
456
if test "$CXX" = "notfound"
461
if test "$preset_cxx" != "$CXX"
465
By default, distutils will build C++ extension modules with "$CXX".
466
If this is not intended, then set CXX on the configure command line.
471
# checks for UNIX variants that set C preprocessor variables
474
# Check for unsupported systems
475
case $ac_sys_system/$ac_sys_release in
477
echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
478
echo See README for details.
483
AC_MSG_CHECKING(for --with-suffix)
485
AC_HELP_STRING(--with-suffix=.exe, set executable suffix),
492
AC_MSG_RESULT($EXEEXT)
494
# Test whether we're running on a non-case-sensitive system, in which
495
# case we give a warning if no ext is given
496
AC_SUBST(BUILDEXEEXT)
497
AC_MSG_CHECKING(for case-insensitive build directory)
498
if test ! -d CaseSensitiveTestDir; then
499
mkdir CaseSensitiveTestDir
502
if test -d casesensitivetestdir
510
rmdir CaseSensitiveTestDir
515
gcc) CC="$CC -D_HAVE_BSDI";;
519
case $ac_sys_system in
522
cc|*/cc) CC="$CC -Ae";;
526
cc) CC="$CC -Wl,-Bexport";;
529
# Some functions have a prototype only with that define, e.g. confstr
530
AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
536
AC_MSG_CHECKING(LIBRARY)
537
if test -z "$LIBRARY"
539
LIBRARY='libpython$(VERSION).a'
541
AC_MSG_RESULT($LIBRARY)
543
# LDLIBRARY is the name of the library to link against (as opposed to the
544
# name of the library into which to insert object files). BLDLIBRARY is also
545
# the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
546
# is blank as the main program is not linked directly against LDLIBRARY.
547
# LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
548
# systems without shared libraries, LDLIBRARY is the same as LIBRARY
549
# (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,
550
# DLLLIBRARY is the shared (i.e., DLL) library.
552
# RUNSHARED is used to run shared python without installed libraries
554
# INSTSONAME is the name of the shared library that will be use to install
555
# on the system - some systems like version suffix, others don't
559
AC_SUBST(LDLIBRARYDIR)
563
BLDLIBRARY='$(LDLIBRARY)'
564
INSTSONAME='$(LDLIBRARY)'
569
# LINKCC is the command that links the python executable -- default is $(CC).
570
# If CXX is set, and if it is needed to link a main function that was
571
# compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
572
# python might then depend on the C++ runtime
573
# This is altered for AIX in order to build the export list before
576
AC_MSG_CHECKING(LINKCC)
579
LINKCC='$(PURIFY) $(MAINCC)'
580
case $ac_sys_system in
583
if test $ac_sys_release -ge 5 -o \
584
$ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then
587
LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
589
LINKCC="$LINKCC -L/usr/lib/ia64l64";;
591
# qcc must be used because the other compilers do not
596
AC_MSG_RESULT($LINKCC)
598
AC_MSG_CHECKING(for --enable-shared)
599
AC_ARG_ENABLE(shared,
600
AC_HELP_STRING(--enable-shared, disable/enable building shared python library))
602
if test -z "$enable_shared"
604
case $ac_sys_system in
606
enable_shared="yes";;
611
AC_MSG_RESULT($enable_shared)
613
AC_MSG_CHECKING(for --enable-profiling)
614
AC_ARG_ENABLE(profiling,
615
AC_HELP_STRING(--enable-profiling, enable C-level code profiling),
618
AC_TRY_RUN([int main() { return 0; }],
619
ac_enable_profiling="yes",
620
ac_enable_profiling="no",
621
ac_enable_profiling="no")
623
AC_MSG_RESULT($ac_enable_profiling)
625
case "$ac_enable_profiling" in
627
BASECFLAGS="-pg $BASECFLAGS"
628
LDFLAGS="-pg $LDFLAGS"
632
AC_MSG_CHECKING(LDLIBRARY)
634
# MacOSX framework builds need more magic. LDLIBRARY is the dynamic
635
# library that we build, but we do not want to link against it (we
636
# will find it with a -framework option). For this reason there is an
637
# extra variable BLDLIBRARY against which Python and the extension
638
# modules are linked, BLDLIBRARY. This is normally the same as
639
# LDLIBRARY, but empty for MacOSX framework builds.
640
if test "$enable_framework"
642
LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
643
RUNSHARED=DYLD_FRAMEWORK_PATH="`pwd`:$DYLD_FRAMEWORK_PATH"
646
BLDLIBRARY='$(LDLIBRARY)'
649
# Other platforms follow
650
if test $enable_shared = "yes"; then
651
AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
652
case $ac_sys_system in
654
LDLIBRARY='libpython$(VERSION).dll.a'
655
DLLLIBRARY='libpython$(VERSION).dll'
658
LDLIBRARY='libpython$(VERSION).so'
659
BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
660
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
661
INSTSONAME="$LDLIBRARY".$SOVERSION
663
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
664
LDLIBRARY='libpython$(VERSION).so'
665
BLDLIBRARY='-L. -lpython$(VERSION)'
666
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
667
case $ac_sys_system in
669
SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
672
INSTSONAME="$LDLIBRARY".$SOVERSION
677
LDLIBRARY='libpython$(VERSION).so'
680
LDLIBRARY='libpython$(VERSION).sl'
683
BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)'
684
RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH}
687
LDLIBRARY='libpython$(VERSION).so'
688
BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
689
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
692
LDLIBRARY='libpython$(VERSION).so'
693
BLDLIBRARY='-L. -lpython$(VERSION)'
694
RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
697
LDLIBRARY='libpython$(VERSION).dylib'
698
BLDLIBRARY='-L. -lpython$(VERSION)'
699
RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
703
else # shared is disabled
704
case $ac_sys_system in
706
BLDLIBRARY='$(LIBRARY)'
707
LDLIBRARY='libpython$(VERSION).dll.a'
712
AC_MSG_RESULT($LDLIBRARY)
716
AC_CHECK_PROGS(AR, ar aal, ar)
719
AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
720
if test $SVNVERSION = found
722
SVNVERSION="svnversion \$(srcdir)"
724
SVNVERSION="echo exported"
729
# install -d does not work on BSDI or HP-UX
730
if test -z "$INSTALL"
732
INSTALL="${srcdir}/install-sh -c"
737
# Not every filesystem supports hard links
739
if test -z "$LN" ; then
740
case $ac_sys_system in
741
CYGWIN*) LN="ln -s";;
742
atheos*) LN="ln -s";;
747
# Check for --with-pydebug
748
AC_MSG_CHECKING(for --with-pydebug)
750
AC_HELP_STRING(--with-pydebug, build with Py_DEBUG defined),
752
if test "$withval" != no
754
AC_DEFINE(Py_DEBUG, 1,
755
[Define if you want to build an interpreter with many run-time checks.])
758
else AC_MSG_RESULT(no); Py_DEBUG='false'
762
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
763
# merged with this chunk of code?
765
# Optimizer/debugger flags
766
# ------------------------
767
# (The following bit of code is complicated enough - please keep things
768
# indented properly. Just pretend you're editing Python code. ;-)
770
# There are two parallel sets of case statements below, one that checks to
771
# see if OPT was set and one that does BASECFLAGS setting based upon
772
# compiler and platform. BASECFLAGS tweaks need to be made even if the
775
# tweak OPT based on compiler and platform, only if the user didn't set
776
# it on the command line
782
if test "$CC" != 'g++' ; then
783
STRICT_PROTO="-Wstrict-prototypes"
785
# For gcc 4.x we need to use -fwrapv so lets check if its supported
786
if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
789
case $ac_cv_prog_cc_g in
791
if test "$Py_DEBUG" = 'true' ; then
792
# Optimization messes up debuggers, so turn it off for
794
OPT="-g -Wall $STRICT_PROTO"
796
OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
800
OPT="-O3 -Wall $STRICT_PROTO"
803
case $ac_sys_system in
804
SCO_SV*) OPT="$OPT -m486 -DSCO5"
814
# The current (beta) Monterey compiler dies with optimizations
815
# XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
816
case $ac_sys_system in
826
# The -arch flags for universal builds on OSX
827
UNIVERSAL_ARCH_FLAGS=
828
AC_SUBST(UNIVERSAL_ARCH_FLAGS)
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.
869
if test "${enable_universalsdk}"; then
870
UNIVERSAL_ARCH_FLAGS=""
871
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
872
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
875
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
876
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
878
elif test "$UNIVERSAL_ARCHS" = "all" ; then
879
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
880
ARCH_RUN_32BIT="arch -i386 -ppc"
883
AC_MSG_ERROR([proper usage is --with-universalarch=32-bit|64-bit|all])
888
BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
889
tgt=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
890
if test "${UNIVERSALSDK}" != "/" -a "${tgt}" '>' '10.4' ; then
891
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
895
# Calculate the right deployment target for this build.
897
cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
898
if test ${cur_target} '>' 10.2; then
901
if test "${UNIVERSAL_ARCHS}" = "all"; then
902
# Ensure that the default platform for a 4-way
903
# universal build is OSX 10.5, that's the first
904
# OS release where 4-way builds make sense.
907
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
909
# Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
910
# environment with a value that is the same as what we'll use
911
# in the Makefile to ensure that we'll get the same compiler
912
# environment during configure and build time.
913
MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
914
export MACOSX_DEPLOYMENT_TARGET
915
EXPORT_MACOSX_DEPLOYMENT_TARGET=''
919
BASECFLAGS="$BASECFLAGS -mieee"
925
case $ac_sys_system in
927
BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
930
BASECFLAGS="$BASECFLAGS -ieee -std"
933
BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
939
if test "$Py_DEBUG" = 'true'; then
945
if test "$ac_arch_flags"
947
BASECFLAGS="$BASECFLAGS $ac_arch_flags"
950
# disable check for icc since it seems to pass, but generates a warning
953
ac_cv_opt_olimit_ok=no
956
AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
957
AC_CACHE_VAL(ac_cv_opt_olimit_ok,
959
CC="$CC -OPT:Olimit=0"
960
AC_TRY_RUN([int main() { return 0; }],
961
ac_cv_opt_olimit_ok=yes,
962
ac_cv_opt_olimit_ok=no,
963
ac_cv_opt_olimit_ok=no)
965
AC_MSG_RESULT($ac_cv_opt_olimit_ok)
966
if test $ac_cv_opt_olimit_ok = yes; then
967
case $ac_sys_system in
968
# XXX is this branch needed? On MacOSX 10.2.2 the result of the
969
# olimit_ok test is "no". Is it "yes" in some other Darwin-esque
974
BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
978
AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
979
AC_CACHE_VAL(ac_cv_olimit_ok,
981
CC="$CC -Olimit 1500"
982
AC_TRY_RUN([int main() { return 0; }],
987
AC_MSG_RESULT($ac_cv_olimit_ok)
988
if test $ac_cv_olimit_ok = yes; then
989
BASECFLAGS="$BASECFLAGS -Olimit 1500"
993
# Check whether GCC supports PyArg_ParseTuple format
994
if test "$GCC" = "yes"
996
AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
998
CFLAGS="$CFLAGS -Werror"
1000
void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
1002
AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1, [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
1009
# On some compilers, pthreads are available without further options
1010
# (e.g. MacOS X). On some of these systems, the compiler will not
1011
# complain if unaccepted options are passed (e.g. gcc on Mac OS X).
1012
# So we have to see first whether pthreads are available without
1013
# options before we can check whether -Kpthread improves anything.
1014
AC_MSG_CHECKING(whether pthreads are available without options)
1015
AC_CACHE_VAL(ac_cv_pthread_is_default,
1017
#include <pthread.h>
1019
void* routine(void* p){return NULL;}
1023
if(pthread_create(&p,NULL,routine,NULL)!=0)
1025
(void)pthread_detach(p);
1030
ac_cv_pthread_is_default=yes
1034
ac_cv_pthread_is_default=no,
1035
ac_cv_pthread_is_default=no)
1037
AC_MSG_RESULT($ac_cv_pthread_is_default)
1040
if test $ac_cv_pthread_is_default = yes
1044
# -Kpthread, if available, provides the right #defines
1045
# and linker options to make pthread_create available
1046
# Some compilers won't report that they do not support -Kpthread,
1047
# so we need to run a program to see whether it really made the
1048
# function available.
1049
AC_MSG_CHECKING(whether $CC accepts -Kpthread)
1050
AC_CACHE_VAL(ac_cv_kpthread,
1054
#include <pthread.h>
1056
void* routine(void* p){return NULL;}
1060
if(pthread_create(&p,NULL,routine,NULL)!=0)
1062
(void)pthread_detach(p);
1070
AC_MSG_RESULT($ac_cv_kpthread)
1073
if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
1075
# -Kthread, if available, provides the right #defines
1076
# and linker options to make pthread_create available
1077
# Some compilers won't report that they do not support -Kthread,
1078
# so we need to run a program to see whether it really made the
1079
# function available.
1080
AC_MSG_CHECKING(whether $CC accepts -Kthread)
1081
AC_CACHE_VAL(ac_cv_kthread,
1085
#include <pthread.h>
1087
void* routine(void* p){return NULL;}
1091
if(pthread_create(&p,NULL,routine,NULL)!=0)
1093
(void)pthread_detach(p);
1101
AC_MSG_RESULT($ac_cv_kthread)
1104
if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
1106
# -pthread, if available, provides the right #defines
1107
# and linker options to make pthread_create available
1108
# Some compilers won't report that they do not support -pthread,
1109
# so we need to run a program to see whether it really made the
1110
# function available.
1111
AC_MSG_CHECKING(whether $CC accepts -pthread)
1112
AC_CACHE_VAL(ac_cv_thread,
1116
#include <pthread.h>
1118
void* routine(void* p){return NULL;}
1122
if(pthread_create(&p,NULL,routine,NULL)!=0)
1124
(void)pthread_detach(p);
1132
AC_MSG_RESULT($ac_cv_pthread)
1135
# If we have set a CC compiler flag for thread support then
1136
# check if it works for CXX, too.
1140
AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
1143
if test "$ac_cv_kpthread" = "yes"
1145
CXX="$CXX -Kpthread"
1146
ac_cv_cxx_thread=yes
1147
elif test "$ac_cv_kthread" = "yes"
1150
ac_cv_cxx_thread=yes
1151
elif test "$ac_cv_pthread" = "yes"
1154
ac_cv_cxx_thread=yes
1157
if test $ac_cv_cxx_thread = yes
1159
echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext
1160
$CXX -c conftest.$ac_ext 2>&5
1161
if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
1162
&& test -s conftest$ac_exeext && ./conftest$ac_exeext
1164
ac_cv_cxx_thread=yes
1170
AC_MSG_RESULT($ac_cv_cxx_thread)
1174
dnl # check for ANSI or K&R ("traditional") preprocessor
1175
dnl AC_MSG_CHECKING(for C preprocessor type)
1176
dnl AC_TRY_COMPILE([
1177
dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
1179
dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
1180
dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional)
1181
dnl AC_MSG_RESULT($cpp_type)
1183
# checks for header files
1185
AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
1187
ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
1188
shadow.h signal.h stdint.h stropts.h termios.h thread.h \
1190
sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
1191
sys/lock.h sys/mkdev.h sys/modem.h \
1192
sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
1193
sys/termio.h sys/time.h \
1194
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
1195
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
1196
bluetooth/bluetooth.h linux/tipc.h)
1200
# On Solaris, term.h requires curses.h
1201
AC_CHECK_HEADERS(term.h,,,[
1202
#ifdef HAVE_CURSES_H
1207
# On Linux, netlink.h requires asm/types.h
1208
AC_CHECK_HEADERS(linux/netlink.h,,,[
1209
#ifdef HAVE_ASM_TYPES_H
1210
#include <asm/types.h>
1212
#ifdef HAVE_SYS_SOCKET_H
1213
#include <sys/socket.h>
1217
# checks for typedefs
1219
AC_MSG_CHECKING(for clock_t in time.h)
1220
AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
1221
AC_DEFINE(clock_t, long, [Define to 'long' if <time.h> doesn't define.])
1223
AC_MSG_RESULT($was_it_defined)
1225
# Check whether using makedev requires defining _OSF_SOURCE
1226
AC_MSG_CHECKING(for makedev)
1227
AC_TRY_LINK([#include <sys/types.h> ],
1229
ac_cv_has_makedev=yes,
1230
ac_cv_has_makedev=no)
1231
if test "$ac_cv_has_makedev" = "no"; then
1232
# we didn't link, try if _OSF_SOURCE will allow us to link
1234
#define _OSF_SOURCE 1
1235
#include <sys/types.h>
1238
ac_cv_has_makedev=yes,
1239
ac_cv_has_makedev=no)
1240
if test "$ac_cv_has_makedev" = "yes"; then
1241
AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
1244
AC_MSG_RESULT($ac_cv_has_makedev)
1245
if test "$ac_cv_has_makedev" = "yes"; then
1246
AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
1249
# Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in
1250
# the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are
1251
# defined, but the compiler does not support pragma redefine_extname,
1252
# and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit
1253
# structures (such as rlimit64) without declaring them. As a
1254
# work-around, disable LFS on such configurations
1257
AC_MSG_CHECKING(Solaris LFS bug)
1259
#define _LARGEFILE_SOURCE 1
1260
#define _FILE_OFFSET_BITS 64
1261
#include <sys/resource.h>
1262
],struct rlimit foo;,sol_lfs_bug=no,sol_lfs_bug=yes)
1263
AC_MSG_RESULT($sol_lfs_bug)
1264
if test "$sol_lfs_bug" = "yes"; then
1268
if test "$use_lfs" = "yes"; then
1269
# Two defines needed to enable largefile support on various platforms
1270
# These may affect some typedefs
1271
AC_DEFINE(_LARGEFILE_SOURCE, 1,
1272
[This must be defined on some systems to enable large file support.])
1273
AC_DEFINE(_FILE_OFFSET_BITS, 64,
1274
[This must be set to 64 on some systems to enable large file support.])
1277
# Add some code to confdefs.h so that the test for off_t works on SCO
1278
cat >> confdefs.h <<\EOF
1284
# Type availability checks
1295
AC_CHECK_TYPE(ssize_t,
1296
AC_DEFINE(HAVE_SSIZE_T, 1, Define if your compiler provides ssize_t),,)
1298
# Sizes of various common basic types
1299
# ANSI C requires sizeof(char) == 1, so no need to check it
1300
AC_CHECK_SIZEOF(int, 4)
1301
AC_CHECK_SIZEOF(long, 4)
1302
AC_CHECK_SIZEOF(void *, 4)
1303
AC_CHECK_SIZEOF(short, 2)
1304
AC_CHECK_SIZEOF(float, 4)
1305
AC_CHECK_SIZEOF(double, 8)
1306
AC_CHECK_SIZEOF(fpos_t, 4)
1307
AC_CHECK_SIZEOF(size_t, 4)
1308
AC_CHECK_SIZEOF(pid_t, 4)
1310
AC_MSG_CHECKING(for long long support)
1312
AC_TRY_COMPILE([], [long long x; x = (long long)0;], [
1313
AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
1316
AC_MSG_RESULT($have_long_long)
1317
if test "$have_long_long" = yes ; then
1318
AC_CHECK_SIZEOF(long long, 8)
1321
AC_MSG_CHECKING(for long double support)
1323
AC_TRY_COMPILE([], [long double x; x = (long double)0;], [
1324
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
1325
have_long_double=yes
1327
AC_MSG_RESULT($have_long_double)
1328
if test "$have_long_double" = yes ; then
1329
AC_CHECK_SIZEOF(long double, 16)
1333
AC_MSG_CHECKING(for _Bool support)
1335
AC_TRY_COMPILE([], [_Bool x; x = (_Bool)0;], [
1336
AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.])
1339
AC_MSG_RESULT($have_c99_bool)
1340
if test "$have_c99_bool" = yes ; then
1341
AC_CHECK_SIZEOF(_Bool, 1)
1344
AC_CHECK_TYPES(uintptr_t,
1345
[AC_CHECK_SIZEOF(uintptr_t, 4)],
1346
[], [#ifdef HAVE_STDINT_H
1351
# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
1352
AC_MSG_CHECKING(size of off_t)
1353
AC_CACHE_VAL(ac_cv_sizeof_off_t,
1354
[AC_TRY_RUN([#include <stdio.h>
1355
#include <sys/types.h>
1358
FILE *f=fopen("conftestval", "w");
1360
fprintf(f, "%d\n", sizeof(off_t));
1363
ac_cv_sizeof_off_t=`cat conftestval`,
1364
ac_cv_sizeof_off_t=0,
1365
ac_cv_sizeof_off_t=4)
1367
AC_MSG_RESULT($ac_cv_sizeof_off_t)
1368
AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
1369
[The number of bytes in an off_t.])
1371
AC_MSG_CHECKING(whether to enable large file support)
1372
if test "$have_long_long" = yes -a \
1373
"$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
1374
"$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
1375
AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
1376
[Defined to enable large file support when an off_t is bigger than a long
1377
and long long is available and at least as big as an off_t. You may need
1378
to add some flags for configuration and compilation to enable this mode.
1379
(For Solaris and Linux, the necessary defines are already defined.)])
1385
# AC_CHECK_SIZEOF() doesn't include <time.h>.
1386
AC_MSG_CHECKING(size of time_t)
1387
AC_CACHE_VAL(ac_cv_sizeof_time_t,
1388
[AC_TRY_RUN([#include <stdio.h>
1392
FILE *f=fopen("conftestval", "w");
1394
fprintf(f, "%d\n", sizeof(time_t));
1397
ac_cv_sizeof_time_t=`cat conftestval`,
1398
ac_cv_sizeof_time_t=0,
1399
ac_cv_sizeof_time_t=4)
1401
AC_MSG_RESULT($ac_cv_sizeof_time_t)
1402
AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
1403
[The number of bytes in a time_t.])
1406
# if have pthread_t then define SIZEOF_PTHREAD_T
1408
if test "$ac_cv_kpthread" = "yes"
1409
then CC="$CC -Kpthread"
1410
elif test "$ac_cv_kthread" = "yes"
1411
then CC="$CC -Kthread"
1412
elif test "$ac_cv_pthread" = "yes"
1413
then CC="$CC -pthread"
1415
AC_MSG_CHECKING(for pthread_t)
1417
AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
1418
AC_MSG_RESULT($have_pthread_t)
1419
if test "$have_pthread_t" = yes ; then
1420
# AC_CHECK_SIZEOF() doesn't include <pthread.h>.
1421
AC_MSG_CHECKING(size of pthread_t)
1422
AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
1423
[AC_TRY_RUN([#include <stdio.h>
1424
#include <pthread.h>
1427
FILE *f=fopen("conftestval", "w");
1429
fprintf(f, "%d\n", sizeof(pthread_t));
1432
ac_cv_sizeof_pthread_t=`cat conftestval`,
1433
ac_cv_sizeof_pthread_t=0,
1434
ac_cv_sizeof_pthread_t=4)
1436
AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
1437
AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
1438
[The number of bytes in a pthread_t.])
1444
AC_SUBST(OTHER_LIBTOOL_OPT)
1445
case $ac_sys_system/$ac_sys_release in
1446
Darwin/@<:@01567@:>@\..*)
1447
OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
1450
OTHER_LIBTOOL_OPT=""
1454
AC_SUBST(LIBTOOL_CRUFT)
1455
case $ac_sys_system/$ac_sys_release in
1456
Darwin/@<:@01567@:>@\..*)
1457
LIBTOOL_CRUFT="-framework System -lcc_dynamic"
1458
if test "${enable_universalsdk}"; then
1461
LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
1463
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1464
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
1466
gcc_version=`gcc -v 2>&1 | grep version | cut -d\ -f3`
1467
if test ${gcc_version} '<' 4.0
1469
LIBTOOL_CRUFT="-lcc_dynamic"
1473
LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
1474
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1475
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
1478
AC_MSG_CHECKING(for --enable-framework)
1479
if test "$enable_framework"
1481
BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
1482
# -F. is needed to allow linking to the framework while
1483
# in the build location.
1484
AC_DEFINE(WITH_NEXT_FRAMEWORK, 1,
1485
[Define if you want to produce an OpenStep/Rhapsody framework
1486
(shared library plus accessory files).])
1492
AC_MSG_CHECKING(for dyld)
1493
case $ac_sys_system/$ac_sys_release in
1495
AC_DEFINE(WITH_DYLD, 1,
1496
[Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
1497
dynamic linker (dyld) instead of the old-style (NextStep) dynamic
1498
linker (rld). Dyld is necessary to support frameworks.])
1499
AC_MSG_RESULT(always on for Darwin)
1506
# Set info about shared libraries.
1511
AC_SUBST(LINKFORSHARED)
1512
# SO is the extension of shared libraries `(including the dot!)
1513
# -- usually .so, .sl on HP-UX, .dll on Cygwin
1517
case $ac_sys_system in
1528
# this might also be a termcap variable, see #610332
1530
echo '====================================================================='
1532
echo '+ WARNING: You have set SO in your environment. +'
1533
echo '+ Do you really mean to change the extension for shared libraries? +'
1534
echo '+ Continuing in 10 seconds to let you to ponder. +'
1536
echo '====================================================================='
1541
AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
1542
# LDSHARED is the ld *command* used to create shared library
1543
# -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
1544
# (Shared libraries in this instance are shared modules to be loaded into
1545
# Python, as opposed to building Python itself as a shared library.)
1546
AC_MSG_CHECKING(LDSHARED)
1547
if test -z "$LDSHARED"
1549
case $ac_sys_system/$ac_sys_release in
1551
BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
1552
LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
1554
IRIX/5*) LDSHARED="ld -shared";;
1555
IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
1557
if test "$GCC" = "yes"
1558
then LDSHARED='$(CC) -shared'
1559
else LDSHARED='$(CC) -G';
1562
if test "$GCC" = "yes"
1563
then LDSHARED='$(CC) -shared'
1564
else LDSHARED='ld -b';
1566
OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
1568
LDSHARED='$(CC) $(LDFLAGS) -bundle'
1569
if test "$enable_framework" ; then
1570
# Link against the framework. All externals should be defined.
1571
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1572
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1574
# No framework. Ignore undefined symbols, assuming they come from Python
1575
LDSHARED="$LDSHARED -undefined suppress"
1577
Darwin/1.4*|Darwin/5.*|Darwin/6.*)
1578
LDSHARED='$(CC) $(LDFLAGS) -bundle'
1579
if test "$enable_framework" ; then
1580
# Link against the framework. All externals should be defined.
1581
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1582
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1584
# No framework, use the Python app as bundle-loader
1585
BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
1586
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
1589
# Use -undefined dynamic_lookup whenever possible (10.3 and later).
1590
# This allows an extension to be used in any Python
1592
if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
1594
if test "${enable_universalsdk}"; then
1595
LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
1597
LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
1598
BLDSHARED="$LDSHARED"
1600
LDSHARED='$(CC) $(LDFLAGS) -bundle'
1601
if test "$enable_framework" ; then
1602
# Link against the framework. All externals should be defined.
1603
BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1604
LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1606
# No framework, use the Python app as bundle-loader
1607
BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
1608
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
1612
Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
1613
BSD/OS*/4*) LDSHARED="gcc -shared";;
1615
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
1617
LDSHARED="$CC -shared ${LDFLAGS}"
1619
LDSHARED="ld -Bshareable ${LDFLAGS}"
1622
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
1624
LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
1627
[[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
1628
LDSHARED="ld -Bshareable ${LDFLAGS}"
1631
LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
1635
NetBSD*|DragonFly*) LDSHARED="cc -shared ${LDFLAGS}";;
1636
OpenUNIX*|UnixWare*)
1637
if test "$GCC" = "yes"
1638
then LDSHARED='$(CC) -shared'
1639
else LDSHARED='$(CC) -G'
1641
SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
1642
Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
1643
CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
1644
atheos*) LDSHARED="gcc -shared";;
1648
AC_MSG_RESULT($LDSHARED)
1649
BLDSHARED=${BLDSHARED-$LDSHARED}
1650
# CCSHARED are the C *flags* used to create objects to go into a shared
1651
# library (module) -- this is only needed for a few systems
1652
AC_MSG_CHECKING(CCSHARED)
1653
if test -z "$CCSHARED"
1655
case $ac_sys_system/$ac_sys_release in
1656
SunOS*) if test "$GCC" = yes;
1657
then CCSHARED="-fPIC";
1658
elif test `uname -p` = sparc;
1659
then CCSHARED="-xcode=pic32";
1660
else CCSHARED="-Kpic";
1662
hp*|HP*) if test "$GCC" = yes;
1663
then CCSHARED="-fPIC";
1666
Linux*|GNU*) CCSHARED="-fPIC";;
1667
BSD/OS*/4*) CCSHARED="-fpic";;
1668
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
1669
OpenUNIX*|UnixWare*)
1670
if test "$GCC" = "yes"
1671
then CCSHARED="-fPIC"
1672
else CCSHARED="-KPIC"
1675
if test "$GCC" = "yes"
1676
then CCSHARED="-fPIC"
1677
else CCSHARED="-Kpic -belf"
1679
Monterey*) CCSHARED="-G";;
1680
IRIX*/6*) case $CC in
1681
*gcc*) CCSHARED="-shared";;
1684
atheos*) CCSHARED="-fPIC";;
1687
AC_MSG_RESULT($CCSHARED)
1688
# LINKFORSHARED are the flags passed to the $(CC) command that links
1689
# the python executable -- this is only needed for a few systems
1690
AC_MSG_CHECKING(LINKFORSHARED)
1691
if test -z "$LINKFORSHARED"
1693
case $ac_sys_system/$ac_sys_release in
1694
AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
1696
LINKFORSHARED="-Wl,-E -Wl,+s";;
1697
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
1698
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
1699
Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
1700
# -u libsys_s pulls in all symbols in libsys
1702
# -u _PyMac_Error is needed to pull in the mac toolbox glue,
1704
# not used by the core itself but which needs to be in the core so
1705
# that dynamically loaded extension modules have access to it.
1706
# -prebind is no longer used, because it actually seems to give a
1707
# slowdown in stead of a speedup, maybe due to the large number of
1708
# dynamic loads Python does.
1710
LINKFORSHARED="$extra_undefs"
1711
if test "$enable_framework"
1713
LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1715
LINKFORSHARED="$LINKFORSHARED";;
1716
OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
1717
SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
1718
ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
1719
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*)
1720
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
1722
LINKFORSHARED="-Wl,--export-dynamic"
1724
SunOS/5*) case $CC in
1726
if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
1728
LINKFORSHARED="-Xlinker --export-dynamic"
1732
if test $enable_shared = "no"
1734
LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
1737
# -Wl,-E causes the symbols to be added to the dynamic
1738
# symbol table so that they can be found when a module
1739
# is loaded. -N 2048K causes the stack size to be set
1740
# to 2048 kilobytes so that the stack doesn't overflow
1741
# when running test_compile.py.
1742
LINKFORSHARED='-Wl,-E -N 2048K';;
1745
AC_MSG_RESULT($LINKFORSHARED)
1748
AC_SUBST(CFLAGSFORSHARED)
1749
AC_MSG_CHECKING(CFLAGSFORSHARED)
1750
if test ! "$LIBRARY" = "$LDLIBRARY"
1752
case $ac_sys_system in
1754
# Cygwin needs CCSHARED when building extension DLLs
1755
# but not when building the interpreter DLL.
1756
CFLAGSFORSHARED='';;
1758
CFLAGSFORSHARED='$(CCSHARED)'
1761
AC_MSG_RESULT($CFLAGSFORSHARED)
1763
# SHLIBS are libraries (except -lc and -lm) to link to the python shared
1764
# library (with --enable-shared).
1765
# For platforms on which shared libraries are not allowed to have unresolved
1766
# symbols, this must be set to $(LIBS) (expanded by make). We do this even
1767
# if it is not required, since it creates a dependency of the shared library
1768
# to LIBS. This, in turn, means that applications linking the shared libpython
1769
# don't need to link LIBS explicitly. The default should be only changed
1770
# on systems where this approach causes problems.
1772
AC_MSG_CHECKING(SHLIBS)
1773
case "$ac_sys_system" in
1777
AC_MSG_RESULT($SHLIBS)
1780
# checks for libraries
1781
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
1782
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
1784
# only check for sem_init if thread support is requested
1785
if test "$with_threads" = "yes" -o -z "$with_threads"; then
1786
AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
1787
# posix4 on Solaris 2.6
1788
# pthread (first!) on Linux
1791
# check if we need libintl for locale functions
1792
AC_CHECK_LIB(intl, textdomain,
1793
AC_DEFINE(WITH_LIBINTL, 1,
1794
[Define to 1 if libintl is needed for locale functions.]))
1796
# checks for system dependent C++ extensions support
1797
case "$ac_sys_system" in
1798
AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support)
1799
AC_TRY_LINK([#include "/usr/lpp/xlC/include/load.h"],
1800
[loadAndInit("", 0, "")],
1801
[AC_DEFINE(AIX_GENUINE_CPLUSPLUS, 1,
1802
[Define for AIX if your compiler is a genuine IBM xlC/xlC_r
1803
and you want support for AIX C++ shared extension modules.])
1804
AC_MSG_RESULT(yes)],
1805
[AC_MSG_RESULT(no)]);;
1809
# Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
1810
AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
1811
AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
1813
AC_MSG_CHECKING(for --with-libs)
1815
AC_HELP_STRING(--with-libs='lib1 ...', link against additional libs),
1817
AC_MSG_RESULT($withval)
1818
LIBS="$withval $LIBS"
1820
[AC_MSG_RESULT(no)])
1822
# Check for use of the system libffi library
1823
AC_MSG_CHECKING(for --with-system-ffi)
1824
AC_ARG_WITH(system_ffi,
1825
AC_HELP_STRING(--with-system-ffi, build _ctypes module using an installed ffi library))
1827
AC_MSG_RESULT($with_system_ffi)
1829
# Determine if signalmodule should be used.
1830
AC_SUBST(USE_SIGNAL_MODULE)
1831
AC_SUBST(SIGNAL_OBJS)
1832
AC_MSG_CHECKING(for --with-signal-module)
1833
AC_ARG_WITH(signal-module,
1834
AC_HELP_STRING(--with-signal-module, disable/enable signal module))
1836
if test -z "$with_signal_module"
1837
then with_signal_module="yes"
1839
AC_MSG_RESULT($with_signal_module)
1841
if test "${with_signal_module}" = "yes"; then
1842
USE_SIGNAL_MODULE=""
1845
USE_SIGNAL_MODULE="#"
1846
SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o"
1849
# This is used to generate Setup.config
1850
AC_SUBST(USE_THREAD_MODULE)
1851
USE_THREAD_MODULE=""
1853
AC_MSG_CHECKING(for --with-dec-threads)
1855
AC_ARG_WITH(dec-threads,
1856
AC_HELP_STRING(--with-dec-threads, use DEC Alpha/OSF1 thread-safe libraries),
1858
AC_MSG_RESULT($withval)
1860
if test "${with_thread+set}" != set; then
1861
with_thread="$withval";
1863
[AC_MSG_RESULT(no)])
1865
# Templates for things AC_DEFINEd more than once.
1866
# For a single AC_DEFINE, no template is needed.
1867
AH_TEMPLATE(C_THREADS,[Define if you have the Mach cthreads package])
1868
AH_TEMPLATE(_REENTRANT,
1869
[Define to force use of thread-safe errno, h_errno, and other functions])
1870
AH_TEMPLATE(WITH_THREAD,
1871
[Define if you want to compile in rudimentary thread support])
1873
AC_MSG_CHECKING(for --with-threads)
1874
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
1875
AC_ARG_WITH(threads,
1876
AC_HELP_STRING(--with(out)-threads@<:@=DIRECTORY@:>@, disable/enable thread support))
1878
# --with-thread is deprecated, but check for it anyway
1879
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
1881
AC_HELP_STRING(--with(out)-thread@<:@=DIRECTORY@:>@, deprecated; use --with(out)-threads),
1882
[with_threads=$with_thread])
1884
if test -z "$with_threads"
1885
then with_threads="yes"
1887
AC_MSG_RESULT($with_threads)
1890
if test "$with_threads" = "no"
1892
USE_THREAD_MODULE="#"
1893
elif test "$ac_cv_pthread_is_default" = yes
1895
AC_DEFINE(WITH_THREAD)
1896
# Defining _REENTRANT on system with POSIX threads should not hurt.
1897
AC_DEFINE(_REENTRANT)
1899
THREADOBJ="Python/thread.o"
1900
elif test "$ac_cv_kpthread" = "yes"
1903
if test "$ac_cv_cxx_thread" = "yes"; then
1904
CXX="$CXX -Kpthread"
1906
AC_DEFINE(WITH_THREAD)
1908
THREADOBJ="Python/thread.o"
1909
elif test "$ac_cv_kthread" = "yes"
1912
if test "$ac_cv_cxx_thread" = "yes"; then
1915
AC_DEFINE(WITH_THREAD)
1917
THREADOBJ="Python/thread.o"
1918
elif test "$ac_cv_pthread" = "yes"
1921
if test "$ac_cv_cxx_thread" = "yes"; then
1924
AC_DEFINE(WITH_THREAD)
1926
THREADOBJ="Python/thread.o"
1928
if test ! -z "$with_threads" -a -d "$with_threads"
1929
then LDFLAGS="$LDFLAGS -L$with_threads"
1931
if test ! -z "$withval" -a -d "$withval"
1932
then LDFLAGS="$LDFLAGS -L$withval"
1935
# According to the POSIX spec, a pthreads implementation must
1936
# define _POSIX_THREADS in unistd.h. Some apparently don't
1937
# (e.g. gnu pth with pthread emulation)
1938
AC_MSG_CHECKING(for _POSIX_THREADS in unistd.h)
1942
#ifdef _POSIX_THREADS
1945
], unistd_defines_pthreads=yes, unistd_defines_pthreads=no)
1946
AC_MSG_RESULT($unistd_defines_pthreads)
1948
AC_DEFINE(_REENTRANT)
1949
AC_CHECK_HEADER(cthreads.h, [AC_DEFINE(WITH_THREAD)
1950
AC_DEFINE(C_THREADS)
1951
AC_DEFINE(HURD_C_THREADS, 1,
1952
[Define if you are using Mach cthreads directly under /include])
1953
LIBS="$LIBS -lthreads"
1954
THREADOBJ="Python/thread.o"],[
1955
AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
1956
AC_DEFINE(C_THREADS)
1957
AC_DEFINE(MACH_C_THREADS, 1,
1958
[Define if you are using Mach cthreads under mach /])
1959
THREADOBJ="Python/thread.o"],[
1960
AC_MSG_CHECKING(for --with-pth)
1962
AC_HELP_STRING(--with-pth, use GNU pth threading libraries),
1963
[AC_MSG_RESULT($withval)
1964
AC_DEFINE([WITH_THREAD])
1965
AC_DEFINE([HAVE_PTH], 1,
1966
[Define if you have GNU PTH threads.])
1968
THREADOBJ="Python/thread.o"],
1971
# Just looking for pthread_create in libpthread is not enough:
1972
# on HP/UX, pthread.h renames pthread_create to a different symbol name.
1973
# So we really have to include pthread.h, and then link.
1975
LIBS="$LIBS -lpthread"
1976
AC_MSG_CHECKING([for pthread_create in -lpthread])
1977
AC_TRY_LINK([#include <pthread.h>
1979
void * start_routine (void *arg) { exit (0); }], [
1980
pthread_create (NULL, NULL, start_routine, NULL)], [
1982
AC_DEFINE(WITH_THREAD)
1984
THREADOBJ="Python/thread.o"],[
1986
AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
1988
THREADOBJ="Python/thread.o"],[
1989
AC_CHECK_HEADER(atheos/threads.h, [AC_DEFINE(WITH_THREAD)
1990
AC_DEFINE(ATHEOS_THREADS, 1,
1991
[Define this if you have AtheOS threads.])
1992
THREADOBJ="Python/thread.o"],[
1993
AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
1995
LIBS="$LIBS -lpthreads"
1996
THREADOBJ="Python/thread.o"], [
1997
AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
2000
THREADOBJ="Python/thread.o"], [
2001
AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
2003
LIBS="$LIBS -lpthread"
2004
THREADOBJ="Python/thread.o"], [
2005
AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
2008
THREADOBJ="Python/thread.o"],[
2009
USE_THREAD_MODULE="#"])
2012
AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
2014
THREADOBJ="Python/thread.o"
2015
USE_THREAD_MODULE=""])
2017
if test "$posix_threads" != "yes"; then
2018
AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
2019
LIBS="$LIBS -lthread"
2020
THREADOBJ="Python/thread.o"
2021
USE_THREAD_MODULE=""])
2024
if test "$USE_THREAD_MODULE" != "#"
2026
# If the above checks didn't disable threads, (at least) OSF1
2027
# needs this '-threads' argument during linking.
2028
case $ac_sys_system in
2029
OSF1) LDLAST=-threads;;
2034
if test "$posix_threads" = "yes"; then
2035
if test "$unistd_defines_pthreads" = "no"; then
2036
AC_DEFINE(_POSIX_THREADS, 1,
2037
[Define if you have POSIX threads,
2038
and your system does not define that.])
2041
# Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
2042
case $ac_sys_system/$ac_sys_release in
2043
SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1,
2044
Defined for Solaris 2.6 bug in pthread header.)
2046
SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
2047
Define if the Posix semaphores do not work on your system)
2049
AIX/5) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
2050
Define if the Posix semaphores do not work on your system)
2054
AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
2055
AC_CACHE_VAL(ac_cv_pthread_system_supported,
2056
[AC_TRY_RUN([#include <pthread.h>
2057
void *foo(void *parm) {
2061
pthread_attr_t attr;
2063
if (pthread_attr_init(&attr)) exit(-1);
2064
if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
2065
if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
2068
ac_cv_pthread_system_supported=yes,
2069
ac_cv_pthread_system_supported=no,
2070
ac_cv_pthread_system_supported=no)
2072
AC_MSG_RESULT($ac_cv_pthread_system_supported)
2073
if test "$ac_cv_pthread_system_supported" = "yes"; then
2074
AC_DEFINE(PTHREAD_SYSTEM_SCHED_SUPPORTED, 1, [Defined if PTHREAD_SCOPE_SYSTEM supported.])
2076
AC_CHECK_FUNCS(pthread_sigmask,
2077
[case $ac_sys_system in
2079
AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1,
2080
[Define if pthread_sigmask() does not work on your system.])
2086
# Check for enable-ipv6
2087
AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
2088
AC_MSG_CHECKING([if --enable-ipv6 is specified])
2090
[ --enable-ipv6 Enable ipv6 (with ipv4) support
2091
--disable-ipv6 Disable ipv6 support],
2092
[ case "$enableval" in
2097
*) AC_MSG_RESULT(yes)
2098
AC_DEFINE(ENABLE_IPV6)
2104
dnl the check does not work on cross compilation case...
2105
AC_TRY_RUN([ /* AF_INET6 available check */
2106
#include <sys/types.h>
2107
#include <sys/socket.h>
2110
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
2124
if test "$ipv6" = "yes"; then
2125
AC_MSG_CHECKING(if RFC2553 API is available)
2126
AC_TRY_COMPILE([#include <sys/types.h>
2127
#include <netinet/in.h>],
2128
[struct sockaddr_in6 x;
2132
AC_MSG_RESULT(no, IPv6 disabled)
2136
if test "$ipv6" = "yes"; then
2137
AC_DEFINE(ENABLE_IPV6)
2145
if test "$ipv6" = "yes"; then
2146
AC_MSG_CHECKING([ipv6 stack type])
2147
for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
2151
dnl http://www.kame.net/
2153
#include <netinet/in.h>
2154
#ifdef IPV6_INRIA_VERSION
2160
dnl http://www.kame.net/
2162
#include <netinet/in.h>
2168
ipv6libdir=/usr/local/v6/lib
2172
dnl http://www.v6.linux.or.jp/
2174
#include <features.h>
2175
#if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2))
2182
dnl http://www.v6.linux.or.jp/
2183
if test -d /usr/inet6; then
2186
ipv6libdir=/usr/inet6/lib
2187
BASECFLAGS="-I/usr/inet6/include $BASECFLAGS"
2191
if test -f /etc/netconfig; then
2192
if /usr/xpg4/bin/grep -q tcp6 /etc/netconfig; then
2200
#include <sys/param.h>
2201
#ifdef _TOSHIBA_INET6
2206
ipv6libdir=/usr/local/v6/lib])
2210
#include </usr/local/v6/include/sys/v6config.h>
2216
ipv6libdir=/usr/local/v6/lib;
2217
BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"])
2221
#include <sys/param.h>
2222
#ifdef _ZETA_MINAMI_INET6
2227
ipv6libdir=/usr/local/v6/lib])
2230
if test "$ipv6type" != "unknown"; then
2234
AC_MSG_RESULT($ipv6type)
2237
if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
2238
if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
2239
LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
2240
echo "using lib$ipv6lib"
2242
if test $ipv6trylibc = "yes"; then
2245
echo 'Fatal: no $ipv6lib library found. cannot continue.'
2246
echo "You need to fetch lib$ipv6lib.a from appropriate"
2247
echo 'ipv6 kit and compile beforehand.'
2253
AC_MSG_CHECKING(for OSX 10.5 SDK or later)
2254
AC_TRY_COMPILE([#include <Carbon/Carbon.h>], FSIORefNum fRef = 0,
2255
AC_DEFINE(HAVE_OSX105_SDK, 1, Define if compiling using MacOS X 10.5 SDK or later.)
2260
# Check for --with-doc-strings
2261
AC_MSG_CHECKING(for --with-doc-strings)
2262
AC_ARG_WITH(doc-strings,
2263
AC_HELP_STRING(--with(out)-doc-strings, disable/enable documentation strings))
2265
if test -z "$with_doc_strings"
2266
then with_doc_strings="yes"
2268
if test "$with_doc_strings" != "no"
2270
AC_DEFINE(WITH_DOC_STRINGS, 1,
2271
[Define if you want documentation strings in extension modules])
2273
AC_MSG_RESULT($with_doc_strings)
2275
# Check for Python-specific malloc support
2276
AC_MSG_CHECKING(for --with-tsc)
2278
[ --with(out)-tsc enable/disable timestamp counter profile], [
2279
if test "$withval" != no
2281
AC_DEFINE(WITH_TSC, 1,
2282
[Define to profile with the Pentium timestamp counter])
2284
else AC_MSG_RESULT(no)
2286
[AC_MSG_RESULT(no)])
2288
# Check for Python-specific malloc support
2289
AC_MSG_CHECKING(for --with-pymalloc)
2290
AC_ARG_WITH(pymalloc,
2291
AC_HELP_STRING(--with(out)-pymalloc, disable/enable specialized mallocs))
2293
if test -z "$with_pymalloc"
2294
then with_pymalloc="yes"
2296
if test "$with_pymalloc" != "no"
2298
AC_DEFINE(WITH_PYMALLOC, 1,
2299
[Define if you want to compile in Python-specific mallocs])
2301
AC_MSG_RESULT($with_pymalloc)
2303
# Check for --with-wctype-functions
2304
AC_MSG_CHECKING(for --with-wctype-functions)
2305
AC_ARG_WITH(wctype-functions,
2306
AC_HELP_STRING(--with-wctype-functions, use wctype.h functions),
2308
if test "$withval" != no
2310
AC_DEFINE(WANT_WCTYPE_FUNCTIONS, 1,
2311
[Define if you want wctype.h functions to be used instead of the
2312
one supplied by Python itself. (see Include/unicodectype.h).])
2314
else AC_MSG_RESULT(no)
2316
[AC_MSG_RESULT(no)])
2318
# -I${DLINCLDIR} is added to the compile rule for importdl.o
2322
# the dlopen() function means we might want to use dynload_shlib.o. some
2323
# platforms, such as AIX, have dlopen(), but don't want to use it.
2324
AC_CHECK_FUNCS(dlopen)
2326
# DYNLOADFILE specifies which dynload_*.o file we will use for dynamic
2327
# loading of modules.
2328
AC_SUBST(DYNLOADFILE)
2329
AC_MSG_CHECKING(DYNLOADFILE)
2330
if test -z "$DYNLOADFILE"
2332
case $ac_sys_system/$ac_sys_release in
2333
AIX*) # Use dynload_shlib.c and dlopen() if we have it; otherwise dynload_aix.c
2334
if test "$ac_cv_func_dlopen" = yes
2335
then DYNLOADFILE="dynload_shlib.o"
2336
else DYNLOADFILE="dynload_aix.o"
2339
hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
2340
# Use dynload_next.c only on 10.2 and below, which don't have native dlopen()
2341
Darwin/@<:@0156@:>@\..*) DYNLOADFILE="dynload_next.o";;
2342
atheos*) DYNLOADFILE="dynload_atheos.o";;
2344
# use dynload_shlib.c and dlopen() if we have it; otherwise stub
2345
# out any dynamic loading
2346
if test "$ac_cv_func_dlopen" = yes
2347
then DYNLOADFILE="dynload_shlib.o"
2348
else DYNLOADFILE="dynload_stub.o"
2353
AC_MSG_RESULT($DYNLOADFILE)
2354
if test "$DYNLOADFILE" != "dynload_stub.o"
2356
AC_DEFINE(HAVE_DYNAMIC_LOADING, 1,
2357
[Defined when any dynamic module loading is enabled.])
2360
# MACHDEP_OBJS can be set to platform-specific object files needed by Python
2362
AC_SUBST(MACHDEP_OBJS)
2363
AC_MSG_CHECKING(MACHDEP_OBJS)
2364
if test -z "$MACHDEP_OBJS"
2366
MACHDEP_OBJS=$extra_machdep_objs
2368
MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs"
2370
AC_MSG_RESULT(MACHDEP_OBJS)
2372
# checks for library functions
2373
AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
2374
clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
2375
gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
2376
getpriority getpwent getspnam getspent getsid getwd \
2377
kill killpg lchmod lchown lstat mkfifo mknod mktime \
2378
mremap nice pathconf pause plock poll pthread_init \
2379
putenv readlink realpath \
2380
select setegid seteuid setgid \
2381
setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \
2382
sigaction siginterrupt sigrelse strftime strlcpy \
2383
sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
2384
truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll wcsxfrm _getpty)
2386
# For some functions, having a definition is not sufficient, since
2387
# we want to take their address.
2388
AC_MSG_CHECKING(for chroot)
2389
AC_TRY_COMPILE([#include <unistd.h>], void *x=chroot,
2390
AC_DEFINE(HAVE_CHROOT, 1, Define if you have the 'chroot' function.)
2394
AC_MSG_CHECKING(for link)
2395
AC_TRY_COMPILE([#include <unistd.h>], void *x=link,
2396
AC_DEFINE(HAVE_LINK, 1, Define if you have the 'link' function.)
2400
AC_MSG_CHECKING(for symlink)
2401
AC_TRY_COMPILE([#include <unistd.h>], void *x=symlink,
2402
AC_DEFINE(HAVE_SYMLINK, 1, Define if you have the 'symlink' function.)
2406
AC_MSG_CHECKING(for fchdir)
2407
AC_TRY_COMPILE([#include <unistd.h>], void *x=fchdir,
2408
AC_DEFINE(HAVE_FCHDIR, 1, Define if you have the 'fchdir' function.)
2412
AC_MSG_CHECKING(for fsync)
2413
AC_TRY_COMPILE([#include <unistd.h>], void *x=fsync,
2414
AC_DEFINE(HAVE_FSYNC, 1, Define if you have the 'fsync' function.)
2418
AC_MSG_CHECKING(for fdatasync)
2419
AC_TRY_COMPILE([#include <unistd.h>], void *x=fdatasync,
2420
AC_DEFINE(HAVE_FDATASYNC, 1, Define if you have the 'fdatasync' function.)
2424
AC_MSG_CHECKING(for epoll)
2425
AC_TRY_COMPILE([#include <sys/epoll.h>], void *x=epoll_create,
2426
AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.)
2430
AC_MSG_CHECKING(for kqueue)
2432
#include <sys/types.h>
2433
#include <sys/event.h>
2435
AC_DEFINE(HAVE_KQUEUE, 1, Define if you have the 'kqueue' functions.)
2439
# On some systems (eg. FreeBSD 5), we would find a definition of the
2440
# functions ctermid_r, setgroups in the library, but no prototype
2441
# (e.g. because we use _XOPEN_SOURCE). See whether we can take their
2442
# address to avoid compiler warnings and potential miscompilations
2443
# because of the missing prototypes.
2445
AC_MSG_CHECKING(for ctermid_r)
2447
#include "confdefs.h"
2449
], void* p = ctermid_r,
2450
AC_DEFINE(HAVE_CTERMID_R, 1, Define if you have the 'ctermid_r' function.)
2455
AC_MSG_CHECKING(for flock)
2457
#include "confdefs.h"
2458
#include <sys/file.h>
2460
AC_DEFINE(HAVE_FLOCK, 1, Define if you have the 'flock' function.)
2465
AC_MSG_CHECKING(for getpagesize)
2467
#include "confdefs.h"
2469
], void* p = getpagesize,
2470
AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function.)
2476
AC_CHECK_PROGS(TRUE, true, /bin/true)
2478
dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
2479
dnl On others, they are in the C library, so we to take no action
2480
AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
2481
AC_CHECK_LIB(resolv, inet_aton)
2484
# On Tru64, chflags seems to be present, but calling it will
2486
AC_MSG_CHECKING(for chflags)
2488
#include <sys/stat.h>
2490
int main(int argc, char*argv[])
2492
if(chflags(argv[0], 0) != 0)
2496
],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
2501
AC_MSG_CHECKING(for lchflags)
2503
#include <sys/stat.h>
2505
int main(int argc, char*argv[])
2507
if(lchflags(argv[0], 0) != 0)
2511
],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
2516
dnl Check if system zlib has *Copy() functions
2518
dnl On MacOSX the linker will search for dylibs on the entire linker path
2519
dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first
2520
dnl to revert to a more traditional unix behaviour and make it possible to
2521
dnl override the system libz with a local static library of libz. Temporarily
2522
dnl add that flag to our CFLAGS as well to ensure that we check the version
2523
dnl of libz that will be used by setup.py.
2524
dnl The -L/usr/local/lib is needed as wel to get the same compilation
2525
dnl environment as setup.py (and leaving it out can cause configure to use the
2526
dnl wrong version of the library)
2527
case $ac_sys_system/$ac_sys_release in
2529
_CUR_CFLAGS="${CFLAGS}"
2530
_CUR_LDFLAGS="${LDFLAGS}"
2531
CFLAGS="${CFLAGS} -Wl,-search_paths_first"
2532
LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
2536
AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, Define if the zlib library has inflateCopy))
2538
case $ac_sys_system/$ac_sys_release in
2540
CFLAGS="${_CUR_CFLAGS}"
2541
LDFLAGS="${_CUR_LDFLAGS}"
2545
AC_MSG_CHECKING(for hstrerror)
2547
#include "confdefs.h"
2549
], void* p = hstrerror; hstrerror(0),
2550
AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.)
2555
AC_MSG_CHECKING(for inet_aton)
2557
#include "confdefs.h"
2558
#include <sys/types.h>
2559
#include <sys/socket.h>
2560
#include <netinet/in.h>
2561
#include <arpa/inet.h>
2562
], void* p = inet_aton;inet_aton(0,0),
2563
AC_DEFINE(HAVE_INET_ATON, 1, Define if you have the 'inet_aton' function.)
2568
AC_MSG_CHECKING(for inet_pton)
2570
#include "confdefs.h"
2571
#include <sys/types.h>
2572
#include <sys/socket.h>
2573
#include <netinet/in.h>
2574
#include <arpa/inet.h>
2575
], void* p = inet_pton,
2576
AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.)
2581
# On some systems, setgroups is in unistd.h, on others, in grp.h
2582
AC_MSG_CHECKING(for setgroups)
2584
#include "confdefs.h"
2590
void* p = setgroups,
2591
AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.)
2596
# check for openpty and forkpty
2598
AC_CHECK_FUNCS(openpty,,
2599
AC_CHECK_LIB(util,openpty,
2600
[AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"],
2601
AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"])
2604
AC_CHECK_FUNCS(forkpty,,
2605
AC_CHECK_LIB(util,forkpty,
2606
[AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"],
2607
AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"])
2612
AC_CHECK_FUNCS(memmove)
2614
# check for long file support functions
2615
AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)
2617
AC_REPLACE_FUNCS(dup2 getcwd strdup)
2618
AC_CHECK_FUNCS(getpgrp,
2619
AC_TRY_COMPILE([#include <unistd.h>],
2621
AC_DEFINE(GETPGRP_HAVE_ARG, 1,
2622
[Define if getpgrp() must be called as getpgrp(0).])
2625
AC_CHECK_FUNCS(setpgrp,
2626
AC_TRY_COMPILE([#include <unistd.h>],
2628
AC_DEFINE(SETPGRP_HAVE_ARG, 1,
2629
[Define if setpgrp() must be called as setpgrp(0, 0).])
2632
AC_CHECK_FUNCS(gettimeofday,
2633
AC_TRY_COMPILE([#include <sys/time.h>],
2634
[gettimeofday((struct timeval*)0,(struct timezone*)0);], ,
2635
AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1,
2636
[Define if gettimeofday() does not have second (timezone) argument
2637
This is the case on Motorola V4 (R40V4.2)])
2641
AC_MSG_CHECKING(for major, minor, and makedev)
2643
#if defined(MAJOR_IN_MKDEV)
2644
#include <sys/mkdev.h>
2645
#elif defined(MAJOR_IN_SYSMACROS)
2646
#include <sys/sysmacros.h>
2648
#include <sys/types.h>
2651
makedev(major(0),minor(0));
2653
AC_DEFINE(HAVE_DEVICE_MACROS, 1,
2654
[Define to 1 if you have the device macros.])
2660
# On OSF/1 V5.1, getaddrinfo is available, but a define
2661
# for [no]getaddrinfo in netdb.h.
2662
AC_MSG_CHECKING(for getaddrinfo)
2664
#include <sys/types.h>
2665
#include <sys/socket.h>
2669
getaddrinfo(NULL, NULL, NULL, NULL);
2672
AC_MSG_CHECKING(getaddrinfo bug)
2674
#include <sys/types.h>
2677
#include <sys/socket.h>
2678
#include <netinet/in.h>
2682
int passive, gaierr, inet4 = 0, inet6 = 0;
2683
struct addrinfo hints, *ai, *aitop;
2684
char straddr[INET6_ADDRSTRLEN], strport[16];
2686
for (passive = 0; passive <= 1; passive++) {
2687
memset(&hints, 0, sizeof(hints));
2688
hints.ai_family = AF_UNSPEC;
2689
hints.ai_flags = passive ? AI_PASSIVE : 0;
2690
hints.ai_socktype = SOCK_STREAM;
2691
hints.ai_protocol = IPPROTO_TCP;
2692
if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
2693
(void)gai_strerror(gaierr);
2696
for (ai = aitop; ai; ai = ai->ai_next) {
2697
if (ai->ai_addr == NULL ||
2698
ai->ai_addrlen == 0 ||
2699
getnameinfo(ai->ai_addr, ai->ai_addrlen,
2700
straddr, sizeof(straddr), strport, sizeof(strport),
2701
NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
2704
switch (ai->ai_family) {
2706
if (strcmp(strport, "54321") != 0) {
2710
if (strcmp(straddr, "0.0.0.0") != 0) {
2714
if (strcmp(straddr, "127.0.0.1") != 0) {
2721
if (strcmp(strport, "54321") != 0) {
2725
if (strcmp(straddr, "::") != 0) {
2729
if (strcmp(straddr, "::1") != 0) {
2739
/* another family support? */
2745
if (!(inet4 == 0 || inet4 == 2))
2747
if (!(inet6 == 0 || inet6 == 2))
2751
freeaddrinfo(aitop);
2756
freeaddrinfo(aitop);
2761
buggygetaddrinfo=no,
2762
AC_MSG_RESULT(buggy)
2763
buggygetaddrinfo=yes,
2764
AC_MSG_RESULT(buggy)
2765
buggygetaddrinfo=yes)], [
2767
buggygetaddrinfo=yes
2770
if test "$buggygetaddrinfo" = "yes"; then
2771
if test "$ipv6" = "yes"; then
2772
echo 'Fatal: You must get working getaddrinfo() function.'
2773
echo ' or you can specify "--disable-ipv6"'.
2777
AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.])
2779
AC_CHECK_FUNCS(getnameinfo)
2781
# checks for structures
2785
AC_CHECK_MEMBERS([struct stat.st_rdev])
2786
AC_CHECK_MEMBERS([struct stat.st_blksize])
2787
AC_CHECK_MEMBERS([struct stat.st_flags])
2788
AC_CHECK_MEMBERS([struct stat.st_gen])
2789
AC_CHECK_MEMBERS([struct stat.st_birthtime])
2792
AC_MSG_CHECKING(for time.h that defines altzone)
2793
AC_CACHE_VAL(ac_cv_header_time_altzone,
2794
[AC_TRY_COMPILE([#include <time.h>], [return altzone;],
2795
ac_cv_header_time_altzone=yes,
2796
ac_cv_header_time_altzone=no)])
2797
AC_MSG_RESULT($ac_cv_header_time_altzone)
2798
if test $ac_cv_header_time_altzone = yes; then
2799
AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.])
2803
AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included)
2805
#include <sys/types.h>
2806
#include <sys/select.h>
2807
#include <sys/time.h>
2809
AC_DEFINE(SYS_SELECT_WITH_SYS_TIME, 1,
2810
[Define if you can safely include both <sys/select.h> and <sys/time.h>
2811
(which you can't on SCO ODT 3.0).])
2814
AC_MSG_RESULT($was_it_defined)
2816
AC_MSG_CHECKING(for addrinfo)
2817
AC_CACHE_VAL(ac_cv_struct_addrinfo,
2819
# include <netdb.h>],
2820
[struct addrinfo a],
2821
ac_cv_struct_addrinfo=yes,
2822
ac_cv_struct_addrinfo=no))
2823
AC_MSG_RESULT($ac_cv_struct_addrinfo)
2824
if test $ac_cv_struct_addrinfo = yes; then
2825
AC_DEFINE(HAVE_ADDRINFO, 1, [struct addrinfo (netdb.h)])
2828
AC_MSG_CHECKING(for sockaddr_storage)
2829
AC_CACHE_VAL(ac_cv_struct_sockaddr_storage,
2831
# include <sys/types.h>
2832
# include <sys/socket.h>],
2833
[struct sockaddr_storage s],
2834
ac_cv_struct_sockaddr_storage=yes,
2835
ac_cv_struct_sockaddr_storage=no))
2836
AC_MSG_RESULT($ac_cv_struct_sockaddr_storage)
2837
if test $ac_cv_struct_sockaddr_storage = yes; then
2838
AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket.h)])
2841
# checks for compiler characteristics
2847
AC_MSG_CHECKING(for working volatile)
2848
AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes,
2849
AC_DEFINE(volatile, [], [Define to empty if the keyword does not work.])
2851
AC_MSG_RESULT($works)
2854
AC_MSG_CHECKING(for working signed char)
2855
AC_TRY_COMPILE([], [signed char c;], works=yes,
2856
AC_DEFINE(signed, [], [Define to empty if the keyword does not work.])
2858
AC_MSG_RESULT($works)
2861
AC_MSG_CHECKING(for prototypes)
2862
AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],[
2863
AC_DEFINE(HAVE_PROTOTYPES, 1,
2864
[Define if your compiler supports function prototype])
2867
AC_MSG_RESULT($have_prototypes)
2870
AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
2873
int foo(int x, ...) {
2881
], [return foo(10, "", 3.14);], [
2882
AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1,
2883
[Define if your compiler supports variable length function prototypes
2884
(e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>])
2887
AC_MSG_RESULT($works)
2889
# check for socketpair
2890
AC_MSG_CHECKING(for socketpair)
2892
#include <sys/types.h>
2893
#include <sys/socket.h>
2894
], void *x=socketpair,
2895
AC_DEFINE(HAVE_SOCKETPAIR, 1, Define if you have the 'socketpair' function.)
2900
# check if sockaddr has sa_len member
2901
AC_MSG_CHECKING(if sockaddr has sa_len member)
2902
AC_TRY_COMPILE([#include <sys/types.h>
2903
#include <sys/socket.h>],
2907
AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member]),
2911
AC_MSG_CHECKING(whether va_list is an array)
2913
#ifdef HAVE_STDARG_PROTOTYPES
2916
#include <varargs.h>
2918
], [va_list list1, list2; list1 = list2;], , [
2919
AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
2920
va_list_is_array=yes
2922
AC_MSG_RESULT($va_list_is_array)
2924
# sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
2925
AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
2926
[Define this if you have some version of gethostbyname_r()])
2928
AC_CHECK_FUNC(gethostbyname_r, [
2929
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2930
AC_MSG_CHECKING([gethostbyname_r with 6 args])
2932
CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
2937
struct hostent *he, *res;
2942
(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
2944
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2945
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
2946
[Define this if you have the 6-arg version of gethostbyname_r().])
2950
AC_MSG_CHECKING([gethostbyname_r with 5 args])
2960
(void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
2962
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2963
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
2964
[Define this if you have the 5-arg version of gethostbyname_r().])
2968
AC_MSG_CHECKING([gethostbyname_r with 3 args])
2974
struct hostent_data data;
2976
(void) gethostbyname_r(name, he, &data);
2978
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
2979
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
2980
[Define this if you have the 3-arg version of gethostbyname_r().])
2989
AC_CHECK_FUNCS(gethostbyname)
2991
AC_SUBST(HAVE_GETHOSTBYNAME_R_6_ARG)
2992
AC_SUBST(HAVE_GETHOSTBYNAME_R_5_ARG)
2993
AC_SUBST(HAVE_GETHOSTBYNAME_R_3_ARG)
2994
AC_SUBST(HAVE_GETHOSTBYNAME_R)
2995
AC_SUBST(HAVE_GETHOSTBYNAME)
2997
# checks for system services
3000
# Linux requires this for correct f.p. operations
3001
AC_CHECK_FUNC(__fpu_control,
3003
[AC_CHECK_LIB(ieee, __fpu_control)
3006
# Check for --with-fpectl
3007
AC_MSG_CHECKING(for --with-fpectl)
3009
AC_HELP_STRING(--with-fpectl, enable SIGFPE catching),
3011
if test "$withval" != no
3013
AC_DEFINE(WANT_SIGFPE_HANDLER, 1,
3014
[Define if you want SIGFPE handled (see Include/pyfpe.h).])
3016
else AC_MSG_RESULT(no)
3018
[AC_MSG_RESULT(no)])
3020
# check for --with-libm=...
3022
case $ac_sys_system in
3026
AC_MSG_CHECKING(for --with-libm=STRING)
3028
AC_HELP_STRING(--with-libm=STRING, math library),
3030
if test "$withval" = no
3032
AC_MSG_RESULT(force LIBM empty)
3033
elif test "$withval" != yes
3035
AC_MSG_RESULT(set LIBM="$withval")
3036
else AC_MSG_ERROR([proper usage is --with-libm=STRING])
3038
[AC_MSG_RESULT(default LIBM="$LIBM")])
3040
# check for --with-libc=...
3042
AC_MSG_CHECKING(for --with-libc=STRING)
3044
AC_HELP_STRING(--with-libc=STRING, C library),
3046
if test "$withval" = no
3048
AC_MSG_RESULT(force LIBC empty)
3049
elif test "$withval" != yes
3051
AC_MSG_RESULT(set LIBC="$withval")
3052
else AC_MSG_ERROR([proper usage is --with-libc=STRING])
3054
[AC_MSG_RESULT(default LIBC="$LIBC")])
3056
# ************************************
3057
# * Check for mathematical functions *
3058
# ************************************
3063
# Detect whether system arithmetic is subject to x87-style double
3064
# rounding issues. The result of this test has little meaning on non
3065
# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding
3066
# mode is round-to-nearest and double rounding issues are present, and
3067
# 0 otherwise. See http://bugs.python.org/issue2937 for more info.
3068
AC_MSG_CHECKING(for x87-style double rounding)
3069
AC_CACHE_VAL(ac_cv_x87_double_rounding, [
3074
volatile double x, y, z;
3075
/* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
3076
x = 0.99999999999999989; /* 1-2**-53 */
3080
/* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */
3086
/* both tests show evidence of double rounding */
3090
ac_cv_x87_double_rounding=no,
3091
ac_cv_x87_double_rounding=yes,
3092
ac_cv_x87_double_rounding=no)])
3093
AC_MSG_RESULT($ac_cv_x87_double_rounding)
3094
if test "$ac_cv_x87_double_rounding" = yes
3096
AC_DEFINE(X87_DOUBLE_ROUNDING, 1,
3097
[Define if arithmetic is subject to x87-style double rounding issue])
3101
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
3102
# -0. on some architectures.
3103
AC_MSG_CHECKING(whether tanh preserves the sign of zero)
3104
AC_CACHE_VAL(ac_cv_tanh_preserves_zero_sign, [
3109
/* return 0 if either negative zeros don't exist
3110
on this platform or if negative zeros exist
3111
and tanh(-0.) == -0. */
3112
if (atan2(0., -1.) == atan2(-0., -1.) ||
3113
atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
3117
ac_cv_tanh_preserves_zero_sign=yes,
3118
ac_cv_tanh_preserves_zero_sign=no,
3119
ac_cv_tanh_preserves_zero_sign=no)])
3120
AC_MSG_RESULT($ac_cv_tanh_preserves_zero_sign)
3121
if test "$ac_cv_tanh_preserves_zero_sign" = yes
3123
AC_DEFINE(TANH_PRESERVES_ZERO_SIGN, 1,
3124
[Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
3127
AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p])
3128
AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
3132
# determine what size digit to use for Python's longs
3133
AC_MSG_CHECKING([digit size for Python's longs])
3134
AC_ARG_ENABLE(big-digits,
3135
AC_HELP_STRING([--enable-big-digits@<:@=BITS@:>@],[use big digits for Python longs [[BITS=30]]]),
3136
[case $enable_big_digits in
3138
enable_big_digits=30 ;;
3140
enable_big_digits=15 ;;
3144
AC_MSG_ERROR([bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30]) ;;
3146
AC_MSG_RESULT($enable_big_digits)
3147
AC_DEFINE_UNQUOTED(PYLONG_BITS_IN_DIGIT, $enable_big_digits, [Define as the preferred size in bits of long digits])
3149
[AC_MSG_RESULT(no value specified)])
3152
AC_CHECK_HEADER(wchar.h, [
3153
AC_DEFINE(HAVE_WCHAR_H, 1,
3154
[Define if the compiler provides a wchar.h header file.])
3160
# determine wchar_t size
3161
if test "$wchar_h" = yes
3163
AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
3166
AC_MSG_CHECKING(for UCS-4 tcl)
3170
#if TCL_UTF_MAX != 6
3171
# error "NOT UCS4_TCL"
3173
AC_DEFINE(HAVE_UCS4_TCL, 1, [Define this if you have tcl and TCL_UTF_MAX==6])
3176
AC_MSG_RESULT($have_ucs4_tcl)
3178
# check whether wchar_t is signed or not
3179
if test "$wchar_h" = yes
3181
# check whether wchar_t is signed or not
3182
AC_MSG_CHECKING(whether wchar_t is signed)
3183
AC_CACHE_VAL(ac_cv_wchar_t_signed, [
3188
/* Success: exit code 0 */
3189
exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
3192
ac_cv_wchar_t_signed=yes,
3193
ac_cv_wchar_t_signed=no,
3194
ac_cv_wchar_t_signed=yes)])
3195
AC_MSG_RESULT($ac_cv_wchar_t_signed)
3198
AC_MSG_CHECKING(what type to use for str)
3199
AC_ARG_WITH(wide-unicode,
3200
AC_HELP_STRING(--with-wide-unicode, Use 4-byte Unicode characters (default is 2 bytes)),
3202
if test "$withval" != no
3203
then unicode_size="4"
3204
else unicode_size="2"
3208
case "$have_ucs4_tcl" in
3209
yes) unicode_size="4" ;;
3210
*) unicode_size="2" ;;
3214
AH_TEMPLATE(Py_UNICODE_SIZE,
3215
[Define as the size of the unicode type.])
3216
case "$unicode_size" in
3217
4) AC_DEFINE(Py_UNICODE_SIZE, 4) ;;
3218
*) AC_DEFINE(Py_UNICODE_SIZE, 2) ;;
3221
AH_TEMPLATE(PY_UNICODE_TYPE,
3222
[Define as the integral type used for Unicode representation.])
3224
# wchar_t is only usable if it maps to an unsigned type
3225
if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \
3226
-a "$ac_cv_wchar_t_signed" = "no"
3228
PY_UNICODE_TYPE="wchar_t"
3229
AC_DEFINE(HAVE_USABLE_WCHAR_T, 1,
3230
[Define if you have a useable wchar_t type defined in wchar.h; useable
3231
means wchar_t must be an unsigned type with at least 16 bits. (see
3232
Include/unicodeobject.h).])
3233
AC_DEFINE(PY_UNICODE_TYPE,wchar_t)
3234
elif test "$ac_cv_sizeof_short" = "$unicode_size"
3236
PY_UNICODE_TYPE="unsigned short"
3237
AC_DEFINE(PY_UNICODE_TYPE,unsigned short)
3238
elif test "$ac_cv_sizeof_long" = "$unicode_size"
3240
PY_UNICODE_TYPE="unsigned long"
3241
AC_DEFINE(PY_UNICODE_TYPE,unsigned long)
3243
PY_UNICODE_TYPE="no type found"
3245
AC_MSG_RESULT($PY_UNICODE_TYPE)
3247
# check for endianness
3250
# Check whether right shifting a negative integer extends the sign bit
3251
# or fills with zeros (like the Cray J90, according to Tim Peters).
3252
AC_MSG_CHECKING(whether right shift extends the sign bit)
3253
AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
3257
exit(((-1)>>3 == -1) ? 0 : 1);
3260
ac_cv_rshift_extends_sign=yes,
3261
ac_cv_rshift_extends_sign=no,
3262
ac_cv_rshift_extends_sign=yes)])
3263
AC_MSG_RESULT($ac_cv_rshift_extends_sign)
3264
if test "$ac_cv_rshift_extends_sign" = no
3266
AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS, 1,
3267
[Define if i>>j for signed int i does not extend the sign bit
3271
# check for getc_unlocked and related locking functions
3272
AC_MSG_CHECKING(for getc_unlocked() and friends)
3273
AC_CACHE_VAL(ac_cv_have_getc_unlocked, [
3274
AC_TRY_LINK([#include <stdio.h>],[
3275
FILE *f = fopen("/dev/null", "r");
3279
], ac_cv_have_getc_unlocked=yes, ac_cv_have_getc_unlocked=no)])
3280
AC_MSG_RESULT($ac_cv_have_getc_unlocked)
3281
if test "$ac_cv_have_getc_unlocked" = yes
3283
AC_DEFINE(HAVE_GETC_UNLOCKED, 1,
3284
[Define this if you have flockfile(), getc_unlocked(), and funlockfile()])
3287
# check where readline lives
3288
# save the value of LIBS so we don't actually link Python with readline
3289
LIBS_no_readline=$LIBS
3291
# On some systems we need to link readline to a termcap compatible
3292
# library. NOTE: Keep the precedence of listed libraries synchronised
3294
py_cv_lib_readline=no
3295
AC_MSG_CHECKING([how to link readline libs])
3296
for py_libtermcap in "" ncursesw ncurses curses termcap; do
3297
if test -z "$py_libtermcap"; then
3298
READLINE_LIBS="-lreadline"
3300
READLINE_LIBS="-lreadline -l$py_libtermcap"
3302
LIBS="$READLINE_LIBS $LIBS_no_readline"
3304
[AC_LANG_CALL([],[readline])],
3305
[py_cv_lib_readline=yes])
3306
if test $py_cv_lib_readline = yes; then
3310
# Uncomment this line if you want to use READINE_LIBS in Makefile or scripts
3311
#AC_SUBST([READLINE_LIBS])
3312
if test $py_cv_lib_readline = no; then
3313
AC_MSG_RESULT([none])
3315
AC_MSG_RESULT([$READLINE_LIBS])
3316
AC_DEFINE(HAVE_LIBREADLINE, 1,
3317
[Define if you have the readline library (-lreadline).])
3320
# check for readline 2.1
3321
AC_CHECK_LIB(readline, rl_callback_handler_install,
3322
AC_DEFINE(HAVE_RL_CALLBACK, 1,
3323
[Define if you have readline 2.1]), ,$READLINE_LIBS)
3325
# check for readline 2.2
3326
AC_TRY_CPP([#include <readline/readline.h>],
3327
have_readline=yes, have_readline=no)
3328
if test $have_readline = yes
3330
AC_EGREP_HEADER([extern int rl_completion_append_character;],
3331
[readline/readline.h],
3332
AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
3333
[Define if you have readline 2.2]), )
3336
# check for readline 4.0
3337
AC_CHECK_LIB(readline, rl_pre_input_hook,
3338
AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1,
3339
[Define if you have readline 4.0]), ,$READLINE_LIBS)
3342
AC_CHECK_LIB(readline, rl_completion_display_matches_hook,
3343
AC_DEFINE(HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK, 1,
3344
[Define if you have readline 4.0]), ,$READLINE_LIBS)
3346
# check for readline 4.2
3347
AC_CHECK_LIB(readline, rl_completion_matches,
3348
AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1,
3349
[Define if you have readline 4.2]), ,$READLINE_LIBS)
3351
# also in readline 4.2
3352
AC_TRY_CPP([#include <readline/readline.h>],
3353
have_readline=yes, have_readline=no)
3354
if test $have_readline = yes
3356
AC_EGREP_HEADER([extern int rl_catch_signals;],
3357
[readline/readline.h],
3358
AC_DEFINE(HAVE_RL_CATCH_SIGNAL, 1,
3359
[Define if you can turn off readline's signal handling.]), )
3362
# End of readline checks: restore LIBS
3363
LIBS=$LIBS_no_readline
3365
AC_MSG_CHECKING(for broken nice())
3366
AC_CACHE_VAL(ac_cv_broken_nice, [
3371
if (val1 != -1 && val1 == nice(2))
3376
ac_cv_broken_nice=yes,
3377
ac_cv_broken_nice=no,
3378
ac_cv_broken_nice=no)])
3379
AC_MSG_RESULT($ac_cv_broken_nice)
3380
if test "$ac_cv_broken_nice" = yes
3382
AC_DEFINE(HAVE_BROKEN_NICE, 1,
3383
[Define if nice() returns success/failure instead of the new priority.])
3386
AC_MSG_CHECKING(for broken poll())
3392
struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
3396
int poll_test = poll (&poll_struct, 1, 0);
3402
else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
3412
ac_cv_broken_poll=yes,
3413
ac_cv_broken_poll=no,
3414
ac_cv_broken_poll=no)
3415
AC_MSG_RESULT($ac_cv_broken_poll)
3416
if test "$ac_cv_broken_poll" = yes
3418
AC_DEFINE(HAVE_BROKEN_POLL, 1,
3419
[Define if poll() sets errno on invalid file descriptors.])
3422
# Before we can test tzset, we need to check if struct tm has a tm_zone
3423
# (which is not required by ISO C or UNIX spec) and/or if we support
3427
# check tzset(3) exists and works like we expect it to
3428
AC_MSG_CHECKING(for working tzset())
3429
AC_CACHE_VAL(ac_cv_working_tzset, [
3436
extern char *tzname[];
3441
/* Note that we need to ensure that not only does tzset(3)
3442
do 'something' with localtime, but it works as documented
3443
in the library reference and as expected by the test suite.
3444
This includes making sure that tzname is set properly if
3445
tm->tm_zone does not exist since it is the alternative way
3446
of getting timezone info.
3448
Red Hat 6.2 doesn't understand the southern hemisphere
3449
after New Year's Day.
3452
time_t groundhogday = 1044144000; /* GMT-based */
3453
time_t midyear = groundhogday + (365 * 24 * 3600 / 2);
3457
if (localtime(&groundhogday)->tm_hour != 0)
3460
/* For UTC, tzname[1] is sometimes "", sometimes " " */
3461
if (strcmp(tzname[0], "UTC") ||
3462
(tzname[1][0] != 0 && tzname[1][0] != ' '))
3466
putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
3468
if (localtime(&groundhogday)->tm_hour != 19)
3471
if (strcmp(tzname[0], "EST") || strcmp(tzname[1], "EDT"))
3475
putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
3477
if (localtime(&groundhogday)->tm_hour != 11)
3480
if (strcmp(tzname[0], "AEST") || strcmp(tzname[1], "AEDT"))
3484
#if HAVE_STRUCT_TM_TM_ZONE
3485
if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
3487
if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
3494
ac_cv_working_tzset=yes,
3495
ac_cv_working_tzset=no,
3496
ac_cv_working_tzset=no)])
3497
AC_MSG_RESULT($ac_cv_working_tzset)
3498
if test "$ac_cv_working_tzset" = yes
3500
AC_DEFINE(HAVE_WORKING_TZSET, 1,
3501
[Define if tzset() actually switches the local timezone in a meaningful way.])
3504
# Look for subsecond timestamps in struct stat
3505
AC_MSG_CHECKING(for tv_nsec in struct stat)
3506
AC_CACHE_VAL(ac_cv_stat_tv_nsec,
3507
AC_TRY_COMPILE([#include <sys/stat.h>], [
3509
st.st_mtim.tv_nsec = 1;
3511
ac_cv_stat_tv_nsec=yes,
3512
ac_cv_stat_tv_nsec=no,
3513
ac_cv_stat_tv_nsec=no))
3514
AC_MSG_RESULT($ac_cv_stat_tv_nsec)
3515
if test "$ac_cv_stat_tv_nsec" = yes
3517
AC_DEFINE(HAVE_STAT_TV_NSEC, 1,
3518
[Define if you have struct stat.st_mtim.tv_nsec])
3521
# Look for BSD style subsecond timestamps in struct stat
3522
AC_MSG_CHECKING(for tv_nsec2 in struct stat)
3523
AC_CACHE_VAL(ac_cv_stat_tv_nsec2,
3524
AC_TRY_COMPILE([#include <sys/stat.h>], [
3526
st.st_mtimespec.tv_nsec = 1;
3528
ac_cv_stat_tv_nsec2=yes,
3529
ac_cv_stat_tv_nsec2=no,
3530
ac_cv_stat_tv_nsec2=no))
3531
AC_MSG_RESULT($ac_cv_stat_tv_nsec2)
3532
if test "$ac_cv_stat_tv_nsec2" = yes
3534
AC_DEFINE(HAVE_STAT_TV_NSEC2, 1,
3535
[Define if you have struct stat.st_mtimensec])
3538
# On HP/UX 11.0, mvwdelch is a block with a return statement
3539
AC_MSG_CHECKING(whether mvwdelch is an expression)
3540
AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,
3541
AC_TRY_COMPILE([#include <curses.h>], [
3543
rtn = mvwdelch(0,0,0);
3544
], ac_cv_mvwdelch_is_expression=yes,
3545
ac_cv_mvwdelch_is_expression=no,
3546
ac_cv_mvwdelch_is_expression=yes))
3547
AC_MSG_RESULT($ac_cv_mvwdelch_is_expression)
3549
if test "$ac_cv_mvwdelch_is_expression" = yes
3551
AC_DEFINE(MVWDELCH_IS_EXPRESSION, 1,
3552
[Define if mvwdelch in curses.h is an expression.])
3555
AC_MSG_CHECKING(whether WINDOW has _flags)
3556
AC_CACHE_VAL(ac_cv_window_has_flags,
3557
AC_TRY_COMPILE([#include <curses.h>], [
3560
], ac_cv_window_has_flags=yes,
3561
ac_cv_window_has_flags=no,
3562
ac_cv_window_has_flags=no))
3563
AC_MSG_RESULT($ac_cv_window_has_flags)
3566
if test "$ac_cv_window_has_flags" = yes
3568
AC_DEFINE(WINDOW_HAS_FLAGS, 1,
3569
[Define if WINDOW in curses.h offers a field _flags.])
3572
AC_MSG_CHECKING(for is_term_resized)
3573
AC_TRY_COMPILE([#include <curses.h>], void *x=is_term_resized,
3574
AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_resized' function.)
3579
AC_MSG_CHECKING(for resize_term)
3580
AC_TRY_COMPILE([#include <curses.h>], void *x=resize_term,
3581
AC_DEFINE(HAVE_CURSES_RESIZE_TERM, 1, Define if you have the 'resize_term' function.)
3586
AC_MSG_CHECKING(for resizeterm)
3587
AC_TRY_COMPILE([#include <curses.h>], void *x=resizeterm,
3588
AC_DEFINE(HAVE_CURSES_RESIZETERM, 1, Define if you have the 'resizeterm' function.)
3593
AC_MSG_CHECKING(for /dev/ptmx)
3595
if test -r /dev/ptmx
3598
AC_DEFINE(HAVE_DEV_PTMX, 1,
3599
[Define if we have /dev/ptmx.])
3604
AC_MSG_CHECKING(for /dev/ptc)
3609
AC_DEFINE(HAVE_DEV_PTC, 1,
3610
[Define if we have /dev/ptc.])
3615
AC_MSG_CHECKING(for %zd printf() format support)
3616
AC_TRY_RUN([#include <stdio.h>
3620
#ifdef HAVE_SYS_TYPES_H
3621
#include <sys/types.h>
3625
typedef ssize_t Py_ssize_t;
3626
#elif SIZEOF_VOID_P == SIZEOF_LONG
3627
typedef long Py_ssize_t;
3629
typedef int Py_ssize_t;
3636
if(sprintf(buffer, "%zd", (size_t)123) < 0)
3639
if (strcmp(buffer, "123"))
3642
if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
3645
if (strcmp(buffer, "-123"))
3651
AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
3654
AC_CHECK_TYPE(socklen_t,,
3655
AC_DEFINE(socklen_t,int,
3656
Define to `int' if <sys/socket.h> does not define.),[
3657
#ifdef HAVE_SYS_TYPES_H
3658
#include <sys/types.h>
3660
#ifdef HAVE_SYS_SOCKET_H
3661
#include <sys/socket.h>
3665
AC_MSG_CHECKING(for broken mbstowcs)
3670
const char *str = "text";
3671
len = mbstowcs(NULL, str, 0);
3675
ac_cv_broken_mbstowcs=no,
3676
ac_cv_broken_mbstowcs=yes,
3677
ac_cv_broken_mbstowcs=no)
3678
AC_MSG_RESULT($ac_cv_broken_mbstowcs)
3679
if test "$ac_cv_broken_mbstowcs" = yes
3681
AC_DEFINE(HAVE_BROKEN_MBSTOWCS, 1,
3682
[Define if mbstowcs(NULL, "text", 0) does not return the number of
3683
wide chars that would be converted.])
3686
# Check for --with-computed-gotos
3687
AC_MSG_CHECKING(for --with-computed-gotos)
3688
AC_ARG_WITH(computed-gotos,
3689
AC_HELP_STRING(--with-computed-gotos,
3690
Use computed gotos / threaded dispatch in evaluation loop (not available on all compilers)),
3692
if test "$withval" != no
3694
AC_DEFINE(USE_COMPUTED_GOTOS, 1,
3695
[Define if you want to use computed gotos in ceval.c.])
3697
else AC_MSG_RESULT(no)
3699
[AC_MSG_RESULT(no)])
3702
AC_SUBST(THREADHEADERS)
3704
for h in `(cd $srcdir;echo Python/thread_*.h)`
3706
THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
3710
SRCDIRS="Parser Grammar Objects Python Modules Mac"
3711
AC_MSG_CHECKING(for build directories)
3712
for dir in $SRCDIRS; do
3713
if test ! -d $dir; then
3719
# generate output files
3720
AC_CONFIG_FILES(Makefile.pre Modules/Setup.config)
3723
echo "creating Modules/Setup"
3724
if test ! -f Modules/Setup
3726
cp $srcdir/Modules/Setup.dist Modules/Setup
3729
echo "creating Modules/Setup.local"
3730
if test ! -f Modules/Setup.local
3732
echo "# Edit this file for local setup changes" >Modules/Setup.local
3735
echo "creating Makefile"
3736
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
3737
-s Modules Modules/Setup.config \
3738
Modules/Setup.local Modules/Setup