| 1 | dnl Process this file with autoconf 2.0 or later to make a configure script.
|
|---|
| 2 |
|
|---|
| 3 | # Set VERSION so we only need to edit in one place (i.e., here)
|
|---|
| 4 | m4_define(PYTHON_VERSION, 2.5)
|
|---|
| 5 |
|
|---|
| 6 | AC_REVISION($Revision: 51727 $)
|
|---|
| 7 | AC_PREREQ(2.59)
|
|---|
| 8 | AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
|
|---|
| 9 | AC_CONFIG_SRCDIR([Include/object.h])
|
|---|
| 10 | AC_CONFIG_HEADER(pyconfig.h)
|
|---|
| 11 |
|
|---|
| 12 | dnl This is for stuff that absolutely must end up in pyconfig.h.
|
|---|
| 13 | dnl Please use pyport.h instead, if possible.
|
|---|
| 14 | AH_TOP([
|
|---|
| 15 | #ifndef Py_PYCONFIG_H
|
|---|
| 16 | #define Py_PYCONFIG_H
|
|---|
| 17 | ])
|
|---|
| 18 | AH_BOTTOM([
|
|---|
| 19 | /* Define the macros needed if on a UnixWare 7.x system. */
|
|---|
| 20 | #if defined(__USLC__) && defined(__SCO_VERSION__)
|
|---|
| 21 | #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
|
|---|
| 22 | #endif
|
|---|
| 23 |
|
|---|
| 24 | #endif /*Py_PYCONFIG_H*/
|
|---|
| 25 | ])
|
|---|
| 26 |
|
|---|
| 27 | # We don't use PACKAGE_ variables, and they cause conflicts
|
|---|
| 28 | # with other autoconf-based packages that include Python.h
|
|---|
| 29 | grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new
|
|---|
| 30 | rm confdefs.h
|
|---|
| 31 | mv confdefs.h.new confdefs.h
|
|---|
| 32 |
|
|---|
| 33 | AC_SUBST(VERSION)
|
|---|
| 34 | VERSION=PYTHON_VERSION
|
|---|
| 35 |
|
|---|
| 36 | AC_SUBST(SOVERSION)
|
|---|
| 37 | SOVERSION=1.0
|
|---|
| 38 |
|
|---|
| 39 | # The later defininition of _XOPEN_SOURCE disables certain features
|
|---|
| 40 | # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
|
|---|
| 41 | AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features])
|
|---|
| 42 |
|
|---|
| 43 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
|---|
| 44 | # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
|
|---|
| 45 | # them.
|
|---|
| 46 | AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
|
|---|
| 47 |
|
|---|
| 48 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
|---|
| 49 | # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
|
|---|
| 50 | # them.
|
|---|
| 51 | AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
|
|---|
| 52 |
|
|---|
| 53 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
|---|
| 54 | # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
|
|---|
| 55 | AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
|
|---|
| 56 |
|
|---|
| 57 | define_xopen_source=yes
|
|---|
| 58 |
|
|---|
| 59 | # Arguments passed to configure.
|
|---|
| 60 | AC_SUBST(CONFIG_ARGS)
|
|---|
| 61 | CONFIG_ARGS="$ac_configure_args"
|
|---|
| 62 |
|
|---|
| 63 | AC_ARG_ENABLE(universalsdk,
|
|---|
| 64 | AC_HELP_STRING(--enable-universalsdk@<:@SDKDIR@:>@, Build agains Mac OS X 10.4u SDK (ppc/i386)),
|
|---|
| 65 | [
|
|---|
| 66 | case $enableval in
|
|---|
| 67 | yes)
|
|---|
| 68 | enableval=/Developer/SDKs/MacOSX10.4u.sdk
|
|---|
| 69 | ;;
|
|---|
| 70 | esac
|
|---|
| 71 | case $enableval in
|
|---|
| 72 | no)
|
|---|
| 73 | UNIVERSALSDK=
|
|---|
| 74 | enable_universalsdk=
|
|---|
| 75 | ;;
|
|---|
| 76 | *)
|
|---|
| 77 | UNIVERSALSDK=$enableval
|
|---|
| 78 | ;;
|
|---|
| 79 | esac
|
|---|
| 80 | ],[
|
|---|
| 81 | UNIVERSALSDK=
|
|---|
| 82 | enable_universalsdk=
|
|---|
| 83 | ])
|
|---|
| 84 | AC_SUBST(UNIVERSALSDK)
|
|---|
| 85 |
|
|---|
| 86 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
|---|
| 87 | AC_ARG_ENABLE(framework,
|
|---|
| 88 | AC_HELP_STRING(--enable-framework@<:@=INSTALLDIR@:>@, Build (MacOSX|Darwin) framework),
|
|---|
| 89 | [
|
|---|
| 90 | case $enableval in
|
|---|
| 91 | yes)
|
|---|
| 92 | enableval=/Library/Frameworks
|
|---|
| 93 | esac
|
|---|
| 94 | case $enableval in
|
|---|
| 95 | no)
|
|---|
| 96 | PYTHONFRAMEWORK=
|
|---|
| 97 | PYTHONFRAMEWORKDIR=no-framework
|
|---|
| 98 | PYTHONFRAMEWORKPREFIX=
|
|---|
| 99 | PYTHONFRAMEWORKINSTALLDIR=
|
|---|
| 100 | FRAMEWORKINSTALLFIRST=
|
|---|
| 101 | FRAMEWORKINSTALLLAST=
|
|---|
| 102 | FRAMEWORKALTINSTALLFIRST=
|
|---|
| 103 | FRAMEWORKALTINSTALLLAST=
|
|---|
| 104 | if test "x${prefix}" = "xNONE"; then
|
|---|
| 105 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
|
|---|
| 106 | else
|
|---|
| 107 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
|
|---|
| 108 | fi
|
|---|
| 109 | enable_framework=
|
|---|
| 110 | ;;
|
|---|
| 111 | *)
|
|---|
| 112 | PYTHONFRAMEWORK=Python
|
|---|
| 113 | PYTHONFRAMEWORKDIR=Python.framework
|
|---|
| 114 | PYTHONFRAMEWORKPREFIX=$enableval
|
|---|
| 115 | PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
|
|---|
| 116 | FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
|
|---|
| 117 | FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
|
|---|
| 118 | FRAMEWORKALTINSTALLFIRST="${FRAMEWORKINSTALLFIRST} bininstall maninstall"
|
|---|
| 119 | FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
|
|---|
| 120 | if test "x${prefix}" = "xNONE" ; then
|
|---|
| 121 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
|
|---|
| 122 | else
|
|---|
| 123 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
|
|---|
| 124 | fi
|
|---|
| 125 | prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
|
|---|
| 126 |
|
|---|
| 127 | # Add makefiles for Mac specific code to the list of output
|
|---|
| 128 | # files:
|
|---|
| 129 | AC_CONFIG_FILES(Mac/Makefile)
|
|---|
| 130 | AC_CONFIG_FILES(Mac/PythonLauncher/Makefile)
|
|---|
| 131 | AC_CONFIG_FILES(Mac/IDLE/Makefile)
|
|---|
| 132 | esac
|
|---|
| 133 | ],[
|
|---|
| 134 | PYTHONFRAMEWORK=
|
|---|
| 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}"
|
|---|
| 144 | else
|
|---|
| 145 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
|
|---|
| 146 | fi
|
|---|
| 147 | enable_framework=
|
|---|
| 148 | ])
|
|---|
| 149 | AC_SUBST(PYTHONFRAMEWORK)
|
|---|
| 150 | AC_SUBST(PYTHONFRAMEWORKDIR)
|
|---|
| 151 | AC_SUBST(PYTHONFRAMEWORKPREFIX)
|
|---|
| 152 | AC_SUBST(PYTHONFRAMEWORKINSTALLDIR)
|
|---|
| 153 | AC_SUBST(FRAMEWORKINSTALLFIRST)
|
|---|
| 154 | AC_SUBST(FRAMEWORKINSTALLLAST)
|
|---|
| 155 | AC_SUBST(FRAMEWORKALTINSTALLFIRST)
|
|---|
| 156 | AC_SUBST(FRAMEWORKALTINSTALLLAST)
|
|---|
| 157 | AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
|
|---|
| 158 |
|
|---|
| 159 | ##AC_ARG_WITH(dyld,
|
|---|
| 160 | ## AC_HELP_STRING(--with-dyld,
|
|---|
| 161 | ## Use (OpenStep|Rhapsody) dynamic linker))
|
|---|
| 162 | ##
|
|---|
| 163 | # Set name for machine-dependent library files
|
|---|
| 164 | AC_SUBST(MACHDEP)
|
|---|
| 165 | AC_MSG_CHECKING(MACHDEP)
|
|---|
| 166 | if test -z "$MACHDEP"
|
|---|
| 167 | then
|
|---|
| 168 | ac_sys_system=`uname -s`
|
|---|
| 169 | if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
|
|---|
| 170 | -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
|
|---|
| 171 | ac_sys_release=`uname -v`
|
|---|
| 172 | else
|
|---|
| 173 | ac_sys_release=`uname -r`
|
|---|
| 174 | fi
|
|---|
| 175 | ac_md_system=`echo $ac_sys_system |
|
|---|
| 176 | tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
|
|---|
| 177 | ac_md_release=`echo $ac_sys_release |
|
|---|
| 178 | tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
|
|---|
| 179 | MACHDEP="$ac_md_system$ac_md_release"
|
|---|
| 180 |
|
|---|
| 181 | case $MACHDEP in
|
|---|
| 182 | cygwin*) MACHDEP="cygwin";;
|
|---|
| 183 | darwin*) MACHDEP="darwin";;
|
|---|
| 184 | atheos*) MACHDEP="atheos";;
|
|---|
| 185 | irix646) MACHDEP="irix6";;
|
|---|
| 186 | os2*|emx*) MACHDEP="emx";;
|
|---|
| 187 |
|
|---|
| 188 | '') MACHDEP="unknown";;
|
|---|
| 189 | esac
|
|---|
| 190 | fi
|
|---|
| 191 |
|
|---|
| 192 | # Some systems cannot stand _XOPEN_SOURCE being defined at all; they
|
|---|
| 193 | # disable features if it is defined, without any means to access these
|
|---|
| 194 | # features as extensions. For these systems, we skip the definition of
|
|---|
| 195 | # _XOPEN_SOURCE. Before adding a system to the list to gain access to
|
|---|
| 196 | # some feature, make sure there is no alternative way to access this
|
|---|
| 197 | # feature. Also, when using wildcards, make sure you have verified the
|
|---|
| 198 | # need for not defining _XOPEN_SOURCE on all systems matching the
|
|---|
| 199 | # wildcard, and that the wildcard does not include future systems
|
|---|
| 200 | # (which may remove their limitations).
|
|---|
| 201 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
|---|
| 202 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 203 | # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
|
|---|
| 204 | # even though select is a POSIX function. Reported by J. Ribbens.
|
|---|
| 205 | # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
|
|---|
| 206 | OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0@:>@)
|
|---|
| 207 | define_xopen_source=no;;
|
|---|
| 208 | # On Solaris 2.6, sys/wait.h is inconsistent in the usage
|
|---|
| 209 | # of union __?sigval. Reported by Stuart Bishop.
|
|---|
| 210 | SunOS/5.6)
|
|---|
| 211 | define_xopen_source=no;;
|
|---|
| 212 | # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
|
|---|
| 213 | # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
|
|---|
| 214 | # Reconfirmed for 7.1.4 by Martin v. Loewis.
|
|---|
| 215 | OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
|
|---|
| 216 | define_xopen_source=no;;
|
|---|
| 217 | # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
|
|---|
| 218 | # but used in struct sockaddr.sa_family. Reported by Tim Rice.
|
|---|
| 219 | SCO_SV/3.2)
|
|---|
| 220 | define_xopen_source=no;;
|
|---|
| 221 | # On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that
|
|---|
| 222 | # it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently,
|
|---|
| 223 | # this is fixed in 10.3, which identifies itself as Darwin/7.*
|
|---|
| 224 | # This should hopefully be fixed in FreeBSD 4.9
|
|---|
| 225 | FreeBSD/4.8* | Darwin/6* )
|
|---|
| 226 | define_xopen_source=no;;
|
|---|
| 227 | # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
|
|---|
| 228 | # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
|
|---|
| 229 | # or has another value. By not (re)defining it, the defaults come in place.
|
|---|
| 230 | AIX/4)
|
|---|
| 231 | define_xopen_source=no;;
|
|---|
| 232 | AIX/5)
|
|---|
| 233 | if test `uname -r` -eq 1; then
|
|---|
| 234 | define_xopen_source=no
|
|---|
| 235 | fi
|
|---|
| 236 | ;;
|
|---|
| 237 | # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
|
|---|
| 238 | # disables platform specific features beyond repair.
|
|---|
| 239 | # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
|
|---|
| 240 | # has no effect, don't bother defining them
|
|---|
| 241 | Darwin/@<:@789@:>@.*)
|
|---|
| 242 | define_xopen_source=no
|
|---|
| 243 | ;;
|
|---|
| 244 |
|
|---|
| 245 | esac
|
|---|
| 246 |
|
|---|
| 247 | if test $define_xopen_source = yes
|
|---|
| 248 | then
|
|---|
| 249 | # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
|
|---|
| 250 | # defined precisely as g++ defines it
|
|---|
| 251 | # Furthermore, on Solaris 10, XPG6 requires the use of a C99
|
|---|
| 252 | # compiler
|
|---|
| 253 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 254 | SunOS/5.8|SunOS/5.9|SunOS/5.10)
|
|---|
| 255 | AC_DEFINE(_XOPEN_SOURCE, 500,
|
|---|
| 256 | Define to the level of X/Open that your system supports)
|
|---|
| 257 | ;;
|
|---|
| 258 | *)
|
|---|
| 259 | AC_DEFINE(_XOPEN_SOURCE, 600,
|
|---|
| 260 | Define to the level of X/Open that your system supports)
|
|---|
| 261 | ;;
|
|---|
| 262 | esac
|
|---|
| 263 |
|
|---|
| 264 | # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
|
|---|
| 265 | # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
|
|---|
| 266 | # several APIs are not declared. Since this is also needed in some
|
|---|
| 267 | # cases for HP-UX, we define it globally.
|
|---|
| 268 | # except for Solaris 10, where it must not be defined,
|
|---|
| 269 | # as it implies XPG4.2
|
|---|
| 270 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 271 | SunOS/5.10)
|
|---|
| 272 | ;;
|
|---|
| 273 | *)
|
|---|
| 274 | AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
|
|---|
| 275 | Define to activate Unix95-and-earlier features)
|
|---|
| 276 | ;;
|
|---|
| 277 | esac
|
|---|
| 278 |
|
|---|
| 279 | AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
|
|---|
| 280 |
|
|---|
| 281 | fi
|
|---|
| 282 |
|
|---|
| 283 | #
|
|---|
| 284 | # SGI compilers allow the specification of the both the ABI and the
|
|---|
| 285 | # ISA on the command line. Depending on the values of these switches,
|
|---|
| 286 | # different and often incompatable code will be generated.
|
|---|
| 287 | #
|
|---|
| 288 | # The SGI_ABI variable can be used to modify the CC and LDFLAGS and
|
|---|
| 289 | # thus supply support for various ABI/ISA combinations. The MACHDEP
|
|---|
| 290 | # variable is also adjusted.
|
|---|
| 291 | #
|
|---|
| 292 | AC_SUBST(SGI_ABI)
|
|---|
| 293 | if test ! -z "$SGI_ABI"
|
|---|
| 294 | then
|
|---|
| 295 | CC="cc $SGI_ABI"
|
|---|
| 296 | LDFLAGS="$SGI_ABI $LDFLAGS"
|
|---|
| 297 | MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
|
|---|
| 298 | fi
|
|---|
| 299 | AC_MSG_RESULT($MACHDEP)
|
|---|
| 300 |
|
|---|
| 301 | # And add extra plat-mac for darwin
|
|---|
| 302 | AC_SUBST(EXTRAPLATDIR)
|
|---|
| 303 | AC_SUBST(EXTRAMACHDEPPATH)
|
|---|
| 304 | AC_MSG_CHECKING(EXTRAPLATDIR)
|
|---|
| 305 | if test -z "$EXTRAPLATDIR"
|
|---|
| 306 | then
|
|---|
| 307 | case $MACHDEP in
|
|---|
| 308 | darwin)
|
|---|
| 309 | EXTRAPLATDIR="\$(PLATMACDIRS)"
|
|---|
| 310 | EXTRAMACHDEPPATH="\$(PLATMACPATH)"
|
|---|
| 311 | ;;
|
|---|
| 312 | *)
|
|---|
| 313 | EXTRAPLATDIR=""
|
|---|
| 314 | EXTRAMACHDEPPATH=""
|
|---|
| 315 | ;;
|
|---|
| 316 | esac
|
|---|
| 317 | fi
|
|---|
| 318 | AC_MSG_RESULT($EXTRAPLATDIR)
|
|---|
| 319 |
|
|---|
| 320 | # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
|
|---|
| 321 | # it may influence the way we can build extensions, so distutils
|
|---|
| 322 | # needs to check it
|
|---|
| 323 | AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
|
|---|
| 324 | AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
|
|---|
| 325 | CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
|
|---|
| 326 | EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
|
|---|
| 327 |
|
|---|
| 328 | # checks for alternative programs
|
|---|
| 329 |
|
|---|
| 330 | # compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
|
|---|
| 331 | # for debug/optimization stuff. BASECFLAGS is for flags that are required
|
|---|
| 332 | # just to get things to compile and link. Users are free to override OPT
|
|---|
| 333 | # when running configure or make. The build should not break if they do.
|
|---|
| 334 | # BASECFLAGS should generally not be messed with, however.
|
|---|
| 335 |
|
|---|
| 336 | # XXX shouldn't some/most/all of this code be merged with the stuff later
|
|---|
| 337 | # on that fiddles with OPT and BASECFLAGS?
|
|---|
| 338 | AC_MSG_CHECKING(for --without-gcc)
|
|---|
| 339 | AC_ARG_WITH(gcc,
|
|---|
| 340 | AC_HELP_STRING(--without-gcc,never use gcc),
|
|---|
| 341 | [
|
|---|
| 342 | case $withval in
|
|---|
| 343 | no) CC=cc
|
|---|
| 344 | without_gcc=yes;;
|
|---|
| 345 | yes) CC=gcc
|
|---|
| 346 | without_gcc=no;;
|
|---|
| 347 | *) CC=$withval
|
|---|
| 348 | without_gcc=$withval;;
|
|---|
| 349 | esac], [
|
|---|
| 350 | case $ac_sys_system in
|
|---|
| 351 | AIX*) CC=cc_r
|
|---|
| 352 | without_gcc=;;
|
|---|
| 353 | BeOS*)
|
|---|
| 354 | case $BE_HOST_CPU in
|
|---|
| 355 | ppc)
|
|---|
| 356 | CC=mwcc
|
|---|
| 357 | without_gcc=yes
|
|---|
| 358 | BASECFLAGS="$BASECFLAGS -export pragma"
|
|---|
| 359 | OPT="$OPT -O"
|
|---|
| 360 | LDFLAGS="$LDFLAGS -nodup"
|
|---|
| 361 | ;;
|
|---|
| 362 | x86)
|
|---|
| 363 | CC=gcc
|
|---|
| 364 | without_gcc=no
|
|---|
| 365 | OPT="$OPT -O"
|
|---|
| 366 | ;;
|
|---|
| 367 | *)
|
|---|
| 368 | AC_MSG_ERROR([Unknown BeOS platform "$BE_HOST_CPU"])
|
|---|
| 369 | ;;
|
|---|
| 370 | esac
|
|---|
| 371 | AR="\$(srcdir)/Modules/ar_beos"
|
|---|
| 372 | RANLIB=:
|
|---|
| 373 | ;;
|
|---|
| 374 | Monterey*)
|
|---|
| 375 | RANLIB=:
|
|---|
| 376 | without_gcc=;;
|
|---|
| 377 | *) without_gcc=no;;
|
|---|
| 378 | esac])
|
|---|
| 379 | AC_MSG_RESULT($without_gcc)
|
|---|
| 380 |
|
|---|
| 381 | # If the user switches compilers, we can't believe the cache
|
|---|
| 382 | if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
|
|---|
| 383 | then
|
|---|
| 384 | AC_MSG_ERROR([cached CC is different -- throw away $cache_file
|
|---|
| 385 | (it is also a good idea to do 'make clean' before compiling)])
|
|---|
| 386 | fi
|
|---|
| 387 |
|
|---|
| 388 | AC_PROG_CC
|
|---|
| 389 |
|
|---|
| 390 | AC_SUBST(CXX)
|
|---|
| 391 | AC_SUBST(MAINCC)
|
|---|
| 392 | AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
|
|---|
| 393 | AC_ARG_WITH(cxx_main,
|
|---|
| 394 | AC_HELP_STRING([--with-cxx-main=<compiler>],
|
|---|
| 395 | [compile main() and link python executable with C++ compiler]),
|
|---|
| 396 | [
|
|---|
| 397 |
|
|---|
| 398 | case $withval in
|
|---|
| 399 | no) with_cxx_main=no
|
|---|
| 400 | MAINCC='$(CC)';;
|
|---|
| 401 | yes) with_cxx_main=yes
|
|---|
| 402 | MAINCC='$(CXX)';;
|
|---|
| 403 | *) with_cxx_main=yes
|
|---|
| 404 | MAINCC=$withval
|
|---|
| 405 | if test -z "$CXX"
|
|---|
| 406 | then
|
|---|
| 407 | CXX=$withval
|
|---|
| 408 | fi;;
|
|---|
| 409 | esac], [
|
|---|
| 410 | with_cxx_main=no
|
|---|
| 411 | MAINCC='$(CC)'
|
|---|
| 412 | ])
|
|---|
| 413 | AC_MSG_RESULT($with_cxx_main)
|
|---|
| 414 |
|
|---|
| 415 | preset_cxx="$CXX"
|
|---|
| 416 | if test -z "$CXX"
|
|---|
| 417 | then
|
|---|
| 418 | case "$CC" in
|
|---|
| 419 | gcc) AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;;
|
|---|
| 420 | cc) AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;;
|
|---|
| 421 | esac
|
|---|
| 422 | if test "$CXX" = "notfound"
|
|---|
| 423 | then
|
|---|
| 424 | CXX=""
|
|---|
| 425 | fi
|
|---|
| 426 | fi
|
|---|
| 427 | if test -z "$CXX"
|
|---|
| 428 | then
|
|---|
| 429 | AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
|
|---|
| 430 | if test "$CXX" = "notfound"
|
|---|
| 431 | then
|
|---|
| 432 | CXX=""
|
|---|
| 433 | fi
|
|---|
| 434 | fi
|
|---|
| 435 | if test "$preset_cxx" != "$CXX"
|
|---|
| 436 | then
|
|---|
| 437 | AC_MSG_WARN([
|
|---|
| 438 |
|
|---|
| 439 | By default, distutils will build C++ extension modules with "$CXX".
|
|---|
| 440 | If this is not intended, then set CXX on the configure command line.
|
|---|
| 441 | ])
|
|---|
| 442 | fi
|
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 | # checks for UNIX variants that set C preprocessor variables
|
|---|
| 446 | AC_AIX
|
|---|
| 447 |
|
|---|
| 448 | # Check for unsupported systems
|
|---|
| 449 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 450 | Linux*/1*)
|
|---|
| 451 | echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
|
|---|
| 452 | echo See README for details.
|
|---|
| 453 | exit 1;;
|
|---|
| 454 | esac
|
|---|
| 455 |
|
|---|
| 456 | AC_EXEEXT
|
|---|
| 457 | AC_MSG_CHECKING(for --with-suffix)
|
|---|
| 458 | AC_ARG_WITH(suffix,
|
|---|
| 459 | AC_HELP_STRING(--with-suffix=.exe, set executable suffix),
|
|---|
| 460 | [
|
|---|
| 461 | case $withval in
|
|---|
| 462 | no) EXEEXT=;;
|
|---|
| 463 | yes) EXEEXT=.exe;;
|
|---|
| 464 | *) EXEEXT=$withval;;
|
|---|
| 465 | esac])
|
|---|
| 466 | AC_MSG_RESULT($EXEEXT)
|
|---|
| 467 |
|
|---|
| 468 | # Test whether we're running on a non-case-sensitive system, in which
|
|---|
| 469 | # case we give a warning if no ext is given
|
|---|
| 470 | AC_SUBST(BUILDEXEEXT)
|
|---|
| 471 | AC_MSG_CHECKING(for case-insensitive build directory)
|
|---|
| 472 | if test ! -d CaseSensitiveTestDir; then
|
|---|
| 473 | mkdir CaseSensitiveTestDir
|
|---|
| 474 | fi
|
|---|
| 475 |
|
|---|
| 476 | if test -d casesensitivetestdir
|
|---|
| 477 | then
|
|---|
| 478 | AC_MSG_RESULT(yes)
|
|---|
| 479 | BUILDEXEEXT=.exe
|
|---|
| 480 | else
|
|---|
| 481 | AC_MSG_RESULT(no)
|
|---|
| 482 | BUILDEXEEXT=$EXEEXT
|
|---|
| 483 | fi
|
|---|
| 484 | rmdir CaseSensitiveTestDir
|
|---|
| 485 |
|
|---|
| 486 | case $MACHDEP in
|
|---|
| 487 | bsdos*)
|
|---|
| 488 | case $CC in
|
|---|
| 489 | gcc) CC="$CC -D_HAVE_BSDI";;
|
|---|
| 490 | esac;;
|
|---|
| 491 | os2*|emx*)
|
|---|
| 492 | CC="$CC -DPYOS_OS2=1 -DPYCC_GCC=1"
|
|---|
| 493 | ;;
|
|---|
| 494 | esac
|
|---|
| 495 |
|
|---|
| 496 | case $ac_sys_system in
|
|---|
| 497 | hp*|HP*)
|
|---|
| 498 | case $CC in
|
|---|
| 499 | cc|*/cc) CC="$CC -Ae";;
|
|---|
| 500 | esac;;
|
|---|
| 501 | Monterey*)
|
|---|
| 502 | case $CC in
|
|---|
| 503 | cc) CC="$CC -Wl,-Bexport";;
|
|---|
| 504 | esac;;
|
|---|
| 505 | SunOS*)
|
|---|
| 506 | # Some functions have a prototype only with that define, e.g. confstr
|
|---|
| 507 | AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
|
|---|
| 508 | ;;
|
|---|
| 509 | esac
|
|---|
| 510 |
|
|---|
| 511 |
|
|---|
| 512 | AC_SUBST(LIBRARY)
|
|---|
| 513 | AC_MSG_CHECKING(LIBRARY)
|
|---|
| 514 | if test -z "$LIBRARY"
|
|---|
| 515 | then
|
|---|
| 516 | LIBRARY='libpython$(VERSION).a'
|
|---|
| 517 | fi
|
|---|
| 518 | AC_MSG_RESULT($LIBRARY)
|
|---|
| 519 |
|
|---|
| 520 | # LDLIBRARY is the name of the library to link against (as opposed to the
|
|---|
| 521 | # name of the library into which to insert object files). BLDLIBRARY is also
|
|---|
| 522 | # the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
|
|---|
| 523 | # is blank as the main program is not linked directly against LDLIBRARY.
|
|---|
| 524 | # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
|
|---|
| 525 | # systems without shared libraries, LDLIBRARY is the same as LIBRARY
|
|---|
| 526 | # (defined in the Makefiles). On Cygwin and OS/2 LDLIBRARY is the import
|
|---|
| 527 | # library, DLLLIBRARY is the shared (i.e., DLL) library.
|
|---|
| 528 | #
|
|---|
| 529 | # RUNSHARED is used to run shared python without installed libraries
|
|---|
| 530 | #
|
|---|
| 531 | # INSTSONAME is the name of the shared library that will be use to install
|
|---|
| 532 | # on the system - some systems like version suffix, others don't
|
|---|
| 533 | AC_SUBST(LDLIBRARY)
|
|---|
| 534 | AC_SUBST(DLLLIBRARY)
|
|---|
| 535 | AC_SUBST(BLDLIBRARY)
|
|---|
| 536 | AC_SUBST(LDLIBRARYDIR)
|
|---|
| 537 | AC_SUBST(INSTSONAME)
|
|---|
| 538 | AC_SUBST(RUNSHARED)
|
|---|
| 539 | LDLIBRARY="$LIBRARY"
|
|---|
| 540 | BLDLIBRARY='$(LDLIBRARY)'
|
|---|
| 541 | INSTSONAME='$(LDLIBRARY)'
|
|---|
| 542 | DLLLIBRARY=''
|
|---|
| 543 | LDLIBRARYDIR=''
|
|---|
| 544 | RUNSHARED=''
|
|---|
| 545 |
|
|---|
| 546 | # LINKCC is the command that links the python executable -- default is $(CC).
|
|---|
| 547 | # If CXX is set, and if it is needed to link a main function that was
|
|---|
| 548 | # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
|
|---|
| 549 | # python might then depend on the C++ runtime
|
|---|
| 550 | # This is altered for AIX in order to build the export list before
|
|---|
| 551 | # linking.
|
|---|
| 552 | AC_SUBST(LINKCC)
|
|---|
| 553 | AC_MSG_CHECKING(LINKCC)
|
|---|
| 554 | if test -z "$LINKCC"
|
|---|
| 555 | then
|
|---|
| 556 | LINKCC='$(PURIFY) $(MAINCC)'
|
|---|
| 557 | case $ac_sys_system in
|
|---|
| 558 | AIX*)
|
|---|
| 559 | exp_extra="\"\""
|
|---|
| 560 | if test $ac_sys_release -ge 5 -o \
|
|---|
| 561 | $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then
|
|---|
| 562 | exp_extra="."
|
|---|
| 563 | fi
|
|---|
| 564 | LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
|
|---|
| 565 | Monterey64*)
|
|---|
| 566 | LINKCC="$LINKCC -L/usr/lib/ia64l64";;
|
|---|
| 567 | esac
|
|---|
| 568 | fi
|
|---|
| 569 | AC_MSG_RESULT($LINKCC)
|
|---|
| 570 |
|
|---|
| 571 | AC_MSG_CHECKING(for --enable-shared)
|
|---|
| 572 | AC_ARG_ENABLE(shared,
|
|---|
| 573 | AC_HELP_STRING(--enable-shared, disable/enable building shared python library))
|
|---|
| 574 |
|
|---|
| 575 | if test -z "$enable_shared"
|
|---|
| 576 | then
|
|---|
| 577 | case $ac_sys_system in
|
|---|
| 578 | CYGWIN* | atheos* | os2* | emx*)
|
|---|
| 579 | enable_shared="yes";;
|
|---|
| 580 | *)
|
|---|
| 581 | enable_shared="no";;
|
|---|
| 582 | esac
|
|---|
| 583 | fi
|
|---|
| 584 | AC_MSG_RESULT($enable_shared)
|
|---|
| 585 |
|
|---|
| 586 | AC_MSG_CHECKING(for --enable-profiling)
|
|---|
| 587 | AC_ARG_ENABLE(profiling,
|
|---|
| 588 | AC_HELP_STRING(--enable-profiling, enable C-level code profiling),
|
|---|
| 589 | [ac_save_cc="$CC"
|
|---|
| 590 | CC="$CC -pg"
|
|---|
| 591 | AC_TRY_RUN([int main() { return 0; }],
|
|---|
| 592 | ac_enable_profiling="yes",
|
|---|
| 593 | ac_enable_profiling="no",
|
|---|
| 594 | ac_enable_profiling="no")
|
|---|
| 595 | CC="$ac_save_cc"])
|
|---|
| 596 | AC_MSG_RESULT($ac_enable_profiling)
|
|---|
| 597 |
|
|---|
| 598 | case "$ac_enable_profiling" in
|
|---|
| 599 | "yes")
|
|---|
| 600 | BASECFLAGS="-pg $BASECFLAGS"
|
|---|
| 601 | LDFLAGS="-pg $LDFLAGS"
|
|---|
| 602 | ;;
|
|---|
| 603 | esac
|
|---|
| 604 |
|
|---|
| 605 | AC_MSG_CHECKING(LDLIBRARY)
|
|---|
| 606 |
|
|---|
| 607 | # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
|
|---|
| 608 | # library that we build, but we do not want to link against it (we
|
|---|
| 609 | # will find it with a -framework option). For this reason there is an
|
|---|
| 610 | # extra variable BLDLIBRARY against which Python and the extension
|
|---|
| 611 | # modules are linked, BLDLIBRARY. This is normally the same as
|
|---|
| 612 | # LDLIBRARY, but empty for MacOSX framework builds.
|
|---|
| 613 | if test "$enable_framework"
|
|---|
| 614 | then
|
|---|
| 615 | LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 616 | RUNSHARED=DYLD_FRAMEWORK_PATH="`pwd`:$DYLD_FRAMEWORK_PATH"
|
|---|
| 617 | BLDLIBRARY=''
|
|---|
| 618 | else
|
|---|
| 619 | BLDLIBRARY='$(LDLIBRARY)'
|
|---|
| 620 | fi
|
|---|
| 621 |
|
|---|
| 622 | # Other platforms follow
|
|---|
| 623 | if test $enable_shared = "yes"; then
|
|---|
| 624 | AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
|
|---|
| 625 | case $ac_sys_system in
|
|---|
| 626 | BeOS*)
|
|---|
| 627 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 628 | ;;
|
|---|
| 629 | CYGWIN*)
|
|---|
| 630 | LDLIBRARY='libpython$(VERSION).dll.a'
|
|---|
| 631 | DLLLIBRARY='libpython$(VERSION).dll'
|
|---|
| 632 | ;;
|
|---|
| 633 | SunOS*)
|
|---|
| 634 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 635 | BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
|
|---|
| 636 | RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
|---|
| 637 | INSTSONAME="$LDLIBRARY".$SOVERSION
|
|---|
| 638 | ;;
|
|---|
| 639 | Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
|
|---|
| 640 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 641 | BLDLIBRARY='-L. -lpython$(VERSION)'
|
|---|
| 642 | RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
|---|
| 643 | case $ac_sys_system in
|
|---|
| 644 | FreeBSD*)
|
|---|
| 645 | SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
|
|---|
| 646 | ;;
|
|---|
| 647 | esac
|
|---|
| 648 | INSTSONAME="$LDLIBRARY".$SOVERSION
|
|---|
| 649 | ;;
|
|---|
| 650 | hp*|HP*)
|
|---|
| 651 | case `uname -m` in
|
|---|
| 652 | ia64)
|
|---|
| 653 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 654 | ;;
|
|---|
| 655 | *)
|
|---|
| 656 | LDLIBRARY='libpython$(VERSION).sl'
|
|---|
| 657 | ;;
|
|---|
| 658 | esac
|
|---|
| 659 | BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)'
|
|---|
| 660 | RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH}
|
|---|
| 661 | ;;
|
|---|
| 662 | OSF*)
|
|---|
| 663 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 664 | BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
|
|---|
| 665 | RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
|---|
| 666 | ;;
|
|---|
| 667 | atheos*)
|
|---|
| 668 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 669 | BLDLIBRARY='-L. -lpython$(VERSION)'
|
|---|
| 670 | RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
|
|---|
| 671 | ;;
|
|---|
| 672 | os2*|emx*)
|
|---|
| 673 | LDLIBRARY='python$(VERSION)_dll.a'
|
|---|
| 674 | BLDLIBRARY='-L. -lpython$(VERSION)'
|
|---|
| 675 | RUNSHARED=BEGINLIBPATH="`pwd`;$BEGINLIBPATH"
|
|---|
| 676 | CONDENSED_VERSION=`echo "$(VERSION)" | tr -d .,"`
|
|---|
| 677 | DLLLIBRARY='python$(CONDENSED_VERSION).dll'
|
|---|
| 678 | ;;
|
|---|
| 679 | esac
|
|---|
| 680 | else # shared is disabled
|
|---|
| 681 | case $ac_sys_system in
|
|---|
| 682 | CYGWIN*)
|
|---|
| 683 | BLDLIBRARY='$(LIBRARY)'
|
|---|
| 684 | LDLIBRARY='libpython$(VERSION).dll.a'
|
|---|
| 685 | ;;
|
|---|
| 686 | esac
|
|---|
| 687 | fi
|
|---|
| 688 |
|
|---|
| 689 | AC_MSG_RESULT($LDLIBRARY)
|
|---|
| 690 |
|
|---|
| 691 | AC_PROG_RANLIB
|
|---|
| 692 | AC_SUBST(AR)
|
|---|
| 693 | AC_CHECK_PROGS(AR, ar aal, ar)
|
|---|
| 694 |
|
|---|
| 695 | AC_SUBST(SVNVERSION)
|
|---|
| 696 | AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
|
|---|
| 697 | if test $SVNVERSION = found
|
|---|
| 698 | then
|
|---|
| 699 | SVNVERSION="svnversion \$(srcdir)"
|
|---|
| 700 | else
|
|---|
| 701 | SVNVERSION="echo exported"
|
|---|
| 702 | fi
|
|---|
| 703 |
|
|---|
| 704 | case $MACHDEP in
|
|---|
| 705 | bsdos*|hp*|HP*)
|
|---|
| 706 | # install -d does not work on BSDI or HP-UX
|
|---|
| 707 | if test -z "$INSTALL"
|
|---|
| 708 | then
|
|---|
| 709 | INSTALL="${srcdir}/install-sh -c"
|
|---|
| 710 | fi
|
|---|
| 711 | esac
|
|---|
| 712 | AC_PROG_INSTALL
|
|---|
| 713 |
|
|---|
| 714 | # Not every filesystem supports hard links
|
|---|
| 715 | AC_SUBST(LN)
|
|---|
| 716 | if test -z "$LN" ; then
|
|---|
| 717 | case $ac_sys_system in
|
|---|
| 718 | BeOS*) LN="ln -s";;
|
|---|
| 719 | CYGWIN*) LN="ln -s";;
|
|---|
| 720 | os2*|emx*) LN="ln -s";;
|
|---|
| 721 | atheos*) LN="ln -s";;
|
|---|
| 722 | *) LN=ln;;
|
|---|
| 723 | esac
|
|---|
| 724 | fi
|
|---|
| 725 |
|
|---|
| 726 | # Check for --with-pydebug
|
|---|
| 727 | AC_MSG_CHECKING(for --with-pydebug)
|
|---|
| 728 | AC_ARG_WITH(pydebug,
|
|---|
| 729 | AC_HELP_STRING(--with-pydebug, build with Py_DEBUG defined),
|
|---|
| 730 | [
|
|---|
| 731 | if test "$withval" != no
|
|---|
| 732 | then
|
|---|
| 733 | AC_DEFINE(Py_DEBUG, 1,
|
|---|
| 734 | [Define if you want to build an interpreter with many run-time checks.])
|
|---|
| 735 | AC_MSG_RESULT(yes);
|
|---|
| 736 | Py_DEBUG='true'
|
|---|
| 737 | else AC_MSG_RESULT(no); Py_DEBUG='false'
|
|---|
| 738 | fi],
|
|---|
| 739 | [AC_MSG_RESULT(no)])
|
|---|
| 740 |
|
|---|
| 741 | # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
|
|---|
| 742 | # merged with this chunk of code?
|
|---|
| 743 |
|
|---|
| 744 | # Optimizer/debugger flags
|
|---|
| 745 | # ------------------------
|
|---|
| 746 | # (The following bit of code is complicated enough - please keep things
|
|---|
| 747 | # indented properly. Just pretend you're editing Python code. ;-)
|
|---|
| 748 |
|
|---|
| 749 | # There are two parallel sets of case statements below, one that checks to
|
|---|
| 750 | # see if OPT was set and one that does BASECFLAGS setting based upon
|
|---|
| 751 | # compiler and platform. BASECFLAGS tweaks need to be made even if the
|
|---|
| 752 | # user set OPT.
|
|---|
| 753 |
|
|---|
| 754 | # tweak OPT based on compiler and platform, only if the user didn't set
|
|---|
| 755 | # it on the command line
|
|---|
| 756 | AC_SUBST(OPT)
|
|---|
| 757 | if test -z "$OPT"
|
|---|
| 758 | then
|
|---|
| 759 | case $GCC in
|
|---|
| 760 | yes)
|
|---|
| 761 | if test "$CC" != 'g++' ; then
|
|---|
| 762 | STRICT_PROTO="-Wstrict-prototypes"
|
|---|
| 763 | fi
|
|---|
| 764 | case $ac_cv_prog_cc_g in
|
|---|
| 765 | yes)
|
|---|
| 766 | if test "$Py_DEBUG" = 'true' ; then
|
|---|
| 767 | # Optimization messes up debuggers, so turn it off for
|
|---|
| 768 | # debug builds.
|
|---|
| 769 | OPT="-g -Wall $STRICT_PROTO"
|
|---|
| 770 | else
|
|---|
| 771 | OPT="-g -O3 -Wall $STRICT_PROTO"
|
|---|
| 772 | fi
|
|---|
| 773 | ;;
|
|---|
| 774 | *)
|
|---|
| 775 | OPT="-O3 -Wall $STRICT_PROTO"
|
|---|
| 776 | ;;
|
|---|
| 777 | esac
|
|---|
| 778 | case $ac_sys_system in
|
|---|
| 779 | SCO_SV*) OPT="$OPT -m486 -DSCO5"
|
|---|
| 780 | ;;
|
|---|
| 781 | esac
|
|---|
| 782 | ;;
|
|---|
| 783 |
|
|---|
| 784 | *)
|
|---|
| 785 | OPT="-O"
|
|---|
| 786 | ;;
|
|---|
| 787 | esac
|
|---|
| 788 |
|
|---|
| 789 | # The current (beta) Monterey compiler dies with optimizations
|
|---|
| 790 | # XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
|
|---|
| 791 | case $ac_sys_system in
|
|---|
| 792 | Monterey*)
|
|---|
| 793 | OPT=""
|
|---|
| 794 | ;;
|
|---|
| 795 | esac
|
|---|
| 796 |
|
|---|
| 797 | fi
|
|---|
| 798 |
|
|---|
| 799 | AC_SUBST(BASECFLAGS)
|
|---|
| 800 | # tweak BASECFLAGS based on compiler and platform
|
|---|
| 801 | case $GCC in
|
|---|
| 802 | yes)
|
|---|
| 803 | # Python violates C99 rules, by casting between incompatible
|
|---|
| 804 | # pointer types. GCC may generate bad code as a result of that,
|
|---|
| 805 | # so use -fno-strict-aliasing if supported.
|
|---|
| 806 | AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
|
|---|
| 807 | ac_save_cc="$CC"
|
|---|
| 808 | CC="$CC -fno-strict-aliasing"
|
|---|
| 809 | AC_TRY_RUN([int main() { return 0; }],
|
|---|
| 810 | ac_cv_no_strict_aliasing_ok=yes,
|
|---|
| 811 | ac_cv_no_strict_aliasing_ok=no,
|
|---|
| 812 | ac_cv_no_strict_aliasing_ok=no)
|
|---|
| 813 | CC="$ac_save_cc"
|
|---|
| 814 | AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
|
|---|
| 815 | if test $ac_cv_no_strict_aliasing_ok = yes
|
|---|
| 816 | then
|
|---|
| 817 | BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
|
|---|
| 818 | fi
|
|---|
| 819 | case $ac_sys_system in
|
|---|
| 820 | SCO_SV*)
|
|---|
| 821 | BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
|
|---|
| 822 | ;;
|
|---|
| 823 | # is there any other compiler on Darwin besides gcc?
|
|---|
| 824 | Darwin*)
|
|---|
| 825 | BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd"
|
|---|
| 826 | if test "${enable_universalsdk}"; then
|
|---|
| 827 | BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
|
|---|
| 828 | fi
|
|---|
| 829 |
|
|---|
| 830 | ;;
|
|---|
| 831 | OSF*)
|
|---|
| 832 | BASECFLAGS="$BASECFLAGS -mieee"
|
|---|
| 833 | ;;
|
|---|
| 834 | esac
|
|---|
| 835 | ;;
|
|---|
| 836 |
|
|---|
| 837 | *)
|
|---|
| 838 | case $ac_sys_system in
|
|---|
| 839 | OpenUNIX*|UnixWare*)
|
|---|
| 840 | BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
|
|---|
| 841 | ;;
|
|---|
| 842 | OSF*)
|
|---|
| 843 | BASECFLAGS="$BASECFLAGS -ieee -std"
|
|---|
| 844 | ;;
|
|---|
| 845 | SCO_SV*)
|
|---|
| 846 | BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
|
|---|
| 847 | ;;
|
|---|
| 848 | esac
|
|---|
| 849 | ;;
|
|---|
| 850 | esac
|
|---|
| 851 |
|
|---|
| 852 | if test "$Py_DEBUG" = 'true'; then
|
|---|
| 853 | :
|
|---|
| 854 | else
|
|---|
| 855 | OPT="-DNDEBUG $OPT"
|
|---|
| 856 | fi
|
|---|
| 857 |
|
|---|
| 858 | if test "$ac_arch_flags"
|
|---|
| 859 | then
|
|---|
| 860 | BASECFLAGS="$BASECFLAGS $ac_arch_flags"
|
|---|
| 861 | fi
|
|---|
| 862 |
|
|---|
| 863 | # disable check for icc since it seems to pass, but generates a warning
|
|---|
| 864 | if test "$CC" = icc
|
|---|
| 865 | then
|
|---|
| 866 | ac_cv_opt_olimit_ok=no
|
|---|
| 867 | fi
|
|---|
| 868 |
|
|---|
| 869 | AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
|
|---|
| 870 | AC_CACHE_VAL(ac_cv_opt_olimit_ok,
|
|---|
| 871 | [ac_save_cc="$CC"
|
|---|
| 872 | CC="$CC -OPT:Olimit=0"
|
|---|
| 873 | AC_TRY_RUN([int main() { return 0; }],
|
|---|
| 874 | ac_cv_opt_olimit_ok=yes,
|
|---|
| 875 | ac_cv_opt_olimit_ok=no,
|
|---|
| 876 | ac_cv_opt_olimit_ok=no)
|
|---|
| 877 | CC="$ac_save_cc"])
|
|---|
| 878 | AC_MSG_RESULT($ac_cv_opt_olimit_ok)
|
|---|
| 879 | if test $ac_cv_opt_olimit_ok = yes; then
|
|---|
| 880 | case $ac_sys_system in
|
|---|
| 881 | # XXX is this branch needed? On MacOSX 10.2.2 the result of the
|
|---|
| 882 | # olimit_ok test is "no". Is it "yes" in some other Darwin-esque
|
|---|
| 883 | # environment?
|
|---|
| 884 | Darwin*)
|
|---|
| 885 | ;;
|
|---|
| 886 | *)
|
|---|
| 887 | BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
|
|---|
| 888 | ;;
|
|---|
| 889 | esac
|
|---|
| 890 | else
|
|---|
| 891 | AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
|
|---|
| 892 | AC_CACHE_VAL(ac_cv_olimit_ok,
|
|---|
| 893 | [ac_save_cc="$CC"
|
|---|
| 894 | CC="$CC -Olimit 1500"
|
|---|
| 895 | AC_TRY_RUN([int main() { return 0; }],
|
|---|
| 896 | ac_cv_olimit_ok=yes,
|
|---|
| 897 | ac_cv_olimit_ok=no,
|
|---|
| 898 | ac_cv_olimit_ok=no)
|
|---|
| 899 | CC="$ac_save_cc"])
|
|---|
| 900 | AC_MSG_RESULT($ac_cv_olimit_ok)
|
|---|
| 901 | if test $ac_cv_olimit_ok = yes; then
|
|---|
| 902 | BASECFLAGS="$BASECFLAGS -Olimit 1500"
|
|---|
| 903 | fi
|
|---|
| 904 | fi
|
|---|
| 905 |
|
|---|
| 906 | # On some compilers, pthreads are available without further options
|
|---|
| 907 | # (e.g. MacOS X). On some of these systems, the compiler will not
|
|---|
| 908 | # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
|
|---|
| 909 | # So we have to see first whether pthreads are available without
|
|---|
| 910 | # options before we can check whether -Kpthread improves anything.
|
|---|
| 911 | AC_MSG_CHECKING(whether pthreads are available without options)
|
|---|
| 912 | AC_CACHE_VAL(ac_cv_pthread_is_default,
|
|---|
| 913 | [AC_TRY_RUN([
|
|---|
| 914 | #include <pthread.h>
|
|---|
| 915 |
|
|---|
| 916 | void* routine(void* p){return NULL;}
|
|---|
| 917 |
|
|---|
| 918 | int main(){
|
|---|
| 919 | pthread_t p;
|
|---|
| 920 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
|---|
| 921 | return 1;
|
|---|
| 922 | (void)pthread_detach(p);
|
|---|
| 923 | return 0;
|
|---|
| 924 | }
|
|---|
| 925 | ],
|
|---|
| 926 | [
|
|---|
| 927 | ac_cv_pthread_is_default=yes
|
|---|
| 928 | ac_cv_kthread=no
|
|---|
| 929 | ac_cv_pthread=no
|
|---|
| 930 | ],
|
|---|
| 931 | ac_cv_pthread_is_default=no,
|
|---|
| 932 | ac_cv_pthread_is_default=no)
|
|---|
| 933 | ])
|
|---|
| 934 | AC_MSG_RESULT($ac_cv_pthread_is_default)
|
|---|
| 935 |
|
|---|
| 936 |
|
|---|
| 937 | if test $ac_cv_pthread_is_default = yes
|
|---|
| 938 | then
|
|---|
| 939 | ac_cv_kpthread=no
|
|---|
| 940 | else
|
|---|
| 941 | # -Kpthread, if available, provides the right #defines
|
|---|
| 942 | # and linker options to make pthread_create available
|
|---|
| 943 | # Some compilers won't report that they do not support -Kpthread,
|
|---|
| 944 | # so we need to run a program to see whether it really made the
|
|---|
| 945 | # function available.
|
|---|
| 946 | AC_MSG_CHECKING(whether $CC accepts -Kpthread)
|
|---|
| 947 | AC_CACHE_VAL(ac_cv_kpthread,
|
|---|
| 948 | [ac_save_cc="$CC"
|
|---|
| 949 | CC="$CC -Kpthread"
|
|---|
| 950 | AC_TRY_RUN([
|
|---|
| 951 | #include <pthread.h>
|
|---|
| 952 |
|
|---|
| 953 | void* routine(void* p){return NULL;}
|
|---|
| 954 |
|
|---|
| 955 | int main(){
|
|---|
| 956 | pthread_t p;
|
|---|
| 957 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
|---|
| 958 | return 1;
|
|---|
| 959 | (void)pthread_detach(p);
|
|---|
| 960 | return 0;
|
|---|
| 961 | }
|
|---|
| 962 | ],
|
|---|
| 963 | ac_cv_kpthread=yes,
|
|---|
| 964 | ac_cv_kpthread=no,
|
|---|
| 965 | ac_cv_kpthread=no)
|
|---|
| 966 | CC="$ac_save_cc"])
|
|---|
| 967 | AC_MSG_RESULT($ac_cv_kpthread)
|
|---|
| 968 | fi
|
|---|
| 969 |
|
|---|
| 970 | if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
|
|---|
| 971 | then
|
|---|
| 972 | # -Kthread, if available, provides the right #defines
|
|---|
| 973 | # and linker options to make pthread_create available
|
|---|
| 974 | # Some compilers won't report that they do not support -Kthread,
|
|---|
| 975 | # so we need to run a program to see whether it really made the
|
|---|
| 976 | # function available.
|
|---|
| 977 | AC_MSG_CHECKING(whether $CC accepts -Kthread)
|
|---|
| 978 | AC_CACHE_VAL(ac_cv_kthread,
|
|---|
| 979 | [ac_save_cc="$CC"
|
|---|
| 980 | CC="$CC -Kthread"
|
|---|
| 981 | AC_TRY_RUN([
|
|---|
| 982 | #include <pthread.h>
|
|---|
| 983 |
|
|---|
| 984 | void* routine(void* p){return NULL;}
|
|---|
| 985 |
|
|---|
| 986 | int main(){
|
|---|
| 987 | pthread_t p;
|
|---|
| 988 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
|---|
| 989 | return 1;
|
|---|
| 990 | (void)pthread_detach(p);
|
|---|
| 991 | return 0;
|
|---|
| 992 | }
|
|---|
| 993 | ],
|
|---|
| 994 | ac_cv_kthread=yes,
|
|---|
| 995 | ac_cv_kthread=no,
|
|---|
| 996 | ac_cv_kthread=no)
|
|---|
| 997 | CC="$ac_save_cc"])
|
|---|
| 998 | AC_MSG_RESULT($ac_cv_kthread)
|
|---|
| 999 | fi
|
|---|
| 1000 |
|
|---|
| 1001 | if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
|
|---|
| 1002 | then
|
|---|
| 1003 | # -pthread, if available, provides the right #defines
|
|---|
| 1004 | # and linker options to make pthread_create available
|
|---|
| 1005 | # Some compilers won't report that they do not support -pthread,
|
|---|
| 1006 | # so we need to run a program to see whether it really made the
|
|---|
| 1007 | # function available.
|
|---|
| 1008 | AC_MSG_CHECKING(whether $CC accepts -pthread)
|
|---|
| 1009 | AC_CACHE_VAL(ac_cv_thread,
|
|---|
| 1010 | [ac_save_cc="$CC"
|
|---|
| 1011 | CC="$CC -pthread"
|
|---|
| 1012 | AC_TRY_RUN([
|
|---|
| 1013 | #include <pthread.h>
|
|---|
| 1014 |
|
|---|
| 1015 | void* routine(void* p){return NULL;}
|
|---|
| 1016 |
|
|---|
| 1017 | int main(){
|
|---|
| 1018 | pthread_t p;
|
|---|
| 1019 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
|---|
| 1020 | return 1;
|
|---|
| 1021 | (void)pthread_detach(p);
|
|---|
| 1022 | return 0;
|
|---|
| 1023 | }
|
|---|
| 1024 | ],
|
|---|
| 1025 | ac_cv_pthread=yes,
|
|---|
| 1026 | ac_cv_pthread=no,
|
|---|
| 1027 | ac_cv_pthread=no)
|
|---|
| 1028 | CC="$ac_save_cc"])
|
|---|
| 1029 | AC_MSG_RESULT($ac_cv_pthread)
|
|---|
| 1030 | fi
|
|---|
| 1031 |
|
|---|
| 1032 | # If we have set a CC compiler flag for thread support then
|
|---|
| 1033 | # check if it works for CXX, too.
|
|---|
| 1034 | ac_cv_cxx_thread=no
|
|---|
| 1035 | if test ! -z "$CXX"
|
|---|
| 1036 | then
|
|---|
| 1037 | AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
|
|---|
| 1038 | ac_save_cxx="$CXX"
|
|---|
| 1039 |
|
|---|
| 1040 | if test "$ac_cv_kpthread" = "yes"
|
|---|
| 1041 | then
|
|---|
| 1042 | CXX="$CXX -Kpthread"
|
|---|
| 1043 | ac_cv_cxx_thread=yes
|
|---|
| 1044 | elif test "$ac_cv_kthread" = "yes"
|
|---|
| 1045 | then
|
|---|
| 1046 | CXX="$CXX -Kthread"
|
|---|
| 1047 | ac_cv_cxx_thread=yes
|
|---|
| 1048 | elif test "$ac_cv_pthread" = "yes"
|
|---|
| 1049 | then
|
|---|
| 1050 | CXX="$CXX -pthread"
|
|---|
| 1051 | ac_cv_cxx_thread=yes
|
|---|
| 1052 | fi
|
|---|
| 1053 |
|
|---|
| 1054 | if test $ac_cv_cxx_thread = yes
|
|---|
| 1055 | then
|
|---|
| 1056 | echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext
|
|---|
| 1057 | $CXX -c conftest.$ac_ext 2>&5
|
|---|
| 1058 | if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
|
|---|
| 1059 | && test -s conftest$ac_exeext && ./conftest$ac_exeext
|
|---|
| 1060 | then
|
|---|
| 1061 | ac_cv_cxx_thread=yes
|
|---|
| 1062 | else
|
|---|
| 1063 | ac_cv_cxx_thread=no
|
|---|
| 1064 | fi
|
|---|
| 1065 | rm -fr conftest*
|
|---|
| 1066 | fi
|
|---|
| 1067 | AC_MSG_RESULT($ac_cv_cxx_thread)
|
|---|
| 1068 | fi
|
|---|
| 1069 | CXX="$ac_save_cxx"
|
|---|
| 1070 |
|
|---|
| 1071 | dnl # check for ANSI or K&R ("traditional") preprocessor
|
|---|
| 1072 | dnl AC_MSG_CHECKING(for C preprocessor type)
|
|---|
| 1073 | dnl AC_TRY_COMPILE([
|
|---|
| 1074 | dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
|
|---|
| 1075 | dnl int foo;
|
|---|
| 1076 | dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
|
|---|
| 1077 | dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional)
|
|---|
| 1078 | dnl AC_MSG_RESULT($cpp_type)
|
|---|
| 1079 |
|
|---|
| 1080 | # checks for header files
|
|---|
| 1081 | AC_HEADER_STDC
|
|---|
| 1082 | AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
|
|---|
| 1083 | fcntl.h grp.h \
|
|---|
| 1084 | shadow.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
|
|---|
| 1085 | signal.h stropts.h termios.h thread.h \
|
|---|
| 1086 | unistd.h utime.h \
|
|---|
| 1087 | sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \
|
|---|
| 1088 | sys/modem.h \
|
|---|
| 1089 | sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
|
|---|
| 1090 | sys/time.h \
|
|---|
| 1091 | sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
|
|---|
| 1092 | sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
|
|---|
| 1093 | bluetooth/bluetooth.h)
|
|---|
| 1094 | AC_HEADER_DIRENT
|
|---|
| 1095 | AC_HEADER_MAJOR
|
|---|
| 1096 |
|
|---|
| 1097 | # On Solaris, term.h requires curses.h
|
|---|
| 1098 | AC_CHECK_HEADERS(term.h,,,[
|
|---|
| 1099 | #ifdef HAVE_CURSES_H
|
|---|
| 1100 | #include <curses.h>
|
|---|
| 1101 | #endif
|
|---|
| 1102 | ])
|
|---|
| 1103 |
|
|---|
| 1104 | # On Linux, netlink.h requires asm/types.h
|
|---|
| 1105 | AC_CHECK_HEADERS(linux/netlink.h,,,[
|
|---|
| 1106 | #ifdef HAVE_ASM_TYPES_H
|
|---|
| 1107 | #include <asm/types.h>
|
|---|
| 1108 | #endif
|
|---|
| 1109 | #ifdef HAVE_SYS_SOCKET_H
|
|---|
| 1110 | #include <sys/socket.h>
|
|---|
| 1111 | #endif
|
|---|
| 1112 | ])
|
|---|
| 1113 |
|
|---|
| 1114 | # checks for typedefs
|
|---|
| 1115 | was_it_defined=no
|
|---|
| 1116 | AC_MSG_CHECKING(for clock_t in time.h)
|
|---|
| 1117 | AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
|
|---|
| 1118 | AC_DEFINE(clock_t, long, [Define to 'long' if <time.h> doesn't define.])
|
|---|
| 1119 | ])
|
|---|
| 1120 | AC_MSG_RESULT($was_it_defined)
|
|---|
| 1121 |
|
|---|
| 1122 | # Check whether using makedev requires defining _OSF_SOURCE
|
|---|
| 1123 | AC_MSG_CHECKING(for makedev)
|
|---|
| 1124 | AC_TRY_LINK([#include <sys/types.h> ],
|
|---|
| 1125 | [ makedev(0, 0) ],
|
|---|
| 1126 | ac_cv_has_makedev=yes,
|
|---|
| 1127 | ac_cv_has_makedev=no)
|
|---|
| 1128 | if test "$ac_cv_has_makedev" = "no"; then
|
|---|
| 1129 | # we didn't link, try if _OSF_SOURCE will allow us to link
|
|---|
| 1130 | AC_TRY_LINK([
|
|---|
| 1131 | #define _OSF_SOURCE 1
|
|---|
| 1132 | #include <sys/types.h>
|
|---|
| 1133 | ],
|
|---|
| 1134 | [ makedev(0, 0) ],
|
|---|
| 1135 | ac_cv_has_makedev=yes,
|
|---|
| 1136 | ac_cv_has_makedev=no)
|
|---|
| 1137 | if test "$ac_cv_has_makedev" = "yes"; then
|
|---|
| 1138 | AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
|
|---|
| 1139 | fi
|
|---|
| 1140 | fi
|
|---|
| 1141 | AC_MSG_RESULT($ac_cv_has_makedev)
|
|---|
| 1142 | if test "$ac_cv_has_makedev" = "yes"; then
|
|---|
| 1143 | AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
|
|---|
| 1144 | fi
|
|---|
| 1145 |
|
|---|
| 1146 | # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in
|
|---|
| 1147 | # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are
|
|---|
| 1148 | # defined, but the compiler does not support pragma redefine_extname,
|
|---|
| 1149 | # and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit
|
|---|
| 1150 | # structures (such as rlimit64) without declaring them. As a
|
|---|
| 1151 | # work-around, disable LFS on such configurations
|
|---|
| 1152 |
|
|---|
| 1153 | use_lfs=yes
|
|---|
| 1154 | AC_MSG_CHECKING(Solaris LFS bug)
|
|---|
| 1155 | AC_TRY_COMPILE([
|
|---|
| 1156 | #define _LARGEFILE_SOURCE 1
|
|---|
| 1157 | #define _FILE_OFFSET_BITS 64
|
|---|
| 1158 | #include <sys/resource.h>
|
|---|
| 1159 | ],struct rlimit foo;,sol_lfs_bug=no,sol_lfs_bug=yes)
|
|---|
| 1160 | AC_MSG_RESULT($sol_lfs_bug)
|
|---|
| 1161 | if test "$sol_lfs_bug" = "yes"; then
|
|---|
| 1162 | use_lfs=no
|
|---|
| 1163 | fi
|
|---|
| 1164 |
|
|---|
| 1165 | if test "$use_lfs" = "yes"; then
|
|---|
| 1166 | # Two defines needed to enable largefile support on various platforms
|
|---|
| 1167 | # These may affect some typedefs
|
|---|
| 1168 | AC_DEFINE(_LARGEFILE_SOURCE, 1,
|
|---|
| 1169 | [This must be defined on some systems to enable large file support.])
|
|---|
| 1170 | AC_DEFINE(_FILE_OFFSET_BITS, 64,
|
|---|
| 1171 | [This must be set to 64 on some systems to enable large file support.])
|
|---|
| 1172 | fi
|
|---|
| 1173 |
|
|---|
| 1174 | # Add some code to confdefs.h so that the test for off_t works on SCO
|
|---|
| 1175 | cat >> confdefs.h <<\EOF
|
|---|
| 1176 | #if defined(SCO_DS)
|
|---|
| 1177 | #undef _OFF_T
|
|---|
| 1178 | #endif
|
|---|
| 1179 | EOF
|
|---|
| 1180 |
|
|---|
| 1181 | # Type availability checks
|
|---|
| 1182 | AC_TYPE_MODE_T
|
|---|
| 1183 | AC_TYPE_OFF_T
|
|---|
| 1184 | AC_TYPE_PID_T
|
|---|
| 1185 | AC_TYPE_SIGNAL
|
|---|
| 1186 | AC_TYPE_SIZE_T
|
|---|
| 1187 | AC_TYPE_UID_T
|
|---|
| 1188 | AC_CHECK_TYPE(ssize_t,
|
|---|
| 1189 | AC_DEFINE(HAVE_SSIZE_T, 1, Define if your compiler provides ssize_t),,)
|
|---|
| 1190 |
|
|---|
| 1191 | # Sizes of various common basic types
|
|---|
| 1192 | # ANSI C requires sizeof(char) == 1, so no need to check it
|
|---|
| 1193 | AC_CHECK_SIZEOF(int, 4)
|
|---|
| 1194 | AC_CHECK_SIZEOF(long, 4)
|
|---|
| 1195 | AC_CHECK_SIZEOF(void *, 4)
|
|---|
| 1196 | AC_CHECK_SIZEOF(short, 2)
|
|---|
| 1197 | AC_CHECK_SIZEOF(float, 4)
|
|---|
| 1198 | AC_CHECK_SIZEOF(double, 8)
|
|---|
| 1199 | AC_CHECK_SIZEOF(fpos_t, 4)
|
|---|
| 1200 | AC_CHECK_SIZEOF(size_t, 4)
|
|---|
| 1201 |
|
|---|
| 1202 | AC_MSG_CHECKING(for long long support)
|
|---|
| 1203 | have_long_long=no
|
|---|
| 1204 | AC_TRY_COMPILE([], [long long x; x = (long long)0;], [
|
|---|
| 1205 | AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
|
|---|
| 1206 | have_long_long=yes
|
|---|
| 1207 | ])
|
|---|
| 1208 | AC_MSG_RESULT($have_long_long)
|
|---|
| 1209 | if test "$have_long_long" = yes ; then
|
|---|
| 1210 | AC_CHECK_SIZEOF(long long, 8)
|
|---|
| 1211 | fi
|
|---|
| 1212 |
|
|---|
| 1213 | AC_MSG_CHECKING(for uintptr_t support)
|
|---|
| 1214 | have_uintptr_t=no
|
|---|
| 1215 | AC_TRY_COMPILE([], [uintptr_t x; x = (uintptr_t)0;], [
|
|---|
| 1216 | AC_DEFINE(HAVE_UINTPTR_T, 1, [Define this if you have the type uintptr_t.])
|
|---|
| 1217 | have_uintptr_t=yes
|
|---|
| 1218 | ])
|
|---|
| 1219 | AC_MSG_RESULT($have_uintptr_t)
|
|---|
| 1220 | if test "$have_uintptr_t" = yes ; then
|
|---|
| 1221 | AC_CHECK_SIZEOF(uintptr_t, 4)
|
|---|
| 1222 | fi
|
|---|
| 1223 |
|
|---|
| 1224 | # Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
|
|---|
| 1225 | AC_MSG_CHECKING(size of off_t)
|
|---|
| 1226 | AC_CACHE_VAL(ac_cv_sizeof_off_t,
|
|---|
| 1227 | [AC_TRY_RUN([#include <stdio.h>
|
|---|
| 1228 | #include <sys/types.h>
|
|---|
| 1229 | main()
|
|---|
| 1230 | {
|
|---|
| 1231 | FILE *f=fopen("conftestval", "w");
|
|---|
| 1232 | if (!f) exit(1);
|
|---|
| 1233 | fprintf(f, "%d\n", sizeof(off_t));
|
|---|
| 1234 | exit(0);
|
|---|
| 1235 | }],
|
|---|
| 1236 | ac_cv_sizeof_off_t=`cat conftestval`,
|
|---|
| 1237 | ac_cv_sizeof_off_t=0,
|
|---|
| 1238 | ac_cv_sizeof_off_t=4)
|
|---|
| 1239 | ])
|
|---|
| 1240 | AC_MSG_RESULT($ac_cv_sizeof_off_t)
|
|---|
| 1241 | AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
|
|---|
| 1242 | [The number of bytes in an off_t.])
|
|---|
| 1243 |
|
|---|
| 1244 | AC_MSG_CHECKING(whether to enable large file support)
|
|---|
| 1245 | if test "$have_long_long" = yes -a \
|
|---|
| 1246 | "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
|
|---|
| 1247 | "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
|
|---|
| 1248 | AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
|
|---|
| 1249 | [Defined to enable large file support when an off_t is bigger than a long
|
|---|
| 1250 | and long long is available and at least as big as an off_t. You may need
|
|---|
| 1251 | to add some flags for configuration and compilation to enable this mode.
|
|---|
| 1252 | (For Solaris and Linux, the necessary defines are already defined.)])
|
|---|
| 1253 | AC_MSG_RESULT(yes)
|
|---|
| 1254 | else
|
|---|
| 1255 | AC_MSG_RESULT(no)
|
|---|
| 1256 | fi
|
|---|
| 1257 |
|
|---|
| 1258 | # AC_CHECK_SIZEOF() doesn't include <time.h>.
|
|---|
| 1259 | AC_MSG_CHECKING(size of time_t)
|
|---|
| 1260 | AC_CACHE_VAL(ac_cv_sizeof_time_t,
|
|---|
| 1261 | [AC_TRY_RUN([#include <stdio.h>
|
|---|
| 1262 | #include <time.h>
|
|---|
| 1263 | main()
|
|---|
| 1264 | {
|
|---|
| 1265 | FILE *f=fopen("conftestval", "w");
|
|---|
| 1266 | if (!f) exit(1);
|
|---|
| 1267 | fprintf(f, "%d\n", sizeof(time_t));
|
|---|
| 1268 | exit(0);
|
|---|
| 1269 | }],
|
|---|
| 1270 | ac_cv_sizeof_time_t=`cat conftestval`,
|
|---|
| 1271 | ac_cv_sizeof_time_t=0,
|
|---|
| 1272 | ac_cv_sizeof_time_t=4)
|
|---|
| 1273 | ])
|
|---|
| 1274 | AC_MSG_RESULT($ac_cv_sizeof_time_t)
|
|---|
| 1275 | AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
|
|---|
| 1276 | [The number of bytes in a time_t.])
|
|---|
| 1277 |
|
|---|
| 1278 |
|
|---|
| 1279 | # if have pthread_t then define SIZEOF_PTHREAD_T
|
|---|
| 1280 | ac_save_cc="$CC"
|
|---|
| 1281 | if test "$ac_cv_kpthread" = "yes"
|
|---|
| 1282 | then CC="$CC -Kpthread"
|
|---|
| 1283 | elif test "$ac_cv_kthread" = "yes"
|
|---|
| 1284 | then CC="$CC -Kthread"
|
|---|
| 1285 | elif test "$ac_cv_pthread" = "yes"
|
|---|
| 1286 | then CC="$CC -pthread"
|
|---|
| 1287 | fi
|
|---|
| 1288 | AC_MSG_CHECKING(for pthread_t)
|
|---|
| 1289 | have_pthread_t=no
|
|---|
| 1290 | AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
|
|---|
| 1291 | AC_MSG_RESULT($have_pthread_t)
|
|---|
| 1292 | if test "$have_pthread_t" = yes ; then
|
|---|
| 1293 | # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
|
|---|
| 1294 | AC_MSG_CHECKING(size of pthread_t)
|
|---|
| 1295 | AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
|
|---|
| 1296 | [AC_TRY_RUN([#include <stdio.h>
|
|---|
| 1297 | #include <pthread.h>
|
|---|
| 1298 | main()
|
|---|
| 1299 | {
|
|---|
| 1300 | FILE *f=fopen("conftestval", "w");
|
|---|
| 1301 | if (!f) exit(1);
|
|---|
| 1302 | fprintf(f, "%d\n", sizeof(pthread_t));
|
|---|
| 1303 | exit(0);
|
|---|
| 1304 | }],
|
|---|
| 1305 | ac_cv_sizeof_pthread_t=`cat conftestval`,
|
|---|
| 1306 | ac_cv_sizeof_pthread_t=0,
|
|---|
| 1307 | ac_cv_sizeof_pthread_t=4)
|
|---|
| 1308 | ])
|
|---|
| 1309 | AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
|
|---|
| 1310 | AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
|
|---|
| 1311 | [The number of bytes in a pthread_t.])
|
|---|
| 1312 | fi
|
|---|
| 1313 | CC="$ac_save_cc"
|
|---|
| 1314 |
|
|---|
| 1315 | AC_MSG_CHECKING(for --enable-toolbox-glue)
|
|---|
| 1316 | AC_ARG_ENABLE(toolbox-glue,
|
|---|
| 1317 | AC_HELP_STRING(--enable-toolbox-glue, disable/enable MacOSX glue code for extensions))
|
|---|
| 1318 |
|
|---|
| 1319 | if test -z "$enable_toolbox_glue"
|
|---|
| 1320 | then
|
|---|
| 1321 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 1322 | Darwin/*)
|
|---|
| 1323 | enable_toolbox_glue="yes";;
|
|---|
| 1324 | *)
|
|---|
| 1325 | enable_toolbox_glue="no";;
|
|---|
| 1326 | esac
|
|---|
| 1327 | fi
|
|---|
| 1328 | case "$enable_toolbox_glue" in
|
|---|
| 1329 | yes)
|
|---|
| 1330 | extra_machdep_objs="Python/mactoolboxglue.o"
|
|---|
| 1331 | extra_undefs="-u _PyMac_Error"
|
|---|
| 1332 | AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE, 1,
|
|---|
| 1333 | [Define if you want to use MacPython modules on MacOSX in unix-Python.])
|
|---|
| 1334 | ;;
|
|---|
| 1335 | *)
|
|---|
| 1336 | extra_machdep_objs=""
|
|---|
| 1337 | extra_undefs=""
|
|---|
| 1338 | ;;
|
|---|
| 1339 | esac
|
|---|
| 1340 | AC_MSG_RESULT($enable_toolbox_glue)
|
|---|
| 1341 |
|
|---|
| 1342 | AC_SUBST(OTHER_LIBTOOL_OPT)
|
|---|
| 1343 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 1344 | Darwin/@<:@01567@:>@\..*)
|
|---|
| 1345 | OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
|
|---|
| 1346 | ;;
|
|---|
| 1347 | Darwin/*)
|
|---|
| 1348 | OTHER_LIBTOOL_OPT=""
|
|---|
| 1349 | ;;
|
|---|
| 1350 | esac
|
|---|
| 1351 |
|
|---|
| 1352 | AC_SUBST(LIBTOOL_CRUFT)
|
|---|
| 1353 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 1354 | Darwin/@<:@01567@:>@\..*)
|
|---|
| 1355 | LIBTOOL_CRUFT="-framework System -lcc_dynamic"
|
|---|
| 1356 | if test "${enable_universalsdk}"; then
|
|---|
| 1357 | :
|
|---|
| 1358 | else
|
|---|
| 1359 | LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
|
|---|
| 1360 | fi
|
|---|
| 1361 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 1362 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
|---|
| 1363 | Darwin/*)
|
|---|
| 1364 | gcc_version=`gcc -v 2>&1 | grep version | cut -d\ -f3`
|
|---|
| 1365 | if test ${gcc_version} '<' 4.0
|
|---|
| 1366 | then
|
|---|
| 1367 | LIBTOOL_CRUFT="-lcc_dynamic"
|
|---|
| 1368 | else
|
|---|
| 1369 | LIBTOOL_CRUFT=""
|
|---|
| 1370 | fi
|
|---|
| 1371 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
|
|---|
| 1372 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 1373 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
|---|
| 1374 | esac
|
|---|
| 1375 |
|
|---|
| 1376 | AC_MSG_CHECKING(for --enable-framework)
|
|---|
| 1377 | if test "$enable_framework"
|
|---|
| 1378 | then
|
|---|
| 1379 | BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
|
|---|
| 1380 | # -F. is needed to allow linking to the framework while
|
|---|
| 1381 | # in the build location.
|
|---|
| 1382 | AC_DEFINE(WITH_NEXT_FRAMEWORK, 1,
|
|---|
| 1383 | [Define if you want to produce an OpenStep/Rhapsody framework
|
|---|
| 1384 | (shared library plus accessory files).])
|
|---|
| 1385 | AC_MSG_RESULT(yes)
|
|---|
| 1386 | else
|
|---|
| 1387 | AC_MSG_RESULT(no)
|
|---|
| 1388 | fi
|
|---|
| 1389 |
|
|---|
| 1390 | AC_MSG_CHECKING(for dyld)
|
|---|
| 1391 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 1392 | Darwin/*)
|
|---|
| 1393 | AC_DEFINE(WITH_DYLD, 1,
|
|---|
| 1394 | [Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
|
|---|
| 1395 | dynamic linker (dyld) instead of the old-style (NextStep) dynamic
|
|---|
| 1396 | linker (rld). Dyld is necessary to support frameworks.])
|
|---|
| 1397 | AC_MSG_RESULT(always on for Darwin)
|
|---|
| 1398 | ;;
|
|---|
| 1399 | *)
|
|---|
| 1400 | AC_MSG_RESULT(no)
|
|---|
| 1401 | ;;
|
|---|
| 1402 | esac
|
|---|
| 1403 |
|
|---|
| 1404 | # Set info about shared libraries.
|
|---|
| 1405 | AC_SUBST(SO)
|
|---|
| 1406 | AC_SUBST(LDSHARED)
|
|---|
| 1407 | AC_SUBST(BLDSHARED)
|
|---|
| 1408 | AC_SUBST(CCSHARED)
|
|---|
| 1409 | AC_SUBST(LINKFORSHARED)
|
|---|
| 1410 | # SO is the extension of shared libraries `(including the dot!)
|
|---|
| 1411 | # -- usually .so, .sl on HP-UX, .dll on Cygwin and OS/2
|
|---|
| 1412 | AC_MSG_CHECKING(SO)
|
|---|
| 1413 | if test -z "$SO"
|
|---|
| 1414 | then
|
|---|
| 1415 | case $ac_sys_system in
|
|---|
| 1416 | hp*|HP*)
|
|---|
| 1417 | case `uname -m` in
|
|---|
| 1418 | ia64) SO=.so;;
|
|---|
| 1419 | *) SO=.sl;;
|
|---|
| 1420 | esac
|
|---|
| 1421 | ;;
|
|---|
| 1422 | CYGWIN*) SO=.dll;;
|
|---|
| 1423 | os2*|emx*) SO=.dll;;
|
|---|
| 1424 | *) SO=.so;;
|
|---|
| 1425 | esac
|
|---|
| 1426 | else
|
|---|
| 1427 | # this might also be a termcap variable, see #610332
|
|---|
| 1428 | echo
|
|---|
| 1429 | echo '====================================================================='
|
|---|
| 1430 | echo '+ +'
|
|---|
| 1431 | echo '+ WARNING: You have set SO in your environment. +'
|
|---|
| 1432 | echo '+ Do you really mean to change the extension for shared libraries? +'
|
|---|
| 1433 | echo '+ Continuing in 10 seconds to let you to ponder. +'
|
|---|
| 1434 | echo '+ +'
|
|---|
| 1435 | echo '====================================================================='
|
|---|
| 1436 | sleep 10
|
|---|
| 1437 | fi
|
|---|
| 1438 | AC_MSG_RESULT($SO)
|
|---|
| 1439 | AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
|
|---|
| 1440 | # LDSHARED is the ld *command* used to create shared library
|
|---|
| 1441 | # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
|
|---|
| 1442 | # (Shared libraries in this instance are shared modules to be loaded into
|
|---|
| 1443 | # Python, as opposed to building Python itself as a shared library.)
|
|---|
| 1444 | AC_MSG_CHECKING(LDSHARED)
|
|---|
| 1445 | if test -z "$LDSHARED"
|
|---|
| 1446 | then
|
|---|
| 1447 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 1448 | AIX*)
|
|---|
| 1449 | BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
|
|---|
| 1450 | LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
|
|---|
| 1451 | ;;
|
|---|
| 1452 | BeOS*)
|
|---|
| 1453 | BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
|
|---|
| 1454 | LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
|
|---|
| 1455 | ;;
|
|---|
| 1456 | IRIX/5*) LDSHARED="ld -shared";;
|
|---|
| 1457 | IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
|
|---|
| 1458 | SunOS/5*)
|
|---|
| 1459 | if test "$GCC" = "yes"
|
|---|
| 1460 | then LDSHARED='$(CC) -shared'
|
|---|
| 1461 | else LDSHARED='$(CC) -G';
|
|---|
| 1462 | fi ;;
|
|---|
| 1463 | hp*|HP*) LDSHARED="ld -b";;
|
|---|
| 1464 | OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
|
|---|
| 1465 | Darwin/1.3*)
|
|---|
| 1466 | LDSHARED='$(CC) $(LDFLAGS) -bundle'
|
|---|
| 1467 | if test "$enable_framework" ; then
|
|---|
| 1468 | # Link against the framework. All externals should be defined.
|
|---|
| 1469 | BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 1470 | LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 1471 | else
|
|---|
| 1472 | # No framework. Ignore undefined symbols, assuming they come from Python
|
|---|
| 1473 | LDSHARED="$LDSHARED -undefined suppress"
|
|---|
| 1474 | fi ;;
|
|---|
| 1475 | Darwin/1.4*|Darwin/5.*|Darwin/6.*)
|
|---|
| 1476 | LDSHARED='$(CC) $(LDFLAGS) -bundle'
|
|---|
| 1477 | if test "$enable_framework" ; then
|
|---|
| 1478 | # Link against the framework. All externals should be defined.
|
|---|
| 1479 | BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 1480 | LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 1481 | else
|
|---|
| 1482 | # No framework, use the Python app as bundle-loader
|
|---|
| 1483 | BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
|
|---|
| 1484 | LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
|
|---|
| 1485 | fi ;;
|
|---|
| 1486 | Darwin/*)
|
|---|
| 1487 | # Use -undefined dynamic_lookup whenever possible (10.3 and later).
|
|---|
| 1488 | # This allows an extension to be used in any Python
|
|---|
| 1489 | cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
|
|---|
| 1490 | if test ${cur_target} '>' 10.2; then
|
|---|
| 1491 | cur_target=10.3
|
|---|
| 1492 | fi
|
|---|
| 1493 | CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
|
|---|
| 1494 | EXPORT_MACOSX_DEPLOYMENT_TARGET=''
|
|---|
| 1495 | if test ${MACOSX_DEPLOYMENT_TARGET-${cur_target}} '>' 10.2
|
|---|
| 1496 | then
|
|---|
| 1497 | if test "${enable_universalsdk}"; then
|
|---|
| 1498 | LDFLAGS="-arch i386 -arch ppc -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
|---|
| 1499 | fi
|
|---|
| 1500 | LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
|
|---|
| 1501 | BLDSHARED="$LDSHARED"
|
|---|
| 1502 | else
|
|---|
| 1503 | LDSHARED='$(CC) $(LDFLAGS) -bundle'
|
|---|
| 1504 | if test "$enable_framework" ; then
|
|---|
| 1505 | # Link against the framework. All externals should be defined.
|
|---|
| 1506 | BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 1507 | LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 1508 | else
|
|---|
| 1509 | # No framework, use the Python app as bundle-loader
|
|---|
| 1510 | BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
|
|---|
| 1511 | LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
|
|---|
| 1512 | fi
|
|---|
| 1513 | fi
|
|---|
| 1514 | ;;
|
|---|
| 1515 | Linux*|GNU*) LDSHARED='$(CC) -shared';;
|
|---|
| 1516 | BSD/OS*/4*) LDSHARED="gcc -shared";;
|
|---|
| 1517 | FreeBSD*)
|
|---|
| 1518 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
|---|
| 1519 | then
|
|---|
| 1520 | LDSHARED="$CC -shared ${LDFLAGS}"
|
|---|
| 1521 | else
|
|---|
| 1522 | LDSHARED="ld -Bshareable ${LDFLAGS}"
|
|---|
| 1523 | fi;;
|
|---|
| 1524 | OpenBSD*)
|
|---|
| 1525 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
|---|
| 1526 | then
|
|---|
| 1527 | LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
|
|---|
| 1528 | else
|
|---|
| 1529 | case `uname -r` in
|
|---|
| 1530 | [[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
|
|---|
| 1531 | LDSHARED="ld -Bshareable ${LDFLAGS}"
|
|---|
| 1532 | ;;
|
|---|
| 1533 | *)
|
|---|
| 1534 | LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
|
|---|
| 1535 | ;;
|
|---|
| 1536 | esac
|
|---|
| 1537 | fi;;
|
|---|
| 1538 | NetBSD*|DragonFly*) LDSHARED="cc -shared ${LDFLAGS}";;
|
|---|
| 1539 | OpenUNIX*|UnixWare*)
|
|---|
| 1540 | if test "$GCC" = "yes"
|
|---|
| 1541 | then LDSHARED='$(CC) -shared'
|
|---|
| 1542 | else LDSHARED='$(CC) -G'
|
|---|
| 1543 | fi;;
|
|---|
| 1544 | SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
|
|---|
| 1545 | Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
|
|---|
| 1546 | CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
|
|---|
| 1547 | atheos*) LDSHARED="gcc -shared";;
|
|---|
| 1548 | *) LDSHARED="ld";;
|
|---|
| 1549 | esac
|
|---|
| 1550 | fi
|
|---|
| 1551 | AC_MSG_RESULT($LDSHARED)
|
|---|
| 1552 | BLDSHARED=${BLDSHARED-$LDSHARED}
|
|---|
| 1553 | # CCSHARED are the C *flags* used to create objects to go into a shared
|
|---|
| 1554 | # library (module) -- this is only needed for a few systems
|
|---|
| 1555 | AC_MSG_CHECKING(CCSHARED)
|
|---|
| 1556 | if test -z "$CCSHARED"
|
|---|
| 1557 | then
|
|---|
| 1558 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 1559 | SunOS*) if test "$GCC" = yes;
|
|---|
| 1560 | then CCSHARED="-fPIC";
|
|---|
| 1561 | else CCSHARED="-xcode=pic32";
|
|---|
| 1562 | fi;;
|
|---|
| 1563 | hp*|HP*) if test "$GCC" = yes;
|
|---|
| 1564 | then CCSHARED="-fPIC";
|
|---|
| 1565 | else CCSHARED="+z";
|
|---|
| 1566 | fi;;
|
|---|
| 1567 | Linux*|GNU*) CCSHARED="-fPIC";;
|
|---|
| 1568 | BSD/OS*/4*) CCSHARED="-fpic";;
|
|---|
| 1569 | FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
|
|---|
| 1570 | OpenUNIX*|UnixWare*)
|
|---|
| 1571 | if test "$GCC" = "yes"
|
|---|
| 1572 | then CCSHARED="-fPIC"
|
|---|
| 1573 | else CCSHARED="-KPIC"
|
|---|
| 1574 | fi;;
|
|---|
| 1575 | SCO_SV*)
|
|---|
| 1576 | if test "$GCC" = "yes"
|
|---|
| 1577 | then CCSHARED="-fPIC"
|
|---|
| 1578 | else CCSHARED="-Kpic -belf"
|
|---|
| 1579 | fi;;
|
|---|
| 1580 | Monterey*) CCSHARED="-G";;
|
|---|
| 1581 | IRIX*/6*) case $CC in
|
|---|
| 1582 | *gcc*) CCSHARED="-shared";;
|
|---|
| 1583 | *) CCSHARED="";;
|
|---|
| 1584 | esac;;
|
|---|
| 1585 | atheos*) CCSHARED="-fPIC";;
|
|---|
| 1586 | esac
|
|---|
| 1587 | fi
|
|---|
| 1588 | AC_MSG_RESULT($CCSHARED)
|
|---|
| 1589 | # LINKFORSHARED are the flags passed to the $(CC) command that links
|
|---|
| 1590 | # the python executable -- this is only needed for a few systems
|
|---|
| 1591 | AC_MSG_CHECKING(LINKFORSHARED)
|
|---|
| 1592 | if test -z "$LINKFORSHARED"
|
|---|
| 1593 | then
|
|---|
| 1594 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 1595 | AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
|
|---|
| 1596 | hp*|HP*)
|
|---|
| 1597 | LINKFORSHARED="-Wl,-E -Wl,+s";;
|
|---|
| 1598 | # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
|
|---|
| 1599 | BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
|---|
| 1600 | Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
|---|
| 1601 | # -u libsys_s pulls in all symbols in libsys
|
|---|
| 1602 | Darwin/*)
|
|---|
| 1603 | # -u _PyMac_Error is needed to pull in the mac toolbox glue,
|
|---|
| 1604 | # which is
|
|---|
| 1605 | # not used by the core itself but which needs to be in the core so
|
|---|
| 1606 | # that dynamically loaded extension modules have access to it.
|
|---|
| 1607 | # -prebind is no longer used, because it actually seems to give a
|
|---|
| 1608 | # slowdown in stead of a speedup, maybe due to the large number of
|
|---|
| 1609 | # dynamic loads Python does.
|
|---|
| 1610 |
|
|---|
| 1611 | LINKFORSHARED="$extra_undefs"
|
|---|
| 1612 | if test "$enable_framework"
|
|---|
| 1613 | then
|
|---|
| 1614 | LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 1615 | fi
|
|---|
| 1616 | LINKFORSHARED="$LINKFORSHARED";;
|
|---|
| 1617 | OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
|
|---|
| 1618 | SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
|
|---|
| 1619 | ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
|
|---|
| 1620 | FreeBSD*|NetBSD*|OpenBSD*|DragonFly*)
|
|---|
| 1621 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
|---|
| 1622 | then
|
|---|
| 1623 | LINKFORSHARED="-Wl,--export-dynamic"
|
|---|
| 1624 | fi;;
|
|---|
| 1625 | SunOS/5*) case $CC in
|
|---|
| 1626 | *gcc*)
|
|---|
| 1627 | if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
|
|---|
| 1628 | then
|
|---|
| 1629 | LINKFORSHARED="-Xlinker --export-dynamic"
|
|---|
| 1630 | fi;;
|
|---|
| 1631 | esac;;
|
|---|
| 1632 | CYGWIN*)
|
|---|
| 1633 | if test $enable_shared = "no"
|
|---|
| 1634 | then
|
|---|
| 1635 | LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
|
|---|
| 1636 | fi;;
|
|---|
| 1637 | esac
|
|---|
| 1638 | fi
|
|---|
| 1639 | AC_MSG_RESULT($LINKFORSHARED)
|
|---|
| 1640 |
|
|---|
| 1641 | AC_SUBST(CFLAGSFORSHARED)
|
|---|
| 1642 | AC_MSG_CHECKING(CFLAGSFORSHARED)
|
|---|
| 1643 | if test ! "$LIBRARY" = "$LDLIBRARY"
|
|---|
| 1644 | then
|
|---|
| 1645 | case $ac_sys_system in
|
|---|
| 1646 | CYGWIN*)
|
|---|
| 1647 | # Cygwin needs CCSHARED when building extension DLLs
|
|---|
| 1648 | # but not when building the interpreter DLL.
|
|---|
| 1649 | CFLAGSFORSHARED='';;
|
|---|
| 1650 | *)
|
|---|
| 1651 | CFLAGSFORSHARED='$(CCSHARED)'
|
|---|
| 1652 | esac
|
|---|
| 1653 | fi
|
|---|
| 1654 | AC_MSG_RESULT($CFLAGSFORSHARED)
|
|---|
| 1655 |
|
|---|
| 1656 | # SHLIBS are libraries (except -lc and -lm) to link to the python shared
|
|---|
| 1657 | # library (with --enable-shared).
|
|---|
| 1658 | # For platforms on which shared libraries are not allowed to have unresolved
|
|---|
| 1659 | # symbols, this must be set to $(LIBS) (expanded by make). We do this even
|
|---|
| 1660 | # if it is not required, since it creates a dependency of the shared library
|
|---|
| 1661 | # to LIBS. This, in turn, means that applications linking the shared libpython
|
|---|
| 1662 | # don't need to link LIBS explicitly. The default should be only changed
|
|---|
| 1663 | # on systems where this approach causes problems.
|
|---|
| 1664 | AC_SUBST(SHLIBS)
|
|---|
| 1665 | AC_MSG_CHECKING(SHLIBS)
|
|---|
| 1666 | case "$ac_sys_system" in
|
|---|
| 1667 | *)
|
|---|
| 1668 | SHLIBS='$(LIBS)';;
|
|---|
| 1669 | esac
|
|---|
| 1670 | AC_MSG_RESULT($SHLIBS)
|
|---|
| 1671 |
|
|---|
| 1672 |
|
|---|
| 1673 | # checks for libraries
|
|---|
| 1674 | AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
|
|---|
| 1675 | AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
|
|---|
| 1676 |
|
|---|
| 1677 | # only check for sem_ini if thread support is requested
|
|---|
| 1678 | if test "$with_threads" = "yes" -o -z "$with_threads"; then
|
|---|
| 1679 | AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
|
|---|
| 1680 | # posix4 on Solaris 2.6
|
|---|
| 1681 | # pthread (first!) on Linux
|
|---|
| 1682 | fi
|
|---|
| 1683 |
|
|---|
| 1684 | # check if we need libintl for locale functions
|
|---|
| 1685 | AC_CHECK_LIB(intl, textdomain,
|
|---|
| 1686 | AC_DEFINE(WITH_LIBINTL, 1,
|
|---|
| 1687 | [Define to 1 if libintl is needed for locale functions.]))
|
|---|
| 1688 |
|
|---|
| 1689 | # checks for system dependent C++ extensions support
|
|---|
| 1690 | case "$ac_sys_system" in
|
|---|
| 1691 | AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support)
|
|---|
| 1692 | AC_TRY_LINK([#include "/usr/lpp/xlC/include/load.h"],
|
|---|
| 1693 | [loadAndInit("", 0, "")],
|
|---|
| 1694 | [AC_DEFINE(AIX_GENUINE_CPLUSPLUS, 1,
|
|---|
| 1695 | [Define for AIX if your compiler is a genuine IBM xlC/xlC_r
|
|---|
| 1696 | and you want support for AIX C++ shared extension modules.])
|
|---|
| 1697 | AC_MSG_RESULT(yes)],
|
|---|
| 1698 | [AC_MSG_RESULT(no)]);;
|
|---|
| 1699 | *) ;;
|
|---|
| 1700 | esac
|
|---|
| 1701 |
|
|---|
| 1702 | # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
|
|---|
| 1703 | # BeOS' sockets are stashed in libnet.
|
|---|
| 1704 | AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
|
|---|
| 1705 | AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
|
|---|
| 1706 |
|
|---|
| 1707 | case "$ac_sys_system" in
|
|---|
| 1708 | BeOS*)
|
|---|
| 1709 | AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
|
|---|
| 1710 | ;;
|
|---|
| 1711 | esac
|
|---|
| 1712 |
|
|---|
| 1713 | AC_MSG_CHECKING(for --with-libs)
|
|---|
| 1714 | AC_ARG_WITH(libs,
|
|---|
| 1715 | AC_HELP_STRING(--with-libs='lib1 ...', link against additional libs),
|
|---|
| 1716 | [
|
|---|
| 1717 | AC_MSG_RESULT($withval)
|
|---|
| 1718 | LIBS="$withval $LIBS"
|
|---|
| 1719 | ],
|
|---|
| 1720 | [AC_MSG_RESULT(no)])
|
|---|
| 1721 |
|
|---|
| 1722 | # Check for use of the system libffi library
|
|---|
| 1723 | AC_MSG_CHECKING(for --with-system-ffi)
|
|---|
| 1724 | AC_ARG_WITH(system_ffi,
|
|---|
| 1725 | AC_HELP_STRING(--with-system-ffi, build _ctypes module using an installed ffi library))
|
|---|
| 1726 |
|
|---|
| 1727 | if test -z "$with_system_ffi"
|
|---|
| 1728 | then with_system_ffi="no"
|
|---|
| 1729 | fi
|
|---|
| 1730 | AC_MSG_RESULT($with_system_ffi)
|
|---|
| 1731 |
|
|---|
| 1732 | # Determine if signalmodule should be used.
|
|---|
| 1733 | AC_SUBST(USE_SIGNAL_MODULE)
|
|---|
| 1734 | AC_SUBST(SIGNAL_OBJS)
|
|---|
| 1735 | AC_MSG_CHECKING(for --with-signal-module)
|
|---|
| 1736 | AC_ARG_WITH(signal-module,
|
|---|
| 1737 | AC_HELP_STRING(--with-signal-module, disable/enable signal module))
|
|---|
| 1738 |
|
|---|
| 1739 | if test -z "$with_signal_module"
|
|---|
| 1740 | then with_signal_module="yes"
|
|---|
| 1741 | fi
|
|---|
| 1742 | AC_MSG_RESULT($with_signal_module)
|
|---|
| 1743 |
|
|---|
| 1744 | if test "${with_signal_module}" = "yes"; then
|
|---|
| 1745 | USE_SIGNAL_MODULE=""
|
|---|
| 1746 | SIGNAL_OBJS=""
|
|---|
| 1747 | else
|
|---|
| 1748 | USE_SIGNAL_MODULE="#"
|
|---|
| 1749 | SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o"
|
|---|
| 1750 | fi
|
|---|
| 1751 |
|
|---|
| 1752 | # This is used to generate Setup.config
|
|---|
| 1753 | AC_SUBST(USE_THREAD_MODULE)
|
|---|
| 1754 | USE_THREAD_MODULE=""
|
|---|
| 1755 |
|
|---|
| 1756 | AC_MSG_CHECKING(for --with-dec-threads)
|
|---|
| 1757 | AC_SUBST(LDLAST)
|
|---|
| 1758 | AC_ARG_WITH(dec-threads,
|
|---|
| 1759 | AC_HELP_STRING(--with-dec-threads, use DEC Alpha/OSF1 thread-safe libraries),
|
|---|
| 1760 | [
|
|---|
| 1761 | AC_MSG_RESULT($withval)
|
|---|
| 1762 | LDLAST=-threads
|
|---|
| 1763 | if test "${with_thread+set}" != set; then
|
|---|
| 1764 | with_thread="$withval";
|
|---|
| 1765 | fi],
|
|---|
| 1766 | [AC_MSG_RESULT(no)])
|
|---|
| 1767 |
|
|---|
| 1768 | # Templates for things AC_DEFINEd more than once.
|
|---|
| 1769 | # For a single AC_DEFINE, no template is needed.
|
|---|
| 1770 | AH_TEMPLATE(C_THREADS,[Define if you have the Mach cthreads package])
|
|---|
| 1771 | AH_TEMPLATE(_REENTRANT,
|
|---|
| 1772 | [Define to force use of thread-safe errno, h_errno, and other functions])
|
|---|
| 1773 | AH_TEMPLATE(WITH_THREAD,
|
|---|
| 1774 | [Define if you want to compile in rudimentary thread support])
|
|---|
| 1775 |
|
|---|
| 1776 | AC_MSG_CHECKING(for --with-threads)
|
|---|
| 1777 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
|---|
| 1778 | AC_ARG_WITH(threads,
|
|---|
| 1779 | AC_HELP_STRING(--with(out)-threads@<:@=DIRECTORY@:>@, disable/enable thread support))
|
|---|
| 1780 |
|
|---|
| 1781 | # --with-thread is deprecated, but check for it anyway
|
|---|
| 1782 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
|---|
| 1783 | AC_ARG_WITH(thread,
|
|---|
| 1784 | AC_HELP_STRING(--with(out)-thread@<:@=DIRECTORY@:>@, deprecated; use --with(out)-threads),
|
|---|
| 1785 | [with_threads=$with_thread])
|
|---|
| 1786 |
|
|---|
| 1787 | if test -z "$with_threads"
|
|---|
| 1788 | then with_threads="yes"
|
|---|
| 1789 | fi
|
|---|
| 1790 | AC_MSG_RESULT($with_threads)
|
|---|
| 1791 |
|
|---|
| 1792 | AC_SUBST(THREADOBJ)
|
|---|
| 1793 | if test "$with_threads" = "no"
|
|---|
| 1794 | then
|
|---|
| 1795 | USE_THREAD_MODULE="#"
|
|---|
| 1796 | elif test "$ac_cv_pthread_is_default" = yes
|
|---|
| 1797 | then
|
|---|
| 1798 | AC_DEFINE(WITH_THREAD)
|
|---|
| 1799 | # Defining _REENTRANT on system with POSIX threads should not hurt.
|
|---|
| 1800 | AC_DEFINE(_REENTRANT)
|
|---|
| 1801 | posix_threads=yes
|
|---|
| 1802 | THREADOBJ="Python/thread.o"
|
|---|
| 1803 | elif test "$ac_cv_kpthread" = "yes"
|
|---|
| 1804 | then
|
|---|
| 1805 | CC="$CC -Kpthread"
|
|---|
| 1806 | if test "$ac_cv_cxx_thread" = "yes"; then
|
|---|
| 1807 | CXX="$CXX -Kpthread"
|
|---|
| 1808 | fi
|
|---|
| 1809 | AC_DEFINE(WITH_THREAD)
|
|---|
| 1810 | posix_threads=yes
|
|---|
| 1811 | THREADOBJ="Python/thread.o"
|
|---|
| 1812 | elif test "$ac_cv_kthread" = "yes"
|
|---|
| 1813 | then
|
|---|
| 1814 | CC="$CC -Kthread"
|
|---|
| 1815 | if test "$ac_cv_cxx_thread" = "yes"; then
|
|---|
| 1816 | CXX="$CXX -Kthread"
|
|---|
| 1817 | fi
|
|---|
| 1818 | AC_DEFINE(WITH_THREAD)
|
|---|
| 1819 | posix_threads=yes
|
|---|
| 1820 | THREADOBJ="Python/thread.o"
|
|---|
| 1821 | elif test "$ac_cv_pthread" = "yes"
|
|---|
| 1822 | then
|
|---|
| 1823 | CC="$CC -pthread"
|
|---|
| 1824 | if test "$ac_cv_cxx_thread" = "yes"; then
|
|---|
| 1825 | CXX="$CXX -pthread"
|
|---|
| 1826 | fi
|
|---|
| 1827 | AC_DEFINE(WITH_THREAD)
|
|---|
| 1828 | posix_threads=yes
|
|---|
| 1829 | THREADOBJ="Python/thread.o"
|
|---|
| 1830 | else
|
|---|
| 1831 | if test ! -z "$with_threads" -a -d "$with_threads"
|
|---|
| 1832 | then LDFLAGS="$LDFLAGS -L$with_threads"
|
|---|
| 1833 | fi
|
|---|
| 1834 | if test ! -z "$withval" -a -d "$withval"
|
|---|
| 1835 | then LDFLAGS="$LDFLAGS -L$withval"
|
|---|
| 1836 | fi
|
|---|
| 1837 |
|
|---|
| 1838 | # According to the POSIX spec, a pthreads implementation must
|
|---|
| 1839 | # define _POSIX_THREADS in unistd.h. Some apparently don't
|
|---|
| 1840 | # (e.g. gnu pth with pthread emulation)
|
|---|
| 1841 | AC_MSG_CHECKING(for _POSIX_THREADS in unistd.h)
|
|---|
| 1842 | AC_EGREP_CPP(yes,
|
|---|
| 1843 | [
|
|---|
| 1844 | #include <unistd.h>
|
|---|
| 1845 | #ifdef _POSIX_THREADS
|
|---|
| 1846 | yes
|
|---|
| 1847 | #endif
|
|---|
| 1848 | ], unistd_defines_pthreads=yes, unistd_defines_pthreads=no)
|
|---|
| 1849 | AC_MSG_RESULT($unistd_defines_pthreads)
|
|---|
| 1850 |
|
|---|
| 1851 | AC_DEFINE(_REENTRANT)
|
|---|
| 1852 | AC_CHECK_HEADER(cthreads.h, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1853 | AC_DEFINE(C_THREADS)
|
|---|
| 1854 | AC_DEFINE(HURD_C_THREADS, 1,
|
|---|
| 1855 | [Define if you are using Mach cthreads directly under /include])
|
|---|
| 1856 | LIBS="$LIBS -lthreads"
|
|---|
| 1857 | THREADOBJ="Python/thread.o"],[
|
|---|
| 1858 | AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1859 | AC_DEFINE(C_THREADS)
|
|---|
| 1860 | AC_DEFINE(MACH_C_THREADS, 1,
|
|---|
| 1861 | [Define if you are using Mach cthreads under mach /])
|
|---|
| 1862 | THREADOBJ="Python/thread.o"],[
|
|---|
| 1863 | AC_MSG_CHECKING(for --with-pth)
|
|---|
| 1864 | AC_ARG_WITH([pth],
|
|---|
| 1865 | AC_HELP_STRING(--with-pth, use GNU pth threading libraries),
|
|---|
| 1866 | [AC_MSG_RESULT($withval)
|
|---|
| 1867 | AC_DEFINE([WITH_THREAD])
|
|---|
| 1868 | AC_DEFINE([HAVE_PTH], 1,
|
|---|
| 1869 | [Define if you have GNU PTH threads.])
|
|---|
| 1870 | LIBS="-lpth $LIBS"
|
|---|
| 1871 | THREADOBJ="Python/thread.o"],
|
|---|
| 1872 | [AC_MSG_RESULT(no)
|
|---|
| 1873 |
|
|---|
| 1874 | # Just looking for pthread_create in libpthread is not enough:
|
|---|
| 1875 | # on HP/UX, pthread.h renames pthread_create to a different symbol name.
|
|---|
| 1876 | # So we really have to include pthread.h, and then link.
|
|---|
| 1877 | _libs=$LIBS
|
|---|
| 1878 | LIBS="$LIBS -lpthread"
|
|---|
| 1879 | AC_MSG_CHECKING([for pthread_create in -lpthread])
|
|---|
| 1880 | AC_TRY_LINK([#include <pthread.h>
|
|---|
| 1881 |
|
|---|
| 1882 | void * start_routine (void *arg) { exit (0); }], [
|
|---|
| 1883 | pthread_create (NULL, NULL, start_routine, NULL)], [
|
|---|
| 1884 | AC_MSG_RESULT(yes)
|
|---|
| 1885 | AC_DEFINE(WITH_THREAD)
|
|---|
| 1886 | posix_threads=yes
|
|---|
| 1887 | THREADOBJ="Python/thread.o"],[
|
|---|
| 1888 | LIBS=$_libs
|
|---|
| 1889 | AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1890 | posix_threads=yes
|
|---|
| 1891 | THREADOBJ="Python/thread.o"],[
|
|---|
| 1892 | AC_CHECK_HEADER(atheos/threads.h, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1893 | AC_DEFINE(ATHEOS_THREADS, 1,
|
|---|
| 1894 | [Define this if you have AtheOS threads.])
|
|---|
| 1895 | THREADOBJ="Python/thread.o"],[
|
|---|
| 1896 | AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1897 | AC_DEFINE(BEOS_THREADS, 1,
|
|---|
| 1898 | [Define this if you have BeOS threads.])
|
|---|
| 1899 | THREADOBJ="Python/thread.o"],[
|
|---|
| 1900 | AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1901 | posix_threads=yes
|
|---|
| 1902 | LIBS="$LIBS -lpthreads"
|
|---|
| 1903 | THREADOBJ="Python/thread.o"], [
|
|---|
| 1904 | AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1905 | posix_threads=yes
|
|---|
| 1906 | LIBS="$LIBS -lc_r"
|
|---|
| 1907 | THREADOBJ="Python/thread.o"], [
|
|---|
| 1908 | AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1909 | posix_threads=yes
|
|---|
| 1910 | LIBS="$LIBS -lpthread"
|
|---|
| 1911 | THREADOBJ="Python/thread.o"], [
|
|---|
| 1912 | AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1913 | posix_threads=yes
|
|---|
| 1914 | LIBS="$LIBS -lcma"
|
|---|
| 1915 | THREADOBJ="Python/thread.o"],[
|
|---|
| 1916 | USE_THREAD_MODULE="#"])
|
|---|
| 1917 | ])])])])])])])])])])
|
|---|
| 1918 |
|
|---|
| 1919 | AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1920 | LIBS="$LIBS -lmpc"
|
|---|
| 1921 | THREADOBJ="Python/thread.o"
|
|---|
| 1922 | USE_THREAD_MODULE=""])
|
|---|
| 1923 |
|
|---|
| 1924 | if test "$posix_threads" != "yes"; then
|
|---|
| 1925 | AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
|
|---|
| 1926 | LIBS="$LIBS -lthread"
|
|---|
| 1927 | THREADOBJ="Python/thread.o"
|
|---|
| 1928 | USE_THREAD_MODULE=""])
|
|---|
| 1929 | fi
|
|---|
| 1930 |
|
|---|
| 1931 | if test "$USE_THREAD_MODULE" != "#"
|
|---|
| 1932 | then
|
|---|
| 1933 | # If the above checks didn't disable threads, (at least) OSF1
|
|---|
| 1934 | # needs this '-threads' argument during linking.
|
|---|
| 1935 | case $ac_sys_system in
|
|---|
| 1936 | OSF1) LDLAST=-threads;;
|
|---|
| 1937 | esac
|
|---|
| 1938 | fi
|
|---|
| 1939 | fi
|
|---|
| 1940 |
|
|---|
| 1941 | if test "$posix_threads" = "yes"; then
|
|---|
| 1942 | if test "$unistd_defines_pthreads" = "no"; then
|
|---|
| 1943 | AC_DEFINE(_POSIX_THREADS, 1,
|
|---|
| 1944 | [Define if you have POSIX threads,
|
|---|
| 1945 | and your system does not define that.])
|
|---|
| 1946 | fi
|
|---|
| 1947 |
|
|---|
| 1948 | # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
|
|---|
| 1949 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 1950 | SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1,
|
|---|
| 1951 | Defined for Solaris 2.6 bug in pthread header.)
|
|---|
| 1952 | ;;
|
|---|
| 1953 | SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
|
|---|
| 1954 | Define if the Posix semaphores do not work on your system)
|
|---|
| 1955 | ;;
|
|---|
| 1956 | esac
|
|---|
| 1957 |
|
|---|
| 1958 | AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
|
|---|
| 1959 | AC_CACHE_VAL(ac_cv_pthread_system_supported,
|
|---|
| 1960 | [AC_TRY_RUN([#include <pthread.h>
|
|---|
| 1961 | void *foo(void *parm) {
|
|---|
| 1962 | return NULL;
|
|---|
| 1963 | }
|
|---|
| 1964 | main() {
|
|---|
| 1965 | pthread_attr_t attr;
|
|---|
| 1966 | pthread_t id;
|
|---|
| 1967 | if (pthread_attr_init(&attr)) exit(-1);
|
|---|
| 1968 | if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
|
|---|
| 1969 | if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
|
|---|
| 1970 | exit(0);
|
|---|
| 1971 | }],
|
|---|
| 1972 | ac_cv_pthread_system_supported=yes,
|
|---|
| 1973 | ac_cv_pthread_system_supported=no,
|
|---|
| 1974 | ac_cv_pthread_system_supported=no)
|
|---|
| 1975 | ])
|
|---|
| 1976 | AC_MSG_RESULT($ac_cv_pthread_system_supported)
|
|---|
| 1977 | if test "$ac_cv_pthread_system_supported" = "yes"; then
|
|---|
| 1978 | AC_DEFINE(PTHREAD_SYSTEM_SCHED_SUPPORTED, 1, [Defined if PTHREAD_SCOPE_SYSTEM supported.])
|
|---|
| 1979 | fi
|
|---|
| 1980 | AC_CHECK_FUNCS(pthread_sigmask,
|
|---|
| 1981 | [case $ac_sys_system in
|
|---|
| 1982 | CYGWIN*)
|
|---|
| 1983 | AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1,
|
|---|
| 1984 | [Define if pthread_sigmask() does not work on your system.])
|
|---|
| 1985 | ;;
|
|---|
| 1986 | esac])
|
|---|
| 1987 | fi
|
|---|
| 1988 |
|
|---|
| 1989 |
|
|---|
| 1990 | # Check for enable-ipv6
|
|---|
| 1991 | AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
|
|---|
| 1992 | AC_MSG_CHECKING([if --enable-ipv6 is specified])
|
|---|
| 1993 | AC_ARG_ENABLE(ipv6,
|
|---|
| 1994 | [ --enable-ipv6 Enable ipv6 (with ipv4) support
|
|---|
| 1995 | --disable-ipv6 Disable ipv6 support],
|
|---|
| 1996 | [ case "$enableval" in
|
|---|
| 1997 | no)
|
|---|
| 1998 | AC_MSG_RESULT(no)
|
|---|
| 1999 | ipv6=no
|
|---|
| 2000 | ;;
|
|---|
| 2001 | *) AC_MSG_RESULT(yes)
|
|---|
| 2002 | AC_DEFINE(ENABLE_IPV6)
|
|---|
| 2003 | ipv6=yes
|
|---|
| 2004 | ;;
|
|---|
| 2005 | esac ],
|
|---|
| 2006 |
|
|---|
| 2007 | [
|
|---|
| 2008 | dnl the check does not work on cross compilation case...
|
|---|
| 2009 | AC_TRY_RUN([ /* AF_INET6 available check */
|
|---|
| 2010 | #include <sys/types.h>
|
|---|
| 2011 | #include <sys/socket.h>
|
|---|
| 2012 | main()
|
|---|
| 2013 | {
|
|---|
| 2014 | if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
|
|---|
| 2015 | exit(1);
|
|---|
| 2016 | else
|
|---|
| 2017 | exit(0);
|
|---|
| 2018 | }
|
|---|
| 2019 | ],
|
|---|
| 2020 | AC_MSG_RESULT(yes)
|
|---|
| 2021 | ipv6=yes,
|
|---|
| 2022 | AC_MSG_RESULT(no)
|
|---|
| 2023 | ipv6=no,
|
|---|
| 2024 | AC_MSG_RESULT(no)
|
|---|
| 2025 | ipv6=no
|
|---|
| 2026 | )
|
|---|
| 2027 |
|
|---|
| 2028 | if test "$ipv6" = "yes"; then
|
|---|
| 2029 | AC_MSG_CHECKING(if RFC2553 API is available)
|
|---|
| 2030 | AC_TRY_COMPILE([#include <sys/types.h>
|
|---|
| 2031 | #include <netinet/in.h>],
|
|---|
| 2032 | [struct sockaddr_in6 x;
|
|---|
| 2033 | x.sin6_scope_id;],
|
|---|
| 2034 | AC_MSG_RESULT(yes)
|
|---|
| 2035 | ipv6=yes,
|
|---|
| 2036 | AC_MSG_RESULT(no, IPv6 disabled)
|
|---|
| 2037 | ipv6=no)
|
|---|
| 2038 | fi
|
|---|
| 2039 |
|
|---|
| 2040 | if test "$ipv6" = "yes"; then
|
|---|
| 2041 | AC_DEFINE(ENABLE_IPV6)
|
|---|
| 2042 | fi
|
|---|
| 2043 | ])
|
|---|
| 2044 |
|
|---|
| 2045 | ipv6type=unknown
|
|---|
| 2046 | ipv6lib=none
|
|---|
| 2047 | ipv6trylibc=no
|
|---|
| 2048 |
|
|---|
| 2049 | if test "$ipv6" = "yes"; then
|
|---|
| 2050 | AC_MSG_CHECKING([ipv6 stack type])
|
|---|
| 2051 | for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
|
|---|
| 2052 | do
|
|---|
| 2053 | case $i in
|
|---|
| 2054 | inria)
|
|---|
| 2055 | dnl http://www.kame.net/
|
|---|
| 2056 | AC_EGREP_CPP(yes, [
|
|---|
| 2057 | #include <netinet/in.h>
|
|---|
| 2058 | #ifdef IPV6_INRIA_VERSION
|
|---|
| 2059 | yes
|
|---|
| 2060 | #endif],
|
|---|
| 2061 | [ipv6type=$i])
|
|---|
| 2062 | ;;
|
|---|
| 2063 | kame)
|
|---|
| 2064 | dnl http://www.kame.net/
|
|---|
| 2065 | AC_EGREP_CPP(yes, [
|
|---|
| 2066 | #include <netinet/in.h>
|
|---|
| 2067 | #ifdef __KAME__
|
|---|
| 2068 | yes
|
|---|
| 2069 | #endif],
|
|---|
| 2070 | [ipv6type=$i;
|
|---|
| 2071 | ipv6lib=inet6
|
|---|
| 2072 | ipv6libdir=/usr/local/v6/lib
|
|---|
| 2073 | ipv6trylibc=yes])
|
|---|
| 2074 | ;;
|
|---|
| 2075 | linux-glibc)
|
|---|
| 2076 | dnl http://www.v6.linux.or.jp/
|
|---|
| 2077 | AC_EGREP_CPP(yes, [
|
|---|
| 2078 | #include <features.h>
|
|---|
| 2079 | #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2))
|
|---|
| 2080 | yes
|
|---|
| 2081 | #endif],
|
|---|
| 2082 | [ipv6type=$i;
|
|---|
| 2083 | ipv6trylibc=yes])
|
|---|
| 2084 | ;;
|
|---|
| 2085 | linux-inet6)
|
|---|
| 2086 | dnl http://www.v6.linux.or.jp/
|
|---|
| 2087 | if test -d /usr/inet6; then
|
|---|
| 2088 | ipv6type=$i
|
|---|
| 2089 | ipv6lib=inet6
|
|---|
| 2090 | ipv6libdir=/usr/inet6/lib
|
|---|
| 2091 | BASECFLAGS="-I/usr/inet6/include $BASECFLAGS"
|
|---|
| 2092 | fi
|
|---|
| 2093 | ;;
|
|---|
| 2094 | solaris)
|
|---|
| 2095 | if test -f /etc/netconfig; then
|
|---|
| 2096 | if /usr/xpg4/bin/grep -q tcp6 /etc/netconfig; then
|
|---|
| 2097 | ipv6type=$i
|
|---|
| 2098 | ipv6trylibc=yes
|
|---|
| 2099 | fi
|
|---|
| 2100 | fi
|
|---|
| 2101 | ;;
|
|---|
| 2102 | toshiba)
|
|---|
| 2103 | AC_EGREP_CPP(yes, [
|
|---|
| 2104 | #include <sys/param.h>
|
|---|
| 2105 | #ifdef _TOSHIBA_INET6
|
|---|
| 2106 | yes
|
|---|
| 2107 | #endif],
|
|---|
| 2108 | [ipv6type=$i;
|
|---|
| 2109 | ipv6lib=inet6;
|
|---|
| 2110 | ipv6libdir=/usr/local/v6/lib])
|
|---|
| 2111 | ;;
|
|---|
| 2112 | v6d)
|
|---|
| 2113 | AC_EGREP_CPP(yes, [
|
|---|
| 2114 | #include </usr/local/v6/include/sys/v6config.h>
|
|---|
| 2115 | #ifdef __V6D__
|
|---|
| 2116 | yes
|
|---|
| 2117 | #endif],
|
|---|
| 2118 | [ipv6type=$i;
|
|---|
| 2119 | ipv6lib=v6;
|
|---|
| 2120 | ipv6libdir=/usr/local/v6/lib;
|
|---|
| 2121 | BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"])
|
|---|
| 2122 | ;;
|
|---|
| 2123 | zeta)
|
|---|
| 2124 | AC_EGREP_CPP(yes, [
|
|---|
| 2125 | #include <sys/param.h>
|
|---|
| 2126 | #ifdef _ZETA_MINAMI_INET6
|
|---|
| 2127 | yes
|
|---|
| 2128 | #endif],
|
|---|
| 2129 | [ipv6type=$i;
|
|---|
| 2130 | ipv6lib=inet6;
|
|---|
| 2131 | ipv6libdir=/usr/local/v6/lib])
|
|---|
| 2132 | ;;
|
|---|
| 2133 | esac
|
|---|
| 2134 | if test "$ipv6type" != "unknown"; then
|
|---|
| 2135 | break
|
|---|
| 2136 | fi
|
|---|
| 2137 | done
|
|---|
| 2138 | AC_MSG_RESULT($ipv6type)
|
|---|
| 2139 | fi
|
|---|
| 2140 |
|
|---|
| 2141 | if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
|
|---|
| 2142 | if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
|
|---|
| 2143 | LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
|
|---|
| 2144 | echo "using lib$ipv6lib"
|
|---|
| 2145 | else
|
|---|
| 2146 | if test $ipv6trylibc = "yes"; then
|
|---|
| 2147 | echo "using libc"
|
|---|
| 2148 | else
|
|---|
| 2149 | echo 'Fatal: no $ipv6lib library found. cannot continue.'
|
|---|
| 2150 | echo "You need to fetch lib$ipv6lib.a from appropriate"
|
|---|
| 2151 | echo 'ipv6 kit and compile beforehand.'
|
|---|
| 2152 | exit 1
|
|---|
| 2153 | fi
|
|---|
| 2154 | fi
|
|---|
| 2155 | fi
|
|---|
| 2156 |
|
|---|
| 2157 | # Check for --with-doc-strings
|
|---|
| 2158 | AC_MSG_CHECKING(for --with-doc-strings)
|
|---|
| 2159 | AC_ARG_WITH(doc-strings,
|
|---|
| 2160 | AC_HELP_STRING(--with(out)-doc-strings, disable/enable documentation strings))
|
|---|
| 2161 |
|
|---|
| 2162 | if test -z "$with_doc_strings"
|
|---|
| 2163 | then with_doc_strings="yes"
|
|---|
| 2164 | fi
|
|---|
| 2165 | if test "$with_doc_strings" != "no"
|
|---|
| 2166 | then
|
|---|
| 2167 | AC_DEFINE(WITH_DOC_STRINGS, 1,
|
|---|
| 2168 | [Define if you want documentation strings in extension modules])
|
|---|
| 2169 | fi
|
|---|
| 2170 | AC_MSG_RESULT($with_doc_strings)
|
|---|
| 2171 |
|
|---|
| 2172 | # Check for Python-specific malloc support
|
|---|
| 2173 | AC_MSG_CHECKING(for --with-tsc)
|
|---|
| 2174 | AC_ARG_WITH(tsc,
|
|---|
| 2175 | [ --with(out)-tsc enable/disable timestamp counter profile], [
|
|---|
| 2176 | if test "$withval" != no
|
|---|
| 2177 | then
|
|---|
| 2178 | AC_DEFINE(WITH_TSC, 1,
|
|---|
| 2179 | [Define to profile with the Pentium timestamp counter])
|
|---|
| 2180 | AC_MSG_RESULT(yes)
|
|---|
| 2181 | else AC_MSG_RESULT(no)
|
|---|
| 2182 | fi],
|
|---|
| 2183 | [AC_MSG_RESULT(no)])
|
|---|
| 2184 |
|
|---|
| 2185 | # Check for Python-specific malloc support
|
|---|
| 2186 | AC_MSG_CHECKING(for --with-pymalloc)
|
|---|
| 2187 | AC_ARG_WITH(pymalloc,
|
|---|
| 2188 | AC_HELP_STRING(--with(out)-pymalloc, disable/enable specialized mallocs))
|
|---|
| 2189 |
|
|---|
| 2190 | if test -z "$with_pymalloc"
|
|---|
| 2191 | then with_pymalloc="yes"
|
|---|
| 2192 | fi
|
|---|
| 2193 | if test "$with_pymalloc" != "no"
|
|---|
| 2194 | then
|
|---|
| 2195 | AC_DEFINE(WITH_PYMALLOC, 1,
|
|---|
| 2196 | [Define if you want to compile in Python-specific mallocs])
|
|---|
| 2197 | fi
|
|---|
| 2198 | AC_MSG_RESULT($with_pymalloc)
|
|---|
| 2199 |
|
|---|
| 2200 | # Check for --with-wctype-functions
|
|---|
| 2201 | AC_MSG_CHECKING(for --with-wctype-functions)
|
|---|
| 2202 | AC_ARG_WITH(wctype-functions,
|
|---|
| 2203 | AC_HELP_STRING(--with-wctype-functions, use wctype.h functions),
|
|---|
| 2204 | [
|
|---|
| 2205 | if test "$withval" != no
|
|---|
| 2206 | then
|
|---|
| 2207 | AC_DEFINE(WANT_WCTYPE_FUNCTIONS, 1,
|
|---|
| 2208 | [Define if you want wctype.h functions to be used instead of the
|
|---|
| 2209 | one supplied by Python itself. (see Include/unicodectype.h).])
|
|---|
| 2210 | AC_MSG_RESULT(yes)
|
|---|
| 2211 | else AC_MSG_RESULT(no)
|
|---|
| 2212 | fi],
|
|---|
| 2213 | [AC_MSG_RESULT(no)])
|
|---|
| 2214 |
|
|---|
| 2215 | # -I${DLINCLDIR} is added to the compile rule for importdl.o
|
|---|
| 2216 | AC_SUBST(DLINCLDIR)
|
|---|
| 2217 | DLINCLDIR=.
|
|---|
| 2218 |
|
|---|
| 2219 | # the dlopen() function means we might want to use dynload_shlib.o. some
|
|---|
| 2220 | # platforms, such as AIX, have dlopen(), but don't want to use it.
|
|---|
| 2221 | AC_CHECK_FUNCS(dlopen)
|
|---|
| 2222 |
|
|---|
| 2223 | # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic
|
|---|
| 2224 | # loading of modules.
|
|---|
| 2225 | AC_SUBST(DYNLOADFILE)
|
|---|
| 2226 | AC_MSG_CHECKING(DYNLOADFILE)
|
|---|
| 2227 | if test -z "$DYNLOADFILE"
|
|---|
| 2228 | then
|
|---|
| 2229 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 2230 | AIX*) # Use dynload_shlib.c and dlopen() if we have it; otherwise dynload_aix.c
|
|---|
| 2231 | if test "$ac_cv_func_dlopen" = yes
|
|---|
| 2232 | then DYNLOADFILE="dynload_shlib.o"
|
|---|
| 2233 | else DYNLOADFILE="dynload_aix.o"
|
|---|
| 2234 | fi
|
|---|
| 2235 | ;;
|
|---|
| 2236 | BeOS*) DYNLOADFILE="dynload_beos.o";;
|
|---|
| 2237 | hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
|
|---|
| 2238 | # Use dynload_next.c only on 10.2 and below, which don't have native dlopen()
|
|---|
| 2239 | Darwin/@<:@0156@:>@\..*) DYNLOADFILE="dynload_next.o";;
|
|---|
| 2240 | atheos*) DYNLOADFILE="dynload_atheos.o";;
|
|---|
| 2241 | *)
|
|---|
| 2242 | # use dynload_shlib.c and dlopen() if we have it; otherwise stub
|
|---|
| 2243 | # out any dynamic loading
|
|---|
| 2244 | if test "$ac_cv_func_dlopen" = yes
|
|---|
| 2245 | then DYNLOADFILE="dynload_shlib.o"
|
|---|
| 2246 | else DYNLOADFILE="dynload_stub.o"
|
|---|
| 2247 | fi
|
|---|
| 2248 | ;;
|
|---|
| 2249 | esac
|
|---|
| 2250 | fi
|
|---|
| 2251 | AC_MSG_RESULT($DYNLOADFILE)
|
|---|
| 2252 | if test "$DYNLOADFILE" != "dynload_stub.o"
|
|---|
| 2253 | then
|
|---|
| 2254 | AC_DEFINE(HAVE_DYNAMIC_LOADING, 1,
|
|---|
| 2255 | [Defined when any dynamic module loading is enabled.])
|
|---|
| 2256 | fi
|
|---|
| 2257 |
|
|---|
| 2258 | # MACHDEP_OBJS can be set to platform-specific object files needed by Python
|
|---|
| 2259 |
|
|---|
| 2260 | AC_SUBST(MACHDEP_OBJS)
|
|---|
| 2261 | AC_MSG_CHECKING(MACHDEP_OBJS)
|
|---|
| 2262 | if test -z "$MACHDEP_OBJS"
|
|---|
| 2263 | then
|
|---|
| 2264 | MACHDEP_OBJS=$extra_machdep_objs
|
|---|
| 2265 | else
|
|---|
| 2266 | MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs"
|
|---|
| 2267 | fi
|
|---|
| 2268 | AC_MSG_RESULT(MACHDEP_OBJS)
|
|---|
| 2269 |
|
|---|
| 2270 | # checks for library functions
|
|---|
| 2271 | AC_CHECK_FUNCS(alarm bind_textdomain_codeset chown clock confstr ctermid \
|
|---|
| 2272 | execv fork fpathconf ftime ftruncate \
|
|---|
| 2273 | gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
|
|---|
| 2274 | getpriority getpwent getspnam getspent getsid getwd \
|
|---|
| 2275 | kill killpg lchown lstat mkfifo mknod mktime \
|
|---|
| 2276 | mremap nice pathconf pause plock poll pthread_init \
|
|---|
| 2277 | putenv readlink realpath \
|
|---|
| 2278 | select setegid seteuid setgid \
|
|---|
| 2279 | setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \
|
|---|
| 2280 | sigaction siginterrupt sigrelse strftime \
|
|---|
| 2281 | sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
|
|---|
| 2282 | truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll _getpty)
|
|---|
| 2283 |
|
|---|
| 2284 | # For some functions, having a definition is not sufficient, since
|
|---|
| 2285 | # we want to take their address.
|
|---|
| 2286 | AC_MSG_CHECKING(for chroot)
|
|---|
| 2287 | AC_TRY_COMPILE([#include <unistd.h>], void *x=chroot,
|
|---|
| 2288 | AC_DEFINE(HAVE_CHROOT, 1, Define if you have the 'chroot' function.)
|
|---|
| 2289 | AC_MSG_RESULT(yes),
|
|---|
| 2290 | AC_MSG_RESULT(no)
|
|---|
| 2291 | )
|
|---|
| 2292 | AC_MSG_CHECKING(for link)
|
|---|
| 2293 | AC_TRY_COMPILE([#include <unistd.h>], void *x=link,
|
|---|
| 2294 | AC_DEFINE(HAVE_LINK, 1, Define if you have the 'link' function.)
|
|---|
| 2295 | AC_MSG_RESULT(yes),
|
|---|
| 2296 | AC_MSG_RESULT(no)
|
|---|
| 2297 | )
|
|---|
| 2298 | AC_MSG_CHECKING(for symlink)
|
|---|
| 2299 | AC_TRY_COMPILE([#include <unistd.h>], void *x=symlink,
|
|---|
| 2300 | AC_DEFINE(HAVE_SYMLINK, 1, Define if you have the 'symlink' function.)
|
|---|
| 2301 | AC_MSG_RESULT(yes),
|
|---|
| 2302 | AC_MSG_RESULT(no)
|
|---|
| 2303 | )
|
|---|
| 2304 | AC_MSG_CHECKING(for fchdir)
|
|---|
| 2305 | AC_TRY_COMPILE([#include <unistd.h>], void *x=fchdir,
|
|---|
| 2306 | AC_DEFINE(HAVE_FCHDIR, 1, Define if you have the 'fchdir' function.)
|
|---|
| 2307 | AC_MSG_RESULT(yes),
|
|---|
| 2308 | AC_MSG_RESULT(no)
|
|---|
| 2309 | )
|
|---|
| 2310 | AC_MSG_CHECKING(for fsync)
|
|---|
| 2311 | AC_TRY_COMPILE([#include <unistd.h>], void *x=fsync,
|
|---|
| 2312 | AC_DEFINE(HAVE_FSYNC, 1, Define if you have the 'fsync' function.)
|
|---|
| 2313 | AC_MSG_RESULT(yes),
|
|---|
| 2314 | AC_MSG_RESULT(no)
|
|---|
| 2315 | )
|
|---|
| 2316 | AC_MSG_CHECKING(for fdatasync)
|
|---|
| 2317 | AC_TRY_COMPILE([#include <unistd.h>], void *x=fdatasync,
|
|---|
| 2318 | AC_DEFINE(HAVE_FDATASYNC, 1, Define if you have the 'fdatasync' function.)
|
|---|
| 2319 | AC_MSG_RESULT(yes),
|
|---|
| 2320 | AC_MSG_RESULT(no)
|
|---|
| 2321 | )
|
|---|
| 2322 |
|
|---|
| 2323 | # On some systems (eg. FreeBSD 5), we would find a definition of the
|
|---|
| 2324 | # functions ctermid_r, setgroups in the library, but no prototype
|
|---|
| 2325 | # (e.g. because we use _XOPEN_SOURCE). See whether we can take their
|
|---|
| 2326 | # address to avoid compiler warnings and potential miscompilations
|
|---|
| 2327 | # because of the missing prototypes.
|
|---|
| 2328 |
|
|---|
| 2329 | AC_MSG_CHECKING(for ctermid_r)
|
|---|
| 2330 | AC_TRY_COMPILE([
|
|---|
| 2331 | #include "confdefs.h"
|
|---|
| 2332 | #include <stdio.h>
|
|---|
| 2333 | ], void* p = ctermid_r,
|
|---|
| 2334 | AC_DEFINE(HAVE_CTERMID_R, 1, Define if you have the 'ctermid_r' function.)
|
|---|
| 2335 | AC_MSG_RESULT(yes),
|
|---|
| 2336 | AC_MSG_RESULT(no)
|
|---|
| 2337 | )
|
|---|
| 2338 |
|
|---|
| 2339 | AC_MSG_CHECKING(for flock)
|
|---|
| 2340 | AC_TRY_COMPILE([
|
|---|
| 2341 | #include "confdefs.h"
|
|---|
| 2342 | #include <sys/file.h>
|
|---|
| 2343 | ], void* p = flock,
|
|---|
| 2344 | AC_DEFINE(HAVE_FLOCK, 1, Define if you have the 'flock' function.)
|
|---|
| 2345 | AC_MSG_RESULT(yes),
|
|---|
| 2346 | AC_MSG_RESULT(no)
|
|---|
| 2347 | )
|
|---|
| 2348 |
|
|---|
| 2349 | AC_MSG_CHECKING(for getpagesize)
|
|---|
| 2350 | AC_TRY_COMPILE([
|
|---|
| 2351 | #include "confdefs.h"
|
|---|
| 2352 | #include <unistd.h>
|
|---|
| 2353 | ], void* p = getpagesize,
|
|---|
| 2354 | AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function.)
|
|---|
| 2355 | AC_MSG_RESULT(yes),
|
|---|
| 2356 | AC_MSG_RESULT(no)
|
|---|
| 2357 | )
|
|---|
| 2358 |
|
|---|
| 2359 | dnl check for true
|
|---|
| 2360 | AC_CHECK_PROGS(TRUE, true, /bin/true)
|
|---|
| 2361 |
|
|---|
| 2362 | dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
|
|---|
| 2363 | dnl On others, they are in the C library, so we to take no action
|
|---|
| 2364 | AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
|
|---|
| 2365 | AC_CHECK_LIB(resolv, inet_aton)
|
|---|
| 2366 | )
|
|---|
| 2367 |
|
|---|
| 2368 | dnl Check if system zlib has *Copy() functions
|
|---|
| 2369 | dnl
|
|---|
| 2370 | dnl On MacOSX the linker will search for dylibs on the entire linker path
|
|---|
| 2371 | dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first
|
|---|
| 2372 | dnl to revert to a more traditional unix behaviour and make it possible to
|
|---|
| 2373 | dnl override the system libz with a local static library of libz. Temporarily
|
|---|
| 2374 | dnl add that flag to our CFLAGS as well to ensure that we check the version
|
|---|
| 2375 | dnl of libz that will be used by setup.py.
|
|---|
| 2376 | dnl The -L/usr/local/lib is needed as wel to get the same compilation
|
|---|
| 2377 | dnl environment as setup.py (and leaving it out can cause configure to use the
|
|---|
| 2378 | dnl wrong version of the library)
|
|---|
| 2379 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 2380 | Darwin/*)
|
|---|
| 2381 | _CUR_CFLAGS="${CFLAGS}"
|
|---|
| 2382 | _CUR_LDFLAGS="${LDFLAGS}"
|
|---|
| 2383 | CFLAGS="${CFLAGS} -Wl,-search_paths_first"
|
|---|
| 2384 | LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
|
|---|
| 2385 | ;;
|
|---|
| 2386 | esac
|
|---|
| 2387 |
|
|---|
| 2388 | AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, Define if the zlib library has inflateCopy))
|
|---|
| 2389 |
|
|---|
| 2390 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 2391 | Darwin/*)
|
|---|
| 2392 | CFLAGS="${_CUR_CFLAGS}"
|
|---|
| 2393 | LDFLAGS="${_CUR_LDFLAGS}"
|
|---|
| 2394 | ;;
|
|---|
| 2395 | esac
|
|---|
| 2396 |
|
|---|
| 2397 | AC_MSG_CHECKING(for hstrerror)
|
|---|
| 2398 | AC_TRY_LINK([
|
|---|
| 2399 | #include "confdefs.h"
|
|---|
| 2400 | #include <netdb.h>
|
|---|
| 2401 | ], void* p = hstrerror; hstrerror(0),
|
|---|
| 2402 | AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.)
|
|---|
| 2403 | AC_MSG_RESULT(yes),
|
|---|
| 2404 | AC_MSG_RESULT(no)
|
|---|
| 2405 | )
|
|---|
| 2406 |
|
|---|
| 2407 | AC_MSG_CHECKING(for inet_aton)
|
|---|
| 2408 | AC_TRY_LINK([
|
|---|
| 2409 | #include "confdefs.h"
|
|---|
| 2410 | #include <sys/types.h>
|
|---|
| 2411 | #include <sys/socket.h>
|
|---|
| 2412 | #include <netinet/in.h>
|
|---|
| 2413 | #include <arpa/inet.h>
|
|---|
| 2414 | ], void* p = inet_aton;inet_aton(0,0),
|
|---|
| 2415 | AC_DEFINE(HAVE_INET_ATON, 1, Define if you have the 'inet_aton' function.)
|
|---|
| 2416 | AC_MSG_RESULT(yes),
|
|---|
| 2417 | AC_MSG_RESULT(no)
|
|---|
| 2418 | )
|
|---|
| 2419 |
|
|---|
| 2420 | AC_MSG_CHECKING(for inet_pton)
|
|---|
| 2421 | AC_TRY_COMPILE([
|
|---|
| 2422 | #include "confdefs.h"
|
|---|
| 2423 | #include <sys/types.h>
|
|---|
| 2424 | #include <sys/socket.h>
|
|---|
| 2425 | #include <netinet/in.h>
|
|---|
| 2426 | #include <arpa/inet.h>
|
|---|
| 2427 | ], void* p = inet_pton,
|
|---|
| 2428 | AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.)
|
|---|
| 2429 | AC_MSG_RESULT(yes),
|
|---|
| 2430 | AC_MSG_RESULT(no)
|
|---|
| 2431 | )
|
|---|
| 2432 |
|
|---|
| 2433 | # On some systems, setgroups is in unistd.h, on others, in grp.h
|
|---|
| 2434 | AC_MSG_CHECKING(for setgroups)
|
|---|
| 2435 | AC_TRY_COMPILE([
|
|---|
| 2436 | #include "confdefs.h"
|
|---|
| 2437 | #include <unistd.h>
|
|---|
| 2438 | #ifdef HAVE_GRP_H
|
|---|
| 2439 | #include <grp.h>
|
|---|
| 2440 | #endif
|
|---|
| 2441 | ],
|
|---|
| 2442 | void* p = setgroups,
|
|---|
| 2443 | AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.)
|
|---|
| 2444 | AC_MSG_RESULT(yes),
|
|---|
| 2445 | AC_MSG_RESULT(no)
|
|---|
| 2446 | )
|
|---|
| 2447 |
|
|---|
| 2448 | # check for openpty and forkpty
|
|---|
| 2449 |
|
|---|
| 2450 | AC_CHECK_FUNCS(openpty,,
|
|---|
| 2451 | AC_CHECK_LIB(util,openpty,
|
|---|
| 2452 | [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"],
|
|---|
| 2453 | AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"])
|
|---|
| 2454 | )
|
|---|
| 2455 | )
|
|---|
| 2456 | AC_CHECK_FUNCS(forkpty,,
|
|---|
| 2457 | AC_CHECK_LIB(util,forkpty,
|
|---|
| 2458 | [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"],
|
|---|
| 2459 | AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"])
|
|---|
| 2460 | )
|
|---|
| 2461 | )
|
|---|
| 2462 |
|
|---|
| 2463 | # check for long file support functions
|
|---|
| 2464 | AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)
|
|---|
| 2465 |
|
|---|
| 2466 | AC_REPLACE_FUNCS(dup2 getcwd strdup strerror memmove)
|
|---|
| 2467 | AC_CHECK_FUNCS(getpgrp,
|
|---|
| 2468 | AC_TRY_COMPILE([#include <unistd.h>],
|
|---|
| 2469 | [getpgrp(0);],
|
|---|
| 2470 | AC_DEFINE(GETPGRP_HAVE_ARG, 1,
|
|---|
| 2471 | [Define if getpgrp() must be called as getpgrp(0).])
|
|---|
| 2472 | )
|
|---|
| 2473 | )
|
|---|
| 2474 | AC_CHECK_FUNCS(setpgrp,
|
|---|
| 2475 | AC_TRY_COMPILE([#include <unistd.h>],
|
|---|
| 2476 | [setpgrp(0,0);],
|
|---|
| 2477 | AC_DEFINE(SETPGRP_HAVE_ARG, 1,
|
|---|
| 2478 | [Define if setpgrp() must be called as setpgrp(0, 0).])
|
|---|
| 2479 | )
|
|---|
| 2480 | )
|
|---|
| 2481 | AC_CHECK_FUNCS(gettimeofday,
|
|---|
| 2482 | AC_TRY_COMPILE([#include <sys/time.h>],
|
|---|
| 2483 | [gettimeofday((struct timeval*)0,(struct timezone*)0);], ,
|
|---|
| 2484 | AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1,
|
|---|
| 2485 | [Define if gettimeofday() does not have second (timezone) argument
|
|---|
| 2486 | This is the case on Motorola V4 (R40V4.2)])
|
|---|
| 2487 | )
|
|---|
| 2488 | )
|
|---|
| 2489 |
|
|---|
| 2490 | AC_MSG_CHECKING(for major, minor, and makedev)
|
|---|
| 2491 | AC_TRY_LINK([
|
|---|
| 2492 | #if defined(MAJOR_IN_MKDEV)
|
|---|
| 2493 | #include <sys/mkdev.h>
|
|---|
| 2494 | #elif defined(MAJOR_IN_SYSMACROS)
|
|---|
| 2495 | #include <sys/sysmacros.h>
|
|---|
| 2496 | #else
|
|---|
| 2497 | #include <sys/types.h>
|
|---|
| 2498 | #endif
|
|---|
| 2499 | ],[
|
|---|
| 2500 | makedev(major(0),minor(0));
|
|---|
| 2501 | ],[
|
|---|
| 2502 | AC_DEFINE(HAVE_DEVICE_MACROS, 1,
|
|---|
| 2503 | [Define to 1 if you have the device macros.])
|
|---|
| 2504 | AC_MSG_RESULT(yes)
|
|---|
| 2505 | ],[
|
|---|
| 2506 | AC_MSG_RESULT(no)
|
|---|
| 2507 | ])
|
|---|
| 2508 |
|
|---|
| 2509 | # On OSF/1 V5.1, getaddrinfo is available, but a define
|
|---|
| 2510 | # for [no]getaddrinfo in netdb.h.
|
|---|
| 2511 | AC_MSG_CHECKING(for getaddrinfo)
|
|---|
| 2512 | AC_TRY_LINK([
|
|---|
| 2513 | #include <sys/types.h>
|
|---|
| 2514 | #include <sys/socket.h>
|
|---|
| 2515 | #include <netdb.h>
|
|---|
| 2516 | #include <stdio.h>
|
|---|
| 2517 | ],[
|
|---|
| 2518 | getaddrinfo(NULL, NULL, NULL, NULL);
|
|---|
| 2519 | ], [
|
|---|
| 2520 | AC_MSG_RESULT(yes)
|
|---|
| 2521 | AC_MSG_CHECKING(getaddrinfo bug)
|
|---|
| 2522 | AC_TRY_RUN([
|
|---|
| 2523 | #include <sys/types.h>
|
|---|
| 2524 | #include <netdb.h>
|
|---|
| 2525 | #include <string.h>
|
|---|
| 2526 | #include <sys/socket.h>
|
|---|
| 2527 | #include <netinet/in.h>
|
|---|
| 2528 |
|
|---|
| 2529 | main()
|
|---|
| 2530 | {
|
|---|
| 2531 | int passive, gaierr, inet4 = 0, inet6 = 0;
|
|---|
| 2532 | struct addrinfo hints, *ai, *aitop;
|
|---|
| 2533 | char straddr[INET6_ADDRSTRLEN], strport[16];
|
|---|
| 2534 |
|
|---|
| 2535 | for (passive = 0; passive <= 1; passive++) {
|
|---|
| 2536 | memset(&hints, 0, sizeof(hints));
|
|---|
| 2537 | hints.ai_family = AF_UNSPEC;
|
|---|
| 2538 | hints.ai_flags = passive ? AI_PASSIVE : 0;
|
|---|
| 2539 | hints.ai_socktype = SOCK_STREAM;
|
|---|
| 2540 | hints.ai_protocol = IPPROTO_TCP;
|
|---|
| 2541 | if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
|
|---|
| 2542 | (void)gai_strerror(gaierr);
|
|---|
| 2543 | goto bad;
|
|---|
| 2544 | }
|
|---|
| 2545 | for (ai = aitop; ai; ai = ai->ai_next) {
|
|---|
| 2546 | if (ai->ai_addr == NULL ||
|
|---|
| 2547 | ai->ai_addrlen == 0 ||
|
|---|
| 2548 | getnameinfo(ai->ai_addr, ai->ai_addrlen,
|
|---|
| 2549 | straddr, sizeof(straddr), strport, sizeof(strport),
|
|---|
| 2550 | NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
|
|---|
| 2551 | goto bad;
|
|---|
| 2552 | }
|
|---|
| 2553 | switch (ai->ai_family) {
|
|---|
| 2554 | case AF_INET:
|
|---|
| 2555 | if (strcmp(strport, "54321") != 0) {
|
|---|
| 2556 | goto bad;
|
|---|
| 2557 | }
|
|---|
| 2558 | if (passive) {
|
|---|
| 2559 | if (strcmp(straddr, "0.0.0.0") != 0) {
|
|---|
| 2560 | goto bad;
|
|---|
| 2561 | }
|
|---|
| 2562 | } else {
|
|---|
| 2563 | if (strcmp(straddr, "127.0.0.1") != 0) {
|
|---|
| 2564 | goto bad;
|
|---|
| 2565 | }
|
|---|
| 2566 | }
|
|---|
| 2567 | inet4++;
|
|---|
| 2568 | break;
|
|---|
| 2569 | case AF_INET6:
|
|---|
| 2570 | if (strcmp(strport, "54321") != 0) {
|
|---|
| 2571 | goto bad;
|
|---|
| 2572 | }
|
|---|
| 2573 | if (passive) {
|
|---|
| 2574 | if (strcmp(straddr, "::") != 0) {
|
|---|
| 2575 | goto bad;
|
|---|
| 2576 | }
|
|---|
| 2577 | } else {
|
|---|
| 2578 | if (strcmp(straddr, "::1") != 0) {
|
|---|
| 2579 | goto bad;
|
|---|
| 2580 | }
|
|---|
| 2581 | }
|
|---|
| 2582 | inet6++;
|
|---|
| 2583 | break;
|
|---|
| 2584 | case AF_UNSPEC:
|
|---|
| 2585 | goto bad;
|
|---|
| 2586 | break;
|
|---|
| 2587 | default:
|
|---|
| 2588 | /* another family support? */
|
|---|
| 2589 | break;
|
|---|
| 2590 | }
|
|---|
| 2591 | }
|
|---|
| 2592 | }
|
|---|
| 2593 |
|
|---|
| 2594 | if (!(inet4 == 0 || inet4 == 2))
|
|---|
| 2595 | goto bad;
|
|---|
| 2596 | if (!(inet6 == 0 || inet6 == 2))
|
|---|
| 2597 | goto bad;
|
|---|
| 2598 |
|
|---|
| 2599 | if (aitop)
|
|---|
| 2600 | freeaddrinfo(aitop);
|
|---|
| 2601 | exit(0);
|
|---|
| 2602 |
|
|---|
| 2603 | bad:
|
|---|
| 2604 | if (aitop)
|
|---|
| 2605 | freeaddrinfo(aitop);
|
|---|
| 2606 | exit(1);
|
|---|
| 2607 | }
|
|---|
| 2608 | ],
|
|---|
| 2609 | AC_MSG_RESULT(good)
|
|---|
| 2610 | buggygetaddrinfo=no,
|
|---|
| 2611 | AC_MSG_RESULT(buggy)
|
|---|
| 2612 | buggygetaddrinfo=yes,
|
|---|
| 2613 | AC_MSG_RESULT(buggy)
|
|---|
| 2614 | buggygetaddrinfo=yes)], [
|
|---|
| 2615 | AC_MSG_RESULT(no)
|
|---|
| 2616 | buggygetaddrinfo=yes
|
|---|
| 2617 | ])
|
|---|
| 2618 |
|
|---|
| 2619 | if test "$buggygetaddrinfo" = "yes"; then
|
|---|
| 2620 | if test "$ipv6" = "yes"; then
|
|---|
| 2621 | echo 'Fatal: You must get working getaddrinfo() function.'
|
|---|
| 2622 | echo ' or you can specify "--disable-ipv6"'.
|
|---|
| 2623 | exit 1
|
|---|
| 2624 | fi
|
|---|
| 2625 | else
|
|---|
| 2626 | AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.])
|
|---|
| 2627 | fi
|
|---|
| 2628 | AC_CHECK_FUNCS(getnameinfo)
|
|---|
| 2629 |
|
|---|
| 2630 | # checks for structures
|
|---|
| 2631 | AC_HEADER_TIME
|
|---|
| 2632 | AC_STRUCT_TM
|
|---|
| 2633 | AC_STRUCT_TIMEZONE
|
|---|
| 2634 | AC_CHECK_MEMBERS([struct stat.st_rdev])
|
|---|
| 2635 | AC_CHECK_MEMBERS([struct stat.st_blksize])
|
|---|
| 2636 | AC_CHECK_MEMBERS([struct stat.st_flags])
|
|---|
| 2637 | AC_CHECK_MEMBERS([struct stat.st_gen])
|
|---|
| 2638 | AC_CHECK_MEMBERS([struct stat.st_birthtime])
|
|---|
| 2639 | AC_STRUCT_ST_BLOCKS
|
|---|
| 2640 |
|
|---|
| 2641 | AC_MSG_CHECKING(for time.h that defines altzone)
|
|---|
| 2642 | AC_CACHE_VAL(ac_cv_header_time_altzone,
|
|---|
| 2643 | [AC_TRY_COMPILE([#include <time.h>], [return altzone;],
|
|---|
| 2644 | ac_cv_header_time_altzone=yes,
|
|---|
| 2645 | ac_cv_header_time_altzone=no)])
|
|---|
| 2646 | AC_MSG_RESULT($ac_cv_header_time_altzone)
|
|---|
| 2647 | if test $ac_cv_header_time_altzone = yes; then
|
|---|
| 2648 | AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.])
|
|---|
| 2649 | fi
|
|---|
| 2650 |
|
|---|
| 2651 | was_it_defined=no
|
|---|
| 2652 | AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included)
|
|---|
| 2653 | AC_TRY_COMPILE([
|
|---|
| 2654 | #include <sys/types.h>
|
|---|
| 2655 | #include <sys/select.h>
|
|---|
| 2656 | #include <sys/time.h>
|
|---|
| 2657 | ], [;], [
|
|---|
| 2658 | AC_DEFINE(SYS_SELECT_WITH_SYS_TIME, 1,
|
|---|
| 2659 | [Define if you can safely include both <sys/select.h> and <sys/time.h>
|
|---|
| 2660 | (which you can't on SCO ODT 3.0).])
|
|---|
| 2661 | was_it_defined=yes
|
|---|
| 2662 | ])
|
|---|
| 2663 | AC_MSG_RESULT($was_it_defined)
|
|---|
| 2664 |
|
|---|
| 2665 | AC_MSG_CHECKING(for addrinfo)
|
|---|
| 2666 | AC_CACHE_VAL(ac_cv_struct_addrinfo,
|
|---|
| 2667 | AC_TRY_COMPILE([
|
|---|
| 2668 | # include <netdb.h>],
|
|---|
| 2669 | [struct addrinfo a],
|
|---|
| 2670 | ac_cv_struct_addrinfo=yes,
|
|---|
| 2671 | ac_cv_struct_addrinfo=no))
|
|---|
| 2672 | AC_MSG_RESULT($ac_cv_struct_addrinfo)
|
|---|
| 2673 | if test $ac_cv_struct_addrinfo = yes; then
|
|---|
| 2674 | AC_DEFINE(HAVE_ADDRINFO, 1, [struct addrinfo (netdb.h)])
|
|---|
| 2675 | fi
|
|---|
| 2676 |
|
|---|
| 2677 | AC_MSG_CHECKING(for sockaddr_storage)
|
|---|
| 2678 | AC_CACHE_VAL(ac_cv_struct_sockaddr_storage,
|
|---|
| 2679 | AC_TRY_COMPILE([
|
|---|
| 2680 | # include <sys/types.h>
|
|---|
| 2681 | # include <sys/socket.h>],
|
|---|
| 2682 | [struct sockaddr_storage s],
|
|---|
| 2683 | ac_cv_struct_sockaddr_storage=yes,
|
|---|
| 2684 | ac_cv_struct_sockaddr_storage=no))
|
|---|
| 2685 | AC_MSG_RESULT($ac_cv_struct_sockaddr_storage)
|
|---|
| 2686 | if test $ac_cv_struct_sockaddr_storage = yes; then
|
|---|
| 2687 | AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket.h)])
|
|---|
| 2688 | fi
|
|---|
| 2689 |
|
|---|
| 2690 | # checks for compiler characteristics
|
|---|
| 2691 |
|
|---|
| 2692 | AC_C_CHAR_UNSIGNED
|
|---|
| 2693 | AC_C_CONST
|
|---|
| 2694 |
|
|---|
| 2695 | works=no
|
|---|
| 2696 | AC_MSG_CHECKING(for working volatile)
|
|---|
| 2697 | AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes,
|
|---|
| 2698 | AC_DEFINE(volatile, [], [Define to empty if the keyword does not work.])
|
|---|
| 2699 | )
|
|---|
| 2700 | AC_MSG_RESULT($works)
|
|---|
| 2701 |
|
|---|
| 2702 | works=no
|
|---|
| 2703 | AC_MSG_CHECKING(for working signed char)
|
|---|
| 2704 | AC_TRY_COMPILE([], [signed char c;], works=yes,
|
|---|
| 2705 | AC_DEFINE(signed, [], [Define to empty if the keyword does not work.])
|
|---|
| 2706 | )
|
|---|
| 2707 | AC_MSG_RESULT($works)
|
|---|
| 2708 |
|
|---|
| 2709 | have_prototypes=no
|
|---|
| 2710 | AC_MSG_CHECKING(for prototypes)
|
|---|
| 2711 | AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],[
|
|---|
| 2712 | AC_DEFINE(HAVE_PROTOTYPES, 1,
|
|---|
| 2713 | [Define if your compiler supports function prototype])
|
|---|
| 2714 | have_prototypes=yes
|
|---|
| 2715 | ])
|
|---|
| 2716 | AC_MSG_RESULT($have_prototypes)
|
|---|
| 2717 |
|
|---|
| 2718 | works=no
|
|---|
| 2719 | AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
|
|---|
| 2720 | AC_TRY_COMPILE([
|
|---|
| 2721 | #include <stdarg.h>
|
|---|
| 2722 | int foo(int x, ...) {
|
|---|
| 2723 | va_list va;
|
|---|
| 2724 | va_start(va, x);
|
|---|
| 2725 | va_arg(va, int);
|
|---|
| 2726 | va_arg(va, char *);
|
|---|
| 2727 | va_arg(va, double);
|
|---|
| 2728 | return 0;
|
|---|
| 2729 | }
|
|---|
| 2730 | ], [return foo(10, "", 3.14);], [
|
|---|
| 2731 | AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1,
|
|---|
| 2732 | [Define if your compiler supports variable length function prototypes
|
|---|
| 2733 | (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>])
|
|---|
| 2734 | works=yes
|
|---|
| 2735 | ])
|
|---|
| 2736 | AC_MSG_RESULT($works)
|
|---|
| 2737 |
|
|---|
| 2738 | # check for socketpair
|
|---|
| 2739 | AC_MSG_CHECKING(for socketpair)
|
|---|
| 2740 | AC_TRY_COMPILE([
|
|---|
| 2741 | #include <sys/types.h>
|
|---|
| 2742 | #include <sys/socket.h>
|
|---|
| 2743 | ], void *x=socketpair,
|
|---|
| 2744 | AC_DEFINE(HAVE_SOCKETPAIR, 1, Define if you have the 'socketpair' function.)
|
|---|
| 2745 | AC_MSG_RESULT(yes),
|
|---|
| 2746 | AC_MSG_RESULT(no)
|
|---|
| 2747 | )
|
|---|
| 2748 |
|
|---|
| 2749 | # check if sockaddr has sa_len member
|
|---|
| 2750 | AC_MSG_CHECKING(if sockaddr has sa_len member)
|
|---|
| 2751 | AC_TRY_COMPILE([#include <sys/types.h>
|
|---|
| 2752 | #include <sys/socket.h>],
|
|---|
| 2753 | [struct sockaddr x;
|
|---|
| 2754 | x.sa_len = 0;],
|
|---|
| 2755 | AC_MSG_RESULT(yes)
|
|---|
| 2756 | AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member]),
|
|---|
| 2757 | AC_MSG_RESULT(no))
|
|---|
| 2758 |
|
|---|
| 2759 | va_list_is_array=no
|
|---|
| 2760 | AC_MSG_CHECKING(whether va_list is an array)
|
|---|
| 2761 | AC_TRY_COMPILE([
|
|---|
| 2762 | #ifdef HAVE_STDARG_PROTOTYPES
|
|---|
| 2763 | #include <stdarg.h>
|
|---|
| 2764 | #else
|
|---|
| 2765 | #include <varargs.h>
|
|---|
| 2766 | #endif
|
|---|
| 2767 | ], [va_list list1, list2; list1 = list2;], , [
|
|---|
| 2768 | AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
|
|---|
| 2769 | va_list_is_array=yes
|
|---|
| 2770 | ])
|
|---|
| 2771 | AC_MSG_RESULT($va_list_is_array)
|
|---|
| 2772 |
|
|---|
| 2773 | # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
|
|---|
| 2774 | AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
|
|---|
| 2775 | [Define this if you have some version of gethostbyname_r()])
|
|---|
| 2776 |
|
|---|
| 2777 | AC_CHECK_FUNC(gethostbyname_r, [
|
|---|
| 2778 | AC_DEFINE(HAVE_GETHOSTBYNAME_R)
|
|---|
| 2779 | AC_MSG_CHECKING([gethostbyname_r with 6 args])
|
|---|
| 2780 | OLD_CFLAGS=$CFLAGS
|
|---|
| 2781 | CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
|
|---|
| 2782 | AC_TRY_COMPILE([
|
|---|
| 2783 | # include <netdb.h>
|
|---|
| 2784 | ], [
|
|---|
| 2785 | char *name;
|
|---|
| 2786 | struct hostent *he, *res;
|
|---|
| 2787 | char buffer[2048];
|
|---|
| 2788 | int buflen = 2048;
|
|---|
| 2789 | int h_errnop;
|
|---|
| 2790 |
|
|---|
| 2791 | (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
|
|---|
| 2792 | ], [
|
|---|
| 2793 | AC_DEFINE(HAVE_GETHOSTBYNAME_R)
|
|---|
| 2794 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
|
|---|
| 2795 | [Define this if you have the 6-arg version of gethostbyname_r().])
|
|---|
| 2796 | AC_MSG_RESULT(yes)
|
|---|
| 2797 | ], [
|
|---|
| 2798 | AC_MSG_RESULT(no)
|
|---|
| 2799 | AC_MSG_CHECKING([gethostbyname_r with 5 args])
|
|---|
| 2800 | AC_TRY_COMPILE([
|
|---|
| 2801 | # include <netdb.h>
|
|---|
| 2802 | ], [
|
|---|
| 2803 | char *name;
|
|---|
| 2804 | struct hostent *he;
|
|---|
| 2805 | char buffer[2048];
|
|---|
| 2806 | int buflen = 2048;
|
|---|
| 2807 | int h_errnop;
|
|---|
| 2808 |
|
|---|
| 2809 | (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
|
|---|
| 2810 | ], [
|
|---|
| 2811 | AC_DEFINE(HAVE_GETHOSTBYNAME_R)
|
|---|
| 2812 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
|
|---|
| 2813 | [Define this if you have the 5-arg version of gethostbyname_r().])
|
|---|
| 2814 | AC_MSG_RESULT(yes)
|
|---|
| 2815 | ], [
|
|---|
| 2816 | AC_MSG_RESULT(no)
|
|---|
| 2817 | AC_MSG_CHECKING([gethostbyname_r with 3 args])
|
|---|
| 2818 | AC_TRY_COMPILE([
|
|---|
| 2819 | # include <netdb.h>
|
|---|
| 2820 | ], [
|
|---|
| 2821 | char *name;
|
|---|
| 2822 | struct hostent *he;
|
|---|
| 2823 | struct hostent_data data;
|
|---|
| 2824 |
|
|---|
| 2825 | (void) gethostbyname_r(name, he, &data);
|
|---|
| 2826 | ], [
|
|---|
| 2827 | AC_DEFINE(HAVE_GETHOSTBYNAME_R)
|
|---|
| 2828 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
|
|---|
| 2829 | [Define this if you have the 3-arg version of gethostbyname_r().])
|
|---|
| 2830 | AC_MSG_RESULT(yes)
|
|---|
| 2831 | ], [
|
|---|
| 2832 | AC_MSG_RESULT(no)
|
|---|
| 2833 | ])
|
|---|
| 2834 | ])
|
|---|
| 2835 | ])
|
|---|
| 2836 | CFLAGS=$OLD_CFLAGS
|
|---|
| 2837 | ], [
|
|---|
| 2838 | AC_CHECK_FUNCS(gethostbyname)
|
|---|
| 2839 | ])
|
|---|
| 2840 | AC_SUBST(HAVE_GETHOSTBYNAME_R_6_ARG)
|
|---|
| 2841 | AC_SUBST(HAVE_GETHOSTBYNAME_R_5_ARG)
|
|---|
| 2842 | AC_SUBST(HAVE_GETHOSTBYNAME_R_3_ARG)
|
|---|
| 2843 | AC_SUBST(HAVE_GETHOSTBYNAME_R)
|
|---|
| 2844 | AC_SUBST(HAVE_GETHOSTBYNAME)
|
|---|
| 2845 |
|
|---|
| 2846 | # checks for system services
|
|---|
| 2847 | # (none yet)
|
|---|
| 2848 |
|
|---|
| 2849 | # Linux requires this for correct f.p. operations
|
|---|
| 2850 | AC_CHECK_FUNC(__fpu_control,
|
|---|
| 2851 | [],
|
|---|
| 2852 | [AC_CHECK_LIB(ieee, __fpu_control)
|
|---|
| 2853 | ])
|
|---|
| 2854 |
|
|---|
| 2855 | # Check for --with-fpectl
|
|---|
| 2856 | AC_MSG_CHECKING(for --with-fpectl)
|
|---|
| 2857 | AC_ARG_WITH(fpectl,
|
|---|
| 2858 | AC_HELP_STRING(--with-fpectl, enable SIGFPE catching),
|
|---|
| 2859 | [
|
|---|
| 2860 | if test "$withval" != no
|
|---|
| 2861 | then
|
|---|
| 2862 | AC_DEFINE(WANT_SIGFPE_HANDLER, 1,
|
|---|
| 2863 | [Define if you want SIGFPE handled (see Include/pyfpe.h).])
|
|---|
| 2864 | AC_MSG_RESULT(yes)
|
|---|
| 2865 | else AC_MSG_RESULT(no)
|
|---|
| 2866 | fi],
|
|---|
| 2867 | [AC_MSG_RESULT(no)])
|
|---|
| 2868 |
|
|---|
| 2869 | # check for --with-libm=...
|
|---|
| 2870 | AC_SUBST(LIBM)
|
|---|
| 2871 | case $ac_sys_system in
|
|---|
| 2872 | Darwin) ;;
|
|---|
| 2873 | BeOS) ;;
|
|---|
| 2874 | *) LIBM=-lm
|
|---|
| 2875 | esac
|
|---|
| 2876 | AC_MSG_CHECKING(for --with-libm=STRING)
|
|---|
| 2877 | AC_ARG_WITH(libm,
|
|---|
| 2878 | AC_HELP_STRING(--with-libm=STRING, math library),
|
|---|
| 2879 | [
|
|---|
| 2880 | if test "$withval" = no
|
|---|
| 2881 | then LIBM=
|
|---|
| 2882 | AC_MSG_RESULT(force LIBM empty)
|
|---|
| 2883 | elif test "$withval" != yes
|
|---|
| 2884 | then LIBM=$withval
|
|---|
| 2885 | AC_MSG_RESULT(set LIBM="$withval")
|
|---|
| 2886 | else AC_MSG_ERROR([proper usage is --with-libm=STRING])
|
|---|
| 2887 | fi],
|
|---|
| 2888 | [AC_MSG_RESULT(default LIBM="$LIBM")])
|
|---|
| 2889 |
|
|---|
| 2890 | # check for --with-libc=...
|
|---|
| 2891 | AC_SUBST(LIBC)
|
|---|
| 2892 | AC_MSG_CHECKING(for --with-libc=STRING)
|
|---|
| 2893 | AC_ARG_WITH(libc,
|
|---|
| 2894 | AC_HELP_STRING(--with-libc=STRING, C library),
|
|---|
| 2895 | [
|
|---|
| 2896 | if test "$withval" = no
|
|---|
| 2897 | then LIBC=
|
|---|
| 2898 | AC_MSG_RESULT(force LIBC empty)
|
|---|
| 2899 | elif test "$withval" != yes
|
|---|
| 2900 | then LIBC=$withval
|
|---|
| 2901 | AC_MSG_RESULT(set LIBC="$withval")
|
|---|
| 2902 | else AC_MSG_ERROR([proper usage is --with-libc=STRING])
|
|---|
| 2903 | fi],
|
|---|
| 2904 | [AC_MSG_RESULT(default LIBC="$LIBC")])
|
|---|
| 2905 |
|
|---|
| 2906 | # check for hypot() in math library
|
|---|
| 2907 | LIBS_SAVE=$LIBS
|
|---|
| 2908 | LIBS="$LIBS $LIBM"
|
|---|
| 2909 | AC_REPLACE_FUNCS(hypot)
|
|---|
| 2910 | LIBS=$LIBS_SAVE
|
|---|
| 2911 |
|
|---|
| 2912 | # check for wchar.h
|
|---|
| 2913 | AC_CHECK_HEADER(wchar.h, [
|
|---|
| 2914 | AC_DEFINE(HAVE_WCHAR_H, 1,
|
|---|
| 2915 | [Define if the compiler provides a wchar.h header file.])
|
|---|
| 2916 | wchar_h="yes"
|
|---|
| 2917 | ],
|
|---|
| 2918 | wchar_h="no"
|
|---|
| 2919 | )
|
|---|
| 2920 |
|
|---|
| 2921 | # determine wchar_t size
|
|---|
| 2922 | if test "$wchar_h" = yes
|
|---|
| 2923 | then
|
|---|
| 2924 | AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
|
|---|
| 2925 | fi
|
|---|
| 2926 |
|
|---|
| 2927 | AC_MSG_CHECKING(for UCS-4 tcl)
|
|---|
| 2928 | have_ucs4_tcl=no
|
|---|
| 2929 | AC_TRY_COMPILE([
|
|---|
| 2930 | #include <tcl.h>
|
|---|
| 2931 | #if TCL_UTF_MAX != 6
|
|---|
| 2932 | # error "NOT UCS4_TCL"
|
|---|
| 2933 | #endif], [], [
|
|---|
| 2934 | AC_DEFINE(HAVE_UCS4_TCL, 1, [Define this if you have tcl and TCL_UTF_MAX==6])
|
|---|
| 2935 | have_ucs4_tcl=yes
|
|---|
| 2936 | ])
|
|---|
| 2937 | AC_MSG_RESULT($have_ucs4_tcl)
|
|---|
| 2938 |
|
|---|
| 2939 | # check whether wchar_t is signed or not
|
|---|
| 2940 | if test "$wchar_h" = yes
|
|---|
| 2941 | then
|
|---|
| 2942 | # check whether wchar_t is signed or not
|
|---|
| 2943 | AC_MSG_CHECKING(whether wchar_t is signed)
|
|---|
| 2944 | AC_CACHE_VAL(ac_cv_wchar_t_signed, [
|
|---|
| 2945 | AC_TRY_RUN([
|
|---|
| 2946 | #include <wchar.h>
|
|---|
| 2947 | int main()
|
|---|
| 2948 | {
|
|---|
| 2949 | /* Success: exit code 0 */
|
|---|
| 2950 | exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
|
|---|
| 2951 | }
|
|---|
| 2952 | ],
|
|---|
| 2953 | ac_cv_wchar_t_signed=yes,
|
|---|
| 2954 | ac_cv_wchar_t_signed=no,
|
|---|
| 2955 | ac_cv_wchar_t_signed=yes)])
|
|---|
| 2956 | AC_MSG_RESULT($ac_cv_wchar_t_signed)
|
|---|
| 2957 | fi
|
|---|
| 2958 |
|
|---|
| 2959 | AC_MSG_CHECKING(what type to use for unicode)
|
|---|
| 2960 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
|---|
| 2961 | AC_ARG_ENABLE(unicode,
|
|---|
| 2962 | AC_HELP_STRING(--enable-unicode@<:@=ucs@<:@24@:>@@:>@, Enable Unicode strings (default is yes)),
|
|---|
| 2963 | [],
|
|---|
| 2964 | [enable_unicode=yes])
|
|---|
| 2965 |
|
|---|
| 2966 | if test $enable_unicode = yes
|
|---|
| 2967 | then
|
|---|
| 2968 | # Without any arguments, Py_UNICODE defaults to two-byte mode
|
|---|
| 2969 | case "$have_ucs4_tcl" in
|
|---|
| 2970 | yes) enable_unicode="ucs4"
|
|---|
| 2971 | ;;
|
|---|
| 2972 | *) enable_unicode="ucs2"
|
|---|
| 2973 | ;;
|
|---|
| 2974 | esac
|
|---|
| 2975 | fi
|
|---|
| 2976 |
|
|---|
| 2977 | AH_TEMPLATE(Py_UNICODE_SIZE,
|
|---|
| 2978 | [Define as the size of the unicode type.])
|
|---|
| 2979 | case "$enable_unicode" in
|
|---|
| 2980 | ucs2) unicode_size="2"
|
|---|
| 2981 | AC_DEFINE(Py_UNICODE_SIZE,2)
|
|---|
| 2982 | ;;
|
|---|
| 2983 | ucs4) unicode_size="4"
|
|---|
| 2984 | AC_DEFINE(Py_UNICODE_SIZE,4)
|
|---|
| 2985 | ;;
|
|---|
| 2986 | esac
|
|---|
| 2987 |
|
|---|
| 2988 | AH_TEMPLATE(PY_UNICODE_TYPE,
|
|---|
| 2989 | [Define as the integral type used for Unicode representation.])
|
|---|
| 2990 |
|
|---|
| 2991 | AC_SUBST(UNICODE_OBJS)
|
|---|
| 2992 | if test "$enable_unicode" = "no"
|
|---|
| 2993 | then
|
|---|
| 2994 | UNICODE_OBJS=""
|
|---|
| 2995 | AC_MSG_RESULT(not used)
|
|---|
| 2996 | else
|
|---|
| 2997 | UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o"
|
|---|
| 2998 | AC_DEFINE(Py_USING_UNICODE, 1,
|
|---|
| 2999 | [Define if you want to have a Unicode type.])
|
|---|
| 3000 |
|
|---|
| 3001 | # wchar_t is only usable if it maps to an unsigned type
|
|---|
| 3002 | if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \
|
|---|
| 3003 | -a "$ac_cv_wchar_t_signed" = "no"
|
|---|
| 3004 | then
|
|---|
| 3005 | PY_UNICODE_TYPE="wchar_t"
|
|---|
| 3006 | AC_DEFINE(HAVE_USABLE_WCHAR_T, 1,
|
|---|
| 3007 | [Define if you have a useable wchar_t type defined in wchar.h; useable
|
|---|
| 3008 | means wchar_t must be an unsigned type with at least 16 bits. (see
|
|---|
| 3009 | Include/unicodeobject.h).])
|
|---|
| 3010 | AC_DEFINE(PY_UNICODE_TYPE,wchar_t)
|
|---|
| 3011 | elif test "$ac_cv_sizeof_short" = "$unicode_size"
|
|---|
| 3012 | then
|
|---|
| 3013 | PY_UNICODE_TYPE="unsigned short"
|
|---|
| 3014 | AC_DEFINE(PY_UNICODE_TYPE,unsigned short)
|
|---|
| 3015 | elif test "$ac_cv_sizeof_long" = "$unicode_size"
|
|---|
| 3016 | then
|
|---|
| 3017 | PY_UNICODE_TYPE="unsigned long"
|
|---|
| 3018 | AC_DEFINE(PY_UNICODE_TYPE,unsigned long)
|
|---|
| 3019 | else
|
|---|
| 3020 | PY_UNICODE_TYPE="no type found"
|
|---|
| 3021 | fi
|
|---|
| 3022 | AC_MSG_RESULT($PY_UNICODE_TYPE)
|
|---|
| 3023 | fi
|
|---|
| 3024 |
|
|---|
| 3025 | # check for endianness
|
|---|
| 3026 | AC_C_BIGENDIAN
|
|---|
| 3027 | AH_VERBATIM([WORDS_BIGENDIAN],
|
|---|
| 3028 | [
|
|---|
| 3029 | /* Define to 1 if your processor stores words with the most significant byte
|
|---|
| 3030 | first (like Motorola and SPARC, unlike Intel and VAX).
|
|---|
| 3031 |
|
|---|
| 3032 | The block below does compile-time checking for endianness on platforms
|
|---|
| 3033 | that use GCC and therefore allows compiling fat binaries on OSX by using
|
|---|
| 3034 | '-arch ppc -arch i386' as the compile flags. The phrasing was choosen
|
|---|
| 3035 | such that the configure-result is used on systems that don't use GCC.
|
|---|
| 3036 | */
|
|---|
| 3037 | #ifdef __BIG_ENDIAN__
|
|---|
| 3038 | #define WORDS_BIGENDIAN 1
|
|---|
| 3039 | #else
|
|---|
| 3040 | #ifndef __LITTLE_ENDIAN__
|
|---|
| 3041 | #undef WORDS_BIGENDIAN
|
|---|
| 3042 | #endif
|
|---|
| 3043 | #endif])
|
|---|
| 3044 |
|
|---|
| 3045 | # Check whether right shifting a negative integer extends the sign bit
|
|---|
| 3046 | # or fills with zeros (like the Cray J90, according to Tim Peters).
|
|---|
| 3047 | AC_MSG_CHECKING(whether right shift extends the sign bit)
|
|---|
| 3048 | AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
|
|---|
| 3049 | AC_TRY_RUN([
|
|---|
| 3050 | int main()
|
|---|
| 3051 | {
|
|---|
| 3052 | exit(((-1)>>3 == -1) ? 0 : 1);
|
|---|
| 3053 | }
|
|---|
| 3054 | ],
|
|---|
| 3055 | ac_cv_rshift_extends_sign=yes,
|
|---|
| 3056 | ac_cv_rshift_extends_sign=no,
|
|---|
| 3057 | ac_cv_rshift_extends_sign=yes)])
|
|---|
| 3058 | AC_MSG_RESULT($ac_cv_rshift_extends_sign)
|
|---|
| 3059 | if test "$ac_cv_rshift_extends_sign" = no
|
|---|
| 3060 | then
|
|---|
| 3061 | AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS, 1,
|
|---|
| 3062 | [Define if i>>j for signed int i does not extend the sign bit
|
|---|
| 3063 | when i < 0])
|
|---|
| 3064 | fi
|
|---|
| 3065 |
|
|---|
| 3066 | # check for getc_unlocked and related locking functions
|
|---|
| 3067 | AC_MSG_CHECKING(for getc_unlocked() and friends)
|
|---|
| 3068 | AC_CACHE_VAL(ac_cv_have_getc_unlocked, [
|
|---|
| 3069 | AC_TRY_LINK([#include <stdio.h>],[
|
|---|
| 3070 | FILE *f = fopen("/dev/null", "r");
|
|---|
| 3071 | flockfile(f);
|
|---|
| 3072 | getc_unlocked(f);
|
|---|
| 3073 | funlockfile(f);
|
|---|
| 3074 | ], ac_cv_have_getc_unlocked=yes, ac_cv_have_getc_unlocked=no)])
|
|---|
| 3075 | AC_MSG_RESULT($ac_cv_have_getc_unlocked)
|
|---|
| 3076 | if test "$ac_cv_have_getc_unlocked" = yes
|
|---|
| 3077 | then
|
|---|
| 3078 | AC_DEFINE(HAVE_GETC_UNLOCKED, 1,
|
|---|
| 3079 | [Define this if you have flockfile(), getc_unlocked(), and funlockfile()])
|
|---|
| 3080 | fi
|
|---|
| 3081 |
|
|---|
| 3082 | # check where readline lives
|
|---|
| 3083 | # save the value of LIBS so we don't actually link Python with readline
|
|---|
| 3084 | LIBS_no_readline=$LIBS
|
|---|
| 3085 | AC_CHECK_LIB(readline, readline)
|
|---|
| 3086 | if test "$ac_cv_have_readline_readline" = no
|
|---|
| 3087 | then
|
|---|
| 3088 | AC_CHECK_LIB(termcap, readline)
|
|---|
| 3089 | fi
|
|---|
| 3090 |
|
|---|
| 3091 | # check for readline 2.1
|
|---|
| 3092 | AC_CHECK_LIB(readline, rl_callback_handler_install,
|
|---|
| 3093 | AC_DEFINE(HAVE_RL_CALLBACK, 1,
|
|---|
| 3094 | [Define if you have readline 2.1]), , )
|
|---|
| 3095 |
|
|---|
| 3096 | # check for readline 2.2
|
|---|
| 3097 | AC_TRY_CPP([#include <readline/readline.h>],
|
|---|
| 3098 | have_readline=yes, have_readline=no)
|
|---|
| 3099 | if test $have_readline = yes
|
|---|
| 3100 | then
|
|---|
| 3101 | AC_EGREP_HEADER([extern int rl_completion_append_character;],
|
|---|
| 3102 | [readline/readline.h],
|
|---|
| 3103 | AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
|
|---|
| 3104 | [Define if you have readline 2.2]), )
|
|---|
| 3105 | fi
|
|---|
| 3106 |
|
|---|
| 3107 | # check for readline 4.0
|
|---|
| 3108 | AC_CHECK_LIB(readline, rl_pre_input_hook,
|
|---|
| 3109 | AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1,
|
|---|
| 3110 | [Define if you have readline 4.0]), , )
|
|---|
| 3111 |
|
|---|
| 3112 | # check for readline 4.2
|
|---|
| 3113 | AC_CHECK_LIB(readline, rl_completion_matches,
|
|---|
| 3114 | AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1,
|
|---|
| 3115 | [Define if you have readline 4.2]), , )
|
|---|
| 3116 |
|
|---|
| 3117 | # also in readline 4.2
|
|---|
| 3118 | AC_TRY_CPP([#include <readline/readline.h>],
|
|---|
| 3119 | have_readline=yes, have_readline=no)
|
|---|
| 3120 | if test $have_readline = yes
|
|---|
| 3121 | then
|
|---|
| 3122 | AC_EGREP_HEADER([extern int rl_catch_signals;],
|
|---|
| 3123 | [readline/readline.h],
|
|---|
| 3124 | AC_DEFINE(HAVE_RL_CATCH_SIGNAL, 1,
|
|---|
| 3125 | [Define if you can turn off readline's signal handling.]), )
|
|---|
| 3126 | fi
|
|---|
| 3127 |
|
|---|
| 3128 | # End of readline checks: restore LIBS
|
|---|
| 3129 | LIBS=$LIBS_no_readline
|
|---|
| 3130 |
|
|---|
| 3131 | AC_MSG_CHECKING(for broken nice())
|
|---|
| 3132 | AC_CACHE_VAL(ac_cv_broken_nice, [
|
|---|
| 3133 | AC_TRY_RUN([
|
|---|
| 3134 | int main()
|
|---|
| 3135 | {
|
|---|
| 3136 | int val1 = nice(1);
|
|---|
| 3137 | if (val1 != -1 && val1 == nice(2))
|
|---|
| 3138 | exit(0);
|
|---|
| 3139 | exit(1);
|
|---|
| 3140 | }
|
|---|
| 3141 | ],
|
|---|
| 3142 | ac_cv_broken_nice=yes,
|
|---|
| 3143 | ac_cv_broken_nice=no,
|
|---|
| 3144 | ac_cv_broken_nice=no)])
|
|---|
| 3145 | AC_MSG_RESULT($ac_cv_broken_nice)
|
|---|
| 3146 | if test "$ac_cv_broken_nice" = yes
|
|---|
| 3147 | then
|
|---|
| 3148 | AC_DEFINE(HAVE_BROKEN_NICE, 1,
|
|---|
| 3149 | [Define if nice() returns success/failure instead of the new priority.])
|
|---|
| 3150 | fi
|
|---|
| 3151 |
|
|---|
| 3152 | AC_MSG_CHECKING(for broken poll())
|
|---|
| 3153 | AC_TRY_RUN([
|
|---|
| 3154 | #include <poll.h>
|
|---|
| 3155 |
|
|---|
| 3156 | int main (void)
|
|---|
| 3157 | {
|
|---|
| 3158 | struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
|
|---|
| 3159 |
|
|---|
| 3160 | close (42);
|
|---|
| 3161 |
|
|---|
| 3162 | int poll_test = poll (&poll_struct, 1, 0);
|
|---|
| 3163 |
|
|---|
| 3164 | if (poll_test < 0)
|
|---|
| 3165 | {
|
|---|
| 3166 | exit(0);
|
|---|
| 3167 | }
|
|---|
| 3168 | else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
|
|---|
| 3169 | {
|
|---|
| 3170 | exit(0);
|
|---|
| 3171 | }
|
|---|
| 3172 | else
|
|---|
| 3173 | {
|
|---|
| 3174 | exit(1);
|
|---|
| 3175 | }
|
|---|
| 3176 | }
|
|---|
| 3177 | ],
|
|---|
| 3178 | ac_cv_broken_poll=yes,
|
|---|
| 3179 | ac_cv_broken_poll=no,
|
|---|
| 3180 | ac_cv_broken_poll=no)
|
|---|
| 3181 | AC_MSG_RESULT($ac_cv_broken_poll)
|
|---|
| 3182 | if test "$ac_cv_broken_poll" = yes
|
|---|
| 3183 | then
|
|---|
| 3184 | AC_DEFINE(HAVE_BROKEN_POLL, 1,
|
|---|
| 3185 | [Define if poll() sets errno on invalid file descriptors.])
|
|---|
| 3186 | fi
|
|---|
| 3187 |
|
|---|
| 3188 | # Before we can test tzset, we need to check if struct tm has a tm_zone
|
|---|
| 3189 | # (which is not required by ISO C or UNIX spec) and/or if we support
|
|---|
| 3190 | # tzname[]
|
|---|
| 3191 | AC_STRUCT_TIMEZONE
|
|---|
| 3192 |
|
|---|
| 3193 | # check tzset(3) exists and works like we expect it to
|
|---|
| 3194 | AC_MSG_CHECKING(for working tzset())
|
|---|
| 3195 | AC_CACHE_VAL(ac_cv_working_tzset, [
|
|---|
| 3196 | AC_TRY_RUN([
|
|---|
| 3197 | #include <stdlib.h>
|
|---|
| 3198 | #include <time.h>
|
|---|
| 3199 | #include <string.h>
|
|---|
| 3200 |
|
|---|
| 3201 | #if HAVE_TZNAME
|
|---|
| 3202 | extern char *tzname[];
|
|---|
| 3203 | #endif
|
|---|
| 3204 |
|
|---|
| 3205 | int main()
|
|---|
| 3206 | {
|
|---|
| 3207 | /* Note that we need to ensure that not only does tzset(3)
|
|---|
| 3208 | do 'something' with localtime, but it works as documented
|
|---|
| 3209 | in the library reference and as expected by the test suite.
|
|---|
| 3210 | This includes making sure that tzname is set properly if
|
|---|
| 3211 | tm->tm_zone does not exist since it is the alternative way
|
|---|
| 3212 | of getting timezone info.
|
|---|
| 3213 |
|
|---|
| 3214 | Red Hat 6.2 doesn't understand the southern hemisphere
|
|---|
| 3215 | after New Year's Day.
|
|---|
| 3216 | */
|
|---|
| 3217 |
|
|---|
| 3218 | time_t groundhogday = 1044144000; /* GMT-based */
|
|---|
| 3219 | time_t midyear = groundhogday + (365 * 24 * 3600 / 2);
|
|---|
| 3220 |
|
|---|
| 3221 | putenv("TZ=UTC+0");
|
|---|
| 3222 | tzset();
|
|---|
| 3223 | if (localtime(&groundhogday)->tm_hour != 0)
|
|---|
| 3224 | exit(1);
|
|---|
| 3225 | #if HAVE_TZNAME
|
|---|
| 3226 | /* For UTC, tzname[1] is sometimes "", sometimes " " */
|
|---|
| 3227 | if (strcmp(tzname[0], "UTC") ||
|
|---|
| 3228 | (tzname[1][0] != 0 && tzname[1][0] != ' '))
|
|---|
| 3229 | exit(1);
|
|---|
| 3230 | #endif
|
|---|
| 3231 |
|
|---|
| 3232 | putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
|
|---|
| 3233 | tzset();
|
|---|
| 3234 | if (localtime(&groundhogday)->tm_hour != 19)
|
|---|
| 3235 | exit(1);
|
|---|
| 3236 | #if HAVE_TZNAME
|
|---|
| 3237 | if (strcmp(tzname[0], "EST") || strcmp(tzname[1], "EDT"))
|
|---|
| 3238 | exit(1);
|
|---|
| 3239 | #endif
|
|---|
| 3240 |
|
|---|
| 3241 | putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
|
|---|
| 3242 | tzset();
|
|---|
| 3243 | if (localtime(&groundhogday)->tm_hour != 11)
|
|---|
| 3244 | exit(1);
|
|---|
| 3245 | #if HAVE_TZNAME
|
|---|
| 3246 | if (strcmp(tzname[0], "AEST") || strcmp(tzname[1], "AEDT"))
|
|---|
| 3247 | exit(1);
|
|---|
| 3248 | #endif
|
|---|
| 3249 |
|
|---|
| 3250 | #if HAVE_STRUCT_TM_TM_ZONE
|
|---|
| 3251 | if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
|
|---|
| 3252 | exit(1);
|
|---|
| 3253 | if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
|
|---|
| 3254 | exit(1);
|
|---|
| 3255 | #endif
|
|---|
| 3256 |
|
|---|
| 3257 | exit(0);
|
|---|
| 3258 | }
|
|---|
| 3259 | ],
|
|---|
| 3260 | ac_cv_working_tzset=yes,
|
|---|
| 3261 | ac_cv_working_tzset=no,
|
|---|
| 3262 | ac_cv_working_tzset=no)])
|
|---|
| 3263 | AC_MSG_RESULT($ac_cv_working_tzset)
|
|---|
| 3264 | if test "$ac_cv_working_tzset" = yes
|
|---|
| 3265 | then
|
|---|
| 3266 | AC_DEFINE(HAVE_WORKING_TZSET, 1,
|
|---|
| 3267 | [Define if tzset() actually switches the local timezone in a meaningful way.])
|
|---|
| 3268 | fi
|
|---|
| 3269 |
|
|---|
| 3270 | # Look for subsecond timestamps in struct stat
|
|---|
| 3271 | AC_MSG_CHECKING(for tv_nsec in struct stat)
|
|---|
| 3272 | AC_CACHE_VAL(ac_cv_stat_tv_nsec,
|
|---|
| 3273 | AC_TRY_COMPILE([#include <sys/stat.h>], [
|
|---|
| 3274 | struct stat st;
|
|---|
| 3275 | st.st_mtim.tv_nsec = 1;
|
|---|
| 3276 | ],
|
|---|
| 3277 | ac_cv_stat_tv_nsec=yes,
|
|---|
| 3278 | ac_cv_stat_tv_nsec=no,
|
|---|
| 3279 | ac_cv_stat_tv_nsec=no))
|
|---|
| 3280 | AC_MSG_RESULT($ac_cv_stat_tv_nsec)
|
|---|
| 3281 | if test "$ac_cv_stat_tv_nsec" = yes
|
|---|
| 3282 | then
|
|---|
| 3283 | AC_DEFINE(HAVE_STAT_TV_NSEC, 1,
|
|---|
| 3284 | [Define if you have struct stat.st_mtim.tv_nsec])
|
|---|
| 3285 | fi
|
|---|
| 3286 |
|
|---|
| 3287 | # Look for BSD style subsecond timestamps in struct stat
|
|---|
| 3288 | AC_MSG_CHECKING(for tv_nsec2 in struct stat)
|
|---|
| 3289 | AC_CACHE_VAL(ac_cv_stat_tv_nsec2,
|
|---|
| 3290 | AC_TRY_COMPILE([#include <sys/stat.h>], [
|
|---|
| 3291 | struct stat st;
|
|---|
| 3292 | st.st_mtimespec.tv_nsec = 1;
|
|---|
| 3293 | ],
|
|---|
| 3294 | ac_cv_stat_tv_nsec2=yes,
|
|---|
| 3295 | ac_cv_stat_tv_nsec2=no,
|
|---|
| 3296 | ac_cv_stat_tv_nsec2=no))
|
|---|
| 3297 | AC_MSG_RESULT($ac_cv_stat_tv_nsec2)
|
|---|
| 3298 | if test "$ac_cv_stat_tv_nsec2" = yes
|
|---|
| 3299 | then
|
|---|
| 3300 | AC_DEFINE(HAVE_STAT_TV_NSEC2, 1,
|
|---|
| 3301 | [Define if you have struct stat.st_mtimensec])
|
|---|
| 3302 | fi
|
|---|
| 3303 |
|
|---|
| 3304 | # On HP/UX 11.0, mvwdelch is a block with a return statement
|
|---|
| 3305 | AC_MSG_CHECKING(whether mvwdelch is an expression)
|
|---|
| 3306 | AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,
|
|---|
| 3307 | AC_TRY_COMPILE([#include <curses.h>], [
|
|---|
| 3308 | int rtn;
|
|---|
| 3309 | rtn = mvwdelch(0,0,0);
|
|---|
| 3310 | ], ac_cv_mvwdelch_is_expression=yes,
|
|---|
| 3311 | ac_cv_mvwdelch_is_expression=no,
|
|---|
| 3312 | ac_cv_mvwdelch_is_expression=yes))
|
|---|
| 3313 | AC_MSG_RESULT($ac_cv_mvwdelch_is_expression)
|
|---|
| 3314 |
|
|---|
| 3315 | if test "$ac_cv_mvwdelch_is_expression" = yes
|
|---|
| 3316 | then
|
|---|
| 3317 | AC_DEFINE(MVWDELCH_IS_EXPRESSION, 1,
|
|---|
| 3318 | [Define if mvwdelch in curses.h is an expression.])
|
|---|
| 3319 | fi
|
|---|
| 3320 |
|
|---|
| 3321 | AC_MSG_CHECKING(whether WINDOW has _flags)
|
|---|
| 3322 | AC_CACHE_VAL(ac_cv_window_has_flags,
|
|---|
| 3323 | AC_TRY_COMPILE([#include <curses.h>], [
|
|---|
| 3324 | WINDOW *w;
|
|---|
| 3325 | w->_flags = 0;
|
|---|
| 3326 | ], ac_cv_window_has_flags=yes,
|
|---|
| 3327 | ac_cv_window_has_flags=no,
|
|---|
| 3328 | ac_cv_window_has_flags=no))
|
|---|
| 3329 | AC_MSG_RESULT($ac_cv_window_has_flags)
|
|---|
| 3330 |
|
|---|
| 3331 |
|
|---|
| 3332 | if test "$ac_cv_window_has_flags" = yes
|
|---|
| 3333 | then
|
|---|
| 3334 | AC_DEFINE(WINDOW_HAS_FLAGS, 1,
|
|---|
| 3335 | [Define if WINDOW in curses.h offers a field _flags.])
|
|---|
| 3336 | fi
|
|---|
| 3337 |
|
|---|
| 3338 | AC_MSG_CHECKING(for is_term_resized)
|
|---|
| 3339 | AC_TRY_COMPILE([#include <curses.h>], void *x=is_term_resized,
|
|---|
| 3340 | AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_resized' function.)
|
|---|
| 3341 | AC_MSG_RESULT(yes),
|
|---|
| 3342 | AC_MSG_RESULT(no)
|
|---|
| 3343 | )
|
|---|
| 3344 |
|
|---|
| 3345 | AC_MSG_CHECKING(for resize_term)
|
|---|
| 3346 | AC_TRY_COMPILE([#include <curses.h>], void *x=resize_term,
|
|---|
| 3347 | AC_DEFINE(HAVE_CURSES_RESIZE_TERM, 1, Define if you have the 'resize_term' function.)
|
|---|
| 3348 | AC_MSG_RESULT(yes),
|
|---|
| 3349 | AC_MSG_RESULT(no)
|
|---|
| 3350 | )
|
|---|
| 3351 |
|
|---|
| 3352 | AC_MSG_CHECKING(for resizeterm)
|
|---|
| 3353 | AC_TRY_COMPILE([#include <curses.h>], void *x=resizeterm,
|
|---|
| 3354 | AC_DEFINE(HAVE_CURSES_RESIZETERM, 1, Define if you have the 'resizeterm' function.)
|
|---|
| 3355 | AC_MSG_RESULT(yes),
|
|---|
| 3356 | AC_MSG_RESULT(no)
|
|---|
| 3357 | )
|
|---|
| 3358 |
|
|---|
| 3359 | AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if we have /dev/ptmx.]))
|
|---|
| 3360 | AC_CHECK_FILE(/dev/ptc, AC_DEFINE(HAVE_DEV_PTC, 1, [Define if we have /dev/ptc.]))
|
|---|
| 3361 |
|
|---|
| 3362 | AC_MSG_CHECKING(for %zd printf() format support)
|
|---|
| 3363 | AC_TRY_RUN([#include <stdio.h>
|
|---|
| 3364 | #include <stddef.h>
|
|---|
| 3365 | #include <string.h>
|
|---|
| 3366 |
|
|---|
| 3367 | int main()
|
|---|
| 3368 | {
|
|---|
| 3369 | char buffer[4];
|
|---|
| 3370 |
|
|---|
| 3371 | if(sprintf(buffer, "%zd", (size_t)123) < 0)
|
|---|
| 3372 | return 1;
|
|---|
| 3373 |
|
|---|
| 3374 | if (strncmp(buffer, "123", 3))
|
|---|
| 3375 | return 1;
|
|---|
| 3376 |
|
|---|
| 3377 | return 0;
|
|---|
| 3378 | }],
|
|---|
| 3379 | [AC_MSG_RESULT(yes)
|
|---|
| 3380 | AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
|
|---|
| 3381 | AC_MSG_RESULT(no))
|
|---|
| 3382 |
|
|---|
| 3383 | AC_CHECK_TYPE(socklen_t,,
|
|---|
| 3384 | AC_DEFINE(socklen_t,int,
|
|---|
| 3385 | Define to `int' if <sys/socket.h> does not define.),[
|
|---|
| 3386 | #ifdef HAVE_SYS_TYPES_H
|
|---|
| 3387 | #include <sys/types.h>
|
|---|
| 3388 | #endif
|
|---|
| 3389 | #ifdef HAVE_SYS_SOCKET_H
|
|---|
| 3390 | #include <sys/socket.h>
|
|---|
| 3391 | #endif
|
|---|
| 3392 | ])
|
|---|
| 3393 |
|
|---|
| 3394 | AC_SUBST(THREADHEADERS)
|
|---|
| 3395 |
|
|---|
| 3396 | for h in `(cd $srcdir;echo Python/thread_*.h)`
|
|---|
| 3397 | do
|
|---|
| 3398 | THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
|
|---|
| 3399 | done
|
|---|
| 3400 |
|
|---|
| 3401 | AC_SUBST(SRCDIRS)
|
|---|
| 3402 | SRCDIRS="Parser Grammar Objects Python Modules Mac"
|
|---|
| 3403 | AC_MSG_CHECKING(for build directories)
|
|---|
| 3404 | for dir in $SRCDIRS; do
|
|---|
| 3405 | if test ! -d $dir; then
|
|---|
| 3406 | mkdir $dir
|
|---|
| 3407 | fi
|
|---|
| 3408 | done
|
|---|
| 3409 | AC_MSG_RESULT(done)
|
|---|
| 3410 |
|
|---|
| 3411 | # generate output files
|
|---|
| 3412 | AC_CONFIG_FILES(Makefile.pre Modules/Setup.config)
|
|---|
| 3413 | AC_OUTPUT
|
|---|
| 3414 |
|
|---|
| 3415 | echo "creating Modules/Setup"
|
|---|
| 3416 | if test ! -f Modules/Setup
|
|---|
| 3417 | then
|
|---|
| 3418 | if test "$MACHDEP" = "emx"; then
|
|---|
| 3419 | cp $srcdir/PC/os2emx/Setup.os2emx Modules/Setup
|
|---|
| 3420 | else
|
|---|
| 3421 | cp $srcdir/Modules/Setup.dist Modules/Setup
|
|---|
| 3422 | fi
|
|---|
| 3423 | fi
|
|---|
| 3424 |
|
|---|
| 3425 | echo "creating Modules/Setup.local"
|
|---|
| 3426 | if test ! -f Modules/Setup.local
|
|---|
| 3427 | then
|
|---|
| 3428 | echo "# Edit this file for local setup changes" >Modules/Setup.local
|
|---|
| 3429 | fi
|
|---|
| 3430 |
|
|---|
| 3431 | echo "creating Makefile"
|
|---|
| 3432 | $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
|
|---|
| 3433 | -s Modules Modules/Setup.config \
|
|---|
| 3434 | Modules/Setup.local Modules/Setup
|
|---|
| 3435 | mv config.c Modules
|
|---|