[388] | 1 | dnl ***********************************************
|
---|
| 2 | dnl * Please run autoreconf to test your changes! *
|
---|
| 3 | dnl ***********************************************
|
---|
| 4 |
|
---|
| 5 | # Set VERSION so we only need to edit in one place (i.e., here)
|
---|
| 6 | m4_define(PYTHON_VERSION, 2.7)
|
---|
| 7 |
|
---|
| 8 | AC_PREREQ(2.65)
|
---|
| 9 |
|
---|
| 10 | AC_REVISION($Revision$)
|
---|
| 11 | AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
|
---|
| 12 | AC_CONFIG_SRCDIR([Include/object.h])
|
---|
| 13 | AC_CONFIG_HEADER(pyconfig.h)
|
---|
| 14 |
|
---|
| 15 | AC_CANONICAL_HOST
|
---|
| 16 | AC_SUBST(build)
|
---|
| 17 | AC_SUBST(host)
|
---|
| 18 |
|
---|
| 19 | if test "$cross_compiling" = yes; then
|
---|
| 20 | AC_MSG_CHECKING([for python interpreter for cross build])
|
---|
| 21 | if test -z "$PYTHON_FOR_BUILD"; then
|
---|
| 22 | for interp in python$PACKAGE_VERSION python2 python; do
|
---|
| 23 | which $interp >/dev/null 2>&1 || continue
|
---|
| 24 | if $interp -c 'import sys;sys.exit(not (sys.version_info@<:@:2@:>@ >= (2,7) and sys.version_info@<:@0@:>@ < 3))'; then
|
---|
| 25 | break
|
---|
| 26 | fi
|
---|
| 27 | interp=
|
---|
| 28 | done
|
---|
| 29 | if test x$interp = x; then
|
---|
| 30 | AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
|
---|
| 31 | fi
|
---|
| 32 | AC_MSG_RESULT($interp)
|
---|
| 33 | PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
|
---|
| 34 | fi
|
---|
| 35 | elif test "$cross_compiling" = maybe; then
|
---|
| 36 | AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
|
---|
| 37 | else
|
---|
| 38 | PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
|
---|
| 39 | fi
|
---|
| 40 | AC_SUBST(PYTHON_FOR_BUILD)
|
---|
| 41 |
|
---|
| 42 | dnl Ensure that if prefix is specified, it does not end in a slash. If
|
---|
| 43 | dnl it does, we get path names containing '//' which is both ugly and
|
---|
| 44 | dnl can cause trouble.
|
---|
| 45 |
|
---|
| 46 | dnl Last slash shouldn't be stripped if prefix=/
|
---|
| 47 | if test "$prefix" != "/"; then
|
---|
| 48 | prefix=`echo "$prefix" | sed -e 's/\/$//g'`
|
---|
| 49 | fi
|
---|
| 50 |
|
---|
| 51 | dnl This is for stuff that absolutely must end up in pyconfig.h.
|
---|
| 52 | dnl Please use pyport.h instead, if possible.
|
---|
| 53 | AH_TOP([
|
---|
| 54 | #ifndef Py_PYCONFIG_H
|
---|
| 55 | #define Py_PYCONFIG_H
|
---|
| 56 | ])
|
---|
| 57 | AH_BOTTOM([
|
---|
| 58 | /* Define the macros needed if on a UnixWare 7.x system. */
|
---|
| 59 | #if defined(__USLC__) && defined(__SCO_VERSION__)
|
---|
| 60 | #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
|
---|
| 61 | #endif
|
---|
| 62 |
|
---|
| 63 | #endif /*Py_PYCONFIG_H*/
|
---|
| 64 | ])
|
---|
| 65 |
|
---|
| 66 | # We don't use PACKAGE_ variables, and they cause conflicts
|
---|
| 67 | # with other autoconf-based packages that include Python.h
|
---|
| 68 | grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new
|
---|
| 69 | rm confdefs.h
|
---|
| 70 | mv confdefs.h.new confdefs.h
|
---|
| 71 |
|
---|
| 72 | AC_SUBST(VERSION)
|
---|
| 73 | VERSION=PYTHON_VERSION
|
---|
| 74 |
|
---|
| 75 | AC_SUBST(SOVERSION)
|
---|
| 76 | SOVERSION=1.0
|
---|
| 77 |
|
---|
| 78 | # The later defininition of _XOPEN_SOURCE disables certain features
|
---|
| 79 | # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
|
---|
| 80 | AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features])
|
---|
| 81 |
|
---|
| 82 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
---|
| 83 | # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
|
---|
| 84 | # them.
|
---|
| 85 | AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
|
---|
| 86 |
|
---|
| 87 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
---|
| 88 | # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
|
---|
| 89 | # them.
|
---|
| 90 | AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
|
---|
| 91 |
|
---|
| 92 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
---|
| 93 | # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
|
---|
| 94 | AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
|
---|
| 95 |
|
---|
| 96 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
---|
| 97 | # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
|
---|
| 98 | # them.
|
---|
| 99 | AC_DEFINE(_DARWIN_C_SOURCE, 1, [Define on Darwin to activate all library features])
|
---|
| 100 |
|
---|
| 101 |
|
---|
| 102 | define_xopen_source=yes
|
---|
| 103 |
|
---|
| 104 | # Arguments passed to configure.
|
---|
| 105 | AC_SUBST(CONFIG_ARGS)
|
---|
| 106 | CONFIG_ARGS="$ac_configure_args"
|
---|
| 107 |
|
---|
| 108 | AC_MSG_CHECKING([for --enable-universalsdk])
|
---|
| 109 | AC_ARG_ENABLE(universalsdk,
|
---|
| 110 | AS_HELP_STRING([--enable-universalsdk@<:@=SDKDIR@:>@], [Build against Mac OS X 10.4u SDK (ppc/i386)]),
|
---|
| 111 | [
|
---|
| 112 | case $enableval in
|
---|
| 113 | yes)
|
---|
| 114 | enableval=/Developer/SDKs/MacOSX10.4u.sdk
|
---|
| 115 | if test ! -d "${enableval}"
|
---|
| 116 | then
|
---|
| 117 | enableval=/
|
---|
| 118 | fi
|
---|
| 119 | ;;
|
---|
| 120 | esac
|
---|
| 121 | case $enableval in
|
---|
| 122 | no)
|
---|
| 123 | UNIVERSALSDK=
|
---|
| 124 | enable_universalsdk=
|
---|
| 125 | ;;
|
---|
| 126 | *)
|
---|
| 127 | UNIVERSALSDK=$enableval
|
---|
| 128 | if test ! -d "${UNIVERSALSDK}"
|
---|
| 129 | then
|
---|
| 130 | AC_MSG_ERROR([--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}])
|
---|
| 131 | fi
|
---|
| 132 | ;;
|
---|
| 133 | esac
|
---|
| 134 |
|
---|
| 135 | ],[
|
---|
| 136 | UNIVERSALSDK=
|
---|
| 137 | enable_universalsdk=
|
---|
| 138 | ])
|
---|
| 139 | if test -n "${UNIVERSALSDK}"
|
---|
| 140 | then
|
---|
| 141 | AC_MSG_RESULT(${UNIVERSALSDK})
|
---|
| 142 | else
|
---|
| 143 | AC_MSG_RESULT(no)
|
---|
| 144 | fi
|
---|
| 145 | AC_SUBST(UNIVERSALSDK)
|
---|
| 146 |
|
---|
| 147 | AC_SUBST(ARCH_RUN_32BIT)
|
---|
| 148 | ARCH_RUN_32BIT=""
|
---|
| 149 |
|
---|
| 150 | UNIVERSAL_ARCHS="32-bit"
|
---|
| 151 | AC_SUBST(LIPO_32BIT_FLAGS)
|
---|
| 152 | AC_MSG_CHECKING(for --with-universal-archs)
|
---|
| 153 | AC_ARG_WITH(universal-archs,
|
---|
| 154 | AS_HELP_STRING([--with-universal-archs=ARCH], [select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")]),
|
---|
| 155 | [
|
---|
| 156 | AC_MSG_RESULT($withval)
|
---|
| 157 | UNIVERSAL_ARCHS="$withval"
|
---|
| 158 | if test "${enable_universalsdk}" ; then
|
---|
| 159 | :
|
---|
| 160 | else
|
---|
| 161 | AC_MSG_ERROR([--with-universal-archs without --enable-universalsdk. See Mac/README])
|
---|
| 162 | fi
|
---|
| 163 | ],
|
---|
| 164 | [
|
---|
| 165 | AC_MSG_RESULT(32-bit)
|
---|
| 166 | ])
|
---|
| 167 |
|
---|
| 168 |
|
---|
| 169 |
|
---|
| 170 | AC_ARG_WITH(framework-name,
|
---|
| 171 | AS_HELP_STRING([--with-framework-name=FRAMEWORK],
|
---|
| 172 | [specify an alternate name of the framework built with --enable-framework]),
|
---|
| 173 | [
|
---|
| 174 | if test "${enable_framework}"; then
|
---|
| 175 | :
|
---|
| 176 | else
|
---|
| 177 | AC_MSG_ERROR([--with-framework-name without --enable-framework. See Mac/README])
|
---|
| 178 | fi
|
---|
| 179 | PYTHONFRAMEWORK=${withval}
|
---|
| 180 | PYTHONFRAMEWORKDIR=${withval}.framework
|
---|
| 181 | PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr '[A-Z]' '[a-z]'`
|
---|
| 182 | ],[
|
---|
| 183 | PYTHONFRAMEWORK=Python
|
---|
| 184 | PYTHONFRAMEWORKDIR=Python.framework
|
---|
| 185 | PYTHONFRAMEWORKIDENTIFIER=org.python.python
|
---|
| 186 | ])
|
---|
| 187 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
---|
| 188 | AC_ARG_ENABLE(framework,
|
---|
| 189 | AS_HELP_STRING([--enable-framework@<:@=INSTALLDIR@:>@], [Build (MacOSX|Darwin) framework]),
|
---|
| 190 | [
|
---|
| 191 | case $enableval in
|
---|
| 192 | yes)
|
---|
| 193 | enableval=/Library/Frameworks
|
---|
| 194 | esac
|
---|
| 195 | case $enableval in
|
---|
| 196 | no)
|
---|
| 197 | PYTHONFRAMEWORK=
|
---|
| 198 | PYTHONFRAMEWORKDIR=no-framework
|
---|
| 199 | PYTHONFRAMEWORKPREFIX=
|
---|
| 200 | PYTHONFRAMEWORKINSTALLDIR=
|
---|
| 201 | FRAMEWORKINSTALLFIRST=
|
---|
| 202 | FRAMEWORKINSTALLLAST=
|
---|
| 203 | FRAMEWORKALTINSTALLFIRST=
|
---|
| 204 | FRAMEWORKALTINSTALLLAST=
|
---|
| 205 | if test "x${prefix}" = "xNONE"; then
|
---|
| 206 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
|
---|
| 207 | else
|
---|
| 208 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
|
---|
| 209 | fi
|
---|
| 210 | enable_framework=
|
---|
| 211 | ;;
|
---|
| 212 | *)
|
---|
| 213 | PYTHONFRAMEWORKPREFIX="${enableval}"
|
---|
| 214 | PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
|
---|
| 215 | FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
|
---|
| 216 | FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
|
---|
| 217 | FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
|
---|
| 218 | FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
|
---|
| 219 | FRAMEWORKINSTALLAPPSPREFIX="/Applications"
|
---|
| 220 |
|
---|
| 221 | if test "x${prefix}" = "xNONE" ; then
|
---|
| 222 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
|
---|
| 223 |
|
---|
| 224 | else
|
---|
| 225 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
|
---|
| 226 | fi
|
---|
| 227 |
|
---|
| 228 | case "${enableval}" in
|
---|
| 229 | /System*)
|
---|
| 230 | FRAMEWORKINSTALLAPPSPREFIX="/Applications"
|
---|
| 231 | if test "${prefix}" = "NONE" ; then
|
---|
| 232 | # See below
|
---|
| 233 | FRAMEWORKUNIXTOOLSPREFIX="/usr"
|
---|
| 234 | fi
|
---|
| 235 | ;;
|
---|
| 236 |
|
---|
| 237 | /Library*)
|
---|
| 238 | FRAMEWORKINSTALLAPPSPREFIX="/Applications"
|
---|
| 239 | ;;
|
---|
| 240 |
|
---|
| 241 | */Library/Frameworks)
|
---|
| 242 | MDIR="`dirname "${enableval}"`"
|
---|
| 243 | MDIR="`dirname "${MDIR}"`"
|
---|
| 244 | FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications"
|
---|
| 245 |
|
---|
| 246 | if test "${prefix}" = "NONE"; then
|
---|
| 247 | # User hasn't specified the
|
---|
| 248 | # --prefix option, but wants to install
|
---|
| 249 | # the framework in a non-default location,
|
---|
| 250 | # ensure that the compatibility links get
|
---|
| 251 | # installed relative to that prefix as well
|
---|
| 252 | # instead of in /usr/local.
|
---|
| 253 | FRAMEWORKUNIXTOOLSPREFIX="${MDIR}"
|
---|
| 254 | fi
|
---|
| 255 | ;;
|
---|
| 256 |
|
---|
| 257 | *)
|
---|
| 258 | FRAMEWORKINSTALLAPPSPREFIX="/Applications"
|
---|
| 259 | ;;
|
---|
| 260 | esac
|
---|
| 261 |
|
---|
| 262 | prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
|
---|
| 263 |
|
---|
| 264 | # Add files for Mac specific code to the list of output
|
---|
| 265 | # files:
|
---|
| 266 | AC_CONFIG_FILES(Mac/Makefile)
|
---|
| 267 | AC_CONFIG_FILES(Mac/PythonLauncher/Makefile)
|
---|
| 268 | AC_CONFIG_FILES(Mac/IDLE/Makefile)
|
---|
| 269 | AC_CONFIG_FILES(Mac/Resources/framework/Info.plist)
|
---|
| 270 | AC_CONFIG_FILES(Mac/Resources/app/Info.plist)
|
---|
| 271 | esac
|
---|
| 272 | ],[
|
---|
| 273 | PYTHONFRAMEWORK=
|
---|
| 274 | PYTHONFRAMEWORKDIR=no-framework
|
---|
| 275 | PYTHONFRAMEWORKPREFIX=
|
---|
| 276 | PYTHONFRAMEWORKINSTALLDIR=
|
---|
| 277 | FRAMEWORKINSTALLFIRST=
|
---|
| 278 | FRAMEWORKINSTALLLAST=
|
---|
| 279 | FRAMEWORKALTINSTALLFIRST=
|
---|
| 280 | FRAMEWORKALTINSTALLLAST=
|
---|
| 281 | if test "x${prefix}" = "xNONE" ; then
|
---|
| 282 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
|
---|
| 283 | else
|
---|
| 284 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
|
---|
| 285 | fi
|
---|
| 286 | enable_framework=
|
---|
| 287 |
|
---|
| 288 | ])
|
---|
| 289 | AC_SUBST(PYTHONFRAMEWORK)
|
---|
| 290 | AC_SUBST(PYTHONFRAMEWORKIDENTIFIER)
|
---|
| 291 | AC_SUBST(PYTHONFRAMEWORKDIR)
|
---|
| 292 | AC_SUBST(PYTHONFRAMEWORKPREFIX)
|
---|
| 293 | AC_SUBST(PYTHONFRAMEWORKINSTALLDIR)
|
---|
| 294 | AC_SUBST(FRAMEWORKINSTALLFIRST)
|
---|
| 295 | AC_SUBST(FRAMEWORKINSTALLLAST)
|
---|
| 296 | AC_SUBST(FRAMEWORKALTINSTALLFIRST)
|
---|
| 297 | AC_SUBST(FRAMEWORKALTINSTALLLAST)
|
---|
| 298 | AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
|
---|
| 299 | AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
|
---|
| 300 |
|
---|
| 301 | ##AC_ARG_WITH(dyld,
|
---|
| 302 | ## AS_HELP_STRING([--with-dyld],
|
---|
| 303 | ## [Use (OpenStep|Rhapsody) dynamic linker]))
|
---|
| 304 | ##
|
---|
| 305 | # Set name for machine-dependent library files
|
---|
| 306 | AC_SUBST(MACHDEP)
|
---|
| 307 | AC_MSG_CHECKING(MACHDEP)
|
---|
| 308 | if test -z "$MACHDEP"
|
---|
| 309 | then
|
---|
| 310 | # avoid using uname for cross builds
|
---|
| 311 | if test "$cross_compiling" = yes; then
|
---|
| 312 | # ac_sys_system and ac_sys_release are only used for setting
|
---|
| 313 | # `define_xopen_source' in the case statement below. For the
|
---|
| 314 | # current supported cross builds, this macro is not adjusted.
|
---|
| 315 | case "$host" in
|
---|
| 316 | *-*-linux*)
|
---|
| 317 | ac_sys_system=Linux
|
---|
| 318 | ;;
|
---|
| 319 | *-*-cygwin*)
|
---|
| 320 | ac_sys_system=Cygwin
|
---|
| 321 | ;;
|
---|
| 322 | *)
|
---|
| 323 | # for now, limit cross builds to known configurations
|
---|
| 324 | MACHDEP="unknown"
|
---|
| 325 | AC_MSG_ERROR([cross build not supported for $host])
|
---|
| 326 | esac
|
---|
| 327 | ac_sys_release=
|
---|
| 328 | else
|
---|
| 329 | ac_sys_system=`uname -s`
|
---|
| 330 | if test "$ac_sys_system" = "AIX" \
|
---|
| 331 | -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
|
---|
| 332 | ac_sys_release=`uname -v`
|
---|
| 333 | else
|
---|
| 334 | ac_sys_release=`uname -r`
|
---|
| 335 | fi
|
---|
| 336 | fi
|
---|
| 337 | ac_md_system=`echo $ac_sys_system |
|
---|
| 338 | tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
|
---|
| 339 | ac_md_release=`echo $ac_sys_release |
|
---|
| 340 | tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
|
---|
| 341 | MACHDEP="$ac_md_system$ac_md_release"
|
---|
| 342 |
|
---|
| 343 | case $MACHDEP in
|
---|
| 344 | linux*) MACHDEP="linux2";;
|
---|
| 345 | cygwin*) MACHDEP="cygwin";;
|
---|
| 346 | darwin*) MACHDEP="darwin";;
|
---|
| 347 | atheos*) MACHDEP="atheos";;
|
---|
| 348 | irix646) MACHDEP="irix6";;
|
---|
| 349 | '') MACHDEP="unknown";;
|
---|
| 350 | esac
|
---|
| 351 | fi
|
---|
| 352 |
|
---|
| 353 | AC_SUBST(_PYTHON_HOST_PLATFORM)
|
---|
| 354 | if test "$cross_compiling" = yes; then
|
---|
| 355 | case "$host" in
|
---|
| 356 | *-*-linux*)
|
---|
| 357 | case "$host_cpu" in
|
---|
| 358 | arm*)
|
---|
| 359 | _host_cpu=arm
|
---|
| 360 | ;;
|
---|
| 361 | *)
|
---|
| 362 | _host_cpu=$host_cpu
|
---|
| 363 | esac
|
---|
| 364 | ;;
|
---|
| 365 | *-*-cygwin*)
|
---|
| 366 | _host_cpu=
|
---|
| 367 | ;;
|
---|
| 368 | *)
|
---|
| 369 | # for now, limit cross builds to known configurations
|
---|
| 370 | MACHDEP="unknown"
|
---|
| 371 | AC_MSG_ERROR([cross build not supported for $host])
|
---|
| 372 | esac
|
---|
| 373 | _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
|
---|
| 374 | fi
|
---|
| 375 |
|
---|
| 376 | # Some systems cannot stand _XOPEN_SOURCE being defined at all; they
|
---|
| 377 | # disable features if it is defined, without any means to access these
|
---|
| 378 | # features as extensions. For these systems, we skip the definition of
|
---|
| 379 | # _XOPEN_SOURCE. Before adding a system to the list to gain access to
|
---|
| 380 | # some feature, make sure there is no alternative way to access this
|
---|
| 381 | # feature. Also, when using wildcards, make sure you have verified the
|
---|
| 382 | # need for not defining _XOPEN_SOURCE on all systems matching the
|
---|
| 383 | # wildcard, and that the wildcard does not include future systems
|
---|
| 384 | # (which may remove their limitations).
|
---|
| 385 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
---|
| 386 | case $ac_sys_system/$ac_sys_release in
|
---|
| 387 | # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
|
---|
| 388 | # even though select is a POSIX function. Reported by J. Ribbens.
|
---|
| 389 | # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
|
---|
| 390 | # In addition, Stefan Krah confirms that issue #1244610 exists through
|
---|
| 391 | # OpenBSD 4.6, but is fixed in 4.7.
|
---|
| 392 | OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.@<:@0123456@:>@)
|
---|
| 393 | define_xopen_source=no
|
---|
| 394 | # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
|
---|
| 395 | # also defined. This can be overridden by defining _BSD_SOURCE
|
---|
| 396 | # As this has a different meaning on Linux, only define it on OpenBSD
|
---|
| 397 | AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
|
---|
| 398 | ;;
|
---|
| 399 | OpenBSD/*)
|
---|
| 400 | # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
|
---|
| 401 | # also defined. This can be overridden by defining _BSD_SOURCE
|
---|
| 402 | # As this has a different meaning on Linux, only define it on OpenBSD
|
---|
| 403 | AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
|
---|
| 404 | ;;
|
---|
| 405 | # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
|
---|
| 406 | # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
|
---|
| 407 | # Marc Recht
|
---|
| 408 | NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
|
---|
| 409 | define_xopen_source=no;;
|
---|
| 410 | # From the perspective of Solaris, _XOPEN_SOURCE is not so much a
|
---|
| 411 | # request to enable features supported by the standard as a request
|
---|
| 412 | # to disable features not supported by the standard. The best way
|
---|
| 413 | # for Python to use Solaris is simply to leave _XOPEN_SOURCE out
|
---|
| 414 | # entirely and define __EXTENSIONS__ instead.
|
---|
| 415 | SunOS/*)
|
---|
| 416 | define_xopen_source=no;;
|
---|
| 417 | # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
|
---|
| 418 | # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
|
---|
| 419 | # Reconfirmed for 7.1.4 by Martin v. Loewis.
|
---|
| 420 | OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
|
---|
| 421 | define_xopen_source=no;;
|
---|
| 422 | # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
|
---|
| 423 | # but used in struct sockaddr.sa_family. Reported by Tim Rice.
|
---|
| 424 | SCO_SV/3.2)
|
---|
| 425 | define_xopen_source=no;;
|
---|
| 426 | # On FreeBSD 4, the math functions C89 does not cover are never defined
|
---|
| 427 | # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
|
---|
| 428 | FreeBSD/4.*)
|
---|
| 429 | define_xopen_source=no;;
|
---|
| 430 | # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
|
---|
| 431 | # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
|
---|
| 432 | # identifies itself as Darwin/7.*
|
---|
| 433 | # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
|
---|
| 434 | # disables platform specific features beyond repair.
|
---|
| 435 | # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
|
---|
| 436 | # has no effect, don't bother defining them
|
---|
| 437 | Darwin/@<:@6789@:>@.*)
|
---|
| 438 | define_xopen_source=no;;
|
---|
| 439 | Darwin/1@<:@0-9@:>@.*)
|
---|
| 440 | define_xopen_source=no;;
|
---|
| 441 | # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
|
---|
| 442 | # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
|
---|
| 443 | # or has another value. By not (re)defining it, the defaults come in place.
|
---|
| 444 | AIX/4)
|
---|
| 445 | define_xopen_source=no;;
|
---|
| 446 | AIX/5)
|
---|
| 447 | if test `uname -r` -eq 1; then
|
---|
| 448 | define_xopen_source=no
|
---|
| 449 | fi
|
---|
| 450 | ;;
|
---|
| 451 | # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
|
---|
| 452 | # defining NI_NUMERICHOST.
|
---|
| 453 | QNX/6.3.2)
|
---|
| 454 | define_xopen_source=no
|
---|
| 455 | ;;
|
---|
| 456 |
|
---|
| 457 | esac
|
---|
| 458 |
|
---|
| 459 | if test $define_xopen_source = yes
|
---|
| 460 | then
|
---|
| 461 | AC_DEFINE(_XOPEN_SOURCE, 600,
|
---|
| 462 | Define to the level of X/Open that your system supports)
|
---|
| 463 |
|
---|
| 464 | # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
|
---|
| 465 | # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
|
---|
| 466 | # several APIs are not declared. Since this is also needed in some
|
---|
| 467 | # cases for HP-UX, we define it globally.
|
---|
| 468 | AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
|
---|
| 469 | Define to activate Unix95-and-earlier features)
|
---|
| 470 |
|
---|
| 471 | AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
|
---|
| 472 |
|
---|
| 473 | fi
|
---|
| 474 |
|
---|
| 475 | #
|
---|
| 476 | # SGI compilers allow the specification of the both the ABI and the
|
---|
| 477 | # ISA on the command line. Depending on the values of these switches,
|
---|
| 478 | # different and often incompatable code will be generated.
|
---|
| 479 | #
|
---|
| 480 | # The SGI_ABI variable can be used to modify the CC and LDFLAGS and
|
---|
| 481 | # thus supply support for various ABI/ISA combinations. The MACHDEP
|
---|
| 482 | # variable is also adjusted.
|
---|
| 483 | #
|
---|
| 484 | AC_SUBST(SGI_ABI)
|
---|
| 485 | if test ! -z "$SGI_ABI"
|
---|
| 486 | then
|
---|
| 487 | CC="cc $SGI_ABI"
|
---|
| 488 | LDFLAGS="$SGI_ABI $LDFLAGS"
|
---|
| 489 | MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
|
---|
| 490 | fi
|
---|
| 491 | AC_MSG_RESULT($MACHDEP)
|
---|
| 492 |
|
---|
| 493 | # And add extra plat-mac for darwin
|
---|
| 494 | AC_SUBST(EXTRAPLATDIR)
|
---|
| 495 | AC_SUBST(EXTRAMACHDEPPATH)
|
---|
| 496 | AC_MSG_CHECKING(EXTRAPLATDIR)
|
---|
| 497 | if test -z "$EXTRAPLATDIR"
|
---|
| 498 | then
|
---|
| 499 | case $MACHDEP in
|
---|
| 500 | darwin)
|
---|
| 501 | EXTRAPLATDIR="\$(PLATMACDIRS)"
|
---|
| 502 | EXTRAMACHDEPPATH="\$(PLATMACPATH)"
|
---|
| 503 | ;;
|
---|
| 504 | *)
|
---|
| 505 | EXTRAPLATDIR=""
|
---|
| 506 | EXTRAMACHDEPPATH=""
|
---|
| 507 | ;;
|
---|
| 508 | esac
|
---|
| 509 | fi
|
---|
| 510 | AC_MSG_RESULT($EXTRAPLATDIR)
|
---|
| 511 |
|
---|
| 512 | # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
|
---|
| 513 | # it may influence the way we can build extensions, so distutils
|
---|
| 514 | # needs to check it
|
---|
| 515 | AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
|
---|
| 516 | AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
|
---|
| 517 | CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
|
---|
| 518 | EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
|
---|
| 519 |
|
---|
| 520 | # checks for alternative programs
|
---|
| 521 |
|
---|
| 522 | # compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
|
---|
| 523 | # for debug/optimization stuff. BASECFLAGS is for flags that are required
|
---|
| 524 | # just to get things to compile and link. Users are free to override OPT
|
---|
| 525 | # when running configure or make. The build should not break if they do.
|
---|
| 526 | # BASECFLAGS should generally not be messed with, however.
|
---|
| 527 |
|
---|
| 528 | # XXX shouldn't some/most/all of this code be merged with the stuff later
|
---|
| 529 | # on that fiddles with OPT and BASECFLAGS?
|
---|
| 530 | AC_MSG_CHECKING(for --without-gcc)
|
---|
| 531 | AC_ARG_WITH(gcc,
|
---|
| 532 | AS_HELP_STRING([--without-gcc], [never use gcc]),
|
---|
| 533 | [
|
---|
| 534 | case $withval in
|
---|
| 535 | no) CC=${CC:-cc}
|
---|
| 536 | without_gcc=yes;;
|
---|
| 537 | yes) CC=gcc
|
---|
| 538 | without_gcc=no;;
|
---|
| 539 | *) CC=$withval
|
---|
| 540 | without_gcc=$withval;;
|
---|
| 541 | esac], [
|
---|
| 542 | case $ac_sys_system in
|
---|
| 543 | AIX*) CC=${CC:-xlc_r}
|
---|
| 544 | without_gcc=;;
|
---|
| 545 | BeOS*)
|
---|
| 546 | case $BE_HOST_CPU in
|
---|
| 547 | ppc)
|
---|
| 548 | CC=mwcc
|
---|
| 549 | without_gcc=yes
|
---|
| 550 | BASECFLAGS="$BASECFLAGS -export pragma"
|
---|
| 551 | OPT="$OPT -O"
|
---|
| 552 | LDFLAGS="$LDFLAGS -nodup"
|
---|
| 553 | ;;
|
---|
| 554 | x86)
|
---|
| 555 | CC=gcc
|
---|
| 556 | without_gcc=no
|
---|
| 557 | OPT="$OPT -O"
|
---|
| 558 | ;;
|
---|
| 559 | *)
|
---|
| 560 | AC_MSG_ERROR([Unknown BeOS platform "$BE_HOST_CPU"])
|
---|
| 561 | ;;
|
---|
| 562 | esac
|
---|
| 563 | AR="\$(srcdir)/Modules/ar_beos"
|
---|
| 564 | RANLIB=:
|
---|
| 565 | ;;
|
---|
| 566 | *) without_gcc=no;;
|
---|
| 567 | esac])
|
---|
| 568 | AC_MSG_RESULT($without_gcc)
|
---|
| 569 |
|
---|
| 570 | # If the user switches compilers, we can't believe the cache
|
---|
| 571 | if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
|
---|
| 572 | then
|
---|
| 573 | AC_MSG_ERROR([cached CC is different -- throw away $cache_file
|
---|
| 574 | (it is also a good idea to do 'make clean' before compiling)])
|
---|
| 575 | fi
|
---|
| 576 |
|
---|
| 577 | if test "$MACHDEP" = "irix6" && test "$CC" != "gcc"; then
|
---|
| 578 | # Normally, MIPSpro CC treats #error directives as warnings, which means
|
---|
| 579 | # a successful exit code is returned (0). This is a problem because IRIX
|
---|
| 580 | # has a bunch of system headers with this guard at the top:
|
---|
| 581 | #
|
---|
| 582 | # #ifndef __c99
|
---|
| 583 | # #error This header file is to be used only for c99 mode compilations
|
---|
| 584 | # #else
|
---|
| 585 | #
|
---|
| 586 | # When autoconf tests for such a header, like stdint.h, this happens:
|
---|
| 587 | #
|
---|
| 588 | # configure:4619: cc -c conftest.c >&5
|
---|
| 589 | # cc-1035 cc: WARNING File = /usr/include/stdint.h, Line = 5
|
---|
| 590 | # #error directive: This header file is to be used only for c99 mode
|
---|
| 591 | # compilations
|
---|
| 592 | #
|
---|
| 593 | # #error This header file is to be used only for c99 mode compilations
|
---|
| 594 | # ^
|
---|
| 595 | #
|
---|
| 596 | # configure:4619: $? = 0
|
---|
| 597 | # configure:4619: result: yes
|
---|
| 598 | #
|
---|
| 599 | # Therefore, we use `-diag_error 1035` to have the compiler treat the
|
---|
| 600 | # warning as an error, which causes cc to return a non-zero result,
|
---|
| 601 | # which autoconf can interpret correctly.
|
---|
| 602 | CFLAGS="$CFLAGS -diag_error 1035"
|
---|
| 603 | # Whilst we're here, we might as well make sure CXX defaults to something
|
---|
| 604 | # sensible if we're not using gcc.
|
---|
| 605 | if test -z "$CXX"; then
|
---|
| 606 | CXX="CC"
|
---|
| 607 | fi
|
---|
| 608 | fi
|
---|
| 609 |
|
---|
| 610 | # If the user set CFLAGS, use this instead of the automatically
|
---|
| 611 | # determined setting
|
---|
| 612 | preset_cflags="$CFLAGS"
|
---|
| 613 | AC_PROG_CC
|
---|
| 614 | if test ! -z "$preset_cflags"
|
---|
| 615 | then
|
---|
| 616 | CFLAGS=$preset_cflags
|
---|
| 617 | fi
|
---|
| 618 |
|
---|
| 619 | AC_SUBST(CXX)
|
---|
| 620 | AC_SUBST(MAINCC)
|
---|
| 621 | AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
|
---|
| 622 | AC_ARG_WITH(cxx_main,
|
---|
| 623 | AS_HELP_STRING([--with-cxx-main=<compiler>],
|
---|
| 624 | [compile main() and link python executable with C++ compiler]),
|
---|
| 625 | [
|
---|
| 626 |
|
---|
| 627 | case $withval in
|
---|
| 628 | no) with_cxx_main=no
|
---|
| 629 | MAINCC='$(CC)';;
|
---|
| 630 | yes) with_cxx_main=yes
|
---|
| 631 | MAINCC='$(CXX)';;
|
---|
| 632 | *) with_cxx_main=yes
|
---|
| 633 | MAINCC=$withval
|
---|
| 634 | if test -z "$CXX"
|
---|
| 635 | then
|
---|
| 636 | CXX=$withval
|
---|
| 637 | fi;;
|
---|
| 638 | esac], [
|
---|
| 639 | with_cxx_main=no
|
---|
| 640 | MAINCC='$(CC)'
|
---|
| 641 | ])
|
---|
| 642 | AC_MSG_RESULT($with_cxx_main)
|
---|
| 643 |
|
---|
| 644 | preset_cxx="$CXX"
|
---|
| 645 | if test -z "$CXX"
|
---|
| 646 | then
|
---|
| 647 | case "$CC" in
|
---|
| 648 | gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
|
---|
| 649 | cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
|
---|
| 650 | esac
|
---|
| 651 | if test "$CXX" = "notfound"
|
---|
| 652 | then
|
---|
| 653 | CXX=""
|
---|
| 654 | fi
|
---|
| 655 | fi
|
---|
| 656 | if test -z "$CXX"
|
---|
| 657 | then
|
---|
| 658 | AC_CHECK_TOOLS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
|
---|
| 659 | if test "$CXX" = "notfound"
|
---|
| 660 | then
|
---|
| 661 | CXX=""
|
---|
| 662 | fi
|
---|
| 663 | fi
|
---|
| 664 | if test "$preset_cxx" != "$CXX"
|
---|
| 665 | then
|
---|
| 666 | AC_MSG_WARN([
|
---|
| 667 |
|
---|
| 668 | By default, distutils will build C++ extension modules with "$CXX".
|
---|
| 669 | If this is not intended, then set CXX on the configure command line.
|
---|
| 670 | ])
|
---|
| 671 | fi
|
---|
| 672 |
|
---|
| 673 | MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
---|
| 674 | AC_SUBST(MULTIARCH)
|
---|
| 675 |
|
---|
| 676 |
|
---|
| 677 | # checks for UNIX variants that set C preprocessor variables
|
---|
| 678 | AC_USE_SYSTEM_EXTENSIONS
|
---|
| 679 |
|
---|
| 680 | # Check for unsupported systems
|
---|
| 681 | case $ac_sys_system/$ac_sys_release in
|
---|
| 682 | atheos*|Linux*/1*)
|
---|
| 683 | echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
|
---|
| 684 | echo See README for details.
|
---|
| 685 | exit 1;;
|
---|
| 686 | esac
|
---|
| 687 |
|
---|
| 688 | AC_EXEEXT
|
---|
| 689 | AC_MSG_CHECKING(for --with-suffix)
|
---|
| 690 | AC_ARG_WITH(suffix,
|
---|
| 691 | AS_HELP_STRING([--with-suffix=.exe], [set executable suffix]),
|
---|
| 692 | [
|
---|
| 693 | case $withval in
|
---|
| 694 | no) EXEEXT=;;
|
---|
| 695 | yes) EXEEXT=.exe;;
|
---|
| 696 | *) EXEEXT=$withval;;
|
---|
| 697 | esac])
|
---|
| 698 | AC_MSG_RESULT($EXEEXT)
|
---|
| 699 |
|
---|
| 700 | # Test whether we're running on a non-case-sensitive system, in which
|
---|
| 701 | # case we give a warning if no ext is given
|
---|
| 702 | AC_SUBST(BUILDEXEEXT)
|
---|
| 703 | AC_MSG_CHECKING(for case-insensitive build directory)
|
---|
| 704 | if test ! -d CaseSensitiveTestDir; then
|
---|
| 705 | mkdir CaseSensitiveTestDir
|
---|
| 706 | fi
|
---|
| 707 |
|
---|
| 708 | if test -d casesensitivetestdir
|
---|
| 709 | then
|
---|
| 710 | AC_MSG_RESULT(yes)
|
---|
| 711 | BUILDEXEEXT=.exe
|
---|
| 712 | else
|
---|
| 713 | AC_MSG_RESULT(no)
|
---|
| 714 | BUILDEXEEXT=$EXEEXT
|
---|
| 715 | fi
|
---|
| 716 | rmdir CaseSensitiveTestDir
|
---|
| 717 |
|
---|
| 718 | case $MACHDEP in
|
---|
| 719 | bsdos*)
|
---|
| 720 | case $CC in
|
---|
| 721 | gcc) CC="$CC -D_HAVE_BSDI";;
|
---|
| 722 | esac;;
|
---|
| 723 | esac
|
---|
| 724 |
|
---|
| 725 | case $ac_sys_system in
|
---|
| 726 | hp*|HP*)
|
---|
| 727 | case $CC in
|
---|
| 728 | cc|*/cc) CC="$CC -Ae";;
|
---|
| 729 | esac;;
|
---|
| 730 | SunOS*)
|
---|
| 731 | # Some functions have a prototype only with that define, e.g. confstr
|
---|
| 732 | AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
|
---|
| 733 | ;;
|
---|
| 734 | esac
|
---|
| 735 |
|
---|
| 736 |
|
---|
| 737 | AC_SUBST(LIBRARY)
|
---|
| 738 | AC_MSG_CHECKING(LIBRARY)
|
---|
| 739 | if test -z "$LIBRARY"
|
---|
| 740 | then
|
---|
| 741 | LIBRARY='libpython$(VERSION).a'
|
---|
| 742 | fi
|
---|
| 743 | AC_MSG_RESULT($LIBRARY)
|
---|
| 744 |
|
---|
| 745 | # LDLIBRARY is the name of the library to link against (as opposed to the
|
---|
| 746 | # name of the library into which to insert object files). BLDLIBRARY is also
|
---|
| 747 | # the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
|
---|
| 748 | # is blank as the main program is not linked directly against LDLIBRARY.
|
---|
| 749 | # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
|
---|
| 750 | # systems without shared libraries, LDLIBRARY is the same as LIBRARY
|
---|
| 751 | # (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,
|
---|
| 752 | # DLLLIBRARY is the shared (i.e., DLL) library.
|
---|
| 753 | #
|
---|
| 754 | # RUNSHARED is used to run shared python without installed libraries
|
---|
| 755 | #
|
---|
| 756 | # INSTSONAME is the name of the shared library that will be use to install
|
---|
| 757 | # on the system - some systems like version suffix, others don't
|
---|
| 758 | AC_SUBST(LDLIBRARY)
|
---|
| 759 | AC_SUBST(DLLLIBRARY)
|
---|
| 760 | AC_SUBST(BLDLIBRARY)
|
---|
| 761 | AC_SUBST(LDLIBRARYDIR)
|
---|
| 762 | AC_SUBST(INSTSONAME)
|
---|
| 763 | AC_SUBST(RUNSHARED)
|
---|
| 764 | LDLIBRARY="$LIBRARY"
|
---|
| 765 | BLDLIBRARY='$(LDLIBRARY)'
|
---|
| 766 | INSTSONAME='$(LDLIBRARY)'
|
---|
| 767 | DLLLIBRARY=''
|
---|
| 768 | LDLIBRARYDIR=''
|
---|
| 769 | RUNSHARED=''
|
---|
| 770 |
|
---|
| 771 | # LINKCC is the command that links the python executable -- default is $(CC).
|
---|
| 772 | # If CXX is set, and if it is needed to link a main function that was
|
---|
| 773 | # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
|
---|
| 774 | # python might then depend on the C++ runtime
|
---|
| 775 | # This is altered for AIX in order to build the export list before
|
---|
| 776 | # linking.
|
---|
| 777 | AC_SUBST(LINKCC)
|
---|
| 778 | AC_MSG_CHECKING(LINKCC)
|
---|
| 779 | if test -z "$LINKCC"
|
---|
| 780 | then
|
---|
| 781 | LINKCC='$(PURIFY) $(MAINCC)'
|
---|
| 782 | case $ac_sys_system in
|
---|
| 783 | AIX*)
|
---|
| 784 | exp_extra="\"\""
|
---|
| 785 | if test $ac_sys_release -ge 5 -o \
|
---|
| 786 | $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then
|
---|
| 787 | exp_extra="."
|
---|
| 788 | fi
|
---|
| 789 | LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
|
---|
| 790 | QNX*)
|
---|
| 791 | # qcc must be used because the other compilers do not
|
---|
| 792 | # support -N.
|
---|
| 793 | LINKCC=qcc;;
|
---|
| 794 | esac
|
---|
| 795 | fi
|
---|
| 796 | AC_MSG_RESULT($LINKCC)
|
---|
| 797 |
|
---|
| 798 | # GNULD is set to "yes" if the GNU linker is used. If this goes wrong
|
---|
| 799 | # make sure we default having it set to "no": this is used by
|
---|
| 800 | # distutils.unixccompiler to know if it should add --enable-new-dtags
|
---|
| 801 | # to linker command lines, and failing to detect GNU ld simply results
|
---|
| 802 | # in the same bahaviour as before.
|
---|
| 803 | AC_SUBST(GNULD)
|
---|
| 804 | AC_MSG_CHECKING(for GNU ld)
|
---|
| 805 | ac_prog=ld
|
---|
| 806 | if test "$GCC" = yes; then
|
---|
| 807 | ac_prog=`$CC -print-prog-name=ld`
|
---|
| 808 | fi
|
---|
| 809 | case `"$ac_prog" -V 2>&1 < /dev/null` in
|
---|
| 810 | *GNU*)
|
---|
| 811 | GNULD=yes;;
|
---|
| 812 | *)
|
---|
| 813 | GNULD=no;;
|
---|
| 814 | esac
|
---|
| 815 | AC_MSG_RESULT($GNULD)
|
---|
| 816 |
|
---|
| 817 | AC_MSG_CHECKING(for --enable-shared)
|
---|
| 818 | AC_ARG_ENABLE(shared,
|
---|
| 819 | AS_HELP_STRING([--enable-shared], [disable/enable building shared python library]))
|
---|
| 820 |
|
---|
| 821 | if test -z "$enable_shared"
|
---|
| 822 | then
|
---|
| 823 | case $ac_sys_system in
|
---|
| 824 | CYGWIN* | atheos*)
|
---|
| 825 | enable_shared="yes";;
|
---|
| 826 | *)
|
---|
| 827 | enable_shared="no";;
|
---|
| 828 | esac
|
---|
| 829 | fi
|
---|
| 830 | AC_MSG_RESULT($enable_shared)
|
---|
| 831 |
|
---|
| 832 | AC_MSG_CHECKING(for --enable-profiling)
|
---|
| 833 | AC_ARG_ENABLE(profiling,
|
---|
| 834 | AS_HELP_STRING([--enable-profiling], [enable C-level code profiling]))
|
---|
| 835 | if test "x$enable_profiling" = xyes; then
|
---|
| 836 | ac_save_cc="$CC"
|
---|
| 837 | CC="$CC -pg"
|
---|
| 838 | AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
|
---|
| 839 | [],
|
---|
| 840 | [enable_profiling=no])
|
---|
| 841 | CC="$ac_save_cc"
|
---|
| 842 | else
|
---|
| 843 | enable_profiling=no
|
---|
| 844 | fi
|
---|
| 845 | AC_MSG_RESULT($enable_profiling)
|
---|
| 846 |
|
---|
| 847 | if test "x$enable_profiling" = xyes; then
|
---|
| 848 | BASECFLAGS="-pg $BASECFLAGS"
|
---|
| 849 | LDFLAGS="-pg $LDFLAGS"
|
---|
| 850 | fi
|
---|
| 851 |
|
---|
| 852 | AC_MSG_CHECKING(LDLIBRARY)
|
---|
| 853 |
|
---|
| 854 | # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
|
---|
| 855 | # library that we build, but we do not want to link against it (we
|
---|
| 856 | # will find it with a -framework option). For this reason there is an
|
---|
| 857 | # extra variable BLDLIBRARY against which Python and the extension
|
---|
| 858 | # modules are linked, BLDLIBRARY. This is normally the same as
|
---|
| 859 | # LDLIBRARY, but empty for MacOSX framework builds.
|
---|
| 860 | if test "$enable_framework"
|
---|
| 861 | then
|
---|
| 862 | LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 863 | RUNSHARED=DYLD_FRAMEWORK_PATH="`pwd`:$DYLD_FRAMEWORK_PATH"
|
---|
| 864 | BLDLIBRARY=''
|
---|
| 865 | else
|
---|
| 866 | BLDLIBRARY='$(LDLIBRARY)'
|
---|
| 867 | fi
|
---|
| 868 |
|
---|
| 869 | # Other platforms follow
|
---|
| 870 | if test $enable_shared = "yes"; then
|
---|
| 871 | AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
|
---|
| 872 | case $ac_sys_system in
|
---|
| 873 | BeOS*)
|
---|
| 874 | LDLIBRARY='libpython$(VERSION).so'
|
---|
| 875 | ;;
|
---|
| 876 | CYGWIN*)
|
---|
| 877 | LDLIBRARY='libpython$(VERSION).dll.a'
|
---|
| 878 | DLLLIBRARY='libpython$(VERSION).dll'
|
---|
| 879 | ;;
|
---|
| 880 | SunOS*)
|
---|
| 881 | LDLIBRARY='libpython$(VERSION).so'
|
---|
| 882 | BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
|
---|
| 883 | RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
---|
| 884 | INSTSONAME="$LDLIBRARY".$SOVERSION
|
---|
| 885 | ;;
|
---|
| 886 | Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
|
---|
| 887 | LDLIBRARY='libpython$(VERSION).so'
|
---|
| 888 | BLDLIBRARY='-L. -lpython$(VERSION)'
|
---|
| 889 | RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
---|
| 890 | case $ac_sys_system in
|
---|
| 891 | FreeBSD*)
|
---|
| 892 | SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
|
---|
| 893 | ;;
|
---|
| 894 | esac
|
---|
| 895 | INSTSONAME="$LDLIBRARY".$SOVERSION
|
---|
| 896 | ;;
|
---|
| 897 | hp*|HP*)
|
---|
| 898 | case `uname -m` in
|
---|
| 899 | ia64)
|
---|
| 900 | LDLIBRARY='libpython$(VERSION).so'
|
---|
| 901 | ;;
|
---|
| 902 | *)
|
---|
| 903 | LDLIBRARY='libpython$(VERSION).sl'
|
---|
| 904 | ;;
|
---|
| 905 | esac
|
---|
| 906 | BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)'
|
---|
| 907 | RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH}
|
---|
| 908 | ;;
|
---|
| 909 | OSF*)
|
---|
| 910 | LDLIBRARY='libpython$(VERSION).so'
|
---|
| 911 | BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
|
---|
| 912 | RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
---|
| 913 | ;;
|
---|
| 914 | atheos*)
|
---|
| 915 | LDLIBRARY='libpython$(VERSION).so'
|
---|
| 916 | BLDLIBRARY='-L. -lpython$(VERSION)'
|
---|
| 917 | RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
|
---|
| 918 | ;;
|
---|
| 919 | Darwin*)
|
---|
| 920 | LDLIBRARY='libpython$(VERSION).dylib'
|
---|
| 921 | BLDLIBRARY='-L. -lpython$(VERSION)'
|
---|
| 922 | RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
|
---|
| 923 | ;;
|
---|
| 924 | AIX*)
|
---|
| 925 | LDLIBRARY='libpython$(VERSION).so'
|
---|
| 926 | RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
|
---|
| 927 | ;;
|
---|
| 928 |
|
---|
| 929 | esac
|
---|
| 930 | else # shared is disabled
|
---|
| 931 | case $ac_sys_system in
|
---|
| 932 | CYGWIN*)
|
---|
| 933 | BLDLIBRARY='$(LIBRARY)'
|
---|
| 934 | LDLIBRARY='libpython$(VERSION).dll.a'
|
---|
| 935 | ;;
|
---|
| 936 | esac
|
---|
| 937 | fi
|
---|
| 938 |
|
---|
| 939 | if test "$cross_compiling" = yes; then
|
---|
| 940 | RUNSHARED=
|
---|
| 941 | fi
|
---|
| 942 |
|
---|
| 943 | AC_MSG_RESULT($LDLIBRARY)
|
---|
| 944 |
|
---|
| 945 | AC_PROG_RANLIB
|
---|
| 946 | AC_SUBST(AR)
|
---|
| 947 | AC_CHECK_TOOLS(AR, ar aal, ar)
|
---|
| 948 |
|
---|
| 949 | # tweak ARFLAGS only if the user didn't set it on the command line
|
---|
| 950 | AC_SUBST(ARFLAGS)
|
---|
| 951 | if test -z "$ARFLAGS"
|
---|
| 952 | then
|
---|
| 953 | ARFLAGS="rc"
|
---|
| 954 | fi
|
---|
| 955 |
|
---|
| 956 | AC_SUBST(SVNVERSION)
|
---|
| 957 | AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
|
---|
| 958 | if test $SVNVERSION = found
|
---|
| 959 | then
|
---|
| 960 | SVNVERSION="svnversion \$(srcdir)"
|
---|
| 961 | else
|
---|
| 962 | SVNVERSION="echo Unversioned directory"
|
---|
| 963 | fi
|
---|
| 964 |
|
---|
| 965 | AC_SUBST(BASECPPFLAGS)
|
---|
| 966 | if test "$abs_srcdir" != "$abs_builddir"; then
|
---|
| 967 | # If we're building out-of-tree make sure Include (in the current dir)
|
---|
| 968 | # gets picked up before its $srcdir counterpart in order for Python-ast.h
|
---|
| 969 | # and graminit.h to get picked up from the correct directory.
|
---|
| 970 | # (A side effect of this is that these resources will automatically be
|
---|
| 971 | # regenerated when building out-of-tree, regardless of whether or not
|
---|
| 972 | # the $srcdir counterpart is up-to-date. This is an acceptable trade
|
---|
| 973 | # off.)
|
---|
| 974 | BASECPPFLAGS="-IInclude"
|
---|
| 975 | else
|
---|
| 976 | BASECPPFLAGS=""
|
---|
| 977 | fi
|
---|
| 978 |
|
---|
| 979 | AC_SUBST(HGVERSION)
|
---|
| 980 | AC_SUBST(HGTAG)
|
---|
| 981 | AC_SUBST(HGBRANCH)
|
---|
| 982 | AC_CHECK_PROG(HAS_HG, hg, found, not-found)
|
---|
| 983 | if test $HAS_HG = found
|
---|
| 984 | then
|
---|
| 985 | HGVERSION="hg id -i \$(srcdir)"
|
---|
| 986 | HGTAG="hg id -t \$(srcdir)"
|
---|
| 987 | HGBRANCH="hg id -b \$(srcdir)"
|
---|
| 988 | else
|
---|
| 989 | HGVERSION=""
|
---|
| 990 | HGTAG=""
|
---|
| 991 | HGBRANCH=""
|
---|
| 992 | fi
|
---|
| 993 |
|
---|
| 994 | case $MACHDEP in
|
---|
| 995 | bsdos*|hp*|HP*)
|
---|
| 996 | # install -d does not work on BSDI or HP-UX
|
---|
| 997 | if test -z "$INSTALL"
|
---|
| 998 | then
|
---|
| 999 | INSTALL="${srcdir}/install-sh -c"
|
---|
| 1000 | fi
|
---|
| 1001 | esac
|
---|
| 1002 | AC_PROG_INSTALL
|
---|
| 1003 | AC_PROG_MKDIR_P
|
---|
| 1004 |
|
---|
| 1005 | # Not every filesystem supports hard links
|
---|
| 1006 | AC_SUBST(LN)
|
---|
| 1007 | if test -z "$LN" ; then
|
---|
| 1008 | case $ac_sys_system in
|
---|
| 1009 | BeOS*) LN="ln -s";;
|
---|
| 1010 | CYGWIN*) LN="ln -s";;
|
---|
| 1011 | atheos*) LN="ln -s";;
|
---|
| 1012 | *) LN=ln;;
|
---|
| 1013 | esac
|
---|
| 1014 | fi
|
---|
| 1015 |
|
---|
| 1016 | # Check for --with-pydebug
|
---|
| 1017 | AC_MSG_CHECKING(for --with-pydebug)
|
---|
| 1018 | AC_ARG_WITH(pydebug,
|
---|
| 1019 | AS_HELP_STRING([--with-pydebug], [build with Py_DEBUG defined]),
|
---|
| 1020 | [
|
---|
| 1021 | if test "$withval" != no
|
---|
| 1022 | then
|
---|
| 1023 | AC_DEFINE(Py_DEBUG, 1,
|
---|
| 1024 | [Define if you want to build an interpreter with many run-time checks.])
|
---|
| 1025 | AC_MSG_RESULT(yes);
|
---|
| 1026 | Py_DEBUG='true'
|
---|
| 1027 | else AC_MSG_RESULT(no); Py_DEBUG='false'
|
---|
| 1028 | fi],
|
---|
| 1029 | [AC_MSG_RESULT(no)])
|
---|
| 1030 |
|
---|
| 1031 | # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
|
---|
| 1032 | # merged with this chunk of code?
|
---|
| 1033 |
|
---|
| 1034 | # Optimizer/debugger flags
|
---|
| 1035 | # ------------------------
|
---|
| 1036 | # (The following bit of code is complicated enough - please keep things
|
---|
| 1037 | # indented properly. Just pretend you're editing Python code. ;-)
|
---|
| 1038 |
|
---|
| 1039 | # There are two parallel sets of case statements below, one that checks to
|
---|
| 1040 | # see if OPT was set and one that does BASECFLAGS setting based upon
|
---|
| 1041 | # compiler and platform. BASECFLAGS tweaks need to be made even if the
|
---|
| 1042 | # user set OPT.
|
---|
| 1043 |
|
---|
| 1044 | # tweak OPT based on compiler and platform, only if the user didn't set
|
---|
| 1045 | # it on the command line
|
---|
| 1046 | AC_SUBST(OPT)
|
---|
| 1047 | if test "${OPT-unset}" = "unset"
|
---|
| 1048 | then
|
---|
| 1049 | case $GCC in
|
---|
| 1050 | yes)
|
---|
| 1051 | if test "$CC" != 'g++' ; then
|
---|
| 1052 | STRICT_PROTO="-Wstrict-prototypes"
|
---|
| 1053 | fi
|
---|
| 1054 | # For gcc 4.x we need to use -fwrapv so lets check if its supported
|
---|
| 1055 | if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
|
---|
| 1056 | WRAP="-fwrapv"
|
---|
| 1057 | fi
|
---|
| 1058 |
|
---|
| 1059 | # Clang also needs -fwrapv
|
---|
| 1060 | case $CC in
|
---|
| 1061 | *clang*) WRAP="-fwrapv"
|
---|
| 1062 | ;;
|
---|
| 1063 | esac
|
---|
| 1064 |
|
---|
| 1065 | case $ac_cv_prog_cc_g in
|
---|
| 1066 | yes)
|
---|
| 1067 | if test "$Py_DEBUG" = 'true' ; then
|
---|
| 1068 | # Optimization messes up debuggers, so turn it off for
|
---|
| 1069 | # debug builds.
|
---|
| 1070 | OPT="-g -O0 -Wall $STRICT_PROTO"
|
---|
| 1071 | else
|
---|
| 1072 | OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
|
---|
| 1073 | fi
|
---|
| 1074 | ;;
|
---|
| 1075 | *)
|
---|
| 1076 | OPT="-O3 -Wall $STRICT_PROTO"
|
---|
| 1077 | ;;
|
---|
| 1078 | esac
|
---|
| 1079 | case $ac_sys_system in
|
---|
| 1080 | SCO_SV*) OPT="$OPT -m486 -DSCO5"
|
---|
| 1081 | ;;
|
---|
| 1082 | esac
|
---|
| 1083 | ;;
|
---|
| 1084 |
|
---|
| 1085 | *)
|
---|
| 1086 | OPT="-O"
|
---|
| 1087 | ;;
|
---|
| 1088 | esac
|
---|
| 1089 | fi
|
---|
| 1090 |
|
---|
| 1091 | AC_SUBST(BASECFLAGS)
|
---|
| 1092 |
|
---|
| 1093 | # The -arch flags for universal builds on OSX
|
---|
| 1094 | UNIVERSAL_ARCH_FLAGS=
|
---|
| 1095 | AC_SUBST(UNIVERSAL_ARCH_FLAGS)
|
---|
| 1096 |
|
---|
| 1097 | # tweak BASECFLAGS based on compiler and platform
|
---|
| 1098 | case $GCC in
|
---|
| 1099 | yes)
|
---|
| 1100 | # Python violates C99 rules, by casting between incompatible
|
---|
| 1101 | # pointer types. GCC may generate bad code as a result of that,
|
---|
| 1102 | # so use -fno-strict-aliasing if supported.
|
---|
| 1103 | AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
|
---|
| 1104 | ac_save_cc="$CC"
|
---|
| 1105 | CC="$CC -fno-strict-aliasing"
|
---|
| 1106 | AC_CACHE_VAL(ac_cv_no_strict_aliasing_ok,
|
---|
| 1107 | AC_COMPILE_IFELSE(
|
---|
| 1108 | [AC_LANG_PROGRAM([[]], [[]])],
|
---|
| 1109 | [ac_cv_no_strict_aliasing_ok=yes],
|
---|
| 1110 | [ac_cv_no_strict_aliasing_ok=no]))
|
---|
| 1111 | CC="$ac_save_cc"
|
---|
| 1112 | AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
|
---|
| 1113 | if test $ac_cv_no_strict_aliasing_ok = yes
|
---|
| 1114 | then
|
---|
| 1115 | BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
|
---|
| 1116 | fi
|
---|
| 1117 |
|
---|
| 1118 | # if using gcc on alpha, use -mieee to get (near) full IEEE 754
|
---|
| 1119 | # support. Without this, treatment of subnormals doesn't follow
|
---|
| 1120 | # the standard.
|
---|
| 1121 | case $host in
|
---|
| 1122 | alpha*)
|
---|
| 1123 | BASECFLAGS="$BASECFLAGS -mieee"
|
---|
| 1124 | ;;
|
---|
| 1125 | esac
|
---|
| 1126 |
|
---|
| 1127 | case $ac_sys_system in
|
---|
| 1128 | SCO_SV*)
|
---|
| 1129 | BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
|
---|
| 1130 | ;;
|
---|
| 1131 | # is there any other compiler on Darwin besides gcc?
|
---|
| 1132 | Darwin*)
|
---|
| 1133 | # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
|
---|
| 1134 | # used to be here, but non-Apple gcc doesn't accept them.
|
---|
| 1135 | if test "${CC}" = gcc
|
---|
| 1136 | then
|
---|
| 1137 | AC_MSG_CHECKING(which compiler should be used)
|
---|
| 1138 | case "${UNIVERSALSDK}" in
|
---|
| 1139 | */MacOSX10.4u.sdk)
|
---|
| 1140 | # Build using 10.4 SDK, force usage of gcc when the
|
---|
| 1141 | # compiler is gcc, otherwise the user will get very
|
---|
| 1142 | # confusing error messages when building on OSX 10.6
|
---|
| 1143 | CC=gcc-4.0
|
---|
| 1144 | CPP=cpp-4.0
|
---|
| 1145 | ;;
|
---|
| 1146 | esac
|
---|
| 1147 | AC_MSG_RESULT($CC)
|
---|
| 1148 | fi
|
---|
| 1149 |
|
---|
| 1150 | # Calculate the right deployment target for this build.
|
---|
| 1151 | #
|
---|
| 1152 | cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
|
---|
| 1153 | if test ${cur_target} '>' 10.2; then
|
---|
| 1154 | cur_target=10.3
|
---|
| 1155 | if test ${enable_universalsdk}; then
|
---|
| 1156 | if test "${UNIVERSAL_ARCHS}" = "all"; then
|
---|
| 1157 | # Ensure that the default platform for a
|
---|
| 1158 | # 4-way universal build is OSX 10.5,
|
---|
| 1159 | # that's the first OS release where
|
---|
| 1160 | # 4-way builds make sense.
|
---|
| 1161 | cur_target='10.5'
|
---|
| 1162 |
|
---|
| 1163 | elif test "${UNIVERSAL_ARCHS}" = "3-way"; then
|
---|
| 1164 | cur_target='10.5'
|
---|
| 1165 |
|
---|
| 1166 | elif test "${UNIVERSAL_ARCHS}" = "intel"; then
|
---|
| 1167 | cur_target='10.5'
|
---|
| 1168 |
|
---|
| 1169 | elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then
|
---|
| 1170 | cur_target='10.5'
|
---|
| 1171 | fi
|
---|
| 1172 | else
|
---|
| 1173 | if test `/usr/bin/arch` = "i386"; then
|
---|
| 1174 | # On Intel macs default to a deployment
|
---|
| 1175 | # target of 10.4, that's the first OSX
|
---|
| 1176 | # release with Intel support.
|
---|
| 1177 | cur_target="10.4"
|
---|
| 1178 | fi
|
---|
| 1179 | fi
|
---|
| 1180 | fi
|
---|
| 1181 | CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
|
---|
| 1182 |
|
---|
| 1183 | # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
---|
| 1184 | # environment with a value that is the same as what we'll use
|
---|
| 1185 | # in the Makefile to ensure that we'll get the same compiler
|
---|
| 1186 | # environment during configure and build time.
|
---|
| 1187 | MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
|
---|
| 1188 | export MACOSX_DEPLOYMENT_TARGET
|
---|
| 1189 | EXPORT_MACOSX_DEPLOYMENT_TARGET=''
|
---|
| 1190 |
|
---|
| 1191 | if test "${enable_universalsdk}"; then
|
---|
| 1192 | UNIVERSAL_ARCH_FLAGS=""
|
---|
| 1193 | if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
|
---|
| 1194 | UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
|
---|
| 1195 | ARCH_RUN_32BIT=""
|
---|
| 1196 | LIPO_32BIT_FLAGS=""
|
---|
| 1197 |
|
---|
| 1198 | elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
|
---|
| 1199 | UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
---|
| 1200 | LIPO_32BIT_FLAGS=""
|
---|
| 1201 | ARCH_RUN_32BIT="true"
|
---|
| 1202 |
|
---|
| 1203 | elif test "$UNIVERSAL_ARCHS" = "all" ; then
|
---|
| 1204 | UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
---|
| 1205 | LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
---|
| 1206 | ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
---|
| 1207 |
|
---|
| 1208 | elif test "$UNIVERSAL_ARCHS" = "intel" ; then
|
---|
| 1209 | UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
|
---|
| 1210 | LIPO_32BIT_FLAGS="-extract i386"
|
---|
| 1211 | ARCH_RUN_32BIT="/usr/bin/arch -i386"
|
---|
| 1212 |
|
---|
| 1213 | elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
|
---|
| 1214 | UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
|
---|
| 1215 | LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
---|
| 1216 | ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
---|
| 1217 |
|
---|
| 1218 | else
|
---|
| 1219 | AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
|
---|
| 1220 |
|
---|
| 1221 | fi
|
---|
| 1222 |
|
---|
| 1223 |
|
---|
| 1224 | CFLAGS="${UNIVERSAL_ARCH_FLAGS} ${CFLAGS}"
|
---|
| 1225 | if test "${UNIVERSALSDK}" != "/"
|
---|
| 1226 | then
|
---|
| 1227 | CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
|
---|
| 1228 | LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
---|
| 1229 | CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
---|
| 1230 | fi
|
---|
| 1231 |
|
---|
| 1232 | fi
|
---|
| 1233 |
|
---|
| 1234 |
|
---|
| 1235 | ;;
|
---|
| 1236 | OSF*)
|
---|
| 1237 | BASECFLAGS="$BASECFLAGS -mieee"
|
---|
| 1238 | ;;
|
---|
| 1239 | esac
|
---|
| 1240 | ;;
|
---|
| 1241 |
|
---|
| 1242 | *)
|
---|
| 1243 | case $ac_sys_system in
|
---|
| 1244 | OpenUNIX*|UnixWare*)
|
---|
| 1245 | BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
|
---|
| 1246 | ;;
|
---|
| 1247 | OSF*)
|
---|
| 1248 | BASECFLAGS="$BASECFLAGS -ieee -std"
|
---|
| 1249 | ;;
|
---|
| 1250 | SCO_SV*)
|
---|
| 1251 | BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
|
---|
| 1252 | ;;
|
---|
| 1253 | esac
|
---|
| 1254 | ;;
|
---|
| 1255 | esac
|
---|
| 1256 |
|
---|
| 1257 | if test "$Py_DEBUG" = 'true'; then
|
---|
| 1258 | :
|
---|
| 1259 | else
|
---|
| 1260 | OPT="-DNDEBUG $OPT"
|
---|
| 1261 | fi
|
---|
| 1262 |
|
---|
| 1263 | if test "$ac_arch_flags"
|
---|
| 1264 | then
|
---|
| 1265 | BASECFLAGS="$BASECFLAGS $ac_arch_flags"
|
---|
| 1266 | fi
|
---|
| 1267 |
|
---|
| 1268 | # disable check for icc since it seems to pass, but generates a warning
|
---|
| 1269 | if test "$CC" = icc
|
---|
| 1270 | then
|
---|
| 1271 | ac_cv_opt_olimit_ok=no
|
---|
| 1272 | fi
|
---|
| 1273 |
|
---|
| 1274 | AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
|
---|
| 1275 | AC_CACHE_VAL(ac_cv_opt_olimit_ok,
|
---|
| 1276 | [ac_save_cc="$CC"
|
---|
| 1277 | CC="$CC -OPT:Olimit=0"
|
---|
| 1278 | AC_COMPILE_IFELSE(
|
---|
| 1279 | [AC_LANG_PROGRAM([[]], [[]])],
|
---|
| 1280 | [ac_cv_opt_olimit_ok=yes],
|
---|
| 1281 | [ac_cv_opt_olimit_ok=no]
|
---|
| 1282 | )
|
---|
| 1283 | CC="$ac_save_cc"])
|
---|
| 1284 | AC_MSG_RESULT($ac_cv_opt_olimit_ok)
|
---|
| 1285 | if test $ac_cv_opt_olimit_ok = yes; then
|
---|
| 1286 | case $ac_sys_system in
|
---|
| 1287 | # XXX is this branch needed? On MacOSX 10.2.2 the result of the
|
---|
| 1288 | # olimit_ok test is "no". Is it "yes" in some other Darwin-esque
|
---|
| 1289 | # environment?
|
---|
| 1290 | Darwin*)
|
---|
| 1291 | ;;
|
---|
| 1292 | # XXX thankfully this useless troublemaker of a flag has been
|
---|
| 1293 | # eradicated in the 3.x line. For now, make sure it isn't picked
|
---|
| 1294 | # up by any of our other platforms that use CC.
|
---|
| 1295 | AIX*|SunOS*|HP-UX*|IRIX*)
|
---|
| 1296 | ;;
|
---|
| 1297 | *)
|
---|
| 1298 | BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
|
---|
| 1299 | ;;
|
---|
| 1300 | esac
|
---|
| 1301 | else
|
---|
| 1302 | AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
|
---|
| 1303 | AC_CACHE_VAL(ac_cv_olimit_ok,
|
---|
| 1304 | [ac_save_cc="$CC"
|
---|
| 1305 | CC="$CC -Olimit 1500"
|
---|
| 1306 | AC_COMPILE_IFELSE(
|
---|
| 1307 | [AC_LANG_PROGRAM([[]], [[]])],
|
---|
| 1308 | [ac_cv_olimit_ok=yes],
|
---|
| 1309 | [ac_cv_olimit_ok=no]
|
---|
| 1310 | )
|
---|
| 1311 | CC="$ac_save_cc"])
|
---|
| 1312 | AC_MSG_RESULT($ac_cv_olimit_ok)
|
---|
| 1313 | if test $ac_cv_olimit_ok = yes; then
|
---|
| 1314 | case $ac_sys_system in
|
---|
| 1315 | # Issue #16534: On HP-UX ac_cv_olimit_ok=yes is a false positive.
|
---|
| 1316 | HP-UX*)
|
---|
| 1317 | ;;
|
---|
| 1318 | *)
|
---|
| 1319 | BASECFLAGS="$BASECFLAGS -Olimit 1500"
|
---|
| 1320 | ;;
|
---|
| 1321 | esac
|
---|
| 1322 | fi
|
---|
| 1323 | fi
|
---|
| 1324 |
|
---|
| 1325 | # Check whether GCC supports PyArg_ParseTuple format
|
---|
| 1326 | if test "$GCC" = "yes"
|
---|
| 1327 | then
|
---|
| 1328 | AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
|
---|
| 1329 | save_CFLAGS=$CFLAGS
|
---|
| 1330 | CFLAGS="$CFLAGS -Werror -Wformat"
|
---|
| 1331 | AC_COMPILE_IFELSE([
|
---|
| 1332 | AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
|
---|
| 1333 | ],[
|
---|
| 1334 | AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1,
|
---|
| 1335 | [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
|
---|
| 1336 | AC_MSG_RESULT(yes)
|
---|
| 1337 | ],[
|
---|
| 1338 | AC_MSG_RESULT(no)
|
---|
| 1339 | ])
|
---|
| 1340 | CFLAGS=$save_CFLAGS
|
---|
| 1341 | fi
|
---|
| 1342 |
|
---|
| 1343 | # On some compilers, pthreads are available without further options
|
---|
| 1344 | # (e.g. MacOS X). On some of these systems, the compiler will not
|
---|
| 1345 | # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
|
---|
| 1346 | # So we have to see first whether pthreads are available without
|
---|
| 1347 | # options before we can check whether -Kpthread improves anything.
|
---|
| 1348 | AC_MSG_CHECKING(whether pthreads are available without options)
|
---|
| 1349 | AC_CACHE_VAL(ac_cv_pthread_is_default,
|
---|
| 1350 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 1351 | #include <stdio.h>
|
---|
| 1352 | #include <pthread.h>
|
---|
| 1353 |
|
---|
| 1354 | void* routine(void* p){return NULL;}
|
---|
| 1355 |
|
---|
| 1356 | int main(){
|
---|
| 1357 | pthread_t p;
|
---|
| 1358 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
---|
| 1359 | return 1;
|
---|
| 1360 | (void)pthread_detach(p);
|
---|
| 1361 | return 0;
|
---|
| 1362 | }
|
---|
| 1363 | ]])],[
|
---|
| 1364 | ac_cv_pthread_is_default=yes
|
---|
| 1365 | ac_cv_kthread=no
|
---|
| 1366 | ac_cv_pthread=no
|
---|
| 1367 | ],[ac_cv_pthread_is_default=no],[ac_cv_pthread_is_default=no])
|
---|
| 1368 | ])
|
---|
| 1369 | AC_MSG_RESULT($ac_cv_pthread_is_default)
|
---|
| 1370 |
|
---|
| 1371 |
|
---|
| 1372 | if test $ac_cv_pthread_is_default = yes
|
---|
| 1373 | then
|
---|
| 1374 | ac_cv_kpthread=no
|
---|
| 1375 | else
|
---|
| 1376 | # -Kpthread, if available, provides the right #defines
|
---|
| 1377 | # and linker options to make pthread_create available
|
---|
| 1378 | # Some compilers won't report that they do not support -Kpthread,
|
---|
| 1379 | # so we need to run a program to see whether it really made the
|
---|
| 1380 | # function available.
|
---|
| 1381 | AC_MSG_CHECKING(whether $CC accepts -Kpthread)
|
---|
| 1382 | AC_CACHE_VAL(ac_cv_kpthread,
|
---|
| 1383 | [ac_save_cc="$CC"
|
---|
| 1384 | CC="$CC -Kpthread"
|
---|
| 1385 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 1386 | #include <stdio.h>
|
---|
| 1387 | #include <pthread.h>
|
---|
| 1388 |
|
---|
| 1389 | void* routine(void* p){return NULL;}
|
---|
| 1390 |
|
---|
| 1391 | int main(){
|
---|
| 1392 | pthread_t p;
|
---|
| 1393 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
---|
| 1394 | return 1;
|
---|
| 1395 | (void)pthread_detach(p);
|
---|
| 1396 | return 0;
|
---|
| 1397 | }
|
---|
| 1398 | ]])],[ac_cv_kpthread=yes],[ac_cv_kpthread=no],[ac_cv_kpthread=no])
|
---|
| 1399 | CC="$ac_save_cc"])
|
---|
| 1400 | AC_MSG_RESULT($ac_cv_kpthread)
|
---|
| 1401 | fi
|
---|
| 1402 |
|
---|
| 1403 | if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
|
---|
| 1404 | then
|
---|
| 1405 | # -Kthread, if available, provides the right #defines
|
---|
| 1406 | # and linker options to make pthread_create available
|
---|
| 1407 | # Some compilers won't report that they do not support -Kthread,
|
---|
| 1408 | # so we need to run a program to see whether it really made the
|
---|
| 1409 | # function available.
|
---|
| 1410 | AC_MSG_CHECKING(whether $CC accepts -Kthread)
|
---|
| 1411 | AC_CACHE_VAL(ac_cv_kthread,
|
---|
| 1412 | [ac_save_cc="$CC"
|
---|
| 1413 | CC="$CC -Kthread"
|
---|
| 1414 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 1415 | #include <stdio.h>
|
---|
| 1416 | #include <pthread.h>
|
---|
| 1417 |
|
---|
| 1418 | void* routine(void* p){return NULL;}
|
---|
| 1419 |
|
---|
| 1420 | int main(){
|
---|
| 1421 | pthread_t p;
|
---|
| 1422 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
---|
| 1423 | return 1;
|
---|
| 1424 | (void)pthread_detach(p);
|
---|
| 1425 | return 0;
|
---|
| 1426 | }
|
---|
| 1427 | ]])],[ac_cv_kthread=yes],[ac_cv_kthread=no],[ac_cv_kthread=no])
|
---|
| 1428 | CC="$ac_save_cc"])
|
---|
| 1429 | AC_MSG_RESULT($ac_cv_kthread)
|
---|
| 1430 | fi
|
---|
| 1431 |
|
---|
| 1432 | if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
|
---|
| 1433 | then
|
---|
| 1434 | # -pthread, if available, provides the right #defines
|
---|
| 1435 | # and linker options to make pthread_create available
|
---|
| 1436 | # Some compilers won't report that they do not support -pthread,
|
---|
| 1437 | # so we need to run a program to see whether it really made the
|
---|
| 1438 | # function available.
|
---|
| 1439 | AC_MSG_CHECKING(whether $CC accepts -pthread)
|
---|
| 1440 | AC_CACHE_VAL(ac_cv_pthread,
|
---|
| 1441 | [ac_save_cc="$CC"
|
---|
| 1442 | CC="$CC -pthread"
|
---|
| 1443 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 1444 | #include <stdio.h>
|
---|
| 1445 | #include <pthread.h>
|
---|
| 1446 |
|
---|
| 1447 | void* routine(void* p){return NULL;}
|
---|
| 1448 |
|
---|
| 1449 | int main(){
|
---|
| 1450 | pthread_t p;
|
---|
| 1451 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
---|
| 1452 | return 1;
|
---|
| 1453 | (void)pthread_detach(p);
|
---|
| 1454 | return 0;
|
---|
| 1455 | }
|
---|
| 1456 | ]])],[ac_cv_pthread=yes],[ac_cv_pthread=no],[ac_cv_pthread=no])
|
---|
| 1457 | CC="$ac_save_cc"])
|
---|
| 1458 | AC_MSG_RESULT($ac_cv_pthread)
|
---|
| 1459 | fi
|
---|
| 1460 |
|
---|
| 1461 | # If we have set a CC compiler flag for thread support then
|
---|
| 1462 | # check if it works for CXX, too.
|
---|
| 1463 | ac_cv_cxx_thread=no
|
---|
| 1464 | if test ! -z "$CXX"
|
---|
| 1465 | then
|
---|
| 1466 | AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
|
---|
| 1467 | ac_save_cxx="$CXX"
|
---|
| 1468 |
|
---|
| 1469 | if test "$ac_cv_kpthread" = "yes"
|
---|
| 1470 | then
|
---|
| 1471 | CXX="$CXX -Kpthread"
|
---|
| 1472 | ac_cv_cxx_thread=yes
|
---|
| 1473 | elif test "$ac_cv_kthread" = "yes"
|
---|
| 1474 | then
|
---|
| 1475 | CXX="$CXX -Kthread"
|
---|
| 1476 | ac_cv_cxx_thread=yes
|
---|
| 1477 | elif test "$ac_cv_pthread" = "yes"
|
---|
| 1478 | then
|
---|
| 1479 | CXX="$CXX -pthread"
|
---|
| 1480 | ac_cv_cxx_thread=yes
|
---|
| 1481 | fi
|
---|
| 1482 |
|
---|
| 1483 | if test $ac_cv_cxx_thread = yes
|
---|
| 1484 | then
|
---|
| 1485 | echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext
|
---|
| 1486 | $CXX -c conftest.$ac_ext 2>&5
|
---|
| 1487 | if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
|
---|
| 1488 | && test -s conftest$ac_exeext && ./conftest$ac_exeext
|
---|
| 1489 | then
|
---|
| 1490 | ac_cv_cxx_thread=yes
|
---|
| 1491 | else
|
---|
| 1492 | ac_cv_cxx_thread=no
|
---|
| 1493 | fi
|
---|
| 1494 | rm -fr conftest*
|
---|
| 1495 | fi
|
---|
| 1496 | AC_MSG_RESULT($ac_cv_cxx_thread)
|
---|
| 1497 | fi
|
---|
| 1498 | CXX="$ac_save_cxx"
|
---|
| 1499 |
|
---|
| 1500 | dnl # check for ANSI or K&R ("traditional") preprocessor
|
---|
| 1501 | dnl AC_MSG_CHECKING(for C preprocessor type)
|
---|
| 1502 | dnl AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 1503 | dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
|
---|
| 1504 | dnl int foo;
|
---|
| 1505 | dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
|
---|
| 1506 | dnl ]], [[;]])],[cpp_type=ansi],[AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional])
|
---|
| 1507 | dnl AC_MSG_RESULT($cpp_type)
|
---|
| 1508 |
|
---|
| 1509 | # checks for header files
|
---|
| 1510 | AC_HEADER_STDC
|
---|
| 1511 | AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
|
---|
| 1512 | fcntl.h grp.h \
|
---|
| 1513 | ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
|
---|
| 1514 | shadow.h signal.h stdint.h stropts.h termios.h thread.h \
|
---|
| 1515 | unistd.h utime.h \
|
---|
| 1516 | sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
|
---|
| 1517 | sys/lock.h sys/mkdev.h sys/modem.h \
|
---|
| 1518 | sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
|
---|
| 1519 | sys/termio.h sys/time.h \
|
---|
| 1520 | sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
|
---|
| 1521 | sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
|
---|
| 1522 | bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h)
|
---|
| 1523 | AC_HEADER_DIRENT
|
---|
| 1524 | AC_HEADER_MAJOR
|
---|
| 1525 |
|
---|
| 1526 | # On Solaris, term.h requires curses.h
|
---|
| 1527 | AC_CHECK_HEADERS(term.h,,,[
|
---|
| 1528 | #ifdef HAVE_CURSES_H
|
---|
| 1529 | #include <curses.h>
|
---|
| 1530 | #endif
|
---|
| 1531 | ])
|
---|
| 1532 |
|
---|
| 1533 | # On Linux, netlink.h requires asm/types.h
|
---|
| 1534 | AC_CHECK_HEADERS(linux/netlink.h,,,[
|
---|
| 1535 | #ifdef HAVE_ASM_TYPES_H
|
---|
| 1536 | #include <asm/types.h>
|
---|
| 1537 | #endif
|
---|
| 1538 | #ifdef HAVE_SYS_SOCKET_H
|
---|
| 1539 | #include <sys/socket.h>
|
---|
| 1540 | #endif
|
---|
| 1541 | ])
|
---|
| 1542 |
|
---|
| 1543 | # checks for typedefs
|
---|
| 1544 | was_it_defined=no
|
---|
| 1545 | AC_MSG_CHECKING(for clock_t in time.h)
|
---|
| 1546 | AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
|
---|
| 1547 | AC_DEFINE(clock_t, long, [Define to 'long' if <time.h> doesn't define.])
|
---|
| 1548 | ])
|
---|
| 1549 | AC_MSG_RESULT($was_it_defined)
|
---|
| 1550 |
|
---|
| 1551 | # Check whether using makedev requires defining _OSF_SOURCE
|
---|
| 1552 | AC_MSG_CHECKING(for makedev)
|
---|
| 1553 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 1554 | #if defined(MAJOR_IN_MKDEV)
|
---|
| 1555 | #include <sys/mkdev.h>
|
---|
| 1556 | #elif defined(MAJOR_IN_SYSMACROS)
|
---|
| 1557 | #include <sys/sysmacros.h>
|
---|
| 1558 | #else
|
---|
| 1559 | #include <sys/types.h>
|
---|
| 1560 | #endif ]], [[ makedev(0, 0) ]])],
|
---|
| 1561 | [ac_cv_has_makedev=yes],
|
---|
| 1562 | [ac_cv_has_makedev=no])
|
---|
| 1563 | if test "$ac_cv_has_makedev" = "no"; then
|
---|
| 1564 | # we didn't link, try if _OSF_SOURCE will allow us to link
|
---|
| 1565 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 1566 | #define _OSF_SOURCE 1
|
---|
| 1567 | #include <sys/types.h>
|
---|
| 1568 | ]], [[ makedev(0, 0) ]])],
|
---|
| 1569 | [ac_cv_has_makedev=yes],
|
---|
| 1570 | [ac_cv_has_makedev=no])
|
---|
| 1571 | if test "$ac_cv_has_makedev" = "yes"; then
|
---|
| 1572 | AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
|
---|
| 1573 | fi
|
---|
| 1574 | fi
|
---|
| 1575 | AC_MSG_RESULT($ac_cv_has_makedev)
|
---|
| 1576 | if test "$ac_cv_has_makedev" = "yes"; then
|
---|
| 1577 | AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
|
---|
| 1578 | fi
|
---|
| 1579 |
|
---|
| 1580 | # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in
|
---|
| 1581 | # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are
|
---|
| 1582 | # defined, but the compiler does not support pragma redefine_extname,
|
---|
| 1583 | # and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit
|
---|
| 1584 | # structures (such as rlimit64) without declaring them. As a
|
---|
| 1585 | # work-around, disable LFS on such configurations
|
---|
| 1586 |
|
---|
| 1587 | use_lfs=yes
|
---|
| 1588 | AC_MSG_CHECKING(Solaris LFS bug)
|
---|
| 1589 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 1590 | #define _LARGEFILE_SOURCE 1
|
---|
| 1591 | #define _FILE_OFFSET_BITS 64
|
---|
| 1592 | #include <sys/resource.h>
|
---|
| 1593 | ]], [[struct rlimit foo;]])],[sol_lfs_bug=no],[sol_lfs_bug=yes])
|
---|
| 1594 | AC_MSG_RESULT($sol_lfs_bug)
|
---|
| 1595 | if test "$sol_lfs_bug" = "yes"; then
|
---|
| 1596 | use_lfs=no
|
---|
| 1597 | fi
|
---|
| 1598 |
|
---|
| 1599 | if test "$use_lfs" = "yes"; then
|
---|
| 1600 | # Two defines needed to enable largefile support on various platforms
|
---|
| 1601 | # These may affect some typedefs
|
---|
| 1602 | case $ac_sys_system/$ac_sys_release in
|
---|
| 1603 | AIX*)
|
---|
| 1604 | AC_DEFINE(_LARGE_FILES, 1,
|
---|
| 1605 | [This must be defined on AIX systems to enable large file support.])
|
---|
| 1606 | ;;
|
---|
| 1607 | esac
|
---|
| 1608 | AC_DEFINE(_LARGEFILE_SOURCE, 1,
|
---|
| 1609 | [This must be defined on some systems to enable large file support.])
|
---|
| 1610 | AC_DEFINE(_FILE_OFFSET_BITS, 64,
|
---|
| 1611 | [This must be set to 64 on some systems to enable large file support.])
|
---|
| 1612 | fi
|
---|
| 1613 |
|
---|
| 1614 | # Add some code to confdefs.h so that the test for off_t works on SCO
|
---|
| 1615 | cat >> confdefs.h <<\EOF
|
---|
| 1616 | #if defined(SCO_DS)
|
---|
| 1617 | #undef _OFF_T
|
---|
| 1618 | #endif
|
---|
| 1619 | EOF
|
---|
| 1620 |
|
---|
| 1621 | # Type availability checks
|
---|
| 1622 | AC_TYPE_MODE_T
|
---|
| 1623 | AC_TYPE_OFF_T
|
---|
| 1624 | AC_TYPE_PID_T
|
---|
| 1625 | AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void])
|
---|
| 1626 | AC_TYPE_SIZE_T
|
---|
| 1627 | AC_TYPE_UID_T
|
---|
| 1628 |
|
---|
| 1629 | # There are two separate checks for each of the exact-width integer types we
|
---|
| 1630 | # need. First we check whether the type is available using the usual
|
---|
| 1631 | # AC_CHECK_TYPE macro with the default includes (which includes <inttypes.h>
|
---|
| 1632 | # and <stdint.h> where available). We then also use the special type checks of
|
---|
| 1633 | # the form AC_TYPE_UINT32_T, which in the case that uint32_t is not available
|
---|
| 1634 | # directly, #define's uint32_t to be a suitable type.
|
---|
| 1635 |
|
---|
| 1636 | AC_CHECK_TYPE(uint32_t,
|
---|
| 1637 | AC_DEFINE(HAVE_UINT32_T, 1, [Define if your compiler provides uint32_t.]),,)
|
---|
| 1638 | AC_TYPE_UINT32_T
|
---|
| 1639 |
|
---|
| 1640 | AC_CHECK_TYPE(uint64_t,
|
---|
| 1641 | AC_DEFINE(HAVE_UINT64_T, 1, [Define if your compiler provides uint64_t.]),,)
|
---|
| 1642 | AC_TYPE_UINT64_T
|
---|
| 1643 |
|
---|
| 1644 | AC_CHECK_TYPE(int32_t,
|
---|
| 1645 | AC_DEFINE(HAVE_INT32_T, 1, [Define if your compiler provides int32_t.]),,)
|
---|
| 1646 | AC_TYPE_INT32_T
|
---|
| 1647 |
|
---|
| 1648 | AC_CHECK_TYPE(int64_t,
|
---|
| 1649 | AC_DEFINE(HAVE_INT64_T, 1, [Define if your compiler provides int64_t.]),,)
|
---|
| 1650 | AC_TYPE_INT64_T
|
---|
| 1651 |
|
---|
| 1652 | AC_CHECK_TYPE(ssize_t,
|
---|
| 1653 | AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,)
|
---|
| 1654 |
|
---|
| 1655 | # Sizes of various common basic types
|
---|
| 1656 | # ANSI C requires sizeof(char) == 1, so no need to check it
|
---|
| 1657 | AC_CHECK_SIZEOF(int, 4)
|
---|
| 1658 | AC_CHECK_SIZEOF(long, 4)
|
---|
| 1659 | AC_CHECK_SIZEOF(void *, 4)
|
---|
| 1660 | AC_CHECK_SIZEOF(short, 2)
|
---|
| 1661 | AC_CHECK_SIZEOF(float, 4)
|
---|
| 1662 | AC_CHECK_SIZEOF(double, 8)
|
---|
| 1663 | AC_CHECK_SIZEOF(fpos_t, 4)
|
---|
| 1664 | AC_CHECK_SIZEOF(size_t, 4)
|
---|
| 1665 | AC_CHECK_SIZEOF(pid_t, 4)
|
---|
| 1666 |
|
---|
| 1667 | AC_MSG_CHECKING(for long long support)
|
---|
| 1668 | have_long_long=no
|
---|
| 1669 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[
|
---|
| 1670 | AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
|
---|
| 1671 | have_long_long=yes
|
---|
| 1672 | ],[])
|
---|
| 1673 | AC_MSG_RESULT($have_long_long)
|
---|
| 1674 | if test "$have_long_long" = yes ; then
|
---|
| 1675 | AC_CHECK_SIZEOF(long long, 8)
|
---|
| 1676 | fi
|
---|
| 1677 |
|
---|
| 1678 | AC_MSG_CHECKING(for long double support)
|
---|
| 1679 | have_long_double=no
|
---|
| 1680 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]])],[
|
---|
| 1681 | AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
|
---|
| 1682 | have_long_double=yes
|
---|
| 1683 | ],[])
|
---|
| 1684 | AC_MSG_RESULT($have_long_double)
|
---|
| 1685 | if test "$have_long_double" = yes ; then
|
---|
| 1686 | AC_CHECK_SIZEOF(long double, 12)
|
---|
| 1687 | fi
|
---|
| 1688 |
|
---|
| 1689 | AC_MSG_CHECKING(for _Bool support)
|
---|
| 1690 | have_c99_bool=no
|
---|
| 1691 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Bool x; x = (_Bool)0;]])],[
|
---|
| 1692 | AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.])
|
---|
| 1693 | have_c99_bool=yes
|
---|
| 1694 | ],[])
|
---|
| 1695 | AC_MSG_RESULT($have_c99_bool)
|
---|
| 1696 | if test "$have_c99_bool" = yes ; then
|
---|
| 1697 | AC_CHECK_SIZEOF(_Bool, 1)
|
---|
| 1698 | fi
|
---|
| 1699 |
|
---|
| 1700 | AC_CHECK_TYPES(uintptr_t,
|
---|
| 1701 | [AC_CHECK_SIZEOF(uintptr_t, 4)],
|
---|
| 1702 | [], [#ifdef HAVE_STDINT_H
|
---|
| 1703 | #include <stdint.h>
|
---|
| 1704 | #endif
|
---|
| 1705 | #ifdef HAVE_INTTYPES_H
|
---|
| 1706 | #include <inttypes.h>
|
---|
| 1707 | #endif])
|
---|
| 1708 |
|
---|
| 1709 | AC_CHECK_SIZEOF(off_t, [], [
|
---|
| 1710 | #ifdef HAVE_SYS_TYPES_H
|
---|
| 1711 | #include <sys/types.h>
|
---|
| 1712 | #endif
|
---|
| 1713 | ])
|
---|
| 1714 |
|
---|
| 1715 | AC_MSG_CHECKING(whether to enable large file support)
|
---|
| 1716 | if test "$have_long_long" = yes
|
---|
| 1717 | then
|
---|
| 1718 | if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
|
---|
| 1719 | "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
|
---|
| 1720 | AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
|
---|
| 1721 | [Defined to enable large file support when an off_t is bigger than a long
|
---|
| 1722 | and long long is available and at least as big as an off_t. You may need
|
---|
| 1723 | to add some flags for configuration and compilation to enable this mode.
|
---|
| 1724 | (For Solaris and Linux, the necessary defines are already defined.)])
|
---|
| 1725 | AC_MSG_RESULT(yes)
|
---|
| 1726 | else
|
---|
| 1727 | AC_MSG_RESULT(no)
|
---|
| 1728 | fi
|
---|
| 1729 | else
|
---|
| 1730 | AC_MSG_RESULT(no)
|
---|
| 1731 | fi
|
---|
| 1732 |
|
---|
| 1733 | AC_CHECK_SIZEOF(time_t, [], [
|
---|
| 1734 | #ifdef HAVE_SYS_TYPES_H
|
---|
| 1735 | #include <sys/types.h>
|
---|
| 1736 | #endif
|
---|
| 1737 | #ifdef HAVE_TIME_H
|
---|
| 1738 | #include <time.h>
|
---|
| 1739 | #endif
|
---|
| 1740 | ])
|
---|
| 1741 |
|
---|
| 1742 | # if have pthread_t then define SIZEOF_PTHREAD_T
|
---|
| 1743 | ac_save_cc="$CC"
|
---|
| 1744 | if test "$ac_cv_kpthread" = "yes"
|
---|
| 1745 | then CC="$CC -Kpthread"
|
---|
| 1746 | elif test "$ac_cv_kthread" = "yes"
|
---|
| 1747 | then CC="$CC -Kthread"
|
---|
| 1748 | elif test "$ac_cv_pthread" = "yes"
|
---|
| 1749 | then CC="$CC -pthread"
|
---|
| 1750 | fi
|
---|
| 1751 | AC_MSG_CHECKING(for pthread_t)
|
---|
| 1752 | have_pthread_t=no
|
---|
| 1753 | AC_COMPILE_IFELSE([
|
---|
| 1754 | AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t x; x = *(pthread_t*)0;]])
|
---|
| 1755 | ],[have_pthread_t=yes],[])
|
---|
| 1756 | AC_MSG_RESULT($have_pthread_t)
|
---|
| 1757 | if test "$have_pthread_t" = yes ; then
|
---|
| 1758 | AC_CHECK_SIZEOF(pthread_t, [], [
|
---|
| 1759 | #ifdef HAVE_PTHREAD_H
|
---|
| 1760 | #include <pthread.h>
|
---|
| 1761 | #endif
|
---|
| 1762 | ])
|
---|
| 1763 | fi
|
---|
| 1764 | CC="$ac_save_cc"
|
---|
| 1765 |
|
---|
| 1766 | AC_MSG_CHECKING(for --enable-toolbox-glue)
|
---|
| 1767 | AC_ARG_ENABLE(toolbox-glue,
|
---|
| 1768 | AS_HELP_STRING([--enable-toolbox-glue], [disable/enable MacOSX glue code for extensions]))
|
---|
| 1769 |
|
---|
| 1770 | if test -z "$enable_toolbox_glue"
|
---|
| 1771 | then
|
---|
| 1772 | case $ac_sys_system/$ac_sys_release in
|
---|
| 1773 | Darwin/*)
|
---|
| 1774 | enable_toolbox_glue="yes";;
|
---|
| 1775 | *)
|
---|
| 1776 | enable_toolbox_glue="no";;
|
---|
| 1777 | esac
|
---|
| 1778 | fi
|
---|
| 1779 | case "$enable_toolbox_glue" in
|
---|
| 1780 | yes)
|
---|
| 1781 | extra_machdep_objs="Python/mactoolboxglue.o"
|
---|
| 1782 | extra_undefs="-u _PyMac_Error"
|
---|
| 1783 | AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE, 1,
|
---|
| 1784 | [Define if you want to use MacPython modules on MacOSX in unix-Python.])
|
---|
| 1785 | ;;
|
---|
| 1786 | *)
|
---|
| 1787 | extra_machdep_objs=""
|
---|
| 1788 | extra_undefs=""
|
---|
| 1789 | ;;
|
---|
| 1790 | esac
|
---|
| 1791 | AC_MSG_RESULT($enable_toolbox_glue)
|
---|
| 1792 |
|
---|
| 1793 |
|
---|
| 1794 | AC_SUBST(OTHER_LIBTOOL_OPT)
|
---|
| 1795 | case $ac_sys_system/$ac_sys_release in
|
---|
| 1796 | Darwin/@<:@01567@:>@\..*)
|
---|
| 1797 | OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
|
---|
| 1798 | ;;
|
---|
| 1799 | Darwin/*)
|
---|
| 1800 | OTHER_LIBTOOL_OPT=""
|
---|
| 1801 | ;;
|
---|
| 1802 | esac
|
---|
| 1803 |
|
---|
| 1804 |
|
---|
| 1805 | AC_SUBST(LIBTOOL_CRUFT)
|
---|
| 1806 | case $ac_sys_system/$ac_sys_release in
|
---|
| 1807 | Darwin/@<:@01567@:>@\..*)
|
---|
| 1808 | LIBTOOL_CRUFT="-framework System -lcc_dynamic"
|
---|
| 1809 | if test "${enable_universalsdk}"; then
|
---|
| 1810 | :
|
---|
| 1811 | else
|
---|
| 1812 | LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `/usr/bin/arch`"
|
---|
| 1813 | fi
|
---|
| 1814 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 1815 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
---|
| 1816 | Darwin/*)
|
---|
| 1817 | gcc_version=`gcc -dumpversion`
|
---|
| 1818 | if test ${gcc_version} '<' 4.0
|
---|
| 1819 | then
|
---|
| 1820 | LIBTOOL_CRUFT="-lcc_dynamic"
|
---|
| 1821 | else
|
---|
| 1822 | LIBTOOL_CRUFT=""
|
---|
| 1823 | fi
|
---|
| 1824 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 1825 | #include <unistd.h>
|
---|
| 1826 | int main(int argc, char*argv[])
|
---|
| 1827 | {
|
---|
| 1828 | if (sizeof(long) == 4) {
|
---|
| 1829 | return 0;
|
---|
| 1830 | } else {
|
---|
| 1831 | return 1;
|
---|
| 1832 | }
|
---|
| 1833 | }
|
---|
| 1834 | ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes])
|
---|
| 1835 |
|
---|
| 1836 | if test "${ac_osx_32bit}" = "yes"; then
|
---|
| 1837 | case `/usr/bin/arch` in
|
---|
| 1838 | i386)
|
---|
| 1839 | MACOSX_DEFAULT_ARCH="i386"
|
---|
| 1840 | ;;
|
---|
| 1841 | ppc)
|
---|
| 1842 | MACOSX_DEFAULT_ARCH="ppc"
|
---|
| 1843 | ;;
|
---|
| 1844 | *)
|
---|
| 1845 | AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
|
---|
| 1846 | ;;
|
---|
| 1847 | esac
|
---|
| 1848 | else
|
---|
| 1849 | case `/usr/bin/arch` in
|
---|
| 1850 | i386)
|
---|
| 1851 | MACOSX_DEFAULT_ARCH="x86_64"
|
---|
| 1852 | ;;
|
---|
| 1853 | ppc)
|
---|
| 1854 | MACOSX_DEFAULT_ARCH="ppc64"
|
---|
| 1855 | ;;
|
---|
| 1856 | *)
|
---|
| 1857 | AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
|
---|
| 1858 | ;;
|
---|
| 1859 | esac
|
---|
| 1860 |
|
---|
| 1861 | #ARCH_RUN_32BIT="true"
|
---|
| 1862 | fi
|
---|
| 1863 |
|
---|
| 1864 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
|
---|
| 1865 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 1866 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
---|
| 1867 | esac
|
---|
| 1868 |
|
---|
| 1869 | AC_MSG_CHECKING(for --enable-framework)
|
---|
| 1870 | if test "$enable_framework"
|
---|
| 1871 | then
|
---|
| 1872 | BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
|
---|
| 1873 | # -F. is needed to allow linking to the framework while
|
---|
| 1874 | # in the build location.
|
---|
| 1875 | AC_DEFINE(WITH_NEXT_FRAMEWORK, 1,
|
---|
| 1876 | [Define if you want to produce an OpenStep/Rhapsody framework
|
---|
| 1877 | (shared library plus accessory files).])
|
---|
| 1878 | AC_MSG_RESULT(yes)
|
---|
| 1879 | if test $enable_shared = "yes"
|
---|
| 1880 | then
|
---|
| 1881 | AC_MSG_ERROR([Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead. See Mac/README.])
|
---|
| 1882 | fi
|
---|
| 1883 | else
|
---|
| 1884 | AC_MSG_RESULT(no)
|
---|
| 1885 | fi
|
---|
| 1886 |
|
---|
| 1887 | AC_MSG_CHECKING(for dyld)
|
---|
| 1888 | case $ac_sys_system/$ac_sys_release in
|
---|
| 1889 | Darwin/*)
|
---|
| 1890 | AC_DEFINE(WITH_DYLD, 1,
|
---|
| 1891 | [Define if you want to use the new-style (Openstep, Rhapsody, MacOS)
|
---|
| 1892 | dynamic linker (dyld) instead of the old-style (NextStep) dynamic
|
---|
| 1893 | linker (rld). Dyld is necessary to support frameworks.])
|
---|
| 1894 | AC_MSG_RESULT(always on for Darwin)
|
---|
| 1895 | ;;
|
---|
| 1896 | *)
|
---|
| 1897 | AC_MSG_RESULT(no)
|
---|
| 1898 | ;;
|
---|
| 1899 | esac
|
---|
| 1900 |
|
---|
| 1901 | # Set info about shared libraries.
|
---|
| 1902 | AC_SUBST(SO)
|
---|
| 1903 | AC_SUBST(LDSHARED)
|
---|
| 1904 | AC_SUBST(LDCXXSHARED)
|
---|
| 1905 | AC_SUBST(BLDSHARED)
|
---|
| 1906 | AC_SUBST(CCSHARED)
|
---|
| 1907 | AC_SUBST(LINKFORSHARED)
|
---|
| 1908 | # SO is the extension of shared libraries `(including the dot!)
|
---|
| 1909 | # -- usually .so, .sl on HP-UX, .dll on Cygwin
|
---|
| 1910 | AC_MSG_CHECKING(SO)
|
---|
| 1911 | if test -z "$SO"
|
---|
| 1912 | then
|
---|
| 1913 | case $ac_sys_system in
|
---|
| 1914 | hp*|HP*)
|
---|
| 1915 | case `uname -m` in
|
---|
| 1916 | ia64) SO=.so;;
|
---|
| 1917 | *) SO=.sl;;
|
---|
| 1918 | esac
|
---|
| 1919 | ;;
|
---|
| 1920 | CYGWIN*) SO=.dll;;
|
---|
| 1921 | *) SO=.so;;
|
---|
| 1922 | esac
|
---|
| 1923 | else
|
---|
| 1924 | # this might also be a termcap variable, see #610332
|
---|
| 1925 | echo
|
---|
| 1926 | echo '====================================================================='
|
---|
| 1927 | echo '+ +'
|
---|
| 1928 | echo '+ WARNING: You have set SO in your environment. +'
|
---|
| 1929 | echo '+ Do you really mean to change the extension for shared libraries? +'
|
---|
| 1930 | echo '+ Continuing in 10 seconds to let you to ponder. +'
|
---|
| 1931 | echo '+ +'
|
---|
| 1932 | echo '====================================================================='
|
---|
| 1933 | sleep 10
|
---|
| 1934 | fi
|
---|
| 1935 | AC_MSG_RESULT($SO)
|
---|
| 1936 |
|
---|
| 1937 | AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
|
---|
| 1938 | # LDSHARED is the ld *command* used to create shared library
|
---|
| 1939 | # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
|
---|
| 1940 | # (Shared libraries in this instance are shared modules to be loaded into
|
---|
| 1941 | # Python, as opposed to building Python itself as a shared library.)
|
---|
| 1942 | AC_MSG_CHECKING(LDSHARED)
|
---|
| 1943 | if test -z "$LDSHARED"
|
---|
| 1944 | then
|
---|
| 1945 | case $ac_sys_system/$ac_sys_release in
|
---|
| 1946 | AIX*)
|
---|
| 1947 | BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
|
---|
| 1948 | LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
|
---|
| 1949 | ;;
|
---|
| 1950 | BeOS*)
|
---|
| 1951 | BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
|
---|
| 1952 | LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
|
---|
| 1953 | ;;
|
---|
| 1954 | IRIX/5*) LDSHARED="ld -shared";;
|
---|
| 1955 | IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
|
---|
| 1956 | SunOS/5*)
|
---|
| 1957 | if test "$GCC" = "yes" ; then
|
---|
| 1958 | LDSHARED='$(CC) -shared'
|
---|
| 1959 | LDCXXSHARED='$(CXX) -shared'
|
---|
| 1960 | else
|
---|
| 1961 | LDSHARED='$(CC) -G'
|
---|
| 1962 | LDCXXSHARED='$(CXX) -G'
|
---|
| 1963 | fi ;;
|
---|
| 1964 | hp*|HP*)
|
---|
| 1965 | if test "$GCC" = "yes" ; then
|
---|
| 1966 | LDSHARED='$(CC) -shared'
|
---|
| 1967 | LDCXXSHARED='$(CXX) -shared'
|
---|
| 1968 | else
|
---|
| 1969 | LDSHARED='ld -b'
|
---|
| 1970 | fi ;;
|
---|
| 1971 | OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
|
---|
| 1972 | Darwin/1.3*)
|
---|
| 1973 | LDSHARED='$(CC) -bundle'
|
---|
| 1974 | LDCXXSHARED='$(CXX) -bundle'
|
---|
| 1975 | if test "$enable_framework" ; then
|
---|
| 1976 | # Link against the framework. All externals should be defined.
|
---|
| 1977 | BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 1978 | LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 1979 | LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 1980 | else
|
---|
| 1981 | # No framework. Ignore undefined symbols, assuming they come from Python
|
---|
| 1982 | LDSHARED="$LDSHARED -undefined suppress"
|
---|
| 1983 | LDCXXSHARED="$LDCXXSHARED -undefined suppress"
|
---|
| 1984 | fi ;;
|
---|
| 1985 | Darwin/1.4*|Darwin/5.*|Darwin/6.*)
|
---|
| 1986 | LDSHARED='$(CC) -bundle'
|
---|
| 1987 | LDCXXSHARED='$(CXX) -bundle'
|
---|
| 1988 | if test "$enable_framework" ; then
|
---|
| 1989 | # Link against the framework. All externals should be defined.
|
---|
| 1990 | BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 1991 | LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 1992 | LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 1993 | else
|
---|
| 1994 | # No framework, use the Python app as bundle-loader
|
---|
| 1995 | BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
|
---|
| 1996 | LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
|
---|
| 1997 | LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
|
---|
| 1998 | fi ;;
|
---|
| 1999 | Darwin/*)
|
---|
| 2000 | # Use -undefined dynamic_lookup whenever possible (10.3 and later).
|
---|
| 2001 | # This allows an extension to be used in any Python
|
---|
| 2002 |
|
---|
| 2003 | if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
|
---|
| 2004 | then
|
---|
| 2005 | if test "${enable_universalsdk}"; then
|
---|
| 2006 | LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
---|
| 2007 | fi
|
---|
| 2008 | LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
|
---|
| 2009 | LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
|
---|
| 2010 | BLDSHARED="$LDSHARED"
|
---|
| 2011 | else
|
---|
| 2012 | LDSHARED='$(CC) -bundle'
|
---|
| 2013 | LDCXXSHARED='$(CXX) -bundle'
|
---|
| 2014 | if test "$enable_framework" ; then
|
---|
| 2015 | # Link against the framework. All externals should be defined.
|
---|
| 2016 | BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 2017 | LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 2018 | LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 2019 | else
|
---|
| 2020 | # No framework, use the Python app as bundle-loader
|
---|
| 2021 | BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
|
---|
| 2022 | LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
|
---|
| 2023 | LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
|
---|
| 2024 | fi
|
---|
| 2025 | fi
|
---|
| 2026 | ;;
|
---|
| 2027 | Linux*|GNU*|QNX*)
|
---|
| 2028 | LDSHARED='$(CC) -shared'
|
---|
| 2029 | LDCXXSHARED='$(CXX) -shared';;
|
---|
| 2030 | BSD/OS*/4*)
|
---|
| 2031 | LDSHARED="gcc -shared"
|
---|
| 2032 | LDCXXSHARED="g++ -shared";;
|
---|
| 2033 | FreeBSD*)
|
---|
| 2034 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
---|
| 2035 | then
|
---|
| 2036 | LDSHARED='$(CC) -shared'
|
---|
| 2037 | LDCXXSHARED='$(CXX) -shared'
|
---|
| 2038 | else
|
---|
| 2039 | LDSHARED="ld -Bshareable"
|
---|
| 2040 | fi;;
|
---|
| 2041 | OpenBSD*)
|
---|
| 2042 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
---|
| 2043 | then
|
---|
| 2044 | LDSHARED='$(CC) -shared $(CCSHARED)'
|
---|
| 2045 | LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
|
---|
| 2046 | else
|
---|
| 2047 | case `uname -r` in
|
---|
| 2048 | [[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
|
---|
| 2049 | LDSHARED="ld -Bshareable ${LDFLAGS}"
|
---|
| 2050 | ;;
|
---|
| 2051 | *)
|
---|
| 2052 | LDSHARED='$(CC) -shared $(CCSHARED)'
|
---|
| 2053 | LDCXXSHARED='$(CXX) -shared $(CCSHARED)'
|
---|
| 2054 | ;;
|
---|
| 2055 | esac
|
---|
| 2056 | fi;;
|
---|
| 2057 | NetBSD*|DragonFly*)
|
---|
| 2058 | LDSHARED='$(CC) -shared'
|
---|
| 2059 | LDCXXSHARED='$(CXX) -shared';;
|
---|
| 2060 | OpenUNIX*|UnixWare*)
|
---|
| 2061 | if test "$GCC" = "yes" ; then
|
---|
| 2062 | LDSHARED='$(CC) -shared'
|
---|
| 2063 | LDCXXSHARED='$(CXX) -shared'
|
---|
| 2064 | else
|
---|
| 2065 | LDSHARED='$(CC) -G'
|
---|
| 2066 | LDCXXSHARED='$(CXX) -G'
|
---|
| 2067 | fi;;
|
---|
| 2068 | SCO_SV*)
|
---|
| 2069 | LDSHARED='$(CC) -Wl,-G,-Bexport'
|
---|
| 2070 | LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
|
---|
| 2071 | CYGWIN*)
|
---|
| 2072 | LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
|
---|
| 2073 | LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
|
---|
| 2074 | atheos*)
|
---|
| 2075 | LDSHARED="gcc -shared"
|
---|
| 2076 | LDCXXSHARED="g++ -shared";;
|
---|
| 2077 | *) LDSHARED="ld";;
|
---|
| 2078 | esac
|
---|
| 2079 | fi
|
---|
| 2080 | AC_MSG_RESULT($LDSHARED)
|
---|
| 2081 | LDCXXSHARED=${LDCXXSHARED-$LDSHARED}
|
---|
| 2082 | BLDSHARED=${BLDSHARED-$LDSHARED}
|
---|
| 2083 | # CCSHARED are the C *flags* used to create objects to go into a shared
|
---|
| 2084 | # library (module) -- this is only needed for a few systems
|
---|
| 2085 | AC_MSG_CHECKING(CCSHARED)
|
---|
| 2086 | if test -z "$CCSHARED"
|
---|
| 2087 | then
|
---|
| 2088 | case $ac_sys_system/$ac_sys_release in
|
---|
| 2089 | SunOS*) if test "$GCC" = yes;
|
---|
| 2090 | then CCSHARED="-fPIC";
|
---|
| 2091 | elif test `uname -p` = sparc;
|
---|
| 2092 | then CCSHARED="-xcode=pic32";
|
---|
| 2093 | else CCSHARED="-Kpic";
|
---|
| 2094 | fi;;
|
---|
| 2095 | hp*|HP*) if test "$GCC" = yes;
|
---|
| 2096 | then CCSHARED="-fPIC";
|
---|
| 2097 | else CCSHARED="+z";
|
---|
| 2098 | fi;;
|
---|
| 2099 | Linux*|GNU*) CCSHARED="-fPIC";;
|
---|
| 2100 | BSD/OS*/4*) CCSHARED="-fpic";;
|
---|
| 2101 | FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
|
---|
| 2102 | OpenUNIX*|UnixWare*)
|
---|
| 2103 | if test "$GCC" = "yes"
|
---|
| 2104 | then CCSHARED="-fPIC"
|
---|
| 2105 | else CCSHARED="-KPIC"
|
---|
| 2106 | fi;;
|
---|
| 2107 | SCO_SV*)
|
---|
| 2108 | if test "$GCC" = "yes"
|
---|
| 2109 | then CCSHARED="-fPIC"
|
---|
| 2110 | else CCSHARED="-Kpic -belf"
|
---|
| 2111 | fi;;
|
---|
| 2112 | IRIX*/6*) case $CC in
|
---|
| 2113 | *gcc*) CCSHARED="-shared";;
|
---|
| 2114 | *) CCSHARED="";;
|
---|
| 2115 | esac;;
|
---|
| 2116 | atheos*) CCSHARED="-fPIC";;
|
---|
| 2117 | esac
|
---|
| 2118 | fi
|
---|
| 2119 | AC_MSG_RESULT($CCSHARED)
|
---|
| 2120 | # LINKFORSHARED are the flags passed to the $(CC) command that links
|
---|
| 2121 | # the python executable -- this is only needed for a few systems
|
---|
| 2122 | AC_MSG_CHECKING(LINKFORSHARED)
|
---|
| 2123 | if test -z "$LINKFORSHARED"
|
---|
| 2124 | then
|
---|
| 2125 | case $ac_sys_system/$ac_sys_release in
|
---|
| 2126 | AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
|
---|
| 2127 | hp*|HP*)
|
---|
| 2128 | LINKFORSHARED="-Wl,-E -Wl,+s";;
|
---|
| 2129 | # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
|
---|
| 2130 | BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
---|
| 2131 | Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
---|
| 2132 | # -u libsys_s pulls in all symbols in libsys
|
---|
| 2133 | Darwin/*)
|
---|
| 2134 | # -u _PyMac_Error is needed to pull in the mac toolbox glue,
|
---|
| 2135 | # which is
|
---|
| 2136 | # not used by the core itself but which needs to be in the core so
|
---|
| 2137 | # that dynamically loaded extension modules have access to it.
|
---|
| 2138 | # -prebind is no longer used, because it actually seems to give a
|
---|
| 2139 | # slowdown in stead of a speedup, maybe due to the large number of
|
---|
| 2140 | # dynamic loads Python does.
|
---|
| 2141 |
|
---|
| 2142 | LINKFORSHARED="$extra_undefs"
|
---|
| 2143 | if test "$enable_framework"
|
---|
| 2144 | then
|
---|
| 2145 | LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
---|
| 2146 | fi
|
---|
| 2147 | LINKFORSHARED="$LINKFORSHARED";;
|
---|
| 2148 | OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
|
---|
| 2149 | SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
|
---|
| 2150 | ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
|
---|
| 2151 | FreeBSD*|NetBSD*|OpenBSD*|DragonFly*)
|
---|
| 2152 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
---|
| 2153 | then
|
---|
| 2154 | LINKFORSHARED="-Wl,--export-dynamic"
|
---|
| 2155 | fi;;
|
---|
| 2156 | SunOS/5*) case $CC in
|
---|
| 2157 | *gcc*)
|
---|
| 2158 | if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
|
---|
| 2159 | then
|
---|
| 2160 | LINKFORSHARED="-Xlinker --export-dynamic"
|
---|
| 2161 | fi;;
|
---|
| 2162 | esac;;
|
---|
| 2163 | CYGWIN*)
|
---|
| 2164 | if test $enable_shared = "no"
|
---|
| 2165 | then
|
---|
| 2166 | LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
|
---|
| 2167 | fi;;
|
---|
| 2168 | QNX*)
|
---|
| 2169 | # -Wl,-E causes the symbols to be added to the dynamic
|
---|
| 2170 | # symbol table so that they can be found when a module
|
---|
| 2171 | # is loaded. -N 2048K causes the stack size to be set
|
---|
| 2172 | # to 2048 kilobytes so that the stack doesn't overflow
|
---|
| 2173 | # when running test_compile.py.
|
---|
| 2174 | LINKFORSHARED='-Wl,-E -N 2048K';;
|
---|
| 2175 | esac
|
---|
| 2176 | fi
|
---|
| 2177 | AC_MSG_RESULT($LINKFORSHARED)
|
---|
| 2178 |
|
---|
| 2179 |
|
---|
| 2180 | AC_SUBST(CFLAGSFORSHARED)
|
---|
| 2181 | AC_MSG_CHECKING(CFLAGSFORSHARED)
|
---|
| 2182 | if test ! "$LIBRARY" = "$LDLIBRARY"
|
---|
| 2183 | then
|
---|
| 2184 | case $ac_sys_system in
|
---|
| 2185 | CYGWIN*)
|
---|
| 2186 | # Cygwin needs CCSHARED when building extension DLLs
|
---|
| 2187 | # but not when building the interpreter DLL.
|
---|
| 2188 | CFLAGSFORSHARED='';;
|
---|
| 2189 | *)
|
---|
| 2190 | CFLAGSFORSHARED='$(CCSHARED)'
|
---|
| 2191 | esac
|
---|
| 2192 | fi
|
---|
| 2193 | AC_MSG_RESULT($CFLAGSFORSHARED)
|
---|
| 2194 |
|
---|
| 2195 | # SHLIBS are libraries (except -lc and -lm) to link to the python shared
|
---|
| 2196 | # library (with --enable-shared).
|
---|
| 2197 | # For platforms on which shared libraries are not allowed to have unresolved
|
---|
| 2198 | # symbols, this must be set to $(LIBS) (expanded by make). We do this even
|
---|
| 2199 | # if it is not required, since it creates a dependency of the shared library
|
---|
| 2200 | # to LIBS. This, in turn, means that applications linking the shared libpython
|
---|
| 2201 | # don't need to link LIBS explicitly. The default should be only changed
|
---|
| 2202 | # on systems where this approach causes problems.
|
---|
| 2203 | AC_SUBST(SHLIBS)
|
---|
| 2204 | AC_MSG_CHECKING(SHLIBS)
|
---|
| 2205 | case "$ac_sys_system" in
|
---|
| 2206 | *)
|
---|
| 2207 | SHLIBS='$(LIBS)';;
|
---|
| 2208 | esac
|
---|
| 2209 | AC_MSG_RESULT($SHLIBS)
|
---|
| 2210 |
|
---|
| 2211 |
|
---|
| 2212 | # checks for libraries
|
---|
| 2213 | AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
|
---|
| 2214 | AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
|
---|
| 2215 |
|
---|
| 2216 | # only check for sem_init if thread support is requested
|
---|
| 2217 | if test "$with_threads" = "yes" -o -z "$with_threads"; then
|
---|
| 2218 | AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
|
---|
| 2219 | # posix4 on Solaris 2.6
|
---|
| 2220 | # pthread (first!) on Linux
|
---|
| 2221 | fi
|
---|
| 2222 |
|
---|
| 2223 | # check if we need libintl for locale functions
|
---|
| 2224 | AC_CHECK_LIB(intl, textdomain,
|
---|
| 2225 | AC_DEFINE(WITH_LIBINTL, 1,
|
---|
| 2226 | [Define to 1 if libintl is needed for locale functions.]))
|
---|
| 2227 |
|
---|
| 2228 | # checks for system dependent C++ extensions support
|
---|
| 2229 | case "$ac_sys_system" in
|
---|
| 2230 | AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support)
|
---|
| 2231 | AC_LINK_IFELSE([
|
---|
| 2232 | AC_LANG_PROGRAM([[#include <load.h>]],
|
---|
| 2233 | [[loadAndInit("", 0, "")]])
|
---|
| 2234 | ],[
|
---|
| 2235 | AC_DEFINE(AIX_GENUINE_CPLUSPLUS, 1,
|
---|
| 2236 | [Define for AIX if your compiler is a genuine IBM xlC/xlC_r
|
---|
| 2237 | and you want support for AIX C++ shared extension modules.])
|
---|
| 2238 | AC_MSG_RESULT(yes)
|
---|
| 2239 | ],[
|
---|
| 2240 | AC_MSG_RESULT(no)
|
---|
| 2241 | ]);;
|
---|
| 2242 | *) ;;
|
---|
| 2243 | esac
|
---|
| 2244 |
|
---|
| 2245 | # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
|
---|
| 2246 | # BeOS' sockets are stashed in libnet.
|
---|
| 2247 | AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
|
---|
| 2248 | AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
|
---|
| 2249 |
|
---|
| 2250 | case "$ac_sys_system" in
|
---|
| 2251 | BeOS*)
|
---|
| 2252 | AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
|
---|
| 2253 | ;;
|
---|
| 2254 | esac
|
---|
| 2255 |
|
---|
| 2256 | AC_MSG_CHECKING(for --with-libs)
|
---|
| 2257 | AC_ARG_WITH(libs,
|
---|
| 2258 | AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]),
|
---|
| 2259 | [
|
---|
| 2260 | AC_MSG_RESULT($withval)
|
---|
| 2261 | LIBS="$withval $LIBS"
|
---|
| 2262 | ],
|
---|
| 2263 | [AC_MSG_RESULT(no)])
|
---|
| 2264 |
|
---|
| 2265 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
---|
| 2266 |
|
---|
| 2267 | # Check for use of the system expat library
|
---|
| 2268 | AC_MSG_CHECKING(for --with-system-expat)
|
---|
| 2269 | AC_ARG_WITH(system_expat,
|
---|
| 2270 | AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]),
|
---|
| 2271 | [],
|
---|
| 2272 | [with_system_expat="no"])
|
---|
| 2273 |
|
---|
| 2274 | AC_MSG_RESULT($with_system_expat)
|
---|
| 2275 |
|
---|
| 2276 | # Check for use of the system libffi library
|
---|
| 2277 | AC_MSG_CHECKING(for --with-system-ffi)
|
---|
| 2278 | AC_ARG_WITH(system_ffi,
|
---|
| 2279 | AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library]),
|
---|
| 2280 | [],
|
---|
| 2281 | [with_system_ffi="no"])
|
---|
| 2282 |
|
---|
| 2283 | if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
|
---|
| 2284 | LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
|
---|
| 2285 | else
|
---|
| 2286 | LIBFFI_INCLUDEDIR=""
|
---|
| 2287 | fi
|
---|
| 2288 | AC_SUBST(LIBFFI_INCLUDEDIR)
|
---|
| 2289 |
|
---|
| 2290 | AC_MSG_RESULT($with_system_ffi)
|
---|
| 2291 |
|
---|
| 2292 | # Check for --with-tcltk-includes=path and --with-tcltk-libs=path
|
---|
| 2293 | AC_SUBST(TCLTK_INCLUDES)
|
---|
| 2294 | AC_SUBST(TCLTK_LIBS)
|
---|
| 2295 | AC_MSG_CHECKING(for --with-tcltk-includes)
|
---|
| 2296 | AC_ARG_WITH(tcltk-includes,
|
---|
| 2297 | AS_HELP_STRING([--with-tcltk-includes='-I...'], [override search for Tcl and Tk include files]),
|
---|
| 2298 | [],
|
---|
| 2299 | [with_tcltk_includes="default"])
|
---|
| 2300 | AC_MSG_RESULT($with_tcltk_includes)
|
---|
| 2301 | AC_MSG_CHECKING(for --with-tcltk-libs)
|
---|
| 2302 | AC_ARG_WITH(tcltk-libs,
|
---|
| 2303 | AS_HELP_STRING([--with-tcltk-libs='-L...'], [override search for Tcl and Tk libs]),
|
---|
| 2304 | [],
|
---|
| 2305 | [with_tcltk_libs="default"])
|
---|
| 2306 | AC_MSG_RESULT($with_tcltk_libs)
|
---|
| 2307 | if test "x$with_tcltk_includes" = xdefault || test "x$with_tcltk_libs" = xdefault
|
---|
| 2308 | then
|
---|
| 2309 | if test "x$with_tcltk_includes" != "x$with_tcltk_libs"
|
---|
| 2310 | then
|
---|
| 2311 | AC_MSG_ERROR([use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither])
|
---|
| 2312 | fi
|
---|
| 2313 | TCLTK_INCLUDES=""
|
---|
| 2314 | TCLTK_LIBS=""
|
---|
| 2315 | else
|
---|
| 2316 | TCLTK_INCLUDES="$with_tcltk_includes"
|
---|
| 2317 | TCLTK_LIBS="$with_tcltk_libs"
|
---|
| 2318 | fi
|
---|
| 2319 |
|
---|
| 2320 | # Check for --with-dbmliborder
|
---|
| 2321 | AC_MSG_CHECKING(for --with-dbmliborder)
|
---|
| 2322 | AC_ARG_WITH(dbmliborder,
|
---|
| 2323 | AS_HELP_STRING([--with-dbmliborder=db1:db2:...], [order to check db backends for dbm. Valid value is a colon separated string with the backend names `ndbm', `gdbm' and `bdb'.]),
|
---|
| 2324 | [
|
---|
| 2325 | if test x$with_dbmliborder = xyes
|
---|
| 2326 | then
|
---|
| 2327 | AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...])
|
---|
| 2328 | else
|
---|
| 2329 | for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do
|
---|
| 2330 | if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb
|
---|
| 2331 | then
|
---|
| 2332 | AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...])
|
---|
| 2333 | fi
|
---|
| 2334 | done
|
---|
| 2335 | fi])
|
---|
| 2336 | AC_MSG_RESULT($with_dbmliborder)
|
---|
| 2337 |
|
---|
| 2338 | # Determine if signalmodule should be used.
|
---|
| 2339 | AC_SUBST(USE_SIGNAL_MODULE)
|
---|
| 2340 | AC_SUBST(SIGNAL_OBJS)
|
---|
| 2341 | AC_MSG_CHECKING(for --with-signal-module)
|
---|
| 2342 | AC_ARG_WITH(signal-module,
|
---|
| 2343 | AS_HELP_STRING([--with-signal-module], [disable/enable signal module]))
|
---|
| 2344 |
|
---|
| 2345 | if test -z "$with_signal_module"
|
---|
| 2346 | then with_signal_module="yes"
|
---|
| 2347 | fi
|
---|
| 2348 | AC_MSG_RESULT($with_signal_module)
|
---|
| 2349 |
|
---|
| 2350 | if test "${with_signal_module}" = "yes"; then
|
---|
| 2351 | USE_SIGNAL_MODULE=""
|
---|
| 2352 | SIGNAL_OBJS=""
|
---|
| 2353 | else
|
---|
| 2354 | USE_SIGNAL_MODULE="#"
|
---|
| 2355 | SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o"
|
---|
| 2356 | fi
|
---|
| 2357 |
|
---|
| 2358 | # This is used to generate Setup.config
|
---|
| 2359 | AC_SUBST(USE_THREAD_MODULE)
|
---|
| 2360 | USE_THREAD_MODULE=""
|
---|
| 2361 |
|
---|
| 2362 | AC_MSG_CHECKING(for --with-dec-threads)
|
---|
| 2363 | AC_SUBST(LDLAST)
|
---|
| 2364 | AC_ARG_WITH(dec-threads,
|
---|
| 2365 | AS_HELP_STRING([--with-dec-threads], [use DEC Alpha/OSF1 thread-safe libraries]),
|
---|
| 2366 | [
|
---|
| 2367 | AC_MSG_RESULT($withval)
|
---|
| 2368 | LDLAST=-threads
|
---|
| 2369 | if test "${with_thread+set}" != set; then
|
---|
| 2370 | with_thread="$withval";
|
---|
| 2371 | fi],
|
---|
| 2372 | [AC_MSG_RESULT(no)])
|
---|
| 2373 |
|
---|
| 2374 | # Templates for things AC_DEFINEd more than once.
|
---|
| 2375 | # For a single AC_DEFINE, no template is needed.
|
---|
| 2376 | AH_TEMPLATE(C_THREADS,[Define if you have the Mach cthreads package])
|
---|
| 2377 | AH_TEMPLATE(_REENTRANT,
|
---|
| 2378 | [Define to force use of thread-safe errno, h_errno, and other functions])
|
---|
| 2379 | AH_TEMPLATE(WITH_THREAD,
|
---|
| 2380 | [Define if you want to compile in rudimentary thread support])
|
---|
| 2381 |
|
---|
| 2382 | AC_MSG_CHECKING(for --with-threads)
|
---|
| 2383 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
---|
| 2384 | AC_ARG_WITH(threads,
|
---|
| 2385 | AS_HELP_STRING([--with(out)-threads@<:@=DIRECTORY@:>@], [disable/enable thread support]))
|
---|
| 2386 |
|
---|
| 2387 | # --with-thread is deprecated, but check for it anyway
|
---|
| 2388 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
---|
| 2389 | AC_ARG_WITH(thread,
|
---|
| 2390 | AS_HELP_STRING([--with(out)-thread@<:@=DIRECTORY@:>@], [deprecated; use --with(out)-threads]),
|
---|
| 2391 | [with_threads=$with_thread])
|
---|
| 2392 |
|
---|
| 2393 | if test -z "$with_threads"
|
---|
| 2394 | then with_threads="yes"
|
---|
| 2395 | fi
|
---|
| 2396 | AC_MSG_RESULT($with_threads)
|
---|
| 2397 |
|
---|
| 2398 | AC_SUBST(THREADOBJ)
|
---|
| 2399 | if test "$with_threads" = "no"
|
---|
| 2400 | then
|
---|
| 2401 | USE_THREAD_MODULE="#"
|
---|
| 2402 | elif test "$ac_cv_pthread_is_default" = yes
|
---|
| 2403 | then
|
---|
| 2404 | AC_DEFINE(WITH_THREAD)
|
---|
| 2405 | # Defining _REENTRANT on system with POSIX threads should not hurt.
|
---|
| 2406 | AC_DEFINE(_REENTRANT)
|
---|
| 2407 | posix_threads=yes
|
---|
| 2408 | THREADOBJ="Python/thread.o"
|
---|
| 2409 | elif test "$ac_cv_kpthread" = "yes"
|
---|
| 2410 | then
|
---|
| 2411 | CC="$CC -Kpthread"
|
---|
| 2412 | if test "$ac_cv_cxx_thread" = "yes"; then
|
---|
| 2413 | CXX="$CXX -Kpthread"
|
---|
| 2414 | fi
|
---|
| 2415 | AC_DEFINE(WITH_THREAD)
|
---|
| 2416 | posix_threads=yes
|
---|
| 2417 | THREADOBJ="Python/thread.o"
|
---|
| 2418 | elif test "$ac_cv_kthread" = "yes"
|
---|
| 2419 | then
|
---|
| 2420 | CC="$CC -Kthread"
|
---|
| 2421 | if test "$ac_cv_cxx_thread" = "yes"; then
|
---|
| 2422 | CXX="$CXX -Kthread"
|
---|
| 2423 | fi
|
---|
| 2424 | AC_DEFINE(WITH_THREAD)
|
---|
| 2425 | posix_threads=yes
|
---|
| 2426 | THREADOBJ="Python/thread.o"
|
---|
| 2427 | elif test "$ac_cv_pthread" = "yes"
|
---|
| 2428 | then
|
---|
| 2429 | CC="$CC -pthread"
|
---|
| 2430 | if test "$ac_cv_cxx_thread" = "yes"; then
|
---|
| 2431 | CXX="$CXX -pthread"
|
---|
| 2432 | fi
|
---|
| 2433 | AC_DEFINE(WITH_THREAD)
|
---|
| 2434 | posix_threads=yes
|
---|
| 2435 | THREADOBJ="Python/thread.o"
|
---|
| 2436 | else
|
---|
| 2437 | if test ! -z "$with_threads" -a -d "$with_threads"
|
---|
| 2438 | then LDFLAGS="$LDFLAGS -L$with_threads"
|
---|
| 2439 | fi
|
---|
| 2440 | if test ! -z "$withval" -a -d "$withval"
|
---|
| 2441 | then LDFLAGS="$LDFLAGS -L$withval"
|
---|
| 2442 | fi
|
---|
| 2443 |
|
---|
| 2444 | # According to the POSIX spec, a pthreads implementation must
|
---|
| 2445 | # define _POSIX_THREADS in unistd.h. Some apparently don't
|
---|
| 2446 | # (e.g. gnu pth with pthread emulation)
|
---|
| 2447 | AC_MSG_CHECKING(for _POSIX_THREADS in unistd.h)
|
---|
| 2448 | AC_EGREP_CPP(yes,
|
---|
| 2449 | [
|
---|
| 2450 | #include <unistd.h>
|
---|
| 2451 | #ifdef _POSIX_THREADS
|
---|
| 2452 | yes
|
---|
| 2453 | #endif
|
---|
| 2454 | ], unistd_defines_pthreads=yes, unistd_defines_pthreads=no)
|
---|
| 2455 | AC_MSG_RESULT($unistd_defines_pthreads)
|
---|
| 2456 |
|
---|
| 2457 | AC_DEFINE(_REENTRANT)
|
---|
| 2458 | AC_CHECK_HEADER(cthreads.h, [AC_DEFINE(WITH_THREAD)
|
---|
| 2459 | AC_DEFINE(C_THREADS)
|
---|
| 2460 | AC_DEFINE(HURD_C_THREADS, 1,
|
---|
| 2461 | [Define if you are using Mach cthreads directly under /include])
|
---|
| 2462 | LIBS="$LIBS -lthreads"
|
---|
| 2463 | THREADOBJ="Python/thread.o"],[
|
---|
| 2464 | AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
|
---|
| 2465 | AC_DEFINE(C_THREADS)
|
---|
| 2466 | AC_DEFINE(MACH_C_THREADS, 1,
|
---|
| 2467 | [Define if you are using Mach cthreads under mach /])
|
---|
| 2468 | THREADOBJ="Python/thread.o"],[
|
---|
| 2469 | AC_MSG_CHECKING(for --with-pth)
|
---|
| 2470 | AC_ARG_WITH([pth],
|
---|
| 2471 | AS_HELP_STRING([--with-pth], [use GNU pth threading libraries]),
|
---|
| 2472 | [AC_MSG_RESULT($withval)
|
---|
| 2473 | AC_DEFINE([WITH_THREAD])
|
---|
| 2474 | AC_DEFINE([HAVE_PTH], 1,
|
---|
| 2475 | [Define if you have GNU PTH threads.])
|
---|
| 2476 | LIBS="-lpth $LIBS"
|
---|
| 2477 | THREADOBJ="Python/thread.o"],
|
---|
| 2478 | [AC_MSG_RESULT(no)
|
---|
| 2479 |
|
---|
| 2480 | # Just looking for pthread_create in libpthread is not enough:
|
---|
| 2481 | # on HP/UX, pthread.h renames pthread_create to a different symbol name.
|
---|
| 2482 | # So we really have to include pthread.h, and then link.
|
---|
| 2483 | _libs=$LIBS
|
---|
| 2484 | LIBS="$LIBS -lpthread"
|
---|
| 2485 | AC_MSG_CHECKING([for pthread_create in -lpthread])
|
---|
| 2486 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 2487 | #include <stdio.h>
|
---|
| 2488 | #include <pthread.h>
|
---|
| 2489 |
|
---|
| 2490 | void * start_routine (void *arg) { exit (0); }]], [[
|
---|
| 2491 | pthread_create (NULL, NULL, start_routine, NULL)]])],[
|
---|
| 2492 | AC_MSG_RESULT(yes)
|
---|
| 2493 | AC_DEFINE(WITH_THREAD)
|
---|
| 2494 | posix_threads=yes
|
---|
| 2495 | THREADOBJ="Python/thread.o"],[
|
---|
| 2496 | LIBS=$_libs
|
---|
| 2497 | AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
|
---|
| 2498 | posix_threads=yes
|
---|
| 2499 | THREADOBJ="Python/thread.o"],[
|
---|
| 2500 | AC_CHECK_HEADER(atheos/threads.h, [AC_DEFINE(WITH_THREAD)
|
---|
| 2501 | AC_DEFINE(ATHEOS_THREADS, 1,
|
---|
| 2502 | [Define this if you have AtheOS threads.])
|
---|
| 2503 | THREADOBJ="Python/thread.o"],[
|
---|
| 2504 | AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
|
---|
| 2505 | AC_DEFINE(BEOS_THREADS, 1,
|
---|
| 2506 | [Define this if you have BeOS threads.])
|
---|
| 2507 | THREADOBJ="Python/thread.o"],[
|
---|
| 2508 | AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
|
---|
| 2509 | posix_threads=yes
|
---|
| 2510 | LIBS="$LIBS -lpthreads"
|
---|
| 2511 | THREADOBJ="Python/thread.o"], [
|
---|
| 2512 | AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
|
---|
| 2513 | posix_threads=yes
|
---|
| 2514 | LIBS="$LIBS -lc_r"
|
---|
| 2515 | THREADOBJ="Python/thread.o"], [
|
---|
| 2516 | AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
|
---|
| 2517 | posix_threads=yes
|
---|
| 2518 | LIBS="$LIBS -lpthread"
|
---|
| 2519 | THREADOBJ="Python/thread.o"], [
|
---|
| 2520 | AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
|
---|
| 2521 | posix_threads=yes
|
---|
| 2522 | LIBS="$LIBS -lcma"
|
---|
| 2523 | THREADOBJ="Python/thread.o"],[
|
---|
| 2524 | USE_THREAD_MODULE="#"])
|
---|
| 2525 | ])])])])])])])])])])
|
---|
| 2526 |
|
---|
| 2527 | AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
|
---|
| 2528 | LIBS="$LIBS -lmpc"
|
---|
| 2529 | THREADOBJ="Python/thread.o"
|
---|
| 2530 | USE_THREAD_MODULE=""])
|
---|
| 2531 |
|
---|
| 2532 | if test "$posix_threads" != "yes"; then
|
---|
| 2533 | AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
|
---|
| 2534 | LIBS="$LIBS -lthread"
|
---|
| 2535 | THREADOBJ="Python/thread.o"
|
---|
| 2536 | USE_THREAD_MODULE=""])
|
---|
| 2537 | fi
|
---|
| 2538 |
|
---|
| 2539 | if test "$USE_THREAD_MODULE" != "#"
|
---|
| 2540 | then
|
---|
| 2541 | # If the above checks didn't disable threads, (at least) OSF1
|
---|
| 2542 | # needs this '-threads' argument during linking.
|
---|
| 2543 | case $ac_sys_system in
|
---|
| 2544 | OSF1) LDLAST=-threads;;
|
---|
| 2545 | esac
|
---|
| 2546 | fi
|
---|
| 2547 | fi
|
---|
| 2548 |
|
---|
| 2549 | if test "$posix_threads" = "yes"; then
|
---|
| 2550 | if test "$unistd_defines_pthreads" = "no"; then
|
---|
| 2551 | AC_DEFINE(_POSIX_THREADS, 1,
|
---|
| 2552 | [Define if you have POSIX threads,
|
---|
| 2553 | and your system does not define that.])
|
---|
| 2554 | fi
|
---|
| 2555 |
|
---|
| 2556 | # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
|
---|
| 2557 | case $ac_sys_system/$ac_sys_release in
|
---|
| 2558 | SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1,
|
---|
| 2559 | [Defined for Solaris 2.6 bug in pthread header.])
|
---|
| 2560 | ;;
|
---|
| 2561 | SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
|
---|
| 2562 | [Define if the Posix semaphores do not work on your system])
|
---|
| 2563 | ;;
|
---|
| 2564 | AIX/*) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
|
---|
| 2565 | [Define if the Posix semaphores do not work on your system])
|
---|
| 2566 | ;;
|
---|
| 2567 | esac
|
---|
| 2568 |
|
---|
| 2569 | AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
|
---|
| 2570 | AC_CACHE_VAL(ac_cv_pthread_system_supported,
|
---|
| 2571 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 2572 | #include <stdio.h>
|
---|
| 2573 | #include <pthread.h>
|
---|
| 2574 | void *foo(void *parm) {
|
---|
| 2575 | return NULL;
|
---|
| 2576 | }
|
---|
| 2577 | main() {
|
---|
| 2578 | pthread_attr_t attr;
|
---|
| 2579 | pthread_t id;
|
---|
| 2580 | if (pthread_attr_init(&attr)) exit(-1);
|
---|
| 2581 | if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
|
---|
| 2582 | if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
|
---|
| 2583 | exit(0);
|
---|
| 2584 | }]])],
|
---|
| 2585 | [ac_cv_pthread_system_supported=yes],
|
---|
| 2586 | [ac_cv_pthread_system_supported=no],
|
---|
| 2587 | [ac_cv_pthread_system_supported=no])
|
---|
| 2588 | ])
|
---|
| 2589 | AC_MSG_RESULT($ac_cv_pthread_system_supported)
|
---|
| 2590 | if test "$ac_cv_pthread_system_supported" = "yes"; then
|
---|
| 2591 | AC_DEFINE(PTHREAD_SYSTEM_SCHED_SUPPORTED, 1, [Defined if PTHREAD_SCOPE_SYSTEM supported.])
|
---|
| 2592 | fi
|
---|
| 2593 | AC_CHECK_FUNCS(pthread_sigmask,
|
---|
| 2594 | [case $ac_sys_system in
|
---|
| 2595 | CYGWIN*)
|
---|
| 2596 | AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1,
|
---|
| 2597 | [Define if pthread_sigmask() does not work on your system.])
|
---|
| 2598 | ;;
|
---|
| 2599 | esac])
|
---|
| 2600 | AC_CHECK_FUNCS(pthread_atfork)
|
---|
| 2601 | fi
|
---|
| 2602 |
|
---|
| 2603 |
|
---|
| 2604 | # Check for enable-ipv6
|
---|
| 2605 | AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
|
---|
| 2606 | AC_MSG_CHECKING([if --enable-ipv6 is specified])
|
---|
| 2607 | AC_ARG_ENABLE(ipv6,
|
---|
| 2608 | [ --enable-ipv6 Enable ipv6 (with ipv4) support
|
---|
| 2609 | --disable-ipv6 Disable ipv6 support],
|
---|
| 2610 | [ case "$enableval" in
|
---|
| 2611 | no)
|
---|
| 2612 | AC_MSG_RESULT(no)
|
---|
| 2613 | ipv6=no
|
---|
| 2614 | ;;
|
---|
| 2615 | *) AC_MSG_RESULT(yes)
|
---|
| 2616 | AC_DEFINE(ENABLE_IPV6)
|
---|
| 2617 | ipv6=yes
|
---|
| 2618 | ;;
|
---|
| 2619 | esac ],
|
---|
| 2620 |
|
---|
| 2621 | [
|
---|
| 2622 | dnl the check does not work on cross compilation case...
|
---|
| 2623 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* AF_INET6 available check */
|
---|
| 2624 | #include <sys/types.h>
|
---|
| 2625 | #include <sys/socket.h>]],
|
---|
| 2626 | [[int domain = AF_INET6;]])],[
|
---|
| 2627 | AC_MSG_RESULT(yes)
|
---|
| 2628 | ipv6=yes
|
---|
| 2629 | ],[
|
---|
| 2630 | AC_MSG_RESULT(no)
|
---|
| 2631 | ipv6=no
|
---|
| 2632 | ])
|
---|
| 2633 |
|
---|
| 2634 | if test "$ipv6" = "yes"; then
|
---|
| 2635 | AC_MSG_CHECKING(if RFC2553 API is available)
|
---|
| 2636 | AC_COMPILE_IFELSE([
|
---|
| 2637 | AC_LANG_PROGRAM([[#include <sys/types.h>
|
---|
| 2638 | #include <netinet/in.h>]],
|
---|
| 2639 | [[struct sockaddr_in6 x;
|
---|
| 2640 | x.sin6_scope_id;]])
|
---|
| 2641 | ],[
|
---|
| 2642 | AC_MSG_RESULT(yes)
|
---|
| 2643 | ipv6=yes
|
---|
| 2644 | ],[
|
---|
| 2645 | AC_MSG_RESULT(no, IPv6 disabled)
|
---|
| 2646 | ipv6=no
|
---|
| 2647 | ])
|
---|
| 2648 | fi
|
---|
| 2649 |
|
---|
| 2650 | if test "$ipv6" = "yes"; then
|
---|
| 2651 | AC_DEFINE(ENABLE_IPV6)
|
---|
| 2652 | fi
|
---|
| 2653 | ])
|
---|
| 2654 |
|
---|
| 2655 | ipv6type=unknown
|
---|
| 2656 | ipv6lib=none
|
---|
| 2657 | ipv6trylibc=no
|
---|
| 2658 |
|
---|
| 2659 | if test "$ipv6" = "yes"; then
|
---|
| 2660 | AC_MSG_CHECKING([ipv6 stack type])
|
---|
| 2661 | for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
|
---|
| 2662 | do
|
---|
| 2663 | case $i in
|
---|
| 2664 | inria)
|
---|
| 2665 | dnl http://www.kame.net/
|
---|
| 2666 | AC_EGREP_CPP(yes, [
|
---|
| 2667 | #include <netinet/in.h>
|
---|
| 2668 | #ifdef IPV6_INRIA_VERSION
|
---|
| 2669 | yes
|
---|
| 2670 | #endif],
|
---|
| 2671 | [ipv6type=$i])
|
---|
| 2672 | ;;
|
---|
| 2673 | kame)
|
---|
| 2674 | dnl http://www.kame.net/
|
---|
| 2675 | AC_EGREP_CPP(yes, [
|
---|
| 2676 | #include <netinet/in.h>
|
---|
| 2677 | #ifdef __KAME__
|
---|
| 2678 | yes
|
---|
| 2679 | #endif],
|
---|
| 2680 | [ipv6type=$i;
|
---|
| 2681 | ipv6lib=inet6
|
---|
| 2682 | ipv6libdir=/usr/local/v6/lib
|
---|
| 2683 | ipv6trylibc=yes])
|
---|
| 2684 | ;;
|
---|
| 2685 | linux-glibc)
|
---|
| 2686 | dnl http://www.v6.linux.or.jp/
|
---|
| 2687 | AC_EGREP_CPP(yes, [
|
---|
| 2688 | #include <features.h>
|
---|
| 2689 | #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2))
|
---|
| 2690 | yes
|
---|
| 2691 | #endif],
|
---|
| 2692 | [ipv6type=$i;
|
---|
| 2693 | ipv6trylibc=yes])
|
---|
| 2694 | ;;
|
---|
| 2695 | linux-inet6)
|
---|
| 2696 | dnl http://www.v6.linux.or.jp/
|
---|
| 2697 | if test -d /usr/inet6; then
|
---|
| 2698 | ipv6type=$i
|
---|
| 2699 | ipv6lib=inet6
|
---|
| 2700 | ipv6libdir=/usr/inet6/lib
|
---|
| 2701 | BASECFLAGS="-I/usr/inet6/include $BASECFLAGS"
|
---|
| 2702 | fi
|
---|
| 2703 | ;;
|
---|
| 2704 | solaris)
|
---|
| 2705 | if test -f /etc/netconfig; then
|
---|
| 2706 | if $GREP -q tcp6 /etc/netconfig; then
|
---|
| 2707 | ipv6type=$i
|
---|
| 2708 | ipv6trylibc=yes
|
---|
| 2709 | fi
|
---|
| 2710 | fi
|
---|
| 2711 | ;;
|
---|
| 2712 | toshiba)
|
---|
| 2713 | AC_EGREP_CPP(yes, [
|
---|
| 2714 | #include <sys/param.h>
|
---|
| 2715 | #ifdef _TOSHIBA_INET6
|
---|
| 2716 | yes
|
---|
| 2717 | #endif],
|
---|
| 2718 | [ipv6type=$i;
|
---|
| 2719 | ipv6lib=inet6;
|
---|
| 2720 | ipv6libdir=/usr/local/v6/lib])
|
---|
| 2721 | ;;
|
---|
| 2722 | v6d)
|
---|
| 2723 | AC_EGREP_CPP(yes, [
|
---|
| 2724 | #include </usr/local/v6/include/sys/v6config.h>
|
---|
| 2725 | #ifdef __V6D__
|
---|
| 2726 | yes
|
---|
| 2727 | #endif],
|
---|
| 2728 | [ipv6type=$i;
|
---|
| 2729 | ipv6lib=v6;
|
---|
| 2730 | ipv6libdir=/usr/local/v6/lib;
|
---|
| 2731 | BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"])
|
---|
| 2732 | ;;
|
---|
| 2733 | zeta)
|
---|
| 2734 | AC_EGREP_CPP(yes, [
|
---|
| 2735 | #include <sys/param.h>
|
---|
| 2736 | #ifdef _ZETA_MINAMI_INET6
|
---|
| 2737 | yes
|
---|
| 2738 | #endif],
|
---|
| 2739 | [ipv6type=$i;
|
---|
| 2740 | ipv6lib=inet6;
|
---|
| 2741 | ipv6libdir=/usr/local/v6/lib])
|
---|
| 2742 | ;;
|
---|
| 2743 | esac
|
---|
| 2744 | if test "$ipv6type" != "unknown"; then
|
---|
| 2745 | break
|
---|
| 2746 | fi
|
---|
| 2747 | done
|
---|
| 2748 | AC_MSG_RESULT($ipv6type)
|
---|
| 2749 | fi
|
---|
| 2750 |
|
---|
| 2751 | if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
|
---|
| 2752 | if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
|
---|
| 2753 | LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
|
---|
| 2754 | echo "using lib$ipv6lib"
|
---|
| 2755 | else
|
---|
| 2756 | if test $ipv6trylibc = "yes"; then
|
---|
| 2757 | echo "using libc"
|
---|
| 2758 | else
|
---|
| 2759 | echo 'Fatal: no $ipv6lib library found. cannot continue.'
|
---|
| 2760 | echo "You need to fetch lib$ipv6lib.a from appropriate"
|
---|
| 2761 | echo 'ipv6 kit and compile beforehand.'
|
---|
| 2762 | exit 1
|
---|
| 2763 | fi
|
---|
| 2764 | fi
|
---|
| 2765 | fi
|
---|
| 2766 |
|
---|
| 2767 | AC_MSG_CHECKING(for OSX 10.5 SDK or later)
|
---|
| 2768 | AC_COMPILE_IFELSE([
|
---|
| 2769 | AC_LANG_PROGRAM([[#include <Carbon/Carbon.h>]], [[FSIORefNum fRef = 0]])
|
---|
| 2770 | ],[
|
---|
| 2771 | AC_DEFINE(HAVE_OSX105_SDK, 1, [Define if compiling using MacOS X 10.5 SDK or later.])
|
---|
| 2772 | AC_MSG_RESULT(yes)
|
---|
| 2773 | ],[
|
---|
| 2774 | AC_MSG_RESULT(no)
|
---|
| 2775 | ])
|
---|
| 2776 |
|
---|
| 2777 | # Check for --with-doc-strings
|
---|
| 2778 | AC_MSG_CHECKING(for --with-doc-strings)
|
---|
| 2779 | AC_ARG_WITH(doc-strings,
|
---|
| 2780 | AS_HELP_STRING([--with(out)-doc-strings], [disable/enable documentation strings]))
|
---|
| 2781 |
|
---|
| 2782 | if test -z "$with_doc_strings"
|
---|
| 2783 | then with_doc_strings="yes"
|
---|
| 2784 | fi
|
---|
| 2785 | if test "$with_doc_strings" != "no"
|
---|
| 2786 | then
|
---|
| 2787 | AC_DEFINE(WITH_DOC_STRINGS, 1,
|
---|
| 2788 | [Define if you want documentation strings in extension modules])
|
---|
| 2789 | fi
|
---|
| 2790 | AC_MSG_RESULT($with_doc_strings)
|
---|
| 2791 |
|
---|
| 2792 | # Check for Python-specific malloc support
|
---|
| 2793 | AC_MSG_CHECKING(for --with-tsc)
|
---|
| 2794 | AC_ARG_WITH(tsc,
|
---|
| 2795 | AS_HELP_STRING([--with(out)-tsc],[enable/disable timestamp counter profile]),[
|
---|
| 2796 | if test "$withval" != no
|
---|
| 2797 | then
|
---|
| 2798 | AC_DEFINE(WITH_TSC, 1,
|
---|
| 2799 | [Define to profile with the Pentium timestamp counter])
|
---|
| 2800 | AC_MSG_RESULT(yes)
|
---|
| 2801 | else AC_MSG_RESULT(no)
|
---|
| 2802 | fi],
|
---|
| 2803 | [AC_MSG_RESULT(no)])
|
---|
| 2804 |
|
---|
| 2805 | # Check for Python-specific malloc support
|
---|
| 2806 | AC_MSG_CHECKING(for --with-pymalloc)
|
---|
| 2807 | AC_ARG_WITH(pymalloc,
|
---|
| 2808 | AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized mallocs]))
|
---|
| 2809 |
|
---|
| 2810 | if test -z "$with_pymalloc"
|
---|
| 2811 | then with_pymalloc="yes"
|
---|
| 2812 | fi
|
---|
| 2813 | if test "$with_pymalloc" != "no"
|
---|
| 2814 | then
|
---|
| 2815 | AC_DEFINE(WITH_PYMALLOC, 1,
|
---|
| 2816 | [Define if you want to compile in Python-specific mallocs])
|
---|
| 2817 | fi
|
---|
| 2818 | AC_MSG_RESULT($with_pymalloc)
|
---|
| 2819 |
|
---|
| 2820 | # Check for Valgrind support
|
---|
| 2821 | AC_MSG_CHECKING([for --with-valgrind])
|
---|
| 2822 | AC_ARG_WITH([valgrind],
|
---|
| 2823 | AS_HELP_STRING([--with-valgrind], [Enable Valgrind support]),,
|
---|
| 2824 | with_valgrind=no)
|
---|
| 2825 | AC_MSG_RESULT([$with_valgrind])
|
---|
| 2826 | if test "$with_valgrind" != no; then
|
---|
| 2827 | AC_CHECK_HEADER([valgrind/valgrind.h],
|
---|
| 2828 | [AC_DEFINE([WITH_VALGRIND], 1, [Define if you want pymalloc to be disabled when running under valgrind])],
|
---|
| 2829 | [AC_MSG_ERROR([Valgrind support requested but headers not available])]
|
---|
| 2830 | )
|
---|
| 2831 | fi
|
---|
| 2832 |
|
---|
| 2833 | # Check for --with-wctype-functions
|
---|
| 2834 | AC_MSG_CHECKING(for --with-wctype-functions)
|
---|
| 2835 | AC_ARG_WITH(wctype-functions,
|
---|
| 2836 | AS_HELP_STRING([--with-wctype-functions], [use wctype.h functions]),
|
---|
| 2837 | [
|
---|
| 2838 | if test "$withval" != no
|
---|
| 2839 | then
|
---|
| 2840 | AC_DEFINE(WANT_WCTYPE_FUNCTIONS, 1,
|
---|
| 2841 | [Define if you want wctype.h functions to be used instead of the
|
---|
| 2842 | one supplied by Python itself. (see Include/unicodectype.h).])
|
---|
| 2843 | AC_MSG_RESULT(yes)
|
---|
| 2844 | else AC_MSG_RESULT(no)
|
---|
| 2845 | fi],
|
---|
| 2846 | [AC_MSG_RESULT(no)])
|
---|
| 2847 |
|
---|
| 2848 | # -I${DLINCLDIR} is added to the compile rule for importdl.o
|
---|
| 2849 | AC_SUBST(DLINCLDIR)
|
---|
| 2850 | DLINCLDIR=.
|
---|
| 2851 |
|
---|
| 2852 | # the dlopen() function means we might want to use dynload_shlib.o. some
|
---|
| 2853 | # platforms, such as AIX, have dlopen(), but don't want to use it.
|
---|
| 2854 | AC_CHECK_FUNCS(dlopen)
|
---|
| 2855 |
|
---|
| 2856 | # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic
|
---|
| 2857 | # loading of modules.
|
---|
| 2858 | AC_SUBST(DYNLOADFILE)
|
---|
| 2859 | AC_MSG_CHECKING(DYNLOADFILE)
|
---|
| 2860 | if test -z "$DYNLOADFILE"
|
---|
| 2861 | then
|
---|
| 2862 | case $ac_sys_system/$ac_sys_release in
|
---|
| 2863 | AIX*) # Use dynload_shlib.c and dlopen() if we have it; otherwise dynload_aix.c
|
---|
| 2864 | if test "$ac_cv_func_dlopen" = yes
|
---|
| 2865 | then DYNLOADFILE="dynload_shlib.o"
|
---|
| 2866 | else DYNLOADFILE="dynload_aix.o"
|
---|
| 2867 | fi
|
---|
| 2868 | ;;
|
---|
| 2869 | BeOS*) DYNLOADFILE="dynload_beos.o";;
|
---|
| 2870 | hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
|
---|
| 2871 | # Use dynload_next.c only on 10.2 and below, which don't have native dlopen()
|
---|
| 2872 | Darwin/@<:@0156@:>@\..*) DYNLOADFILE="dynload_next.o";;
|
---|
| 2873 | atheos*) DYNLOADFILE="dynload_atheos.o";;
|
---|
| 2874 | *)
|
---|
| 2875 | # use dynload_shlib.c and dlopen() if we have it; otherwise stub
|
---|
| 2876 | # out any dynamic loading
|
---|
| 2877 | if test "$ac_cv_func_dlopen" = yes
|
---|
| 2878 | then DYNLOADFILE="dynload_shlib.o"
|
---|
| 2879 | else DYNLOADFILE="dynload_stub.o"
|
---|
| 2880 | fi
|
---|
| 2881 | ;;
|
---|
| 2882 | esac
|
---|
| 2883 | fi
|
---|
| 2884 | AC_MSG_RESULT($DYNLOADFILE)
|
---|
| 2885 | if test "$DYNLOADFILE" != "dynload_stub.o"
|
---|
| 2886 | then
|
---|
| 2887 | AC_DEFINE(HAVE_DYNAMIC_LOADING, 1,
|
---|
| 2888 | [Defined when any dynamic module loading is enabled.])
|
---|
| 2889 | fi
|
---|
| 2890 |
|
---|
| 2891 | # MACHDEP_OBJS can be set to platform-specific object files needed by Python
|
---|
| 2892 |
|
---|
| 2893 | AC_SUBST(MACHDEP_OBJS)
|
---|
| 2894 | AC_MSG_CHECKING(MACHDEP_OBJS)
|
---|
| 2895 | if test -z "$MACHDEP_OBJS"
|
---|
| 2896 | then
|
---|
| 2897 | MACHDEP_OBJS=$extra_machdep_objs
|
---|
| 2898 | else
|
---|
| 2899 | MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs"
|
---|
| 2900 | fi
|
---|
| 2901 | AC_MSG_RESULT(MACHDEP_OBJS)
|
---|
| 2902 |
|
---|
| 2903 | # checks for library functions
|
---|
| 2904 | AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
|
---|
| 2905 | clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
|
---|
| 2906 | gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
|
---|
| 2907 | getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
|
---|
| 2908 | initgroups kill killpg lchmod lchown lstat mkfifo mknod mktime \
|
---|
| 2909 | mremap nice pathconf pause plock poll pthread_init \
|
---|
| 2910 | putenv readlink realpath \
|
---|
| 2911 | select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \
|
---|
| 2912 | setgid \
|
---|
| 2913 | setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \
|
---|
| 2914 | setlocale setregid setreuid setresuid setresgid \
|
---|
| 2915 | setsid setpgid setpgrp setuid setvbuf snprintf \
|
---|
| 2916 | sigaction siginterrupt sigrelse strftime \
|
---|
| 2917 | sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
|
---|
| 2918 | truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll _getpty)
|
---|
| 2919 |
|
---|
| 2920 | # For some functions, having a definition is not sufficient, since
|
---|
| 2921 | # we want to take their address.
|
---|
| 2922 | AC_MSG_CHECKING(for chroot)
|
---|
| 2923 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=chroot]])],
|
---|
| 2924 | [AC_DEFINE(HAVE_CHROOT, 1, Define if you have the 'chroot' function.)
|
---|
| 2925 | AC_MSG_RESULT(yes)],
|
---|
| 2926 | [AC_MSG_RESULT(no)
|
---|
| 2927 | ])
|
---|
| 2928 | AC_MSG_CHECKING(for link)
|
---|
| 2929 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=link]])],
|
---|
| 2930 | [AC_DEFINE(HAVE_LINK, 1, Define if you have the 'link' function.)
|
---|
| 2931 | AC_MSG_RESULT(yes)],
|
---|
| 2932 | [AC_MSG_RESULT(no)
|
---|
| 2933 | ])
|
---|
| 2934 | AC_MSG_CHECKING(for symlink)
|
---|
| 2935 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=symlink]])],
|
---|
| 2936 | [AC_DEFINE(HAVE_SYMLINK, 1, Define if you have the 'symlink' function.)
|
---|
| 2937 | AC_MSG_RESULT(yes)],
|
---|
| 2938 | [AC_MSG_RESULT(no)
|
---|
| 2939 | ])
|
---|
| 2940 | AC_MSG_CHECKING(for fchdir)
|
---|
| 2941 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=fchdir]])],
|
---|
| 2942 | [AC_DEFINE(HAVE_FCHDIR, 1, Define if you have the 'fchdir' function.)
|
---|
| 2943 | AC_MSG_RESULT(yes)],
|
---|
| 2944 | [AC_MSG_RESULT(no)
|
---|
| 2945 | ])
|
---|
| 2946 | AC_MSG_CHECKING(for fsync)
|
---|
| 2947 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=fsync]])],
|
---|
| 2948 | [AC_DEFINE(HAVE_FSYNC, 1, Define if you have the 'fsync' function.)
|
---|
| 2949 | AC_MSG_RESULT(yes)],
|
---|
| 2950 | [AC_MSG_RESULT(no)
|
---|
| 2951 | ])
|
---|
| 2952 | AC_MSG_CHECKING(for fdatasync)
|
---|
| 2953 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=fdatasync]])],
|
---|
| 2954 | [AC_DEFINE(HAVE_FDATASYNC, 1, Define if you have the 'fdatasync' function.)
|
---|
| 2955 | AC_MSG_RESULT(yes)],
|
---|
| 2956 | [AC_MSG_RESULT(no)
|
---|
| 2957 | ])
|
---|
| 2958 | AC_MSG_CHECKING(for epoll)
|
---|
| 2959 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/epoll.h>]], [[void *x=epoll_create]])],
|
---|
| 2960 | [AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.)
|
---|
| 2961 | AC_MSG_RESULT(yes)],
|
---|
| 2962 | [AC_MSG_RESULT(no)
|
---|
| 2963 | ])
|
---|
| 2964 | AC_MSG_CHECKING(for kqueue)
|
---|
| 2965 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 2966 | #include <sys/types.h>
|
---|
| 2967 | #include <sys/event.h>
|
---|
| 2968 | ]], [[int x=kqueue()]])],
|
---|
| 2969 | [AC_DEFINE(HAVE_KQUEUE, 1, Define if you have the 'kqueue' functions.)
|
---|
| 2970 | AC_MSG_RESULT(yes)],
|
---|
| 2971 | [AC_MSG_RESULT(no)
|
---|
| 2972 | ])
|
---|
| 2973 | # On some systems (eg. FreeBSD 5), we would find a definition of the
|
---|
| 2974 | # functions ctermid_r, setgroups in the library, but no prototype
|
---|
| 2975 | # (e.g. because we use _XOPEN_SOURCE). See whether we can take their
|
---|
| 2976 | # address to avoid compiler warnings and potential miscompilations
|
---|
| 2977 | # because of the missing prototypes.
|
---|
| 2978 |
|
---|
| 2979 | AC_MSG_CHECKING(for ctermid_r)
|
---|
| 2980 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 2981 | #include <stdio.h>
|
---|
| 2982 | ]], [[void* p = ctermid_r]])],
|
---|
| 2983 | [AC_DEFINE(HAVE_CTERMID_R, 1, Define if you have the 'ctermid_r' function.)
|
---|
| 2984 | AC_MSG_RESULT(yes)],
|
---|
| 2985 | [AC_MSG_RESULT(no)
|
---|
| 2986 | ])
|
---|
| 2987 |
|
---|
| 2988 | AC_CACHE_CHECK([for flock declaration], [ac_cv_flock_decl],
|
---|
| 2989 | [AC_COMPILE_IFELSE(
|
---|
| 2990 | [AC_LANG_PROGRAM(
|
---|
| 2991 | [#include <sys/file.h>],
|
---|
| 2992 | [void* p = flock]
|
---|
| 2993 | )],
|
---|
| 2994 | [ac_cv_flock_decl=yes],
|
---|
| 2995 | [ac_cv_flock_decl=no]
|
---|
| 2996 | )
|
---|
| 2997 | ])
|
---|
| 2998 | if test "x${ac_cv_flock_decl}" = xyes; then
|
---|
| 2999 | AC_CHECK_FUNCS(flock,,
|
---|
| 3000 | AC_CHECK_LIB(bsd,flock,
|
---|
| 3001 | [AC_DEFINE(HAVE_FLOCK)
|
---|
| 3002 | AC_DEFINE(FLOCK_NEEDS_LIBBSD, 1, Define if flock needs to be linked with bsd library.)
|
---|
| 3003 | ])
|
---|
| 3004 | )
|
---|
| 3005 | fi
|
---|
| 3006 |
|
---|
| 3007 | AC_MSG_CHECKING(for getpagesize)
|
---|
| 3008 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3009 | #include <unistd.h>
|
---|
| 3010 | ]], [[void* p = getpagesize]])],
|
---|
| 3011 | [AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function.)
|
---|
| 3012 | AC_MSG_RESULT(yes)],
|
---|
| 3013 | [AC_MSG_RESULT(no)
|
---|
| 3014 | ])
|
---|
| 3015 |
|
---|
| 3016 | AC_MSG_CHECKING(for broken unsetenv)
|
---|
| 3017 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3018 | #include <stdlib.h>
|
---|
| 3019 | ]], [[int res = unsetenv("DUMMY")]])],
|
---|
| 3020 | [AC_MSG_RESULT(no)],
|
---|
| 3021 | [AC_DEFINE(HAVE_BROKEN_UNSETENV, 1, Define if `unsetenv` does not return an int.)
|
---|
| 3022 | AC_MSG_RESULT(yes)
|
---|
| 3023 | ])
|
---|
| 3024 |
|
---|
| 3025 | dnl check for true
|
---|
| 3026 | AC_CHECK_PROGS(TRUE, true, /bin/true)
|
---|
| 3027 |
|
---|
| 3028 | dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
|
---|
| 3029 | dnl On others, they are in the C library, so we to take no action
|
---|
| 3030 | AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
|
---|
| 3031 | AC_CHECK_LIB(resolv, inet_aton)
|
---|
| 3032 | )
|
---|
| 3033 |
|
---|
| 3034 | # On Tru64, chflags seems to be present, but calling it will
|
---|
| 3035 | # exit Python
|
---|
| 3036 | AC_CACHE_CHECK([for chflags], [ac_cv_have_chflags], [dnl
|
---|
| 3037 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3038 | #include <sys/stat.h>
|
---|
| 3039 | #include <unistd.h>
|
---|
| 3040 | int main(int argc, char*argv[])
|
---|
| 3041 | {
|
---|
| 3042 | if(chflags(argv[0], 0) != 0)
|
---|
| 3043 | return 1;
|
---|
| 3044 | return 0;
|
---|
| 3045 | }
|
---|
| 3046 | ]])],
|
---|
| 3047 | [ac_cv_have_chflags=yes],
|
---|
| 3048 | [ac_cv_have_chflags=no],
|
---|
| 3049 | [ac_cv_have_chflags=cross])
|
---|
| 3050 | ])
|
---|
| 3051 | if test "$ac_cv_have_chflags" = cross ; then
|
---|
| 3052 | AC_CHECK_FUNC([chflags], [ac_cv_have_chflags="yes"], [ac_cv_have_chflags="no"])
|
---|
| 3053 | fi
|
---|
| 3054 | if test "$ac_cv_have_chflags" = yes ; then
|
---|
| 3055 | AC_DEFINE(HAVE_CHFLAGS, 1, [Define to 1 if you have the 'chflags' function.])
|
---|
| 3056 | fi
|
---|
| 3057 |
|
---|
| 3058 | AC_CACHE_CHECK([for lchflags], [ac_cv_have_lchflags], [dnl
|
---|
| 3059 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3060 | #include <sys/stat.h>
|
---|
| 3061 | #include <unistd.h>
|
---|
| 3062 | int main(int argc, char*argv[])
|
---|
| 3063 | {
|
---|
| 3064 | if(lchflags(argv[0], 0) != 0)
|
---|
| 3065 | return 1;
|
---|
| 3066 | return 0;
|
---|
| 3067 | }
|
---|
| 3068 | ]])],[ac_cv_have_lchflags=yes],[ac_cv_have_lchflags=no],[ac_cv_have_lchflags=cross])
|
---|
| 3069 | ])
|
---|
| 3070 | if test "$ac_cv_have_lchflags" = cross ; then
|
---|
| 3071 | AC_CHECK_FUNC([lchflags], [ac_cv_have_lchflags="yes"], [ac_cv_have_lchflags="no"])
|
---|
| 3072 | fi
|
---|
| 3073 | if test "$ac_cv_have_lchflags" = yes ; then
|
---|
| 3074 | AC_DEFINE(HAVE_LCHFLAGS, 1, [Define to 1 if you have the 'lchflags' function.])
|
---|
| 3075 | fi
|
---|
| 3076 |
|
---|
| 3077 | dnl Check if system zlib has *Copy() functions
|
---|
| 3078 | dnl
|
---|
| 3079 | dnl On MacOSX the linker will search for dylibs on the entire linker path
|
---|
| 3080 | dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first
|
---|
| 3081 | dnl to revert to a more traditional unix behaviour and make it possible to
|
---|
| 3082 | dnl override the system libz with a local static library of libz. Temporarily
|
---|
| 3083 | dnl add that flag to our CFLAGS as well to ensure that we check the version
|
---|
| 3084 | dnl of libz that will be used by setup.py.
|
---|
| 3085 | dnl The -L/usr/local/lib is needed as wel to get the same compilation
|
---|
| 3086 | dnl environment as setup.py (and leaving it out can cause configure to use the
|
---|
| 3087 | dnl wrong version of the library)
|
---|
| 3088 | case $ac_sys_system/$ac_sys_release in
|
---|
| 3089 | Darwin/*)
|
---|
| 3090 | _CUR_CFLAGS="${CFLAGS}"
|
---|
| 3091 | _CUR_LDFLAGS="${LDFLAGS}"
|
---|
| 3092 | CFLAGS="${CFLAGS} -Wl,-search_paths_first"
|
---|
| 3093 | LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
|
---|
| 3094 | ;;
|
---|
| 3095 | esac
|
---|
| 3096 |
|
---|
| 3097 | AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, [Define if the zlib library has inflateCopy]))
|
---|
| 3098 |
|
---|
| 3099 | case $ac_sys_system/$ac_sys_release in
|
---|
| 3100 | Darwin/*)
|
---|
| 3101 | CFLAGS="${_CUR_CFLAGS}"
|
---|
| 3102 | LDFLAGS="${_CUR_LDFLAGS}"
|
---|
| 3103 | ;;
|
---|
| 3104 | esac
|
---|
| 3105 |
|
---|
| 3106 | AC_MSG_CHECKING(for hstrerror)
|
---|
| 3107 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3108 | #include <netdb.h>
|
---|
| 3109 | ]], [[void* p = hstrerror; hstrerror(0)]])],
|
---|
| 3110 | [AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.)
|
---|
| 3111 | AC_MSG_RESULT(yes)],
|
---|
| 3112 | [AC_MSG_RESULT(no)
|
---|
| 3113 | ])
|
---|
| 3114 |
|
---|
| 3115 | AC_MSG_CHECKING(for inet_aton)
|
---|
| 3116 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3117 | #include <sys/types.h>
|
---|
| 3118 | #include <sys/socket.h>
|
---|
| 3119 | #include <netinet/in.h>
|
---|
| 3120 | #include <arpa/inet.h>
|
---|
| 3121 | ]], [[void* p = inet_aton;inet_aton(0,0)]])],
|
---|
| 3122 | [AC_DEFINE(HAVE_INET_ATON, 1, Define if you have the 'inet_aton' function.)
|
---|
| 3123 | AC_MSG_RESULT(yes)],
|
---|
| 3124 | [AC_MSG_RESULT(no)
|
---|
| 3125 | ])
|
---|
| 3126 |
|
---|
| 3127 | AC_MSG_CHECKING(for inet_pton)
|
---|
| 3128 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3129 | #include <sys/types.h>
|
---|
| 3130 | #include <sys/socket.h>
|
---|
| 3131 | #include <netinet/in.h>
|
---|
| 3132 | #include <arpa/inet.h>
|
---|
| 3133 | ]], [[void* p = inet_pton]])],
|
---|
| 3134 | [AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.)
|
---|
| 3135 | AC_MSG_RESULT(yes)],
|
---|
| 3136 | [AC_MSG_RESULT(no)
|
---|
| 3137 | ])
|
---|
| 3138 |
|
---|
| 3139 | # On some systems, setgroups is in unistd.h, on others, in grp.h
|
---|
| 3140 | AC_MSG_CHECKING(for setgroups)
|
---|
| 3141 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3142 | #include <unistd.h>
|
---|
| 3143 | #ifdef HAVE_GRP_H
|
---|
| 3144 | #include <grp.h>
|
---|
| 3145 | #endif
|
---|
| 3146 | ]], [[void* p = setgroups]])],
|
---|
| 3147 | [AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.)
|
---|
| 3148 | AC_MSG_RESULT(yes)],
|
---|
| 3149 | [AC_MSG_RESULT(no)
|
---|
| 3150 | ])
|
---|
| 3151 |
|
---|
| 3152 | # check for openpty and forkpty
|
---|
| 3153 |
|
---|
| 3154 | AC_CHECK_FUNCS(openpty,,
|
---|
| 3155 | AC_CHECK_LIB(util,openpty,
|
---|
| 3156 | [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"],
|
---|
| 3157 | AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"])
|
---|
| 3158 | )
|
---|
| 3159 | )
|
---|
| 3160 | AC_CHECK_FUNCS(forkpty,,
|
---|
| 3161 | AC_CHECK_LIB(util,forkpty,
|
---|
| 3162 | [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"],
|
---|
| 3163 | AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"])
|
---|
| 3164 | )
|
---|
| 3165 | )
|
---|
| 3166 |
|
---|
| 3167 | # Stuff for expat.
|
---|
| 3168 | AC_CHECK_FUNCS(memmove)
|
---|
| 3169 |
|
---|
| 3170 | # check for long file support functions
|
---|
| 3171 | AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)
|
---|
| 3172 |
|
---|
| 3173 | AC_REPLACE_FUNCS(dup2 getcwd strdup)
|
---|
| 3174 | AC_CHECK_FUNCS(getpgrp,
|
---|
| 3175 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[getpgrp(0);]])],
|
---|
| 3176 | [AC_DEFINE(GETPGRP_HAVE_ARG, 1, [Define if getpgrp() must be called as getpgrp(0).])],
|
---|
| 3177 | [])
|
---|
| 3178 | )
|
---|
| 3179 | AC_CHECK_FUNCS(setpgrp,
|
---|
| 3180 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[setpgrp(0,0);]])],
|
---|
| 3181 | [AC_DEFINE(SETPGRP_HAVE_ARG, 1, [Define if setpgrp() must be called as setpgrp(0, 0).])],
|
---|
| 3182 | [])
|
---|
| 3183 | )
|
---|
| 3184 | AC_CHECK_FUNCS(gettimeofday,
|
---|
| 3185 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]],
|
---|
| 3186 | [[gettimeofday((struct timeval*)0,(struct timezone*)0);]])],
|
---|
| 3187 | [],
|
---|
| 3188 | [AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1,
|
---|
| 3189 | [Define if gettimeofday() does not have second (timezone) argument
|
---|
| 3190 | This is the case on Motorola V4 (R40V4.2)])
|
---|
| 3191 | ])
|
---|
| 3192 | )
|
---|
| 3193 |
|
---|
| 3194 | AC_MSG_CHECKING(for major, minor, and makedev)
|
---|
| 3195 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3196 | #if defined(MAJOR_IN_MKDEV)
|
---|
| 3197 | #include <sys/mkdev.h>
|
---|
| 3198 | #elif defined(MAJOR_IN_SYSMACROS)
|
---|
| 3199 | #include <sys/sysmacros.h>
|
---|
| 3200 | #else
|
---|
| 3201 | #include <sys/types.h>
|
---|
| 3202 | #endif
|
---|
| 3203 | ]], [[
|
---|
| 3204 | makedev(major(0),minor(0));
|
---|
| 3205 | ]])],[
|
---|
| 3206 | AC_DEFINE(HAVE_DEVICE_MACROS, 1,
|
---|
| 3207 | [Define to 1 if you have the device macros.])
|
---|
| 3208 | AC_MSG_RESULT(yes)
|
---|
| 3209 | ],[
|
---|
| 3210 | AC_MSG_RESULT(no)
|
---|
| 3211 | ])
|
---|
| 3212 |
|
---|
| 3213 | # On OSF/1 V5.1, getaddrinfo is available, but a define
|
---|
| 3214 | # for [no]getaddrinfo in netdb.h.
|
---|
| 3215 | AC_MSG_CHECKING(for getaddrinfo)
|
---|
| 3216 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3217 | #include <sys/types.h>
|
---|
| 3218 | #include <sys/socket.h>
|
---|
| 3219 | #include <netdb.h>
|
---|
| 3220 | #include <stdio.h>
|
---|
| 3221 | ]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])],
|
---|
| 3222 | [have_getaddrinfo=yes],
|
---|
| 3223 | [have_getaddrinfo=no])
|
---|
| 3224 | AC_MSG_RESULT($have_getaddrinfo)
|
---|
| 3225 | if test $have_getaddrinfo = yes
|
---|
| 3226 | then
|
---|
| 3227 | AC_MSG_CHECKING(getaddrinfo bug)
|
---|
| 3228 | AC_CACHE_VAL(ac_cv_buggy_getaddrinfo,
|
---|
| 3229 | AC_RUN_IFELSE([AC_LANG_SOURCE([[[
|
---|
| 3230 | #include <stdio.h>
|
---|
| 3231 | #include <sys/types.h>
|
---|
| 3232 | #include <netdb.h>
|
---|
| 3233 | #include <string.h>
|
---|
| 3234 | #include <sys/socket.h>
|
---|
| 3235 | #include <netinet/in.h>
|
---|
| 3236 |
|
---|
| 3237 | int main()
|
---|
| 3238 | {
|
---|
| 3239 | int passive, gaierr, inet4 = 0, inet6 = 0;
|
---|
| 3240 | struct addrinfo hints, *ai, *aitop;
|
---|
| 3241 | char straddr[INET6_ADDRSTRLEN], strport[16];
|
---|
| 3242 |
|
---|
| 3243 | for (passive = 0; passive <= 1; passive++) {
|
---|
| 3244 | memset(&hints, 0, sizeof(hints));
|
---|
| 3245 | hints.ai_family = AF_UNSPEC;
|
---|
| 3246 | hints.ai_flags = passive ? AI_PASSIVE : 0;
|
---|
| 3247 | hints.ai_socktype = SOCK_STREAM;
|
---|
| 3248 | hints.ai_protocol = IPPROTO_TCP;
|
---|
| 3249 | if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
|
---|
| 3250 | (void)gai_strerror(gaierr);
|
---|
| 3251 | goto bad;
|
---|
| 3252 | }
|
---|
| 3253 | for (ai = aitop; ai; ai = ai->ai_next) {
|
---|
| 3254 | if (ai->ai_addr == NULL ||
|
---|
| 3255 | ai->ai_addrlen == 0 ||
|
---|
| 3256 | getnameinfo(ai->ai_addr, ai->ai_addrlen,
|
---|
| 3257 | straddr, sizeof(straddr), strport, sizeof(strport),
|
---|
| 3258 | NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
|
---|
| 3259 | goto bad;
|
---|
| 3260 | }
|
---|
| 3261 | switch (ai->ai_family) {
|
---|
| 3262 | case AF_INET:
|
---|
| 3263 | if (strcmp(strport, "54321") != 0) {
|
---|
| 3264 | goto bad;
|
---|
| 3265 | }
|
---|
| 3266 | if (passive) {
|
---|
| 3267 | if (strcmp(straddr, "0.0.0.0") != 0) {
|
---|
| 3268 | goto bad;
|
---|
| 3269 | }
|
---|
| 3270 | } else {
|
---|
| 3271 | if (strcmp(straddr, "127.0.0.1") != 0) {
|
---|
| 3272 | goto bad;
|
---|
| 3273 | }
|
---|
| 3274 | }
|
---|
| 3275 | inet4++;
|
---|
| 3276 | break;
|
---|
| 3277 | case AF_INET6:
|
---|
| 3278 | if (strcmp(strport, "54321") != 0) {
|
---|
| 3279 | goto bad;
|
---|
| 3280 | }
|
---|
| 3281 | if (passive) {
|
---|
| 3282 | if (strcmp(straddr, "::") != 0) {
|
---|
| 3283 | goto bad;
|
---|
| 3284 | }
|
---|
| 3285 | } else {
|
---|
| 3286 | if (strcmp(straddr, "::1") != 0) {
|
---|
| 3287 | goto bad;
|
---|
| 3288 | }
|
---|
| 3289 | }
|
---|
| 3290 | inet6++;
|
---|
| 3291 | break;
|
---|
| 3292 | case AF_UNSPEC:
|
---|
| 3293 | goto bad;
|
---|
| 3294 | break;
|
---|
| 3295 | default:
|
---|
| 3296 | /* another family support? */
|
---|
| 3297 | break;
|
---|
| 3298 | }
|
---|
| 3299 | }
|
---|
| 3300 | }
|
---|
| 3301 |
|
---|
| 3302 | if (!(inet4 == 0 || inet4 == 2))
|
---|
| 3303 | goto bad;
|
---|
| 3304 | if (!(inet6 == 0 || inet6 == 2))
|
---|
| 3305 | goto bad;
|
---|
| 3306 |
|
---|
| 3307 | if (aitop)
|
---|
| 3308 | freeaddrinfo(aitop);
|
---|
| 3309 | return 0;
|
---|
| 3310 |
|
---|
| 3311 | bad:
|
---|
| 3312 | if (aitop)
|
---|
| 3313 | freeaddrinfo(aitop);
|
---|
| 3314 | return 1;
|
---|
| 3315 | }
|
---|
| 3316 | ]]])],
|
---|
| 3317 | [ac_cv_buggy_getaddrinfo=no],
|
---|
| 3318 | [ac_cv_buggy_getaddrinfo=yes],
|
---|
| 3319 | [
|
---|
| 3320 | if test "${enable_ipv6+set}" = set; then
|
---|
| 3321 | ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6"
|
---|
| 3322 | else
|
---|
| 3323 | ac_cv_buggy_getaddrinfo=yes
|
---|
| 3324 | fi]))
|
---|
| 3325 | fi
|
---|
| 3326 |
|
---|
| 3327 | AC_MSG_RESULT($ac_cv_buggy_getaddrinfo)
|
---|
| 3328 |
|
---|
| 3329 | if test $have_getaddrinfo = no -o "$ac_cv_buggy_getaddrinfo" = yes
|
---|
| 3330 | then
|
---|
| 3331 | if test $ipv6 = yes
|
---|
| 3332 | then
|
---|
| 3333 | echo 'Fatal: You must get working getaddrinfo() function.'
|
---|
| 3334 | echo ' or you can specify "--disable-ipv6"'.
|
---|
| 3335 | exit 1
|
---|
| 3336 | fi
|
---|
| 3337 | else
|
---|
| 3338 | AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.])
|
---|
| 3339 | fi
|
---|
| 3340 |
|
---|
| 3341 | AC_CHECK_FUNCS(getnameinfo)
|
---|
| 3342 |
|
---|
| 3343 | # checks for structures
|
---|
| 3344 | AC_HEADER_TIME
|
---|
| 3345 | AC_STRUCT_TM
|
---|
| 3346 | AC_STRUCT_TIMEZONE
|
---|
| 3347 | AC_CHECK_MEMBERS([struct stat.st_rdev])
|
---|
| 3348 | AC_CHECK_MEMBERS([struct stat.st_blksize])
|
---|
| 3349 | AC_CHECK_MEMBERS([struct stat.st_flags])
|
---|
| 3350 | AC_CHECK_MEMBERS([struct stat.st_gen])
|
---|
| 3351 | AC_CHECK_MEMBERS([struct stat.st_birthtime])
|
---|
| 3352 | AC_STRUCT_ST_BLOCKS
|
---|
| 3353 |
|
---|
| 3354 | AC_MSG_CHECKING(for time.h that defines altzone)
|
---|
| 3355 | AC_CACHE_VAL(ac_cv_header_time_altzone,[
|
---|
| 3356 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[return altzone;]])],
|
---|
| 3357 | [ac_cv_header_time_altzone=yes],
|
---|
| 3358 | [ac_cv_header_time_altzone=no])
|
---|
| 3359 | ])
|
---|
| 3360 | AC_MSG_RESULT($ac_cv_header_time_altzone)
|
---|
| 3361 | if test $ac_cv_header_time_altzone = yes; then
|
---|
| 3362 | AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.])
|
---|
| 3363 | fi
|
---|
| 3364 |
|
---|
| 3365 | was_it_defined=no
|
---|
| 3366 | AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included)
|
---|
| 3367 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3368 | #include <sys/types.h>
|
---|
| 3369 | #include <sys/select.h>
|
---|
| 3370 | #include <sys/time.h>
|
---|
| 3371 | ]], [[;]])],[
|
---|
| 3372 | AC_DEFINE(SYS_SELECT_WITH_SYS_TIME, 1,
|
---|
| 3373 | [Define if you can safely include both <sys/select.h> and <sys/time.h>
|
---|
| 3374 | (which you can't on SCO ODT 3.0).])
|
---|
| 3375 | was_it_defined=yes
|
---|
| 3376 | ],[])
|
---|
| 3377 | AC_MSG_RESULT($was_it_defined)
|
---|
| 3378 |
|
---|
| 3379 | AC_MSG_CHECKING(for addrinfo)
|
---|
| 3380 | AC_CACHE_VAL(ac_cv_struct_addrinfo,
|
---|
| 3381 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[struct addrinfo a]])],
|
---|
| 3382 | [ac_cv_struct_addrinfo=yes],
|
---|
| 3383 | [ac_cv_struct_addrinfo=no]))
|
---|
| 3384 | AC_MSG_RESULT($ac_cv_struct_addrinfo)
|
---|
| 3385 | if test $ac_cv_struct_addrinfo = yes; then
|
---|
| 3386 | AC_DEFINE(HAVE_ADDRINFO, 1, [struct addrinfo (netdb.h)])
|
---|
| 3387 | fi
|
---|
| 3388 |
|
---|
| 3389 | AC_MSG_CHECKING(for sockaddr_storage)
|
---|
| 3390 | AC_CACHE_VAL(ac_cv_struct_sockaddr_storage,
|
---|
| 3391 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3392 | # include <sys/types.h>
|
---|
| 3393 | # include <sys/socket.h>]], [[struct sockaddr_storage s]])],
|
---|
| 3394 | [ac_cv_struct_sockaddr_storage=yes],
|
---|
| 3395 | [ac_cv_struct_sockaddr_storage=no]))
|
---|
| 3396 | AC_MSG_RESULT($ac_cv_struct_sockaddr_storage)
|
---|
| 3397 | if test $ac_cv_struct_sockaddr_storage = yes; then
|
---|
| 3398 | AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket.h)])
|
---|
| 3399 | fi
|
---|
| 3400 |
|
---|
| 3401 | # checks for compiler characteristics
|
---|
| 3402 |
|
---|
| 3403 | AC_C_CHAR_UNSIGNED
|
---|
| 3404 | AC_C_CONST
|
---|
| 3405 |
|
---|
| 3406 | works=no
|
---|
| 3407 | AC_MSG_CHECKING(for working volatile)
|
---|
| 3408 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[volatile int x; x = 0;]])],
|
---|
| 3409 | [works=yes],
|
---|
| 3410 | [AC_DEFINE(volatile, , [Define to empty if the keyword does not work.])]
|
---|
| 3411 | )
|
---|
| 3412 | AC_MSG_RESULT($works)
|
---|
| 3413 |
|
---|
| 3414 | works=no
|
---|
| 3415 | AC_MSG_CHECKING(for working signed char)
|
---|
| 3416 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char c;]])],
|
---|
| 3417 | [works=yes],
|
---|
| 3418 | [AC_DEFINE(signed, , [Define to empty if the keyword does not work.])]
|
---|
| 3419 | )
|
---|
| 3420 | AC_MSG_RESULT($works)
|
---|
| 3421 |
|
---|
| 3422 | have_prototypes=no
|
---|
| 3423 | AC_MSG_CHECKING(for prototypes)
|
---|
| 3424 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(int x) { return 0; }]], [[return foo(10);]])],
|
---|
| 3425 | [AC_DEFINE(HAVE_PROTOTYPES, 1,
|
---|
| 3426 | [Define if your compiler supports function prototype])
|
---|
| 3427 | have_prototypes=yes],
|
---|
| 3428 | []
|
---|
| 3429 | )
|
---|
| 3430 | AC_MSG_RESULT($have_prototypes)
|
---|
| 3431 |
|
---|
| 3432 | works=no
|
---|
| 3433 | AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
|
---|
| 3434 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3435 | #include <stdarg.h>
|
---|
| 3436 | int foo(int x, ...) {
|
---|
| 3437 | va_list va;
|
---|
| 3438 | va_start(va, x);
|
---|
| 3439 | va_arg(va, int);
|
---|
| 3440 | va_arg(va, char *);
|
---|
| 3441 | va_arg(va, double);
|
---|
| 3442 | return 0;
|
---|
| 3443 | }
|
---|
| 3444 | ]], [[return foo(10, "", 3.14);]])],[
|
---|
| 3445 | AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1,
|
---|
| 3446 | [Define if your compiler supports variable length function prototypes
|
---|
| 3447 | (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>])
|
---|
| 3448 | works=yes
|
---|
| 3449 | ],[])
|
---|
| 3450 | AC_MSG_RESULT($works)
|
---|
| 3451 |
|
---|
| 3452 | # check for socketpair
|
---|
| 3453 | AC_MSG_CHECKING(for socketpair)
|
---|
| 3454 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3455 | #include <sys/types.h>
|
---|
| 3456 | #include <sys/socket.h>
|
---|
| 3457 | ]], [[void *x=socketpair]])],
|
---|
| 3458 | [AC_DEFINE(HAVE_SOCKETPAIR, 1, [Define if you have the 'socketpair' function.])
|
---|
| 3459 | AC_MSG_RESULT(yes)],
|
---|
| 3460 | [AC_MSG_RESULT(no)]
|
---|
| 3461 | )
|
---|
| 3462 |
|
---|
| 3463 | # check if sockaddr has sa_len member
|
---|
| 3464 | AC_MSG_CHECKING(if sockaddr has sa_len member)
|
---|
| 3465 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
---|
| 3466 | #include <sys/socket.h>]], [[struct sockaddr x;
|
---|
| 3467 | x.sa_len = 0;]])],
|
---|
| 3468 | [AC_MSG_RESULT(yes)
|
---|
| 3469 | AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member])],
|
---|
| 3470 | [AC_MSG_RESULT(no)]
|
---|
| 3471 | )
|
---|
| 3472 |
|
---|
| 3473 | va_list_is_array=no
|
---|
| 3474 | AC_MSG_CHECKING(whether va_list is an array)
|
---|
| 3475 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3476 | #ifdef HAVE_STDARG_PROTOTYPES
|
---|
| 3477 | #include <stdarg.h>
|
---|
| 3478 | #else
|
---|
| 3479 | #include <varargs.h>
|
---|
| 3480 | #endif
|
---|
| 3481 | ]], [[va_list list1, list2; list1 = list2;]])],[],[
|
---|
| 3482 | AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
|
---|
| 3483 | va_list_is_array=yes
|
---|
| 3484 | ])
|
---|
| 3485 | AC_MSG_RESULT($va_list_is_array)
|
---|
| 3486 |
|
---|
| 3487 | # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
|
---|
| 3488 | AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
|
---|
| 3489 | [Define this if you have some version of gethostbyname_r()])
|
---|
| 3490 |
|
---|
| 3491 | AC_CHECK_FUNC(gethostbyname_r, [
|
---|
| 3492 | AC_DEFINE(HAVE_GETHOSTBYNAME_R)
|
---|
| 3493 | AC_MSG_CHECKING([gethostbyname_r with 6 args])
|
---|
| 3494 | OLD_CFLAGS=$CFLAGS
|
---|
| 3495 | CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
|
---|
| 3496 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3497 | # include <netdb.h>
|
---|
| 3498 | ]], [[
|
---|
| 3499 | char *name;
|
---|
| 3500 | struct hostent *he, *res;
|
---|
| 3501 | char buffer[2048];
|
---|
| 3502 | int buflen = 2048;
|
---|
| 3503 | int h_errnop;
|
---|
| 3504 |
|
---|
| 3505 | (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
|
---|
| 3506 | ]])],[
|
---|
| 3507 | AC_DEFINE(HAVE_GETHOSTBYNAME_R)
|
---|
| 3508 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
|
---|
| 3509 | [Define this if you have the 6-arg version of gethostbyname_r().])
|
---|
| 3510 | AC_MSG_RESULT(yes)
|
---|
| 3511 | ],[
|
---|
| 3512 | AC_MSG_RESULT(no)
|
---|
| 3513 | AC_MSG_CHECKING([gethostbyname_r with 5 args])
|
---|
| 3514 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3515 | # include <netdb.h>
|
---|
| 3516 | ]], [[
|
---|
| 3517 | char *name;
|
---|
| 3518 | struct hostent *he;
|
---|
| 3519 | char buffer[2048];
|
---|
| 3520 | int buflen = 2048;
|
---|
| 3521 | int h_errnop;
|
---|
| 3522 |
|
---|
| 3523 | (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
|
---|
| 3524 | ]])],
|
---|
| 3525 | [
|
---|
| 3526 | AC_DEFINE(HAVE_GETHOSTBYNAME_R)
|
---|
| 3527 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
|
---|
| 3528 | [Define this if you have the 5-arg version of gethostbyname_r().])
|
---|
| 3529 | AC_MSG_RESULT(yes)
|
---|
| 3530 | ], [
|
---|
| 3531 | AC_MSG_RESULT(no)
|
---|
| 3532 | AC_MSG_CHECKING([gethostbyname_r with 3 args])
|
---|
| 3533 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3534 | # include <netdb.h>
|
---|
| 3535 | ]], [[
|
---|
| 3536 | char *name;
|
---|
| 3537 | struct hostent *he;
|
---|
| 3538 | struct hostent_data data;
|
---|
| 3539 |
|
---|
| 3540 | (void) gethostbyname_r(name, he, &data);
|
---|
| 3541 | ]])],
|
---|
| 3542 | [
|
---|
| 3543 | AC_DEFINE(HAVE_GETHOSTBYNAME_R)
|
---|
| 3544 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
|
---|
| 3545 | [Define this if you have the 3-arg version of gethostbyname_r().])
|
---|
| 3546 | AC_MSG_RESULT(yes)
|
---|
| 3547 | ], [
|
---|
| 3548 | AC_MSG_RESULT(no)
|
---|
| 3549 | ])
|
---|
| 3550 | ])
|
---|
| 3551 | ])
|
---|
| 3552 | CFLAGS=$OLD_CFLAGS
|
---|
| 3553 | ], [
|
---|
| 3554 | AC_CHECK_FUNCS(gethostbyname)
|
---|
| 3555 | ])
|
---|
| 3556 | AC_SUBST(HAVE_GETHOSTBYNAME_R_6_ARG)
|
---|
| 3557 | AC_SUBST(HAVE_GETHOSTBYNAME_R_5_ARG)
|
---|
| 3558 | AC_SUBST(HAVE_GETHOSTBYNAME_R_3_ARG)
|
---|
| 3559 | AC_SUBST(HAVE_GETHOSTBYNAME_R)
|
---|
| 3560 | AC_SUBST(HAVE_GETHOSTBYNAME)
|
---|
| 3561 |
|
---|
| 3562 | # checks for system services
|
---|
| 3563 | # (none yet)
|
---|
| 3564 |
|
---|
| 3565 | # Linux requires this for correct f.p. operations
|
---|
| 3566 | AC_CHECK_FUNC(__fpu_control,
|
---|
| 3567 | [],
|
---|
| 3568 | [AC_CHECK_LIB(ieee, __fpu_control)
|
---|
| 3569 | ])
|
---|
| 3570 |
|
---|
| 3571 | # Check for --with-fpectl
|
---|
| 3572 | AC_MSG_CHECKING(for --with-fpectl)
|
---|
| 3573 | AC_ARG_WITH(fpectl,
|
---|
| 3574 | AS_HELP_STRING([--with-fpectl], [enable SIGFPE catching]),
|
---|
| 3575 | [
|
---|
| 3576 | if test "$withval" != no
|
---|
| 3577 | then
|
---|
| 3578 | AC_DEFINE(WANT_SIGFPE_HANDLER, 1,
|
---|
| 3579 | [Define if you want SIGFPE handled (see Include/pyfpe.h).])
|
---|
| 3580 | AC_MSG_RESULT(yes)
|
---|
| 3581 | else AC_MSG_RESULT(no)
|
---|
| 3582 | fi],
|
---|
| 3583 | [AC_MSG_RESULT(no)])
|
---|
| 3584 |
|
---|
| 3585 | # check for --with-libm=...
|
---|
| 3586 | AC_SUBST(LIBM)
|
---|
| 3587 | case $ac_sys_system in
|
---|
| 3588 | Darwin) ;;
|
---|
| 3589 | BeOS) ;;
|
---|
| 3590 | *) LIBM=-lm
|
---|
| 3591 | esac
|
---|
| 3592 | AC_MSG_CHECKING(for --with-libm=STRING)
|
---|
| 3593 | AC_ARG_WITH(libm,
|
---|
| 3594 | AS_HELP_STRING([--with-libm=STRING], [math library]),
|
---|
| 3595 | [
|
---|
| 3596 | if test "$withval" = no
|
---|
| 3597 | then LIBM=
|
---|
| 3598 | AC_MSG_RESULT(force LIBM empty)
|
---|
| 3599 | elif test "$withval" != yes
|
---|
| 3600 | then LIBM=$withval
|
---|
| 3601 | AC_MSG_RESULT(set LIBM="$withval")
|
---|
| 3602 | else AC_MSG_ERROR([proper usage is --with-libm=STRING])
|
---|
| 3603 | fi],
|
---|
| 3604 | [AC_MSG_RESULT(default LIBM="$LIBM")])
|
---|
| 3605 |
|
---|
| 3606 | # check for --with-libc=...
|
---|
| 3607 | AC_SUBST(LIBC)
|
---|
| 3608 | AC_MSG_CHECKING(for --with-libc=STRING)
|
---|
| 3609 | AC_ARG_WITH(libc,
|
---|
| 3610 | AS_HELP_STRING([--with-libc=STRING], [C library]),
|
---|
| 3611 | [
|
---|
| 3612 | if test "$withval" = no
|
---|
| 3613 | then LIBC=
|
---|
| 3614 | AC_MSG_RESULT(force LIBC empty)
|
---|
| 3615 | elif test "$withval" != yes
|
---|
| 3616 | then LIBC=$withval
|
---|
| 3617 | AC_MSG_RESULT(set LIBC="$withval")
|
---|
| 3618 | else AC_MSG_ERROR([proper usage is --with-libc=STRING])
|
---|
| 3619 | fi],
|
---|
| 3620 | [AC_MSG_RESULT(default LIBC="$LIBC")])
|
---|
| 3621 |
|
---|
| 3622 | # **************************************************
|
---|
| 3623 | # * Check for various properties of floating point *
|
---|
| 3624 | # **************************************************
|
---|
| 3625 |
|
---|
| 3626 | AC_MSG_CHECKING(whether C doubles are little-endian IEEE 754 binary64)
|
---|
| 3627 | AC_CACHE_VAL(ac_cv_little_endian_double, [
|
---|
| 3628 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3629 | #include <string.h>
|
---|
| 3630 | int main() {
|
---|
| 3631 | double x = 9006104071832581.0;
|
---|
| 3632 | if (memcmp(&x, "\x05\x04\x03\x02\x01\xff\x3f\x43", 8) == 0)
|
---|
| 3633 | return 0;
|
---|
| 3634 | else
|
---|
| 3635 | return 1;
|
---|
| 3636 | }
|
---|
| 3637 | ]])],
|
---|
| 3638 | [ac_cv_little_endian_double=yes],
|
---|
| 3639 | [ac_cv_little_endian_double=no],
|
---|
| 3640 | [ac_cv_little_endian_double=no])])
|
---|
| 3641 | AC_MSG_RESULT($ac_cv_little_endian_double)
|
---|
| 3642 | if test "$ac_cv_little_endian_double" = yes
|
---|
| 3643 | then
|
---|
| 3644 | AC_DEFINE(DOUBLE_IS_LITTLE_ENDIAN_IEEE754, 1,
|
---|
| 3645 | [Define if C doubles are 64-bit IEEE 754 binary format, stored
|
---|
| 3646 | with the least significant byte first])
|
---|
| 3647 | fi
|
---|
| 3648 |
|
---|
| 3649 | AC_MSG_CHECKING(whether C doubles are big-endian IEEE 754 binary64)
|
---|
| 3650 | AC_CACHE_VAL(ac_cv_big_endian_double, [
|
---|
| 3651 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3652 | #include <string.h>
|
---|
| 3653 | int main() {
|
---|
| 3654 | double x = 9006104071832581.0;
|
---|
| 3655 | if (memcmp(&x, "\x43\x3f\xff\x01\x02\x03\x04\x05", 8) == 0)
|
---|
| 3656 | return 0;
|
---|
| 3657 | else
|
---|
| 3658 | return 1;
|
---|
| 3659 | }
|
---|
| 3660 | ]])],
|
---|
| 3661 | [ac_cv_big_endian_double=yes],
|
---|
| 3662 | [ac_cv_big_endian_double=no],
|
---|
| 3663 | [ac_cv_big_endian_double=no])])
|
---|
| 3664 | AC_MSG_RESULT($ac_cv_big_endian_double)
|
---|
| 3665 | if test "$ac_cv_big_endian_double" = yes
|
---|
| 3666 | then
|
---|
| 3667 | AC_DEFINE(DOUBLE_IS_BIG_ENDIAN_IEEE754, 1,
|
---|
| 3668 | [Define if C doubles are 64-bit IEEE 754 binary format, stored
|
---|
| 3669 | with the most significant byte first])
|
---|
| 3670 | fi
|
---|
| 3671 |
|
---|
| 3672 | # Some ARM platforms use a mixed-endian representation for doubles.
|
---|
| 3673 | # While Python doesn't currently have full support for these platforms
|
---|
| 3674 | # (see e.g., issue 1762561), we can at least make sure that float <-> string
|
---|
| 3675 | # conversions work.
|
---|
| 3676 | AC_MSG_CHECKING(whether C doubles are ARM mixed-endian IEEE 754 binary64)
|
---|
| 3677 | AC_CACHE_VAL(ac_cv_mixed_endian_double, [
|
---|
| 3678 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3679 | #include <string.h>
|
---|
| 3680 | int main() {
|
---|
| 3681 | double x = 9006104071832581.0;
|
---|
| 3682 | if (memcmp(&x, "\x01\xff\x3f\x43\x05\x04\x03\x02", 8) == 0)
|
---|
| 3683 | return 0;
|
---|
| 3684 | else
|
---|
| 3685 | return 1;
|
---|
| 3686 | }
|
---|
| 3687 | ]])],
|
---|
| 3688 | [ac_cv_mixed_endian_double=yes],
|
---|
| 3689 | [ac_cv_mixed_endian_double=no],
|
---|
| 3690 | [ac_cv_mixed_endian_double=no])])
|
---|
| 3691 | AC_MSG_RESULT($ac_cv_mixed_endian_double)
|
---|
| 3692 | if test "$ac_cv_mixed_endian_double" = yes
|
---|
| 3693 | then
|
---|
| 3694 | AC_DEFINE(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754, 1,
|
---|
| 3695 | [Define if C doubles are 64-bit IEEE 754 binary format, stored
|
---|
| 3696 | in ARM mixed-endian order (byte order 45670123)])
|
---|
| 3697 | fi
|
---|
| 3698 |
|
---|
| 3699 | # The short float repr introduced in Python 3.1 requires the
|
---|
| 3700 | # correctly-rounded string <-> double conversion functions from
|
---|
| 3701 | # Python/dtoa.c, which in turn require that the FPU uses 53-bit
|
---|
| 3702 | # rounding; this is a problem on x86, where the x87 FPU has a default
|
---|
| 3703 | # rounding precision of 64 bits. For gcc/x86, we can fix this by
|
---|
| 3704 | # using inline assembler to get and set the x87 FPU control word.
|
---|
| 3705 |
|
---|
| 3706 | # This inline assembler syntax may also work for suncc and icc,
|
---|
| 3707 | # so we try it on all platforms.
|
---|
| 3708 |
|
---|
| 3709 | AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set x87 control word)
|
---|
| 3710 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
|
---|
| 3711 | unsigned short cw;
|
---|
| 3712 | __asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
|
---|
| 3713 | __asm__ __volatile__ ("fldcw %0" : : "m" (cw));
|
---|
| 3714 | ]])],[have_gcc_asm_for_x87=yes],[have_gcc_asm_for_x87=no])
|
---|
| 3715 | AC_MSG_RESULT($have_gcc_asm_for_x87)
|
---|
| 3716 | if test "$have_gcc_asm_for_x87" = yes
|
---|
| 3717 | then
|
---|
| 3718 | AC_DEFINE(HAVE_GCC_ASM_FOR_X87, 1,
|
---|
| 3719 | [Define if we can use gcc inline assembler to get and set x87 control word])
|
---|
| 3720 | fi
|
---|
| 3721 |
|
---|
| 3722 | # Detect whether system arithmetic is subject to x87-style double
|
---|
| 3723 | # rounding issues. The result of this test has little meaning on non
|
---|
| 3724 | # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding
|
---|
| 3725 | # mode is round-to-nearest and double rounding issues are present, and
|
---|
| 3726 | # 0 otherwise. See http://bugs.python.org/issue2937 for more info.
|
---|
| 3727 | AC_MSG_CHECKING(for x87-style double rounding)
|
---|
| 3728 | # $BASECFLAGS may affect the result
|
---|
| 3729 | ac_save_cc="$CC"
|
---|
| 3730 | CC="$CC $BASECFLAGS"
|
---|
| 3731 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3732 | #include <stdlib.h>
|
---|
| 3733 | #include <math.h>
|
---|
| 3734 | int main() {
|
---|
| 3735 | volatile double x, y, z;
|
---|
| 3736 | /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
|
---|
| 3737 | x = 0.99999999999999989; /* 1-2**-53 */
|
---|
| 3738 | y = 1./x;
|
---|
| 3739 | if (y != 1.)
|
---|
| 3740 | exit(0);
|
---|
| 3741 | /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */
|
---|
| 3742 | x = 1e16;
|
---|
| 3743 | y = 2.99999;
|
---|
| 3744 | z = x + y;
|
---|
| 3745 | if (z != 1e16+4.)
|
---|
| 3746 | exit(0);
|
---|
| 3747 | /* both tests show evidence of double rounding */
|
---|
| 3748 | exit(1);
|
---|
| 3749 | }
|
---|
| 3750 | ]])],
|
---|
| 3751 | [ac_cv_x87_double_rounding=no],
|
---|
| 3752 | [ac_cv_x87_double_rounding=yes],
|
---|
| 3753 | [ac_cv_x87_double_rounding=no])
|
---|
| 3754 | CC="$ac_save_cc"
|
---|
| 3755 | AC_MSG_RESULT($ac_cv_x87_double_rounding)
|
---|
| 3756 | if test "$ac_cv_x87_double_rounding" = yes
|
---|
| 3757 | then
|
---|
| 3758 | AC_DEFINE(X87_DOUBLE_ROUNDING, 1,
|
---|
| 3759 | [Define if arithmetic is subject to x87-style double rounding issue])
|
---|
| 3760 | fi
|
---|
| 3761 |
|
---|
| 3762 | # ************************************
|
---|
| 3763 | # * Check for mathematical functions *
|
---|
| 3764 | # ************************************
|
---|
| 3765 |
|
---|
| 3766 | LIBS_SAVE=$LIBS
|
---|
| 3767 | LIBS="$LIBS $LIBM"
|
---|
| 3768 |
|
---|
| 3769 | # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
|
---|
| 3770 | # -0. on some architectures.
|
---|
| 3771 | AC_MSG_CHECKING(whether tanh preserves the sign of zero)
|
---|
| 3772 | AC_CACHE_VAL(ac_cv_tanh_preserves_zero_sign, [
|
---|
| 3773 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3774 | #include <math.h>
|
---|
| 3775 | #include <stdlib.h>
|
---|
| 3776 | int main() {
|
---|
| 3777 | /* return 0 if either negative zeros don't exist
|
---|
| 3778 | on this platform or if negative zeros exist
|
---|
| 3779 | and tanh(-0.) == -0. */
|
---|
| 3780 | if (atan2(0., -1.) == atan2(-0., -1.) ||
|
---|
| 3781 | atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
|
---|
| 3782 | else exit(1);
|
---|
| 3783 | }
|
---|
| 3784 | ]])],
|
---|
| 3785 | [ac_cv_tanh_preserves_zero_sign=yes],
|
---|
| 3786 | [ac_cv_tanh_preserves_zero_sign=no],
|
---|
| 3787 | [ac_cv_tanh_preserves_zero_sign=no])])
|
---|
| 3788 | AC_MSG_RESULT($ac_cv_tanh_preserves_zero_sign)
|
---|
| 3789 | if test "$ac_cv_tanh_preserves_zero_sign" = yes
|
---|
| 3790 | then
|
---|
| 3791 | AC_DEFINE(TANH_PRESERVES_ZERO_SIGN, 1,
|
---|
| 3792 | [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
|
---|
| 3793 | fi
|
---|
| 3794 |
|
---|
| 3795 | AC_CHECK_FUNCS([acosh asinh atanh copysign erf erfc expm1 finite gamma])
|
---|
| 3796 | AC_CHECK_FUNCS([hypot lgamma log1p round tgamma])
|
---|
| 3797 | AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
|
---|
| 3798 |
|
---|
| 3799 | LIBS=$LIBS_SAVE
|
---|
| 3800 |
|
---|
| 3801 | # For multiprocessing module, check that sem_open
|
---|
| 3802 | # actually works. For FreeBSD versions <= 7.2,
|
---|
| 3803 | # the kernel module that provides POSIX semaphores
|
---|
| 3804 | # isn't loaded by default, so an attempt to call
|
---|
| 3805 | # sem_open results in a 'Signal 12' error.
|
---|
| 3806 | AC_MSG_CHECKING(whether POSIX semaphores are enabled)
|
---|
| 3807 | AC_CACHE_VAL(ac_cv_posix_semaphores_enabled,
|
---|
| 3808 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3809 | #include <unistd.h>
|
---|
| 3810 | #include <fcntl.h>
|
---|
| 3811 | #include <stdio.h>
|
---|
| 3812 | #include <semaphore.h>
|
---|
| 3813 | #include <sys/stat.h>
|
---|
| 3814 |
|
---|
| 3815 | int main(void) {
|
---|
| 3816 | sem_t *a = sem_open("/autoconf", O_CREAT, S_IRUSR|S_IWUSR, 0);
|
---|
| 3817 | if (a == SEM_FAILED) {
|
---|
| 3818 | perror("sem_open");
|
---|
| 3819 | return 1;
|
---|
| 3820 | }
|
---|
| 3821 | sem_close(a);
|
---|
| 3822 | sem_unlink("/autoconf");
|
---|
| 3823 | return 0;
|
---|
| 3824 | }
|
---|
| 3825 | ]])],
|
---|
| 3826 | [ac_cv_posix_semaphores_enabled=yes],
|
---|
| 3827 | [ac_cv_posix_semaphores_enabled=no],
|
---|
| 3828 | [ac_cv_posix_semaphores_enabled=yes])
|
---|
| 3829 | )
|
---|
| 3830 | AC_MSG_RESULT($ac_cv_posix_semaphores_enabled)
|
---|
| 3831 | if test $ac_cv_posix_semaphores_enabled = no
|
---|
| 3832 | then
|
---|
| 3833 | AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1,
|
---|
| 3834 | [Define if POSIX semaphores aren't enabled on your system])
|
---|
| 3835 | fi
|
---|
| 3836 |
|
---|
| 3837 | # Multiprocessing check for broken sem_getvalue
|
---|
| 3838 | AC_MSG_CHECKING(for broken sem_getvalue)
|
---|
| 3839 | AC_CACHE_VAL(ac_cv_broken_sem_getvalue,
|
---|
| 3840 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3841 | #include <unistd.h>
|
---|
| 3842 | #include <fcntl.h>
|
---|
| 3843 | #include <stdio.h>
|
---|
| 3844 | #include <semaphore.h>
|
---|
| 3845 | #include <sys/stat.h>
|
---|
| 3846 |
|
---|
| 3847 | int main(void){
|
---|
| 3848 | sem_t *a = sem_open("/autocftw", O_CREAT, S_IRUSR|S_IWUSR, 0);
|
---|
| 3849 | int count;
|
---|
| 3850 | int res;
|
---|
| 3851 | if(a==SEM_FAILED){
|
---|
| 3852 | perror("sem_open");
|
---|
| 3853 | return 1;
|
---|
| 3854 |
|
---|
| 3855 | }
|
---|
| 3856 | res = sem_getvalue(a, &count);
|
---|
| 3857 | sem_close(a);
|
---|
| 3858 | sem_unlink("/autocftw");
|
---|
| 3859 | return res==-1 ? 1 : 0;
|
---|
| 3860 | }
|
---|
| 3861 | ]])],
|
---|
| 3862 | [ac_cv_broken_sem_getvalue=no],
|
---|
| 3863 | [ac_cv_broken_sem_getvalue=yes],
|
---|
| 3864 | [ac_cv_broken_sem_getvalue=yes])
|
---|
| 3865 | )
|
---|
| 3866 | AC_MSG_RESULT($ac_cv_broken_sem_getvalue)
|
---|
| 3867 | if test $ac_cv_broken_sem_getvalue = yes
|
---|
| 3868 | then
|
---|
| 3869 | AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1,
|
---|
| 3870 | [define to 1 if your sem_getvalue is broken.])
|
---|
| 3871 | fi
|
---|
| 3872 |
|
---|
| 3873 | # determine what size digit to use for Python's longs
|
---|
| 3874 | AC_MSG_CHECKING([digit size for Python's longs])
|
---|
| 3875 | AC_ARG_ENABLE(big-digits,
|
---|
| 3876 | AS_HELP_STRING([--enable-big-digits@<:@=BITS@:>@],[use big digits for Python longs [[BITS=30]]]),
|
---|
| 3877 | [case $enable_big_digits in
|
---|
| 3878 | yes)
|
---|
| 3879 | enable_big_digits=30 ;;
|
---|
| 3880 | no)
|
---|
| 3881 | enable_big_digits=15 ;;
|
---|
| 3882 | [15|30])
|
---|
| 3883 | ;;
|
---|
| 3884 | *)
|
---|
| 3885 | AC_MSG_ERROR([bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30]) ;;
|
---|
| 3886 | esac
|
---|
| 3887 | AC_MSG_RESULT($enable_big_digits)
|
---|
| 3888 | AC_DEFINE_UNQUOTED(PYLONG_BITS_IN_DIGIT, $enable_big_digits, [Define as the preferred size in bits of long digits])
|
---|
| 3889 | ],
|
---|
| 3890 | [AC_MSG_RESULT(no value specified)])
|
---|
| 3891 |
|
---|
| 3892 | # check for wchar.h
|
---|
| 3893 | AC_CHECK_HEADER(wchar.h, [
|
---|
| 3894 | AC_DEFINE(HAVE_WCHAR_H, 1,
|
---|
| 3895 | [Define if the compiler provides a wchar.h header file.])
|
---|
| 3896 | wchar_h="yes"
|
---|
| 3897 | ],
|
---|
| 3898 | wchar_h="no"
|
---|
| 3899 | )
|
---|
| 3900 |
|
---|
| 3901 | # determine wchar_t size
|
---|
| 3902 | if test "$wchar_h" = yes
|
---|
| 3903 | then
|
---|
| 3904 | AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
|
---|
| 3905 | fi
|
---|
| 3906 |
|
---|
| 3907 | AC_MSG_CHECKING(for UCS-4 tcl)
|
---|
| 3908 | have_ucs4_tcl=no
|
---|
| 3909 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 3910 | #include <tcl.h>
|
---|
| 3911 | #if TCL_UTF_MAX != 6
|
---|
| 3912 | # error "NOT UCS4_TCL"
|
---|
| 3913 | #endif]], [[]])],[
|
---|
| 3914 | AC_DEFINE(HAVE_UCS4_TCL, 1, [Define this if you have tcl and TCL_UTF_MAX==6])
|
---|
| 3915 | have_ucs4_tcl=yes
|
---|
| 3916 | ],[])
|
---|
| 3917 | AC_MSG_RESULT($have_ucs4_tcl)
|
---|
| 3918 |
|
---|
| 3919 | # check whether wchar_t is signed or not
|
---|
| 3920 | if test "$wchar_h" = yes
|
---|
| 3921 | then
|
---|
| 3922 | # check whether wchar_t is signed or not
|
---|
| 3923 | AC_MSG_CHECKING(whether wchar_t is signed)
|
---|
| 3924 | AC_CACHE_VAL(ac_cv_wchar_t_signed, [
|
---|
| 3925 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 3926 | #include <wchar.h>
|
---|
| 3927 | int main()
|
---|
| 3928 | {
|
---|
| 3929 | /* Success: exit code 0 */
|
---|
| 3930 | exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
|
---|
| 3931 | }
|
---|
| 3932 | ]])],
|
---|
| 3933 | [ac_cv_wchar_t_signed=yes],
|
---|
| 3934 | [ac_cv_wchar_t_signed=no],
|
---|
| 3935 | [ac_cv_wchar_t_signed=yes])])
|
---|
| 3936 | AC_MSG_RESULT($ac_cv_wchar_t_signed)
|
---|
| 3937 | fi
|
---|
| 3938 |
|
---|
| 3939 | AC_MSG_CHECKING(what type to use for unicode)
|
---|
| 3940 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
---|
| 3941 | AC_ARG_ENABLE(unicode,
|
---|
| 3942 | AS_HELP_STRING([--enable-unicode@<:@=ucs@<:@24@:>@@:>@], [Enable Unicode strings (default is ucs2)]),
|
---|
| 3943 | [],
|
---|
| 3944 | [enable_unicode=yes])
|
---|
| 3945 |
|
---|
| 3946 | if test $enable_unicode = yes
|
---|
| 3947 | then
|
---|
| 3948 | # Without any arguments, Py_UNICODE defaults to two-byte mode
|
---|
| 3949 | case "$have_ucs4_tcl" in
|
---|
| 3950 | yes) enable_unicode="ucs4"
|
---|
| 3951 | ;;
|
---|
| 3952 | *) enable_unicode="ucs2"
|
---|
| 3953 | ;;
|
---|
| 3954 | esac
|
---|
| 3955 | fi
|
---|
| 3956 |
|
---|
| 3957 | AH_TEMPLATE(Py_UNICODE_SIZE,
|
---|
| 3958 | [Define as the size of the unicode type.])
|
---|
| 3959 | case "$enable_unicode" in
|
---|
| 3960 | ucs2) unicode_size="2"
|
---|
| 3961 | AC_DEFINE(Py_UNICODE_SIZE,2)
|
---|
| 3962 | ;;
|
---|
| 3963 | ucs4) unicode_size="4"
|
---|
| 3964 | AC_DEFINE(Py_UNICODE_SIZE,4)
|
---|
| 3965 | ;;
|
---|
| 3966 | no) ;; # To allow --disable-unicode
|
---|
| 3967 | *) AC_MSG_ERROR([invalid value for --enable-unicode. Use either ucs2 or ucs4 (lowercase).]) ;;
|
---|
| 3968 | esac
|
---|
| 3969 |
|
---|
| 3970 | AH_TEMPLATE(PY_UNICODE_TYPE,
|
---|
| 3971 | [Define as the integral type used for Unicode representation.])
|
---|
| 3972 |
|
---|
| 3973 | AC_SUBST(UNICODE_OBJS)
|
---|
| 3974 | if test "$enable_unicode" = "no"
|
---|
| 3975 | then
|
---|
| 3976 | UNICODE_OBJS=""
|
---|
| 3977 | AC_MSG_RESULT(not used)
|
---|
| 3978 | else
|
---|
| 3979 | UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o"
|
---|
| 3980 | AC_DEFINE(Py_USING_UNICODE, 1,
|
---|
| 3981 | [Define if you want to have a Unicode type.])
|
---|
| 3982 |
|
---|
| 3983 | # wchar_t is only usable if it maps to an unsigned type
|
---|
| 3984 | if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \
|
---|
| 3985 | -a "$ac_cv_wchar_t_signed" = "no"
|
---|
| 3986 | then
|
---|
| 3987 | PY_UNICODE_TYPE="wchar_t"
|
---|
| 3988 | AC_DEFINE(HAVE_USABLE_WCHAR_T, 1,
|
---|
| 3989 | [Define if you have a useable wchar_t type defined in wchar.h; useable
|
---|
| 3990 | means wchar_t must be an unsigned type with at least 16 bits. (see
|
---|
| 3991 | Include/unicodeobject.h).])
|
---|
| 3992 | AC_DEFINE(PY_UNICODE_TYPE,wchar_t)
|
---|
| 3993 | elif test "$ac_cv_sizeof_short" = "$unicode_size"
|
---|
| 3994 | then
|
---|
| 3995 | PY_UNICODE_TYPE="unsigned short"
|
---|
| 3996 | AC_DEFINE(PY_UNICODE_TYPE,unsigned short)
|
---|
| 3997 | elif test "$ac_cv_sizeof_long" = "$unicode_size"
|
---|
| 3998 | then
|
---|
| 3999 | PY_UNICODE_TYPE="unsigned long"
|
---|
| 4000 | AC_DEFINE(PY_UNICODE_TYPE,unsigned long)
|
---|
| 4001 | else
|
---|
| 4002 | PY_UNICODE_TYPE="no type found"
|
---|
| 4003 | fi
|
---|
| 4004 | AC_MSG_RESULT($PY_UNICODE_TYPE)
|
---|
| 4005 | fi
|
---|
| 4006 |
|
---|
| 4007 | # check for endianness
|
---|
| 4008 | AC_C_BIGENDIAN
|
---|
| 4009 |
|
---|
| 4010 | # Check whether right shifting a negative integer extends the sign bit
|
---|
| 4011 | # or fills with zeros (like the Cray J90, according to Tim Peters).
|
---|
| 4012 | AC_MSG_CHECKING(whether right shift extends the sign bit)
|
---|
| 4013 | AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
|
---|
| 4014 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 4015 | int main()
|
---|
| 4016 | {
|
---|
| 4017 | exit(((-1)>>3 == -1) ? 0 : 1);
|
---|
| 4018 | }
|
---|
| 4019 | ]])],
|
---|
| 4020 | [ac_cv_rshift_extends_sign=yes],
|
---|
| 4021 | [ac_cv_rshift_extends_sign=no],
|
---|
| 4022 | [ac_cv_rshift_extends_sign=yes])])
|
---|
| 4023 | AC_MSG_RESULT($ac_cv_rshift_extends_sign)
|
---|
| 4024 | if test "$ac_cv_rshift_extends_sign" = no
|
---|
| 4025 | then
|
---|
| 4026 | AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS, 1,
|
---|
| 4027 | [Define if i>>j for signed int i does not extend the sign bit
|
---|
| 4028 | when i < 0])
|
---|
| 4029 | fi
|
---|
| 4030 |
|
---|
| 4031 | # check for getc_unlocked and related locking functions
|
---|
| 4032 | AC_MSG_CHECKING(for getc_unlocked() and friends)
|
---|
| 4033 | AC_CACHE_VAL(ac_cv_have_getc_unlocked, [
|
---|
| 4034 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[
|
---|
| 4035 | FILE *f = fopen("/dev/null", "r");
|
---|
| 4036 | flockfile(f);
|
---|
| 4037 | getc_unlocked(f);
|
---|
| 4038 | funlockfile(f);
|
---|
| 4039 | ]])],[ac_cv_have_getc_unlocked=yes],[ac_cv_have_getc_unlocked=no])])
|
---|
| 4040 | AC_MSG_RESULT($ac_cv_have_getc_unlocked)
|
---|
| 4041 | if test "$ac_cv_have_getc_unlocked" = yes
|
---|
| 4042 | then
|
---|
| 4043 | AC_DEFINE(HAVE_GETC_UNLOCKED, 1,
|
---|
| 4044 | [Define this if you have flockfile(), getc_unlocked(), and funlockfile()])
|
---|
| 4045 | fi
|
---|
| 4046 |
|
---|
| 4047 | # check where readline lives
|
---|
| 4048 | # save the value of LIBS so we don't actually link Python with readline
|
---|
| 4049 | LIBS_no_readline=$LIBS
|
---|
| 4050 |
|
---|
| 4051 | # On some systems we need to link readline to a termcap compatible
|
---|
| 4052 | # library. NOTE: Keep the precedence of listed libraries synchronised
|
---|
| 4053 | # with setup.py.
|
---|
| 4054 | py_cv_lib_readline=no
|
---|
| 4055 | AC_MSG_CHECKING([how to link readline libs])
|
---|
| 4056 | for py_libtermcap in "" ncursesw ncurses curses termcap; do
|
---|
| 4057 | if test -z "$py_libtermcap"; then
|
---|
| 4058 | READLINE_LIBS="-lreadline"
|
---|
| 4059 | else
|
---|
| 4060 | READLINE_LIBS="-lreadline -l$py_libtermcap"
|
---|
| 4061 | fi
|
---|
| 4062 | LIBS="$READLINE_LIBS $LIBS_no_readline"
|
---|
| 4063 | AC_LINK_IFELSE(
|
---|
| 4064 | [AC_LANG_CALL([],[readline])],
|
---|
| 4065 | [py_cv_lib_readline=yes])
|
---|
| 4066 | if test $py_cv_lib_readline = yes; then
|
---|
| 4067 | break
|
---|
| 4068 | fi
|
---|
| 4069 | done
|
---|
| 4070 | # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts
|
---|
| 4071 | #AC_SUBST([READLINE_LIBS])
|
---|
| 4072 | if test $py_cv_lib_readline = no; then
|
---|
| 4073 | AC_MSG_RESULT([none])
|
---|
| 4074 | else
|
---|
| 4075 | AC_MSG_RESULT([$READLINE_LIBS])
|
---|
| 4076 | AC_DEFINE(HAVE_LIBREADLINE, 1,
|
---|
| 4077 | [Define if you have the readline library (-lreadline).])
|
---|
| 4078 | fi
|
---|
| 4079 |
|
---|
| 4080 | # check for readline 2.1
|
---|
| 4081 | AC_CHECK_LIB(readline, rl_callback_handler_install,
|
---|
| 4082 | AC_DEFINE(HAVE_RL_CALLBACK, 1,
|
---|
| 4083 | [Define if you have readline 2.1]), ,$READLINE_LIBS)
|
---|
| 4084 |
|
---|
| 4085 | # check for readline 2.2
|
---|
| 4086 | AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <readline/readline.h>]])],
|
---|
| 4087 | [have_readline=yes],
|
---|
| 4088 | [have_readline=no]
|
---|
| 4089 | )
|
---|
| 4090 | if test $have_readline = yes
|
---|
| 4091 | then
|
---|
| 4092 | AC_EGREP_HEADER([extern int rl_completion_append_character;],
|
---|
| 4093 | [readline/readline.h],
|
---|
| 4094 | AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
|
---|
| 4095 | [Define if you have readline 2.2]), )
|
---|
| 4096 | AC_EGREP_HEADER([extern int rl_completion_suppress_append;],
|
---|
| 4097 | [readline/readline.h],
|
---|
| 4098 | AC_DEFINE(HAVE_RL_COMPLETION_SUPPRESS_APPEND, 1,
|
---|
| 4099 | [Define if you have rl_completion_suppress_append]), )
|
---|
| 4100 | fi
|
---|
| 4101 |
|
---|
| 4102 | # check for readline 4.0
|
---|
| 4103 | AC_CHECK_LIB(readline, rl_pre_input_hook,
|
---|
| 4104 | AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1,
|
---|
| 4105 | [Define if you have readline 4.0]), ,$READLINE_LIBS)
|
---|
| 4106 |
|
---|
| 4107 | # also in 4.0
|
---|
| 4108 | AC_CHECK_LIB(readline, rl_completion_display_matches_hook,
|
---|
| 4109 | AC_DEFINE(HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK, 1,
|
---|
| 4110 | [Define if you have readline 4.0]), ,$READLINE_LIBS)
|
---|
| 4111 |
|
---|
| 4112 | # check for readline 4.2
|
---|
| 4113 | AC_CHECK_LIB(readline, rl_completion_matches,
|
---|
| 4114 | AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1,
|
---|
| 4115 | [Define if you have readline 4.2]), ,$READLINE_LIBS)
|
---|
| 4116 |
|
---|
| 4117 | # also in readline 4.2
|
---|
| 4118 | AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <readline/readline.h>]])],
|
---|
| 4119 | [have_readline=yes],
|
---|
| 4120 | [have_readline=no]
|
---|
| 4121 | )
|
---|
| 4122 | if test $have_readline = yes
|
---|
| 4123 | then
|
---|
| 4124 | AC_EGREP_HEADER([extern int rl_catch_signals;],
|
---|
| 4125 | [readline/readline.h],
|
---|
| 4126 | AC_DEFINE(HAVE_RL_CATCH_SIGNAL, 1,
|
---|
| 4127 | [Define if you can turn off readline's signal handling.]), )
|
---|
| 4128 | fi
|
---|
| 4129 |
|
---|
| 4130 | # End of readline checks: restore LIBS
|
---|
| 4131 | LIBS=$LIBS_no_readline
|
---|
| 4132 |
|
---|
| 4133 | AC_MSG_CHECKING(for broken nice())
|
---|
| 4134 | AC_CACHE_VAL(ac_cv_broken_nice, [
|
---|
| 4135 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 4136 | int main()
|
---|
| 4137 | {
|
---|
| 4138 | int val1 = nice(1);
|
---|
| 4139 | if (val1 != -1 && val1 == nice(2))
|
---|
| 4140 | exit(0);
|
---|
| 4141 | exit(1);
|
---|
| 4142 | }
|
---|
| 4143 | ]])],
|
---|
| 4144 | [ac_cv_broken_nice=yes],
|
---|
| 4145 | [ac_cv_broken_nice=no],
|
---|
| 4146 | [ac_cv_broken_nice=no])])
|
---|
| 4147 | AC_MSG_RESULT($ac_cv_broken_nice)
|
---|
| 4148 | if test "$ac_cv_broken_nice" = yes
|
---|
| 4149 | then
|
---|
| 4150 | AC_DEFINE(HAVE_BROKEN_NICE, 1,
|
---|
| 4151 | [Define if nice() returns success/failure instead of the new priority.])
|
---|
| 4152 | fi
|
---|
| 4153 |
|
---|
| 4154 | AC_MSG_CHECKING(for broken poll())
|
---|
| 4155 | AC_CACHE_VAL(ac_cv_broken_poll,
|
---|
| 4156 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 4157 | #include <poll.h>
|
---|
| 4158 |
|
---|
| 4159 | int main()
|
---|
| 4160 | {
|
---|
| 4161 | struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
|
---|
| 4162 | int poll_test;
|
---|
| 4163 |
|
---|
| 4164 | close (42);
|
---|
| 4165 |
|
---|
| 4166 | poll_test = poll(&poll_struct, 1, 0);
|
---|
| 4167 | if (poll_test < 0)
|
---|
| 4168 | return 0;
|
---|
| 4169 | else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
|
---|
| 4170 | return 0;
|
---|
| 4171 | else
|
---|
| 4172 | return 1;
|
---|
| 4173 | }
|
---|
| 4174 | ]])],
|
---|
| 4175 | [ac_cv_broken_poll=yes],
|
---|
| 4176 | [ac_cv_broken_poll=no],
|
---|
| 4177 | [ac_cv_broken_poll=no]))
|
---|
| 4178 | AC_MSG_RESULT($ac_cv_broken_poll)
|
---|
| 4179 | if test "$ac_cv_broken_poll" = yes
|
---|
| 4180 | then
|
---|
| 4181 | AC_DEFINE(HAVE_BROKEN_POLL, 1,
|
---|
| 4182 | [Define if poll() sets errno on invalid file descriptors.])
|
---|
| 4183 | fi
|
---|
| 4184 |
|
---|
| 4185 | # Before we can test tzset, we need to check if struct tm has a tm_zone
|
---|
| 4186 | # (which is not required by ISO C or UNIX spec) and/or if we support
|
---|
| 4187 | # tzname[]
|
---|
| 4188 | AC_STRUCT_TIMEZONE
|
---|
| 4189 |
|
---|
| 4190 | # check tzset(3) exists and works like we expect it to
|
---|
| 4191 | AC_MSG_CHECKING(for working tzset())
|
---|
| 4192 | AC_CACHE_VAL(ac_cv_working_tzset, [
|
---|
| 4193 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 4194 | #include <stdlib.h>
|
---|
| 4195 | #include <time.h>
|
---|
| 4196 | #include <string.h>
|
---|
| 4197 |
|
---|
| 4198 | #if HAVE_TZNAME
|
---|
| 4199 | extern char *tzname[];
|
---|
| 4200 | #endif
|
---|
| 4201 |
|
---|
| 4202 | int main()
|
---|
| 4203 | {
|
---|
| 4204 | /* Note that we need to ensure that not only does tzset(3)
|
---|
| 4205 | do 'something' with localtime, but it works as documented
|
---|
| 4206 | in the library reference and as expected by the test suite.
|
---|
| 4207 | This includes making sure that tzname is set properly if
|
---|
| 4208 | tm->tm_zone does not exist since it is the alternative way
|
---|
| 4209 | of getting timezone info.
|
---|
| 4210 |
|
---|
| 4211 | Red Hat 6.2 doesn't understand the southern hemisphere
|
---|
| 4212 | after New Year's Day.
|
---|
| 4213 | */
|
---|
| 4214 |
|
---|
| 4215 | time_t groundhogday = 1044144000; /* GMT-based */
|
---|
| 4216 | time_t midyear = groundhogday + (365 * 24 * 3600 / 2);
|
---|
| 4217 |
|
---|
| 4218 | putenv("TZ=UTC+0");
|
---|
| 4219 | tzset();
|
---|
| 4220 | if (localtime(&groundhogday)->tm_hour != 0)
|
---|
| 4221 | exit(1);
|
---|
| 4222 | #if HAVE_TZNAME
|
---|
| 4223 | /* For UTC, tzname[1] is sometimes "", sometimes " " */
|
---|
| 4224 | if (strcmp(tzname[0], "UTC") ||
|
---|
| 4225 | (tzname[1][0] != 0 && tzname[1][0] != ' '))
|
---|
| 4226 | exit(1);
|
---|
| 4227 | #endif
|
---|
| 4228 |
|
---|
| 4229 | putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
|
---|
| 4230 | tzset();
|
---|
| 4231 | if (localtime(&groundhogday)->tm_hour != 19)
|
---|
| 4232 | exit(1);
|
---|
| 4233 | #if HAVE_TZNAME
|
---|
| 4234 | if (strcmp(tzname[0], "EST") || strcmp(tzname[1], "EDT"))
|
---|
| 4235 | exit(1);
|
---|
| 4236 | #endif
|
---|
| 4237 |
|
---|
| 4238 | putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
|
---|
| 4239 | tzset();
|
---|
| 4240 | if (localtime(&groundhogday)->tm_hour != 11)
|
---|
| 4241 | exit(1);
|
---|
| 4242 | #if HAVE_TZNAME
|
---|
| 4243 | if (strcmp(tzname[0], "AEST") || strcmp(tzname[1], "AEDT"))
|
---|
| 4244 | exit(1);
|
---|
| 4245 | #endif
|
---|
| 4246 |
|
---|
| 4247 | #if HAVE_STRUCT_TM_TM_ZONE
|
---|
| 4248 | if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
|
---|
| 4249 | exit(1);
|
---|
| 4250 | if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
|
---|
| 4251 | exit(1);
|
---|
| 4252 | #endif
|
---|
| 4253 |
|
---|
| 4254 | exit(0);
|
---|
| 4255 | }
|
---|
| 4256 | ]])],
|
---|
| 4257 | [ac_cv_working_tzset=yes],
|
---|
| 4258 | [ac_cv_working_tzset=no],
|
---|
| 4259 | [ac_cv_working_tzset=no])])
|
---|
| 4260 | AC_MSG_RESULT($ac_cv_working_tzset)
|
---|
| 4261 | if test "$ac_cv_working_tzset" = yes
|
---|
| 4262 | then
|
---|
| 4263 | AC_DEFINE(HAVE_WORKING_TZSET, 1,
|
---|
| 4264 | [Define if tzset() actually switches the local timezone in a meaningful way.])
|
---|
| 4265 | fi
|
---|
| 4266 |
|
---|
| 4267 | # Look for subsecond timestamps in struct stat
|
---|
| 4268 | AC_MSG_CHECKING(for tv_nsec in struct stat)
|
---|
| 4269 | AC_CACHE_VAL(ac_cv_stat_tv_nsec,
|
---|
| 4270 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[
|
---|
| 4271 | struct stat st;
|
---|
| 4272 | st.st_mtim.tv_nsec = 1;
|
---|
| 4273 | ]])],
|
---|
| 4274 | [ac_cv_stat_tv_nsec=yes],
|
---|
| 4275 | [ac_cv_stat_tv_nsec=no]))
|
---|
| 4276 | AC_MSG_RESULT($ac_cv_stat_tv_nsec)
|
---|
| 4277 | if test "$ac_cv_stat_tv_nsec" = yes
|
---|
| 4278 | then
|
---|
| 4279 | AC_DEFINE(HAVE_STAT_TV_NSEC, 1,
|
---|
| 4280 | [Define if you have struct stat.st_mtim.tv_nsec])
|
---|
| 4281 | fi
|
---|
| 4282 |
|
---|
| 4283 | # Look for BSD style subsecond timestamps in struct stat
|
---|
| 4284 | AC_MSG_CHECKING(for tv_nsec2 in struct stat)
|
---|
| 4285 | AC_CACHE_VAL(ac_cv_stat_tv_nsec2,
|
---|
| 4286 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[
|
---|
| 4287 | struct stat st;
|
---|
| 4288 | st.st_mtimespec.tv_nsec = 1;
|
---|
| 4289 | ]])],
|
---|
| 4290 | [ac_cv_stat_tv_nsec2=yes],
|
---|
| 4291 | [ac_cv_stat_tv_nsec2=no]))
|
---|
| 4292 | AC_MSG_RESULT($ac_cv_stat_tv_nsec2)
|
---|
| 4293 | if test "$ac_cv_stat_tv_nsec2" = yes
|
---|
| 4294 | then
|
---|
| 4295 | AC_DEFINE(HAVE_STAT_TV_NSEC2, 1,
|
---|
| 4296 | [Define if you have struct stat.st_mtimensec])
|
---|
| 4297 | fi
|
---|
| 4298 |
|
---|
| 4299 | # On HP/UX 11.0, mvwdelch is a block with a return statement
|
---|
| 4300 | AC_MSG_CHECKING(whether mvwdelch is an expression)
|
---|
| 4301 | AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,
|
---|
| 4302 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[
|
---|
| 4303 | int rtn;
|
---|
| 4304 | rtn = mvwdelch(0,0,0);
|
---|
| 4305 | ]])],
|
---|
| 4306 | [ac_cv_mvwdelch_is_expression=yes],
|
---|
| 4307 | [ac_cv_mvwdelch_is_expression=no]))
|
---|
| 4308 | AC_MSG_RESULT($ac_cv_mvwdelch_is_expression)
|
---|
| 4309 |
|
---|
| 4310 | if test "$ac_cv_mvwdelch_is_expression" = yes
|
---|
| 4311 | then
|
---|
| 4312 | AC_DEFINE(MVWDELCH_IS_EXPRESSION, 1,
|
---|
| 4313 | [Define if mvwdelch in curses.h is an expression.])
|
---|
| 4314 | fi
|
---|
| 4315 |
|
---|
| 4316 | AC_MSG_CHECKING(whether WINDOW has _flags)
|
---|
| 4317 | AC_CACHE_VAL(ac_cv_window_has_flags,
|
---|
| 4318 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[
|
---|
| 4319 | WINDOW *w;
|
---|
| 4320 | w->_flags = 0;
|
---|
| 4321 | ]])],
|
---|
| 4322 | [ac_cv_window_has_flags=yes],
|
---|
| 4323 | [ac_cv_window_has_flags=no]))
|
---|
| 4324 | AC_MSG_RESULT($ac_cv_window_has_flags)
|
---|
| 4325 |
|
---|
| 4326 |
|
---|
| 4327 | if test "$ac_cv_window_has_flags" = yes
|
---|
| 4328 | then
|
---|
| 4329 | AC_DEFINE(WINDOW_HAS_FLAGS, 1,
|
---|
| 4330 | [Define if WINDOW in curses.h offers a field _flags.])
|
---|
| 4331 | fi
|
---|
| 4332 |
|
---|
| 4333 | AC_MSG_CHECKING(for is_term_resized)
|
---|
| 4334 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=is_term_resized]])],
|
---|
| 4335 | [AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_resized' function.)
|
---|
| 4336 | AC_MSG_RESULT(yes)],
|
---|
| 4337 | [AC_MSG_RESULT(no)]
|
---|
| 4338 | )
|
---|
| 4339 |
|
---|
| 4340 | AC_MSG_CHECKING(for resize_term)
|
---|
| 4341 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=resize_term]])],
|
---|
| 4342 | [AC_DEFINE(HAVE_CURSES_RESIZE_TERM, 1, Define if you have the 'resize_term' function.)
|
---|
| 4343 | AC_MSG_RESULT(yes)],
|
---|
| 4344 | [AC_MSG_RESULT(no)]
|
---|
| 4345 | )
|
---|
| 4346 |
|
---|
| 4347 | AC_MSG_CHECKING(for resizeterm)
|
---|
| 4348 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=resizeterm]])],
|
---|
| 4349 | [AC_DEFINE(HAVE_CURSES_RESIZETERM, 1, Define if you have the 'resizeterm' function.)
|
---|
| 4350 | AC_MSG_RESULT(yes)],
|
---|
| 4351 | [AC_MSG_RESULT(no)]
|
---|
| 4352 | )
|
---|
| 4353 |
|
---|
| 4354 | AC_MSG_NOTICE([checking for device files])
|
---|
| 4355 |
|
---|
| 4356 | dnl NOTE: Inform user how to proceed with files when cross compiling.
|
---|
| 4357 | if test "x$cross_compiling" = xyes; then
|
---|
| 4358 | if test "${ac_cv_file__dev_ptmx+set}" != set; then
|
---|
| 4359 | AC_MSG_CHECKING([for /dev/ptmx])
|
---|
| 4360 | AC_MSG_RESULT([not set])
|
---|
| 4361 | AC_MSG_ERROR([set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling])
|
---|
| 4362 | fi
|
---|
| 4363 | if test "${ac_cv_file__dev_ptc+set}" != set; then
|
---|
| 4364 | AC_MSG_CHECKING([for /dev/ptc])
|
---|
| 4365 | AC_MSG_RESULT([not set])
|
---|
| 4366 | AC_MSG_ERROR([set ac_cv_file__dev_ptc to yes/no in your CONFIG_SITE file when cross compiling])
|
---|
| 4367 | fi
|
---|
| 4368 | fi
|
---|
| 4369 |
|
---|
| 4370 | AC_CHECK_FILE(/dev/ptmx, [], [])
|
---|
| 4371 | if test "x$ac_cv_file__dev_ptmx" = xyes; then
|
---|
| 4372 | AC_DEFINE(HAVE_DEV_PTMX, 1,
|
---|
| 4373 | [Define to 1 if you have the /dev/ptmx device file.])
|
---|
| 4374 | fi
|
---|
| 4375 | AC_CHECK_FILE(/dev/ptc, [], [])
|
---|
| 4376 | if test "x$ac_cv_file__dev_ptc" = xyes; then
|
---|
| 4377 | AC_DEFINE(HAVE_DEV_PTC, 1,
|
---|
| 4378 | [Define to 1 if you have the /dev/ptc device file.])
|
---|
| 4379 | fi
|
---|
| 4380 |
|
---|
| 4381 | if test "$have_long_long" = yes
|
---|
| 4382 | then
|
---|
| 4383 | AC_MSG_CHECKING(for %lld and %llu printf() format support)
|
---|
| 4384 | AC_CACHE_VAL(ac_cv_have_long_long_format,
|
---|
| 4385 | AC_RUN_IFELSE([AC_LANG_SOURCE([[[
|
---|
| 4386 | #include <stdio.h>
|
---|
| 4387 | #include <stddef.h>
|
---|
| 4388 | #include <string.h>
|
---|
| 4389 |
|
---|
| 4390 | #ifdef HAVE_SYS_TYPES_H
|
---|
| 4391 | #include <sys/types.h>
|
---|
| 4392 | #endif
|
---|
| 4393 |
|
---|
| 4394 | int main()
|
---|
| 4395 | {
|
---|
| 4396 | char buffer[256];
|
---|
| 4397 |
|
---|
| 4398 | if (sprintf(buffer, "%lld", (long long)123) < 0)
|
---|
| 4399 | return 1;
|
---|
| 4400 | if (strcmp(buffer, "123"))
|
---|
| 4401 | return 1;
|
---|
| 4402 |
|
---|
| 4403 | if (sprintf(buffer, "%lld", (long long)-123) < 0)
|
---|
| 4404 | return 1;
|
---|
| 4405 | if (strcmp(buffer, "-123"))
|
---|
| 4406 | return 1;
|
---|
| 4407 |
|
---|
| 4408 | if (sprintf(buffer, "%llu", (unsigned long long)123) < 0)
|
---|
| 4409 | return 1;
|
---|
| 4410 | if (strcmp(buffer, "123"))
|
---|
| 4411 | return 1;
|
---|
| 4412 |
|
---|
| 4413 | return 0;
|
---|
| 4414 | }
|
---|
| 4415 | ]]])],
|
---|
| 4416 | [ac_cv_have_long_long_format=yes],
|
---|
| 4417 | [ac_cv_have_long_long_format=no],
|
---|
| 4418 | [ac_cv_have_long_long_format="cross -- assuming no"
|
---|
| 4419 | if test x$GCC = xyes; then
|
---|
| 4420 | save_CFLAGS=$CFLAGS
|
---|
| 4421 | CFLAGS="$CFLAGS -Werror -Wformat"
|
---|
| 4422 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
---|
| 4423 | #include <stdio.h>
|
---|
| 4424 | #include <stddef.h>
|
---|
| 4425 | ]], [[
|
---|
| 4426 | char *buffer;
|
---|
| 4427 | sprintf(buffer, "%lld", (long long)123);
|
---|
| 4428 | sprintf(buffer, "%lld", (long long)-123);
|
---|
| 4429 | sprintf(buffer, "%llu", (unsigned long long)123);
|
---|
| 4430 | ]])],
|
---|
| 4431 | ac_cv_have_long_long_format=yes
|
---|
| 4432 | )
|
---|
| 4433 | CFLAGS=$save_CFLAGS
|
---|
| 4434 | fi])
|
---|
| 4435 | )
|
---|
| 4436 | AC_MSG_RESULT($ac_cv_have_long_long_format)
|
---|
| 4437 | fi
|
---|
| 4438 |
|
---|
| 4439 | if test "$ac_cv_have_long_long_format" = yes
|
---|
| 4440 | then
|
---|
| 4441 | AC_DEFINE(PY_FORMAT_LONG_LONG, "ll",
|
---|
| 4442 | [Define to printf format modifier for long long type])
|
---|
| 4443 | fi
|
---|
| 4444 |
|
---|
| 4445 | if test $ac_sys_system = Darwin
|
---|
| 4446 | then
|
---|
| 4447 | LIBS="$LIBS -framework CoreFoundation"
|
---|
| 4448 | fi
|
---|
| 4449 |
|
---|
| 4450 |
|
---|
| 4451 | AC_CACHE_CHECK([for %zd printf() format support], ac_cv_have_size_t_format, [dnl
|
---|
| 4452 | AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
---|
| 4453 | #include <stdio.h>
|
---|
| 4454 | #include <stddef.h>
|
---|
| 4455 | #include <string.h>
|
---|
| 4456 |
|
---|
| 4457 | #ifdef HAVE_SYS_TYPES_H
|
---|
| 4458 | #include <sys/types.h>
|
---|
| 4459 | #endif
|
---|
| 4460 |
|
---|
| 4461 | #ifdef HAVE_SSIZE_T
|
---|
| 4462 | typedef ssize_t Py_ssize_t;
|
---|
| 4463 | #elif SIZEOF_VOID_P == SIZEOF_LONG
|
---|
| 4464 | typedef long Py_ssize_t;
|
---|
| 4465 | #else
|
---|
| 4466 | typedef int Py_ssize_t;
|
---|
| 4467 | #endif
|
---|
| 4468 |
|
---|
| 4469 | int main()
|
---|
| 4470 | {
|
---|
| 4471 | char buffer[256];
|
---|
| 4472 |
|
---|
| 4473 | if(sprintf(buffer, "%zd", (size_t)123) < 0)
|
---|
| 4474 | return 1;
|
---|
| 4475 |
|
---|
| 4476 | if (strcmp(buffer, "123"))
|
---|
| 4477 | return 1;
|
---|
| 4478 |
|
---|
| 4479 | if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
|
---|
| 4480 | return 1;
|
---|
| 4481 |
|
---|
| 4482 | if (strcmp(buffer, "-123"))
|
---|
| 4483 | return 1;
|
---|
| 4484 |
|
---|
| 4485 | return 0;
|
---|
| 4486 | }
|
---|
| 4487 | ]])],
|
---|
| 4488 | [ac_cv_have_size_t_format=yes],
|
---|
| 4489 | [ac_cv_have_size_t_format=no],
|
---|
| 4490 | [ac_cv_have_size_t_format="cross -- assuming yes"
|
---|
| 4491 | ])])
|
---|
| 4492 | if test "$ac_cv_have_size_t_format" != no ; then
|
---|
| 4493 | AC_DEFINE(PY_FORMAT_SIZE_T, "z",
|
---|
| 4494 | [Define to printf format modifier for Py_ssize_t])
|
---|
| 4495 | fi
|
---|
| 4496 |
|
---|
| 4497 | AC_CHECK_TYPE(socklen_t,,
|
---|
| 4498 | AC_DEFINE(socklen_t,int,
|
---|
| 4499 | [Define to `int' if <sys/socket.h> does not define.]),[
|
---|
| 4500 | #ifdef HAVE_SYS_TYPES_H
|
---|
| 4501 | #include <sys/types.h>
|
---|
| 4502 | #endif
|
---|
| 4503 | #ifdef HAVE_SYS_SOCKET_H
|
---|
| 4504 | #include <sys/socket.h>
|
---|
| 4505 | #endif
|
---|
| 4506 | ])
|
---|
| 4507 |
|
---|
| 4508 | case $ac_sys_system in
|
---|
| 4509 | AIX*)
|
---|
| 4510 | AC_DEFINE(HAVE_BROKEN_PIPE_BUF, 1, [Define if the system reports an invalid PIPE_BUF value.]) ;;
|
---|
| 4511 | esac
|
---|
| 4512 |
|
---|
| 4513 |
|
---|
| 4514 | AC_SUBST(THREADHEADERS)
|
---|
| 4515 |
|
---|
| 4516 | for h in `(cd $srcdir;echo Python/thread_*.h)`
|
---|
| 4517 | do
|
---|
| 4518 | THREADHEADERS="$THREADHEADERS \$(srcdir)/$h"
|
---|
| 4519 | done
|
---|
| 4520 |
|
---|
| 4521 | AC_SUBST(SRCDIRS)
|
---|
| 4522 | SRCDIRS="Parser Grammar Objects Python Modules Mac"
|
---|
| 4523 | AC_MSG_CHECKING(for build directories)
|
---|
| 4524 | for dir in $SRCDIRS; do
|
---|
| 4525 | if test ! -d $dir; then
|
---|
| 4526 | mkdir $dir
|
---|
| 4527 | fi
|
---|
| 4528 | done
|
---|
| 4529 | AC_MSG_RESULT(done)
|
---|
| 4530 |
|
---|
| 4531 | # generate output files
|
---|
| 4532 | AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
|
---|
| 4533 | AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
|
---|
| 4534 | AC_OUTPUT
|
---|
| 4535 |
|
---|
| 4536 | echo "creating Modules/Setup"
|
---|
| 4537 | if test ! -f Modules/Setup
|
---|
| 4538 | then
|
---|
| 4539 | cp $srcdir/Modules/Setup.dist Modules/Setup
|
---|
| 4540 | fi
|
---|
| 4541 |
|
---|
| 4542 | echo "creating Modules/Setup.local"
|
---|
| 4543 | if test ! -f Modules/Setup.local
|
---|
| 4544 | then
|
---|
| 4545 | echo "# Edit this file for local setup changes" >Modules/Setup.local
|
---|
| 4546 | fi
|
---|
| 4547 |
|
---|
| 4548 | echo "creating Makefile"
|
---|
| 4549 | $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
|
---|
| 4550 | -s Modules Modules/Setup.config \
|
---|
| 4551 | Modules/Setup.local Modules/Setup
|
---|
| 4552 |
|
---|
| 4553 | case $ac_sys_system in
|
---|
| 4554 | BeOS)
|
---|
| 4555 | AC_MSG_WARN([
|
---|
| 4556 |
|
---|
| 4557 | Support for BeOS is deprecated as of Python 2.6.
|
---|
| 4558 | See PEP 11 for the gory details.
|
---|
| 4559 | ])
|
---|
| 4560 | ;;
|
---|
| 4561 | *) ;;
|
---|
| 4562 | esac
|
---|
| 4563 |
|
---|
| 4564 | mv config.c Modules
|
---|