| 1 | dnl Process this file with autoconf 2.0 or later to make a configure script.
|
|---|
| 2 |
|
|---|
| 3 | # Set VERSION so we only need to edit in one place (i.e., here)
|
|---|
| 4 | m4_define(PYTHON_VERSION, 2.5)
|
|---|
| 5 |
|
|---|
| 6 | AC_REVISION($Revision: 51727 $)
|
|---|
| 7 | AC_PREREQ(2.59)
|
|---|
| 8 | AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
|
|---|
| 9 | AC_CONFIG_SRCDIR([Include/object.h])
|
|---|
| 10 | AC_CONFIG_HEADER(pyconfig.h)
|
|---|
| 11 |
|
|---|
| 12 | dnl This is for stuff that absolutely must end up in pyconfig.h.
|
|---|
| 13 | dnl Please use pyport.h instead, if possible.
|
|---|
| 14 | AH_TOP([
|
|---|
| 15 | #ifndef Py_PYCONFIG_H
|
|---|
| 16 | #define Py_PYCONFIG_H
|
|---|
| 17 | ])
|
|---|
| 18 | AH_BOTTOM([
|
|---|
| 19 | /* Define the macros needed if on a UnixWare 7.x system. */
|
|---|
| 20 | #if defined(__USLC__) && defined(__SCO_VERSION__)
|
|---|
| 21 | #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
|
|---|
| 22 | #endif
|
|---|
| 23 |
|
|---|
| 24 | #endif /*Py_PYCONFIG_H*/
|
|---|
| 25 | ])
|
|---|
| 26 |
|
|---|
| 27 | # We don't use PACKAGE_ variables, and they cause conflicts
|
|---|
| 28 | # with other autoconf-based packages that include Python.h
|
|---|
| 29 | grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new
|
|---|
| 30 | rm confdefs.h
|
|---|
| 31 | mv confdefs.h.new confdefs.h
|
|---|
| 32 |
|
|---|
| 33 | AC_SUBST(VERSION)
|
|---|
| 34 | VERSION=PYTHON_VERSION
|
|---|
| 35 |
|
|---|
| 36 | AC_SUBST(SOVERSION)
|
|---|
| 37 | SOVERSION=1.0
|
|---|
| 38 |
|
|---|
| 39 | # The later defininition of _XOPEN_SOURCE disables certain features
|
|---|
| 40 | # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
|
|---|
| 41 | AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features])
|
|---|
| 42 |
|
|---|
| 43 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
|---|
| 44 | # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
|
|---|
| 45 | # them.
|
|---|
| 46 | AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
|
|---|
| 47 |
|
|---|
| 48 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
|---|
| 49 | # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
|
|---|
| 50 | # them.
|
|---|
| 51 | AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
|
|---|
| 52 |
|
|---|
| 53 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
|---|
| 54 | # u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
|
|---|
| 55 | AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
|
|---|
| 56 |
|
|---|
| 57 | define_xopen_source=yes
|
|---|
| 58 |
|
|---|
| 59 | # Arguments passed to configure.
|
|---|
| 60 | AC_SUBST(CONFIG_ARGS)
|
|---|
| 61 | CONFIG_ARGS="$ac_configure_args"
|
|---|
| 62 |
|
|---|
| 63 | AC_ARG_ENABLE(universalsdk,
|
|---|
| 64 | AC_HELP_STRING(--enable-universalsdk@<:@SDKDIR@:>@, Build agains Mac OS X 10.4u SDK (ppc/i386)),
|
|---|
| 65 | [
|
|---|
| 66 | case $enableval in
|
|---|
| 67 | yes)
|
|---|
| 68 | enableval=/Developer/SDKs/MacOSX10.4u.sdk
|
|---|
| 69 | ;;
|
|---|
| 70 | esac
|
|---|
| 71 | case $enableval in
|
|---|
| 72 | no)
|
|---|
| 73 | UNIVERSALSDK=
|
|---|
| 74 | enable_universalsdk=
|
|---|
| 75 | ;;
|
|---|
| 76 | *)
|
|---|
| 77 | UNIVERSALSDK=$enableval
|
|---|
| 78 | ;;
|
|---|
| 79 | esac
|
|---|
| 80 | ],[
|
|---|
| 81 | UNIVERSALSDK=
|
|---|
| 82 | enable_universalsdk=
|
|---|
| 83 | ])
|
|---|
| 84 | AC_SUBST(UNIVERSALSDK)
|
|---|
| 85 |
|
|---|
| 86 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
|---|
| 87 | AC_ARG_ENABLE(framework,
|
|---|
| 88 | AC_HELP_STRING(--enable-framework@<:@=INSTALLDIR@:>@, Build (MacOSX|Darwin) framework),
|
|---|
| 89 | [
|
|---|
| 90 | case $enableval in
|
|---|
| 91 | yes)
|
|---|
| 92 | enableval=/Library/Frameworks
|
|---|
| 93 | esac
|
|---|
| 94 | case $enableval in
|
|---|
| 95 | no)
|
|---|
| 96 | PYTHONFRAMEWORK=
|
|---|
| 97 | PYTHONFRAMEWORKDIR=no-framework
|
|---|
| 98 | PYTHONFRAMEWORKPREFIX=
|
|---|
| 99 | PYTHONFRAMEWORKINSTALLDIR=
|
|---|
| 100 | FRAMEWORKINSTALLFIRST=
|
|---|
| 101 | FRAMEWORKINSTALLLAST=
|
|---|
| 102 | FRAMEWORKALTINSTALLFIRST=
|
|---|
| 103 | FRAMEWORKALTINSTALLLAST=
|
|---|
| 104 | if test "x${prefix}" = "xNONE"; then
|
|---|
| 105 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
|
|---|
| 106 | else
|
|---|
| 107 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
|
|---|
| 108 | fi
|
|---|
| 109 | enable_framework=
|
|---|
| 110 | ;;
|
|---|
| 111 | *)
|
|---|
| 112 | PYTHONFRAMEWORK=Python
|
|---|
| 113 | PYTHONFRAMEWORKDIR=Python.framework
|
|---|
| 114 | PYTHONFRAMEWORKPREFIX=$enableval
|
|---|
| 115 | PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
|
|---|
| 116 | FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
|
|---|
| 117 | FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
|
|---|
| 118 | FRAMEWORKALTINSTALLFIRST="${FRAMEWORKINSTALLFIRST} bininstall maninstall"
|
|---|
| 119 | FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
|
|---|
| 120 | if test "x${prefix}" = "xNONE" ; then
|
|---|
| 121 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
|
|---|
| 122 | else
|
|---|
| 123 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
|
|---|
| 124 | fi
|
|---|
| 125 | prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
|
|---|
| 126 |
|
|---|
| 127 | # Add makefiles for Mac specific code to the list of output
|
|---|
| 128 | # files:
|
|---|
| 129 | AC_CONFIG_FILES(Mac/Makefile)
|
|---|
| 130 | AC_CONFIG_FILES(Mac/PythonLauncher/Makefile)
|
|---|
| 131 | AC_CONFIG_FILES(Mac/IDLE/Makefile)
|
|---|
| 132 | esac
|
|---|
| 133 | ],[
|
|---|
| 134 | PYTHONFRAMEWORK=
|
|---|
| 135 | PYTHONFRAMEWORKDIR=no-framework
|
|---|
| 136 | PYTHONFRAMEWORKPREFIX=
|
|---|
| 137 | PYTHONFRAMEWORKINSTALLDIR=
|
|---|
| 138 | FRAMEWORKINSTALLFIRST=
|
|---|
| 139 | FRAMEWORKINSTALLLAST=
|
|---|
| 140 | FRAMEWORKALTINSTALLFIRST=
|
|---|
| 141 | FRAMEWORKALTINSTALLLAST=
|
|---|
| 142 | if test "x${prefix}" = "xNONE" ; then
|
|---|
| 143 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
|
|---|
| 144 | else
|
|---|
| 145 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
|
|---|
| 146 | fi
|
|---|
| 147 | enable_framework=
|
|---|
| 148 | ])
|
|---|
| 149 | AC_SUBST(PYTHONFRAMEWORK)
|
|---|
| 150 | AC_SUBST(PYTHONFRAMEWORKDIR)
|
|---|
| 151 | AC_SUBST(PYTHONFRAMEWORKPREFIX)
|
|---|
| 152 | AC_SUBST(PYTHONFRAMEWORKINSTALLDIR)
|
|---|
| 153 | AC_SUBST(FRAMEWORKINSTALLFIRST)
|
|---|
| 154 | AC_SUBST(FRAMEWORKINSTALLLAST)
|
|---|
| 155 | AC_SUBST(FRAMEWORKALTINSTALLFIRST)
|
|---|
| 156 | AC_SUBST(FRAMEWORKALTINSTALLLAST)
|
|---|
| 157 | AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
|
|---|
| 158 |
|
|---|
| 159 | ##AC_ARG_WITH(dyld,
|
|---|
| 160 | ## AC_HELP_STRING(--with-dyld,
|
|---|
| 161 | ## Use (OpenStep|Rhapsody) dynamic linker))
|
|---|
| 162 | ##
|
|---|
| 163 | # Set name for machine-dependent library files
|
|---|
| 164 | AC_SUBST(MACHDEP)
|
|---|
| 165 | AC_MSG_CHECKING(MACHDEP)
|
|---|
| 166 | if test -z "$MACHDEP"
|
|---|
| 167 | then
|
|---|
| 168 | ac_sys_system=`uname -s`
|
|---|
| 169 | if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
|
|---|
| 170 | -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
|
|---|
| 171 | ac_sys_release=`uname -v`
|
|---|
| 172 | else
|
|---|
| 173 | ac_sys_release=`uname -r`
|
|---|
| 174 | fi
|
|---|
| 175 | ac_md_system=`echo $ac_sys_system |
|
|---|
| 176 | tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
|
|---|
| 177 | ac_md_release=`echo $ac_sys_release |
|
|---|
| 178 | tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
|
|---|
| 179 | MACHDEP="$ac_md_system$ac_md_release"
|
|---|
| 180 |
|
|---|
| 181 | case $MACHDEP in
|
|---|
| 182 | cygwin*) MACHDEP="cygwin";;
|
|---|
| 183 | darwin*) MACHDEP="darwin";;
|
|---|
| 184 | atheos*) MACHDEP="atheos";;
|
|---|
| 185 | irix646) MACHDEP="irix6";;
|
|---|
| 186 | os2*|OS/2*|emx*) MACHDEP="emx";;
|
|---|
| 187 |
|
|---|
| 188 | '') MACHDEP="unknown";;
|
|---|
| 189 | esac
|
|---|
| 190 | fi
|
|---|
| 191 |
|
|---|
| 192 | # Some systems cannot stand _XOPEN_SOURCE being defined at all; they
|
|---|
| 193 | # disable features if it is defined, without any means to access these
|
|---|
| 194 | # features as extensions. For these systems, we skip the definition of
|
|---|
| 195 | # _XOPEN_SOURCE. Before adding a system to the list to gain access to
|
|---|
| 196 | # some feature, make sure there is no alternative way to access this
|
|---|
| 197 | # feature. Also, when using wildcards, make sure you have verified the
|
|---|
| 198 | # need for not defining _XOPEN_SOURCE on all systems matching the
|
|---|
| 199 | # wildcard, and that the wildcard does not include future systems
|
|---|
| 200 | # (which may remove their limitations).
|
|---|
| 201 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
|
|---|
| 202 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 203 | # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
|
|---|
| 204 | # even though select is a POSIX function. Reported by J. Ribbens.
|
|---|
| 205 | # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
|
|---|
| 206 | OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0@:>@)
|
|---|
| 207 | define_xopen_source=no;;
|
|---|
| 208 | # On Solaris 2.6, sys/wait.h is inconsistent in the usage
|
|---|
| 209 | # of union __?sigval. Reported by Stuart Bishop.
|
|---|
| 210 | SunOS/5.6)
|
|---|
| 211 | define_xopen_source=no;;
|
|---|
| 212 | # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
|
|---|
| 213 | # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
|
|---|
| 214 | # Reconfirmed for 7.1.4 by Martin v. Loewis.
|
|---|
| 215 | OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
|
|---|
| 216 | define_xopen_source=no;;
|
|---|
| 217 | # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
|
|---|
| 218 | # but used in struct sockaddr.sa_family. Reported by Tim Rice.
|
|---|
| 219 | SCO_SV/3.2)
|
|---|
| 220 | define_xopen_source=no;;
|
|---|
| 221 | # On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that
|
|---|
| 222 | # it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently,
|
|---|
| 223 | # this is fixed in 10.3, which identifies itself as Darwin/7.*
|
|---|
| 224 | # This should hopefully be fixed in FreeBSD 4.9
|
|---|
| 225 | FreeBSD/4.8* | Darwin/6* )
|
|---|
| 226 | define_xopen_source=no;;
|
|---|
| 227 | # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
|
|---|
| 228 | # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
|
|---|
| 229 | # or has another value. By not (re)defining it, the defaults come in place.
|
|---|
| 230 | AIX/4)
|
|---|
| 231 | define_xopen_source=no;;
|
|---|
| 232 | AIX/5)
|
|---|
| 233 | if test `uname -r` -eq 1; then
|
|---|
| 234 | define_xopen_source=no
|
|---|
| 235 | fi
|
|---|
| 236 | ;;
|
|---|
| 237 | # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
|
|---|
| 238 | # disables platform specific features beyond repair.
|
|---|
| 239 | # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
|
|---|
| 240 | # has no effect, don't bother defining them
|
|---|
| 241 | Darwin/@<:@789@:>@.*)
|
|---|
| 242 | define_xopen_source=no
|
|---|
| 243 | ;;
|
|---|
| 244 |
|
|---|
| 245 | esac
|
|---|
| 246 |
|
|---|
| 247 | if test $define_xopen_source = yes
|
|---|
| 248 | then
|
|---|
| 249 | # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
|
|---|
| 250 | # defined precisely as g++ defines it
|
|---|
| 251 | # Furthermore, on Solaris 10, XPG6 requires the use of a C99
|
|---|
| 252 | # compiler
|
|---|
| 253 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 254 | SunOS/5.8|SunOS/5.9|SunOS/5.10)
|
|---|
| 255 | AC_DEFINE(_XOPEN_SOURCE, 500,
|
|---|
| 256 | Define to the level of X/Open that your system supports)
|
|---|
| 257 | ;;
|
|---|
| 258 | *)
|
|---|
| 259 | AC_DEFINE(_XOPEN_SOURCE, 600,
|
|---|
| 260 | Define to the level of X/Open that your system supports)
|
|---|
| 261 | ;;
|
|---|
| 262 | esac
|
|---|
| 263 |
|
|---|
| 264 | # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
|
|---|
| 265 | # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
|
|---|
| 266 | # several APIs are not declared. Since this is also needed in some
|
|---|
| 267 | # cases for HP-UX, we define it globally.
|
|---|
| 268 | # except for Solaris 10, where it must not be defined,
|
|---|
| 269 | # as it implies XPG4.2
|
|---|
| 270 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 271 | SunOS/5.10)
|
|---|
| 272 | ;;
|
|---|
| 273 | *)
|
|---|
| 274 | AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
|
|---|
| 275 | Define to activate Unix95-and-earlier features)
|
|---|
| 276 | ;;
|
|---|
| 277 | esac
|
|---|
| 278 |
|
|---|
| 279 | AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
|
|---|
| 280 |
|
|---|
| 281 | fi
|
|---|
| 282 |
|
|---|
| 283 | #
|
|---|
| 284 | # SGI compilers allow the specification of the both the ABI and the
|
|---|
| 285 | # ISA on the command line. Depending on the values of these switches,
|
|---|
| 286 | # different and often incompatable code will be generated.
|
|---|
| 287 | #
|
|---|
| 288 | # The SGI_ABI variable can be used to modify the CC and LDFLAGS and
|
|---|
| 289 | # thus supply support for various ABI/ISA combinations. The MACHDEP
|
|---|
| 290 | # variable is also adjusted.
|
|---|
| 291 | #
|
|---|
| 292 | AC_SUBST(SGI_ABI)
|
|---|
| 293 | if test ! -z "$SGI_ABI"
|
|---|
| 294 | then
|
|---|
| 295 | CC="cc $SGI_ABI"
|
|---|
| 296 | LDFLAGS="$SGI_ABI $LDFLAGS"
|
|---|
| 297 | MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
|
|---|
| 298 | fi
|
|---|
| 299 | AC_MSG_RESULT($MACHDEP)
|
|---|
| 300 |
|
|---|
| 301 | # And add extra plat-mac for darwin
|
|---|
| 302 | AC_SUBST(EXTRAPLATDIR)
|
|---|
| 303 | AC_SUBST(EXTRAMACHDEPPATH)
|
|---|
| 304 | AC_MSG_CHECKING(EXTRAPLATDIR)
|
|---|
| 305 | if test -z "$EXTRAPLATDIR"
|
|---|
| 306 | then
|
|---|
| 307 | case $MACHDEP in
|
|---|
| 308 | darwin)
|
|---|
| 309 | EXTRAPLATDIR="\$(PLATMACDIRS)"
|
|---|
| 310 | EXTRAMACHDEPPATH="\$(PLATMACPATH)"
|
|---|
| 311 | ;;
|
|---|
| 312 | *)
|
|---|
| 313 | EXTRAPLATDIR=""
|
|---|
| 314 | EXTRAMACHDEPPATH=""
|
|---|
| 315 | ;;
|
|---|
| 316 | esac
|
|---|
| 317 | fi
|
|---|
| 318 | AC_MSG_RESULT($EXTRAPLATDIR)
|
|---|
| 319 |
|
|---|
| 320 | # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
|
|---|
| 321 | # it may influence the way we can build extensions, so distutils
|
|---|
| 322 | # needs to check it
|
|---|
| 323 | AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
|
|---|
| 324 | AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
|
|---|
| 325 | CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
|
|---|
| 326 | EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
|
|---|
| 327 |
|
|---|
| 328 | # checks for alternative programs
|
|---|
| 329 |
|
|---|
| 330 | # compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
|
|---|
| 331 | # for debug/optimization stuff. BASECFLAGS is for flags that are required
|
|---|
| 332 | # just to get things to compile and link. Users are free to override OPT
|
|---|
| 333 | # when running configure or make. The build should not break if they do.
|
|---|
| 334 | # BASECFLAGS should generally not be messed with, however.
|
|---|
| 335 |
|
|---|
| 336 | # XXX shouldn't some/most/all of this code be merged with the stuff later
|
|---|
| 337 | # on that fiddles with OPT and BASECFLAGS?
|
|---|
| 338 | AC_MSG_CHECKING(for --without-gcc)
|
|---|
| 339 | AC_ARG_WITH(gcc,
|
|---|
| 340 | AC_HELP_STRING(--without-gcc,never use gcc),
|
|---|
| 341 | [
|
|---|
| 342 | case $withval in
|
|---|
| 343 | no) CC=cc
|
|---|
| 344 | without_gcc=yes;;
|
|---|
| 345 | yes) CC=gcc
|
|---|
| 346 | without_gcc=no;;
|
|---|
| 347 | *) CC=$withval
|
|---|
| 348 | without_gcc=$withval;;
|
|---|
| 349 | esac], [
|
|---|
| 350 | case $ac_sys_system in
|
|---|
| 351 | AIX*) CC=cc_r
|
|---|
| 352 | without_gcc=;;
|
|---|
| 353 | BeOS*)
|
|---|
| 354 | case $BE_HOST_CPU in
|
|---|
| 355 | ppc)
|
|---|
| 356 | CC=mwcc
|
|---|
| 357 | without_gcc=yes
|
|---|
| 358 | BASECFLAGS="$BASECFLAGS -export pragma"
|
|---|
| 359 | OPT="$OPT -O"
|
|---|
| 360 | LDFLAGS="$LDFLAGS -nodup"
|
|---|
| 361 | ;;
|
|---|
| 362 | x86)
|
|---|
| 363 | CC=gcc
|
|---|
| 364 | without_gcc=no
|
|---|
| 365 | OPT="$OPT -O"
|
|---|
| 366 | ;;
|
|---|
| 367 | *)
|
|---|
| 368 | AC_MSG_ERROR([Unknown BeOS platform "$BE_HOST_CPU"])
|
|---|
| 369 | ;;
|
|---|
| 370 | esac
|
|---|
| 371 | AR="\$(srcdir)/Modules/ar_beos"
|
|---|
| 372 | RANLIB=:
|
|---|
| 373 | ;;
|
|---|
| 374 | Monterey*)
|
|---|
| 375 | RANLIB=:
|
|---|
| 376 | without_gcc=;;
|
|---|
| 377 | *) without_gcc=no;;
|
|---|
| 378 | esac])
|
|---|
| 379 | AC_MSG_RESULT($without_gcc)
|
|---|
| 380 |
|
|---|
| 381 | # If the user switches compilers, we can't believe the cache
|
|---|
| 382 | if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
|
|---|
| 383 | then
|
|---|
| 384 | AC_MSG_ERROR([cached CC is different -- throw away $cache_file
|
|---|
| 385 | (it is also a good idea to do 'make clean' before compiling)])
|
|---|
| 386 | fi
|
|---|
| 387 |
|
|---|
| 388 | AC_PROG_CC
|
|---|
| 389 |
|
|---|
| 390 | AC_SUBST(CXX)
|
|---|
| 391 | AC_SUBST(MAINCC)
|
|---|
| 392 | AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
|
|---|
| 393 | AC_ARG_WITH(cxx_main,
|
|---|
| 394 | AC_HELP_STRING([--with-cxx-main=<compiler>],
|
|---|
| 395 | [compile main() and link python executable with C++ compiler]),
|
|---|
| 396 | [
|
|---|
| 397 |
|
|---|
| 398 | case $withval in
|
|---|
| 399 | no) with_cxx_main=no
|
|---|
| 400 | MAINCC='$(CC)';;
|
|---|
| 401 | yes) with_cxx_main=yes
|
|---|
| 402 | MAINCC='$(CXX)';;
|
|---|
| 403 | *) with_cxx_main=yes
|
|---|
| 404 | MAINCC=$withval
|
|---|
| 405 | if test -z "$CXX"
|
|---|
| 406 | then
|
|---|
| 407 | CXX=$withval
|
|---|
| 408 | fi;;
|
|---|
| 409 | esac], [
|
|---|
| 410 | with_cxx_main=no
|
|---|
| 411 | MAINCC='$(CC)'
|
|---|
| 412 | ])
|
|---|
| 413 | AC_MSG_RESULT($with_cxx_main)
|
|---|
| 414 |
|
|---|
| 415 | preset_cxx="$CXX"
|
|---|
| 416 | if test -z "$CXX"
|
|---|
| 417 | then
|
|---|
| 418 | case "$CC" in
|
|---|
| 419 | gcc) AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;;
|
|---|
| 420 | cc) AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;;
|
|---|
| 421 | esac
|
|---|
| 422 | if test "$CXX" = "notfound"
|
|---|
| 423 | then
|
|---|
| 424 | CXX=""
|
|---|
| 425 | fi
|
|---|
| 426 | fi
|
|---|
| 427 | if test -z "$CXX"
|
|---|
| 428 | then
|
|---|
| 429 | AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
|
|---|
| 430 | if test "$CXX" = "notfound"
|
|---|
| 431 | then
|
|---|
| 432 | CXX=""
|
|---|
| 433 | fi
|
|---|
| 434 | fi
|
|---|
| 435 | if test "$preset_cxx" != "$CXX"
|
|---|
| 436 | then
|
|---|
| 437 | AC_MSG_WARN([
|
|---|
| 438 |
|
|---|
| 439 | By default, distutils will build C++ extension modules with "$CXX".
|
|---|
| 440 | If this is not intended, then set CXX on the configure command line.
|
|---|
| 441 | ])
|
|---|
| 442 | fi
|
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 | # checks for UNIX variants that set C preprocessor variables
|
|---|
| 446 | AC_AIX
|
|---|
| 447 |
|
|---|
| 448 | # Check for unsupported systems
|
|---|
| 449 | case $ac_sys_system/$ac_sys_release in
|
|---|
| 450 | Linux*/1*)
|
|---|
| 451 | echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
|
|---|
| 452 | echo See README for details.
|
|---|
| 453 | exit 1;;
|
|---|
| 454 | esac
|
|---|
| 455 |
|
|---|
| 456 | AC_EXEEXT
|
|---|
| 457 | AC_MSG_CHECKING(for --with-suffix)
|
|---|
| 458 | AC_ARG_WITH(suffix,
|
|---|
| 459 | AC_HELP_STRING(--with-suffix=.exe, set executable suffix),
|
|---|
| 460 | [
|
|---|
| 461 | case $withval in
|
|---|
| 462 | no) EXEEXT=;;
|
|---|
| 463 | yes) EXEEXT=.exe;;
|
|---|
| 464 | *) EXEEXT=$withval;;
|
|---|
| 465 | esac])
|
|---|
| 466 | AC_MSG_RESULT($EXEEXT)
|
|---|
| 467 |
|
|---|
| 468 | # Test whether we're running on a non-case-sensitive system, in which
|
|---|
| 469 | # case we give a warning if no ext is given
|
|---|
| 470 | AC_SUBST(BUILDEXEEXT)
|
|---|
| 471 | AC_MSG_CHECKING(for case-insensitive build directory)
|
|---|
| 472 | if test ! -d CaseSensitiveTestDir; then
|
|---|
| 473 | mkdir CaseSensitiveTestDir
|
|---|
| 474 | fi
|
|---|
| 475 |
|
|---|
| 476 | if test -d casesensitivetestdir
|
|---|
| 477 | then
|
|---|
| 478 | AC_MSG_RESULT(yes)
|
|---|
| 479 | BUILDEXEEXT=.exe
|
|---|
| 480 | else
|
|---|
| 481 | AC_MSG_RESULT(no)
|
|---|
| 482 | BUILDEXEEXT=$EXEEXT
|
|---|
| 483 | fi
|
|---|
| 484 | rmdir CaseSensitiveTestDir
|
|---|
| 485 |
|
|---|
| 486 | case $MACHDEP in
|
|---|
| 487 | bsdos*)
|
|---|
| 488 | case $CC in
|
|---|
| 489 | gcc) CC="$CC -D_HAVE_BSDI";;
|
|---|
| 490 | esac;;
|
|---|
| 491 | OS/2*|os2*|emx*)
|
|---|
| 492 | CC="$CC -DPYOS_OS2=1 -DPYCC_GCC=1"
|
|---|
| 493 | ;;
|
|---|
| 494 | esac
|
|---|
| 495 |
|
|---|
| 496 | case $ac_sys_system in
|
|---|
| 497 | hp*|HP*)
|
|---|
| 498 | case $CC in
|
|---|
| 499 | cc|*/cc) CC="$CC -Ae";;
|
|---|
| 500 | esac;;
|
|---|
| 501 | Monterey*)
|
|---|
| 502 | case $CC in
|
|---|
| 503 | cc) CC="$CC -Wl,-Bexport";;
|
|---|
| 504 | esac;;
|
|---|
| 505 | SunOS*)
|
|---|
| 506 | # Some functions have a prototype only with that define, e.g. confstr
|
|---|
| 507 | AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
|
|---|
| 508 | ;;
|
|---|
| 509 | esac
|
|---|
| 510 |
|
|---|
| 511 |
|
|---|
| 512 | AC_SUBST(LIBRARY)
|
|---|
| 513 | AC_MSG_CHECKING(LIBRARY)
|
|---|
| 514 | if test -z "$LIBRARY"
|
|---|
| 515 | then
|
|---|
| 516 | LIBRARY='libpython$(VERSION).a'
|
|---|
| 517 | fi
|
|---|
| 518 | AC_MSG_RESULT($LIBRARY)
|
|---|
| 519 |
|
|---|
| 520 | # LDLIBRARY is the name of the library to link against (as opposed to the
|
|---|
| 521 | # name of the library into which to insert object files). BLDLIBRARY is also
|
|---|
| 522 | # the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
|
|---|
| 523 | # is blank as the main program is not linked directly against LDLIBRARY.
|
|---|
| 524 | # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
|
|---|
| 525 | # systems without shared libraries, LDLIBRARY is the same as LIBRARY
|
|---|
| 526 | # (defined in the Makefiles). On Cygwin and OS/2 LDLIBRARY is the import
|
|---|
| 527 | # library, DLLLIBRARY is the shared (i.e., DLL) library.
|
|---|
| 528 | #
|
|---|
| 529 | # RUNSHARED is used to run shared python without installed libraries
|
|---|
| 530 | #
|
|---|
| 531 | # INSTSONAME is the name of the shared library that will be use to install
|
|---|
| 532 | # on the system - some systems like version suffix, others don't
|
|---|
| 533 | AC_SUBST(LDLIBRARY)
|
|---|
| 534 | AC_SUBST(DLLLIBRARY)
|
|---|
| 535 | AC_SUBST(BLDLIBRARY)
|
|---|
| 536 | AC_SUBST(LDLIBRARYDIR)
|
|---|
| 537 | AC_SUBST(INSTSONAME)
|
|---|
| 538 | AC_SUBST(RUNSHARED)
|
|---|
| 539 | AC_SUBST(CONDENSED_VERSION)
|
|---|
| 540 | LDLIBRARY="$LIBRARY"
|
|---|
| 541 | BLDLIBRARY='$(LDLIBRARY)'
|
|---|
| 542 | INSTSONAME='$(LDLIBRARY)'
|
|---|
| 543 | DLLLIBRARY=''
|
|---|
| 544 | LDLIBRARYDIR=''
|
|---|
| 545 | RUNSHARED=''
|
|---|
| 546 | CONDENSED_VERSION=''
|
|---|
| 547 |
|
|---|
| 548 | # LINKCC is the command that links the python executable -- default is $(CC).
|
|---|
| 549 | # If CXX is set, and if it is needed to link a main function that was
|
|---|
| 550 | # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
|
|---|
| 551 | # python might then depend on the C++ runtime
|
|---|
| 552 | # This is altered for AIX in order to build the export list before
|
|---|
| 553 | # linking.
|
|---|
| 554 | AC_SUBST(LINKCC)
|
|---|
| 555 | AC_MSG_CHECKING(LINKCC)
|
|---|
| 556 | if test -z "$LINKCC"
|
|---|
| 557 | then
|
|---|
| 558 | LINKCC='$(PURIFY) $(MAINCC)'
|
|---|
| 559 | case $ac_sys_system in
|
|---|
| 560 | AIX*)
|
|---|
| 561 | exp_extra="\"\""
|
|---|
| 562 | if test $ac_sys_release -ge 5 -o \
|
|---|
| 563 | $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then
|
|---|
| 564 | exp_extra="."
|
|---|
| 565 | fi
|
|---|
| 566 | LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
|
|---|
| 567 | Monterey64*)
|
|---|
| 568 | LINKCC="$LINKCC -L/usr/lib/ia64l64";;
|
|---|
| 569 | esac
|
|---|
| 570 | fi
|
|---|
| 571 | AC_MSG_RESULT($LINKCC)
|
|---|
| 572 |
|
|---|
| 573 | AC_MSG_CHECKING(for --enable-shared)
|
|---|
| 574 | AC_ARG_ENABLE(shared,
|
|---|
| 575 | AC_HELP_STRING(--enable-shared, disable/enable building shared python library))
|
|---|
| 576 |
|
|---|
| 577 | if test -z "$enable_shared"
|
|---|
| 578 | then
|
|---|
| 579 | case $ac_sys_system in
|
|---|
| 580 | CYGWIN* | atheos* | *OS/2* | *emx*)
|
|---|
| 581 | enable_shared="yes";;
|
|---|
| 582 | *)
|
|---|
| 583 | enable_shared="no";;
|
|---|
| 584 | esac
|
|---|
| 585 | fi
|
|---|
| 586 | AC_MSG_RESULT($enable_shared)
|
|---|
| 587 |
|
|---|
| 588 | AC_MSG_CHECKING(for --enable-profiling)
|
|---|
| 589 | AC_ARG_ENABLE(profiling,
|
|---|
| 590 | AC_HELP_STRING(--enable-profiling, enable C-level code profiling),
|
|---|
| 591 | [ac_save_cc="$CC"
|
|---|
| 592 | CC="$CC -pg"
|
|---|
| 593 | AC_TRY_RUN([int main() { return 0; }],
|
|---|
| 594 | ac_enable_profiling="yes",
|
|---|
| 595 | ac_enable_profiling="no",
|
|---|
| 596 | ac_enable_profiling="no")
|
|---|
| 597 | CC="$ac_save_cc"])
|
|---|
| 598 | AC_MSG_RESULT($ac_enable_profiling)
|
|---|
| 599 |
|
|---|
| 600 | case "$ac_enable_profiling" in
|
|---|
| 601 | "yes")
|
|---|
| 602 | BASECFLAGS="-pg $BASECFLAGS"
|
|---|
| 603 | LDFLAGS="-pg $LDFLAGS"
|
|---|
| 604 | ;;
|
|---|
| 605 | esac
|
|---|
| 606 |
|
|---|
| 607 | AC_MSG_CHECKING(LDLIBRARY)
|
|---|
| 608 |
|
|---|
| 609 | # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
|
|---|
| 610 | # library that we build, but we do not want to link against it (we
|
|---|
| 611 | # will find it with a -framework option). For this reason there is an
|
|---|
| 612 | # extra variable BLDLIBRARY against which Python and the extension
|
|---|
| 613 | # modules are linked, BLDLIBRARY. This is normally the same as
|
|---|
| 614 | # LDLIBRARY, but empty for MacOSX framework builds.
|
|---|
| 615 | if test "$enable_framework"
|
|---|
| 616 | then
|
|---|
| 617 | LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
|---|
| 618 | RUNSHARED=DYLD_FRAMEWORK_PATH="`pwd`:$DYLD_FRAMEWORK_PATH"
|
|---|
| 619 | BLDLIBRARY=''
|
|---|
| 620 | else
|
|---|
| 621 | BLDLIBRARY='$(LDLIBRARY)'
|
|---|
| 622 | fi
|
|---|
| 623 |
|
|---|
| 624 | # Other platforms follow
|
|---|
| 625 | if test $enable_shared = "yes"; then
|
|---|
| 626 | AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
|
|---|
| 627 | case $ac_sys_system in
|
|---|
| 628 | BeOS*)
|
|---|
| 629 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 630 | ;;
|
|---|
| 631 | CYGWIN*)
|
|---|
| 632 | LDLIBRARY='libpython$(VERSION).dll.a'
|
|---|
| 633 | DLLLIBRARY='libpython$(VERSION).dll'
|
|---|
| 634 | ;;
|
|---|
| 635 | SunOS*)
|
|---|
| 636 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 637 | BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
|
|---|
| 638 | RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
|---|
| 639 | INSTSONAME="$LDLIBRARY".$SOVERSION
|
|---|
| 640 | ;;
|
|---|
| 641 | Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
|
|---|
| 642 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 643 | BLDLIBRARY='-L. -lpython$(VERSION)'
|
|---|
| 644 | RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
|---|
| 645 | case $ac_sys_system in
|
|---|
| 646 | FreeBSD*)
|
|---|
| 647 | SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
|
|---|
| 648 | ;;
|
|---|
| 649 | esac
|
|---|
| 650 | INSTSONAME="$LDLIBRARY".$SOVERSION
|
|---|
| 651 | ;;
|
|---|
| 652 | hp*|HP*)
|
|---|
| 653 | case `uname -m` in
|
|---|
| 654 | ia64)
|
|---|
| 655 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 656 | ;;
|
|---|
| 657 | *)
|
|---|
| 658 | LDLIBRARY='libpython$(VERSION).sl'
|
|---|
| 659 | ;;
|
|---|
| 660 | esac
|
|---|
| 661 | BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)'
|
|---|
| 662 | RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH}
|
|---|
| 663 | ;;
|
|---|
| 664 | OSF*)
|
|---|
| 665 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 666 | BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
|
|---|
| 667 | RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
|---|
| 668 | ;;
|
|---|
| 669 | atheos*)
|
|---|
| 670 | LDLIBRARY='libpython$(VERSION).so'
|
|---|
| 671 | BLDLIBRARY='-L. -lpython$(VERSION)'
|
|---|
| 672 | RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
|
|---|
| 673 | ;;
|
|---|
| 674 | OS/2*|os2*|emx*)
|
|---|
| 675 | LDLIBRARY='python$(VERSION)_dll.a'
|
|---|
| 676 | BLDLIBRARY='-L. -lpython$(VERSION)'
|
|---|
| 677 | RUNSHARED=BEGINLIBPATH="'`pwd`;$BEGINLIBPATH'"
|
|---|
| 678 | CONDENSED_VERSION=`echo "$(VERSION)" | tr -d .,"`
|
|---|
| 679 | DLLLIBRARY='python$(CONDENSED_VERSION).dll'
|
|---|
| 680 | ;;
|
|---|
| 681 | esac
|
|---|
| 682 | else # shared is disabled
|
|---|
| 683 | case $ac_sys_system in
|
|---|
| 684 | CYGWIN*)
|
|---|
| 685 | BLDLIBRARY='$(LIBRARY)'
|
|---|
| 686 | LDLIBRARY='libpython$(VERSION).dll.a'
|
|---|
| 687 | ;;
|
|---|
| 688 | esac
|
|---|
| 689 | fi
|
|---|
| 690 |
|
|---|
| 691 | AC_MSG_RESULT($LDLIBRARY)
|
|---|
| 692 |
|
|---|
| 693 | AC_PROG_RANLIB
|
|---|
| 694 | AC_SUBST(AR)
|
|---|
| 695 | AC_CHECK_PROGS(AR, ar aal, ar)
|
|---|
| 696 |
|
|---|
| 697 | AC_SUBST(SVNVERSION)
|
|---|
| 698 | AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
|
|---|
| 699 | if test $SVNVERSION = found
|
|---|
| 700 | then
|
|---|
| 701 | SVNVERSION="svnversion \$(srcdir)"
|
|---|
| 702 | else
|
|---|
| 703 | SVNVERSION="echo exported"
|
|---|
| 704 | fi
|
|---|
| 705 |
|
|---|
| 706 | case $MACHDEP in
|
|---|
| 707 | bsdos*|hp*|HP*)
|
|---|
| 708 | # install -d does not work on BSDI or HP-UX
|
|---|
| 709 | if test -z "$INSTALL"
|
|---|
| 710 | then
|
|---|
| 711 | INSTALL="${srcdir}/install-sh -c"
|
|---|
| 712 | fi
|
|---|
| 713 | esac
|
|---|
| 714 | AC_PROG_INSTALL
|
|---|
| 715 |
|
|---|
| 716 | # Not every filesystem supports hard links
|
|---|
| 717 | AC_SUBST(LN)
|
|---|
| 718 | if test -z "$LN" ; then
|
|---|
| 719 | case $ac_sys_system in
|
|---|
| 720 | BeOS*) LN="ln -s";;
|
|---|
| 721 | CYGWIN*) LN="ln -s";;
|
|---|
| 722 | OS/2*|os2*|emx*) LN="ln -s";;
|
|---|
| 723 | atheos*) LN="ln -s";;
|
|---|
| 724 | *) LN=ln;;
|
|---|
| 725 | esac
|
|---|
| 726 | fi
|
|---|
| 727 |
|
|---|
| 728 | # Check for --with-pydebug
|
|---|
| 729 | AC_MSG_CHECKING(for --with-pydebug)
|
|---|
| 730 | AC_ARG_WITH(pydebug,
|
|---|
| 731 | AC_HELP_STRING(--with-pydebug, build with Py_DEBUG defined),
|
|---|
| 732 | [
|
|---|
| 733 | if test "$withval" != no
|
|---|
| 734 | then
|
|---|
| 735 | AC_DEFINE(Py_DEBUG, 1,
|
|---|
| 736 | [Define if you want to build an interpreter with many run-time checks.])
|
|---|
| 737 | AC_MSG_RESULT(yes);
|
|---|
| 738 | Py_DEBUG='true'
|
|---|
| 739 | else AC_MSG_RESULT(no); Py_DEBUG='false'
|
|---|
| 740 | fi],
|
|---|
| 741 | [AC_MSG_RESULT(no)])
|
|---|
| 742 |
|
|---|
| 743 | # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
|
|---|
| 744 | # merged with this chunk of code?
|
|---|
| 745 |
|
|---|
| 746 | # Optimizer/debugger flags
|
|---|
| 747 | # ------------------------
|
|---|
| 748 | # (The following bit of code is complicated enough - please keep things
|
|---|
| 749 | # indented properly. Just pretend you're editing Python code. ;-)
|
|---|
| 750 |
|
|---|
| 751 | # There are two parallel sets of case statements below, one that checks to
|
|---|
| 752 | # see if OPT was set and one that does BASECFLAGS setting based upon
|
|---|
| 753 | # compiler and platform. BASECFLAGS tweaks need to be made even if the
|
|---|
| 754 | # user set OPT.
|
|---|
| 755 |
|
|---|
| 756 | # tweak OPT based on compiler and platform, only if the user didn't set
|
|---|
| 757 | # it on the command line
|
|---|
| 758 | AC_SUBST(OPT)
|
|---|
| 759 | if test -z "$OPT"
|
|---|
| 760 | then
|
|---|
| 761 | case $GCC in
|
|---|
| 762 | yes)
|
|---|
| 763 | if test "$CC" != 'g++' ; then
|
|---|
| 764 | STRICT_PROTO="-Wstrict-prototypes"
|
|---|
| 765 | fi
|
|---|
| 766 | case $ac_cv_prog_cc_g in
|
|---|
| 767 | yes)
|
|---|
| 768 | if test "$Py_DEBUG" = 'true' ; then
|
|---|
| 769 | # Optimization messes up debuggers, so turn it off for
|
|---|
| 770 | # debug builds.
|
|---|
| 771 | OPT="-g -Wall $STRICT_PROTO"
|
|---|
| 772 | else
|
|---|
| 773 | OPT="-g -O3 -Wall $STRICT_PROTO"
|
|---|
| 774 | fi
|
|---|
| 775 | ;;
|
|---|
| 776 | *)
|
|---|
| 777 | OPT="-O3 -Wall $STRICT_PROTO"
|
|---|
| 778 | ;;
|
|---|
| 779 | esac
|
|---|
| 780 | case $ac_sys_system in
|
|---|
| 781 | SCO_SV*) OPT="$OPT -m486 -DSCO5"
|
|---|
| 782 | ;;
|
|---|
| 783 | esac
|
|---|
| 784 | ;;
|
|---|
| 785 |
|
|---|
| 786 | *)
|
|---|
| 787 | OPT="-O"
|
|---|
| 788 | ;;
|
|---|
| 789 | esac
|
|---|
| 790 |
|
|---|
| 791 | # The current (beta) Monterey compiler dies with optimizations
|
|---|
| 792 | # XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
|
|---|
| 793 | case $ac_sys_system in
|
|---|
| 794 | Monterey*)
|
|---|
| 795 | OPT=""
|
|---|
| 796 | ;;
|
|---|
| 797 | esac
|
|---|
| 798 |
|
|---|
| 799 | fi
|
|---|
| 800 |
|
|---|
| 801 | AC_SUBST(BASECFLAGS)
|
|---|
| 802 | # tweak BASECFLAGS based on compiler and platform
|
|---|
| 803 | case $GCC in
|
|---|
| 804 | yes)
|
|---|
| 805 | # Python violates C99 rules, by casting between incompatible
|
|---|
| 806 | # pointer types. GCC may generate bad code as a result of that,
|
|---|
| 807 | # so use -fno-strict-aliasing if supported.
|
|---|
| 808 | AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
|
|---|
| 809 | ac_save_cc="$CC"
|
|---|
| 810 | CC="$CC -fno-strict-aliasing"
|
|---|
| 811 | AC_TRY_RUN([int main() { return 0; }],
|
|---|
| 812 | ac_cv_no_strict_aliasing_ok=yes,
|
|---|
| 813 | ac_cv_no_strict_aliasing_ok=no,
|
|---|
| 814 | ac_cv_no_strict_aliasing_ok=no)
|
|---|
| 815 | CC="$ac_save_cc"
|
|---|
| 816 | AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
|
|---|
| 817 | if test $ac_cv_no_strict_aliasing_ok = yes
|
|---|
| 818 | then
|
|---|
| 819 | BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
|
|---|
| 820 | fi
|
|---|
| 821 | case $ac_sys_system in
|
|---|
| 822 | SCO_SV*)
|
|---|
| 823 | BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
|
|---|
| 824 | ;;
|
|---|
| 825 | # is there any other compiler on Darwin besides gcc?
|
|---|
| 826 | Darwin*)
|
|---|
| 827 | BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd"
|
|---|
| 828 | if test "${enable_universalsdk}"; then
|
|---|
| 829 | BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
|
|---|
| 830 | fi
|
|---|
| 831 |
|
|---|
| 832 | ;;
|
|---|
| 833 | OSF*)
|
|---|
| 834 | BASECFLAGS="$BASECFLAGS -mieee"
|
|---|
| 835 | ;;
|
|---|
| 836 | esac
|
|---|
| 837 | ;;
|
|---|
| 838 |
|
|---|
| 839 | *)
|
|---|
| 840 | case $ac_sys_system in
|
|---|
| 841 | OpenUNIX*|UnixWare*)
|
|---|
| 842 | BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
|
|---|
| 843 | ;;
|
|---|
| 844 | OSF*)
|
|---|
| 845 | BASECFLAGS="$BASECFLAGS -ieee -std"
|
|---|
| 846 | ;;
|
|---|
| 847 | SCO_SV*)
|
|---|
| 848 | BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
|
|---|
| 849 | ;;
|
|---|
| 850 | esac
|
|---|
| 851 | ;;
|
|---|
| 852 | esac
|
|---|
| 853 |
|
|---|
| 854 | if test "$Py_DEBUG" = 'true'; then
|
|---|
| 855 | :
|
|---|
| 856 | else
|
|---|
| 857 | OPT="-DNDEBUG $OPT"
|
|---|
| 858 | fi
|
|---|
| 859 |
|
|---|
| 860 | if test "$ac_arch_flags"
|
|---|
| 861 | then
|
|---|
| 862 | BASECFLAGS="$BASECFLAGS $ac_arch_flags"
|
|---|
| 863 | fi
|
|---|
| 864 |
|
|---|
| 865 | # disable check for icc since it seems to pass, but generates a warning
|
|---|
| 866 | if test "$CC" = icc
|
|---|
| 867 | then
|
|---|
| 868 | ac_cv_opt_olimit_ok=no
|
|---|
| 869 | fi
|
|---|
| 870 |
|
|---|
| 871 | AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
|
|---|
| 872 | AC_CACHE_VAL(ac_cv_opt_olimit_ok,
|
|---|
| 873 | [ac_save_cc="$CC"
|
|---|
| 874 | CC="$CC -OPT:Olimit=0"
|
|---|
| 875 | AC_TRY_RUN([int main() { return 0; }],
|
|---|
| 876 | ac_cv_opt_olimit_ok=yes,
|
|---|
| 877 | ac_cv_opt_olimit_ok=no,
|
|---|
| 878 | ac_cv_opt_olimit_ok=no)
|
|---|
| 879 | CC="$ac_save_cc"])
|
|---|
| 880 | AC_MSG_RESULT($ac_cv_opt_olimit_ok)
|
|---|
| 881 | if test $ac_cv_opt_olimit_ok = yes; then
|
|---|
| 882 | case $ac_sys_system in
|
|---|
| 883 | # XXX is this branch needed? On MacOSX 10.2.2 the result of the
|
|---|
| 884 | # olimit_ok test is "no". Is it "yes" in some other Darwin-esque
|
|---|
| 885 | # environment?
|
|---|
| 886 | Darwin*)
|
|---|
| 887 | ;;
|
|---|
| 888 | *)
|
|---|
| 889 | BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
|
|---|
| 890 | ;;
|
|---|
| 891 | esac
|
|---|
| 892 | else
|
|---|
| 893 | AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
|
|---|
| 894 | AC_CACHE_VAL(ac_cv_olimit_ok,
|
|---|
| 895 | [ac_save_cc="$CC"
|
|---|
| 896 | CC="$CC -Olimit 1500"
|
|---|
| 897 | AC_TRY_RUN([int main() { return 0; }],
|
|---|
| 898 | ac_cv_olimit_ok=yes,
|
|---|
| 899 | ac_cv_olimit_ok=no,
|
|---|
| 900 | ac_cv_olimit_ok=no)
|
|---|
| 901 | CC="$ac_save_cc"])
|
|---|
| 902 | AC_MSG_RESULT($ac_cv_olimit_ok)
|
|---|
| 903 | if test $ac_cv_olimit_ok = yes; then
|
|---|
| 904 | BASECFLAGS="$BASECFLAGS -Olimit 1500"
|
|---|
| 905 | fi
|
|---|
| 906 | fi
|
|---|
| 907 |
|
|---|
| 908 | # On some compilers, pthreads are available without further options
|
|---|
| 909 | # (e.g. MacOS X). On some of these systems, the compiler will not
|
|---|
| 910 | # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
|
|---|
| 911 | # So we have to see first whether pthreads are available without
|
|---|
| 912 | # options before we can check whether -Kpthread improves anything.
|
|---|
| 913 | AC_MSG_CHECKING(whether pthreads are available without options)
|
|---|
| 914 | AC_CACHE_VAL(ac_cv_pthread_is_default,
|
|---|
| 915 | [AC_TRY_RUN([
|
|---|
| 916 | #include <pthread.h>
|
|---|
| 917 |
|
|---|
| 918 | void* routine(void* p){return NULL;}
|
|---|
| 919 |
|
|---|
| 920 | int main(){
|
|---|
| 921 | pthread_t p;
|
|---|
| 922 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
|---|
| 923 | return 1;
|
|---|
| 924 | (void)pthread_detach(p);
|
|---|
| 925 | return 0;
|
|---|
| 926 | }
|
|---|
| 927 | ],
|
|---|
| 928 | [
|
|---|
| 929 | ac_cv_pthread_is_default=yes
|
|---|
| 930 | ac_cv_kthread=no
|
|---|
| 931 | ac_cv_pthread=no
|
|---|
| 932 | ],
|
|---|
| 933 | ac_cv_pthread_is_default=no,
|
|---|
| 934 | ac_cv_pthread_is_default=no)
|
|---|
| 935 | ])
|
|---|
| 936 | AC_MSG_RESULT($ac_cv_pthread_is_default)
|
|---|
| 937 |
|
|---|
| 938 |
|
|---|
| 939 | if test $ac_cv_pthread_is_default = yes
|
|---|
| 940 | then
|
|---|
| 941 | ac_cv_kpthread=no
|
|---|
| 942 | else
|
|---|
| 943 | # -Kpthread, if available, provides the right #defines
|
|---|
| 944 | # and linker options to make pthread_create available
|
|---|
| 945 | # Some compilers won't report that they do not support -Kpthread,
|
|---|
| 946 | # so we need to run a program to see whether it really made the
|
|---|
| 947 | # function available.
|
|---|
| 948 | AC_MSG_CHECKING(whether $CC accepts -Kpthread)
|
|---|
| 949 | AC_CACHE_VAL(ac_cv_kpthread,
|
|---|
| 950 | [ac_save_cc="$CC"
|
|---|
| 951 | CC="$CC -Kpthread"
|
|---|
| 952 | AC_TRY_RUN([
|
|---|
| 953 | #include <pthread.h>
|
|---|
| 954 |
|
|---|
| 955 | void* routine(void* p){return NULL;}
|
|---|
| 956 |
|
|---|
| 957 | int main(){
|
|---|
| 958 | pthread_t p;
|
|---|
| 959 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
|---|
| 960 | return 1;
|
|---|
| 961 | (void)pthread_detach(p);
|
|---|
| 962 | return 0;
|
|---|
| 963 | }
|
|---|
| 964 | ],
|
|---|
| 965 | ac_cv_kpthread=yes,
|
|---|
| 966 | ac_cv_kpthread=no,
|
|---|
| 967 | ac_cv_kpthread=no)
|
|---|
| 968 | CC="$ac_save_cc"])
|
|---|
| 969 | AC_MSG_RESULT($ac_cv_kpthread)
|
|---|
| 970 | fi
|
|---|
| 971 |
|
|---|
| 972 | if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
|
|---|
| 973 | then
|
|---|
| 974 | # -Kthread, if available, provides the right #defines
|
|---|
| 975 | # and linker options to make pthread_create available
|
|---|
| 976 | # Some compilers won't report that they do not support -Kthread,
|
|---|
| 977 | # so we need to run a program to see whether it really made the
|
|---|
| 978 | # function available.
|
|---|
| 979 | AC_MSG_CHECKING(whether $CC accepts -Kthread)
|
|---|
| 980 | AC_CACHE_VAL(ac_cv_kthread,
|
|---|
| 981 | [ac_save_cc="$CC"
|
|---|
| 982 | CC="$CC -Kthread"
|
|---|
| 983 | AC_TRY_RUN([
|
|---|
| 984 | #include <pthread.h>
|
|---|
| 985 |
|
|---|
| 986 | void* routine(void* p){return NULL;}
|
|---|
| 987 |
|
|---|
| 988 | int main(){
|
|---|
| 989 | pthread_t p;
|
|---|
| 990 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
|---|
| 991 | return 1;
|
|---|
| 992 | (void)pthread_detach(p);
|
|---|
| 993 | return 0;
|
|---|
| 994 | }
|
|---|
| 995 | ],
|
|---|
| 996 | ac_cv_kthread=yes,
|
|---|
| 997 | ac_cv_kthread=no,
|
|---|
| 998 | ac_cv_kthread=no)
|
|---|
| 999 | CC="$ac_save_cc"])
|
|---|
| 1000 | AC_MSG_RESULT($ac_cv_kthread)
|
|---|
| 1001 | fi
|
|---|
| 1002 |
|
|---|
| 1003 | if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
|
|---|
| 1004 | then
|
|---|
| 1005 | # -pthread, if available, provides the right #defines
|
|---|
| 1006 | # and linker options to make pthread_create available
|
|---|
| 1007 | # Some compilers won't report that they do not support -pthread,
|
|---|
| 1008 | # so we need to run a program to see whether it really made the
|
|---|
| 1009 | # function available.
|
|---|
| 1010 | AC_MSG_CHECKING(whether $CC accepts -pthread)
|
|---|
| 1011 | AC_CACHE_VAL(ac_cv_thread,
|
|---|
| 1012 | [ac_save_cc="$CC"
|
|---|
| 1013 | CC="$CC -pthread"
|
|---|
| 1014 | AC_TRY_RUN([
|
|---|
| 1015 | #include <pthread.h>
|
|---|
| 1016 |
|
|---|
| 1017 | void* routine(void* p){return NULL;}
|
|---|
| 1018 |
|
|---|
| 1019 | int main(){
|
|---|
| 1020 | pthread_t p;
|
|---|
| 1021 | if(pthread_create(&p,NULL,routine,NULL)!=0)
|
|---|
| 1022 | return 1;
|
|---|
| 1023 | (void)pthread_detach(p);
|
|---|
| 1024 | return 0;
|
|---|
| 1025 | }
|
|---|
| 1026 | ],
|
|---|
| 1027 | ac_cv_pthread=yes,
|
|---|
| 1028 | ac_cv_pthread=no,
|
|---|
| 1029 | ac_cv_pthread=no)
|
|---|
| 1030 | CC="$ac_save_cc"])
|
|---|
| 1031 | AC_MSG_RESULT($ac_cv_pthread)
|
|---|
| 1032 | fi
|
|---|
| 1033 |
|
|---|
| 1034 | # If we have set a CC compiler flag for thread support then
|
|---|
| 1035 | # check if it works for CXX, too.
|
|---|
| 1036 | ac_cv_cxx_thread=no
|
|---|
| 1037 | if test ! -z "$CXX"
|
|---|
| 1038 | then
|
|---|
| 1039 | AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
|
|---|
| 1040 | ac_save_cxx="$CXX"
|
|---|
| 1041 |
|
|---|
| 1042 | if test "$ac_cv_kpthread" = "yes"
|
|---|
| 1043 | then
|
|---|
| 1044 | CXX="$CXX -Kpthread"
|
|---|
| 1045 | ac_cv_cxx_thread=yes
|
|---|
| 1046 | elif test "$ac_cv_kthread" = "yes"
|
|---|
| 1047 | then
|
|---|
| 1048 | CXX="$CXX -Kthread"
|
|---|
| 1049 | ac_cv_cxx_thread=yes
|
|---|
| 1050 | elif test "$ac_cv_pthread" = "yes"
|
|---|
| 1051 | then
|
|---|
| 1052 | CXX="$CXX -pthread"
|
|---|
| 1053 | ac_cv_cxx_thread=yes
|
|---|
| 1054 | fi
|
|---|
| 1055 |
|
|---|
| 1056 | if test $ac_cv_cxx_thread = yes
|
|---|
| 1057 | then
|
|---|
| 1058 | echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext
|
|---|
| 1059 | $CXX -c conftest.$ac_ext 2>&5
|
|---|
| 1060 | if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
|
|---|
| 1061 | && test -s conftest$ac_exeext && ./conftest$ac_exeext
|
|---|
| 1062 | then
|
|---|
| 1063 | ac_cv_cxx_thread=yes
|
|---|
| 1064 | else
|
|---|
| 1065 | ac_cv_cxx_thread=no
|
|---|
| 1066 | fi
|
|---|
| 1067 | rm -fr conftest*
|
|---|
| 1068 | fi
|
|---|
| 1069 | AC_MSG_RESULT($ac_cv_cxx_thread)
|
|---|
| 1070 | fi
|
|---|
| 1071 | CXX="$ac_save_cxx"
|
|---|
| 1072 |
|
|---|
| 1073 | dnl # check for ANSI or K&R ("traditional") preprocessor
|
|---|
| 1074 | dnl AC_MSG_CHECKING(for C preprocessor type)
|
|---|
| 1075 | dnl AC_TRY_COMPILE([
|
|---|
| 1076 | dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
|
|---|
| 1077 | dnl int foo;
|
|---|
| 1078 | dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
|
|---|
| 1079 | dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional)
|
|---|
| 1080 | dnl AC_MSG_RESULT($cpp_type)
|
|---|
| 1081 |
|
|---|
| 1082 | # checks for header files
|
|---|
| 1083 | AC_HEADER_STDC
|
|---|
| 1084 | AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
|
|---|
| 1085 | fcntl.h grp.h \
|
|---|
| 1086 | shadow.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
|
|---|
| 1087 | signal.h stropts.h termios.h thread.h \
|
|---|
| 1088 | unistd.h utime.h \
|
|---|
| 1089 | sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \
|
|---|
| 1090 | sys/modem.h \
|
|---|
| 1091 | sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
|
|---|
| 1092 | sys/time.h \
|
|---|
| 1093 | sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
|
|---|
| 1094 | sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
|
|---|
| 1095 | bluetooth/bluetooth.h)
|
|---|
| 1096 | AC_HEADER_DIRENT
|
|---|
| 1097 | AC_HEADER_MAJOR
|
|---|
| 1098 |
|
|---|
| 1099 | # On Solaris, term.h requires curses.h
|
|---|
| 1100 | AC_CHECK_HEADERS(term.h,,,[
|
|---|
| 1101 | #ifdef HAVE_CURSES_H
|
|---|
| 1102 | #include <curses.h>
|
|---|
| 1103 | #endif
|
|---|
| 1104 | ])
|
|---|
| 1105 |
|
|---|
| 1106 | # On Linux, netlink.h requires asm/types.h
|
|---|
| 1107 | AC_CHECK_HEADERS(linux/netlink.h,,,[
|
|---|
| 1108 | #ifdef HAVE_ASM_TYPES_H
|
|---|
| 1109 | #include <asm/types.h>
|
|---|
| 1110 | #endif
|
|---|
| 1111 | #ifdef HAVE_SYS_SOCKET_H
|
|---|
| 1112 | #include <sys/socket.h>
|
|---|
| 1113 | #endif
|
|---|
| 1114 | ])
|
|---|
| 1115 |
|
|---|
| 1116 | # checks for typedefs
|
|---|
| 1117 | was_it_defined=no
|
|---|
| 1118 | AC_MSG_CHECKING(for clock_t in time.h)
|
|---|
| 1119 | AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
|
|---|
| 1120 | AC_DEFINE(clock_t, long, [Define to 'long' if <time.h> doesn't define.])
|
|---|
| 1121 | ])
|
|---|
| 1122 | AC_MSG_RESULT($was_it_defined)
|
|---|
| 1123 |
|
|---|
| 1124 | # Check whether using makedev requires defining _OSF_SOURCE
|
|---|
| 1125 | AC_MSG_CHECKING(for makedev)
|
|---|
| 1126 | AC_TRY_LINK([#include <sys/types.h> ],
|
|---|
| 1127 | [ makedev(0, 0) ],
|
|---|
| 1128 | ac_cv_has_makedev=yes,
|
|---|
| 1129 | ac_cv_has_makedev=no)
|
|---|
| 1130 | if test "$ac_cv_has_makedev" = "no"; then
|
|---|
| 1131 | # we didn't link, try if _OSF_SOURCE will allow us to link
|
|---|
| 1132 | AC_TRY_LINK([
|
|---|
| 1133 | #define _OSF_SOURCE 1
|
|---|
| 1134 | #include <sys/types.h>
|
|---|
| 1135 | ],
|
|---|
| 1136 | [ makedev(0, 0) ],
|
|---|
| 1137 | ac_cv_has_makedev=yes,
|
|---|
| 1138 | ac_cv_has_makedev=no)
|
|---|
| 1139 | if test "$ac_cv_has_makedev" = "yes"; then
|
|---|
| 1140 | AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
|
|---|
| 1141 | fi
|
|---|
| 1142 | fi
|
|---|
| 1143 | AC_MSG_RESULT($ac_cv_has_makedev)
|
|---|
| 1144 | if test "$ac_cv_has_makedev" = "yes"; then
|
|---|
| 1145 | AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
|
|---|
| 1146 | fi
|
|---|
| 1147 |
|
|---|
| 1148 | # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in
|
|---|
| 1149 | # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are
|
|---|
| 1150 | # defined, but the compiler does not support pragma redefine_extname,
|
|---|
| 1151 | # and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit
|
|---|
| 1152 | # structures (such as rlimit64) without declaring them. As a
|
|---|
| 1153 | # work-around, disable LFS on such configurations
|
|---|
| 1154 |
|
|---|
| 1155 | use_lfs=yes
|
|---|
| 1156 | AC_MSG_CHECKING(Solaris LFS bug)
|
|---|
| 1157 | AC_TRY_COMPILE([
|
|---|
| 1158 | #define _LARGEFILE_SOURCE 1
|
|---|
| 1159 | #define _FILE_OFFSET_BITS 64
|
|---|
| 1160 | #include <sys/resource.h>
|
|---|
| 1161 | ],struct rlimit foo;,sol_lfs_bug=no,sol_lfs_bug=yes)
|
|---|
| 1162 | AC_MSG_RESULT($sol_lfs_bug)
|
|---|
| 1163 | if test "$sol_lfs_bug" = "yes"; then
|
|---|
| 1164 | use_lfs=no
|
|---|
| 1165 | fi
|
|---|
| 1166 |
|
|---|
| 1167 | if test "$use_lfs" = "yes"; then
|
|---|
| 1168 | # Two defines needed to enable largefile support on various platforms
|
|---|
| 1169 | # These may affect some typedefs
|
|---|
| 1170 | AC_DEFINE(_LARGEFILE_SOURCE, 1,
|
|---|
| 1171 | [This must be defined on some systems to enable large file support.])
|
|---|
| 1172 | AC_DEFINE(_FILE_OFFSET_BITS, 64,
|
|---|
| 1173 | [This must be set to 64 on some systems to enable large file support.])
|
|---|
| 1174 | fi
|
|---|
| 1175 |
|
|---|
| 1176 | # Add some code to confdefs.h so that the test for off_t works on SCO
|
|---|
| 1177 | cat >> confdefs.h <<\EOF
|
|---|
| 1178 | #if defined(SCO_DS)
|
|---|
| 1179 | #undef _OFF_T
|
|---|
| 1180 | #endif
|
|---|
| 1181 | EOF
|
|---|
| 1182 |
|
|---|
| 1183 | # Type availability checks
|
|---|
| 1184 | AC_TYPE_MODE_T
|
|---|
| 1185 | AC_TYPE_OFF_T
|
|---|
| 1186 | AC_TYPE_PID_T
|
|---|
| 1187 | AC_TYPE_SIGNAL
|
|---|
| 1188 | AC_TYPE_SIZE_T
|
|---|
| 1189 | AC_TYPE_UID_T
|
|---|
| 1190 | AC_CHECK_TYPE(ssize_t,
|
|---|
| 1191 | AC_DEFINE(HAVE_SSIZE_T, 1, Define if your compiler provides ssize_t),,)
|
|---|
| 1192 |
|
|---|
| 1193 | # Sizes of various common basic types
|
|---|
| 1194 | # ANSI C requires sizeof(char) == 1, so no need to check it
|
|---|
| 1195 | AC_CHECK_SIZEOF(int, 4)
|
|---|
| 1196 | AC_CHECK_SIZEOF(long, 4)
|
|---|
| 1197 | AC_CHECK_SIZEOF(void *, 4)
|
|---|
| 1198 | AC_CHECK_SIZEOF(short, 2)
|
|---|
| 1199 | AC_CHECK_SIZEOF(float, 4)
|
|---|
| 1200 | AC_CHECK_SIZEOF(double, 8)
|
|---|
| 1201 | AC_CHECK_SIZEOF(fpos_t, 4)
|
|---|
| 1202 | AC_CHECK_SIZEOF(size_t, 4)
|
|---|
| 1203 |
|
|---|
| 1204 | AC_MSG_CHECKING(for long long support)
|
|---|
| 1205 | have_long_long=no
|
|---|
| 1206 | AC_TRY_COMPILE([], [long long x; x = (long long)0;], [
|
|---|
| 1207 | AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
|
|---|
| 1208 | have_long_long=yes
|
|---|
| 1209 | ])
|
|---|
| 1210 | AC_MSG_RESULT($have_long_long)
|
|---|
| 1211 | if test "$have_long_long" = yes ; then
|
|---|
| 1212 | AC_CHECK_SIZEOF(long long, 8)
|
|---|
| 1213 | fi
|
|---|
| 1214 |
|
|---|
| 1215 | AC_MSG_CHECKING(for uintptr_t support)
|
|---|
| 1216 | have_uintptr_t=no
|
|---|
| 1217 | AC_TRY_COMPILE([], [uintptr_t x; x = (uintptr_t)0;], [
|
|---|
| 1218 | AC_DEFINE(HAVE_UINTPTR_T, 1, [Define this if you have the type uintptr_t.])
|
|---|
| 1219 | have_uintptr_t=yes
|
|---|
| 1220 | ])
|
|---|
| 1221 | AC_MSG_RESULT($have_uintptr_t)
|
|---|
| 1222 | if test "$have_uintptr_t" = yes ; then
|
|---|
| 1223 | AC_CHECK_SIZEOF(uintptr_t, 4)
|
|---|
| 1224 | fi
|
|---|
| 1225 |
|
|---|
| 1226 | # Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
|
|---|
| 1227 | AC_MSG_CHECKING(size of off_t)
|
|---|
| 1228 | AC_CACHE_VAL(ac_cv_sizeof_off_t,
|
|---|
| 1229 | [AC_TRY_RUN([#include <stdio.h>
|
|---|
| 1230 | #include <sys/types.h>
|
|---|
| 1231 | main()
|
|---|
| 1232 | {
|
|---|
| 1233 | FILE *f=fopen("conftestval", "w");
|
|---|
| 1234 | if (!f) exit(1);
|
|---|
| 1235 | fprintf(f, "%d\n", sizeof(off_t));
|
|---|
| 1236 | exit(0);
|
|---|
| 1237 | }],
|
|---|
| 1238 | ac_cv_sizeof_off_t=`cat conftestval`,
|
|---|
| 1239 | ac_cv_sizeof_off_t=0,
|
|---|
| 1240 | ac_cv_sizeof_off_t=4)
|
|---|
| 1241 | ])
|
|---|
| 1242 | AC_MSG_RESULT($ac_cv_sizeof_off_t)
|
|---|
| 1243 | AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
|
|---|
| 1244 | [The number of bytes in an off_t.])
|
|---|
| 1245 |
|
|---|
| 1246 | AC_MSG_CHECKING(whether to enable large file support)
|
|---|
| 1247 | if test "$have_long_long" = yes -a \
|
|---|
| 1248 | "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
|
|---|
| 1249 | "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
|
|---|
| 1250 | AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
|
|---|
| 1251 | [Defined to enable large file support when an off_t is bigger than a long
|
|---|
| 1252 | and long long is available and at least as big as an off_t. You may need
|
|---|
| 1253 | to add some flags for configuration and compilation to enable this mode.
|
|---|
| 1254 | (For Solaris and Linux, the necessary defines are already defined.)])
|
|---|
| 1255 | AC_MSG_RESULT(yes)
|
|---|
| 1256 | else
|
|---|
| 1257 | AC_MSG_RESULT(no)
|
|---|
| 1258 | fi
|
|---|
| 1259 |
|
|---|
| 1260 | # AC_CHECK_SIZEOF() doesn't include <time.h>.
|
|---|
| 1261 | AC_MSG_CHECKING(size of time_t)
|
|---|
| 1262 | AC_CACHE_VAL(ac_cv_sizeof_time_t,
|
|---|
| 1263 | [AC_TRY_RUN([#include <stdio.h>
|
|---|
| 1264 | #include <time.h>
|
|---|
| 1265 | main()
|
|---|
| 1266 | {
|
|---|
| 1267 | FILE *f=fopen("conftestval", "w");
|
|---|
| 1268 | if (!f) exit(1);
|
|---|
| 1269 | fprintf(f, "%d\n", sizeof(time_t));
|
|---|
| 1270 | exit(0);
|
|---|
| 1271 | }],
|
|---|
| 1272 | ac_cv_sizeof_time_t=`cat conftestval`,
|
|---|
| 1273 | ac_cv_sizeof_time_t=0,
|
|---|
| 1274 | ac_cv_sizeof_time_t=4)
|
|---|
| 1275 | ])
|
|---|
| 1276 | AC_MSG_RESULT($ac_cv_sizeof_time_t)
|
|---|
|
|---|