PageRenderTime 119ms CodeModel.GetById 97ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

/configure.in

http://unladen-swallow.googlecode.com/
Autoconf | 4075 lines | 3121 code | 362 blank | 592 comment | 450 complexity | 8d20e9524266eeaf8629a3a36d18bef3 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1dnl ***********************************************
   2dnl * Please run autoreconf to test your changes! *
   3dnl ***********************************************
   4dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.61).
   5
   6# Set VERSION so we only need to edit in one place (i.e., here)
   7m4_define(PYTHON_VERSION, 2.6)
   8
   9AC_REVISION($Revision: 75132 $)
  10AC_PREREQ(2.61)
  11AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
  12AC_CONFIG_SRCDIR([Include/object.h])
  13AC_CONFIG_HEADER(pyconfig.h)
  14
  15dnl This is for stuff that absolutely must end up in pyconfig.h.
  16dnl Please use pyport.h instead, if possible.
  17AH_TOP([
  18#ifndef Py_PYCONFIG_H
  19#define Py_PYCONFIG_H
  20])
  21AH_BOTTOM([
  22/* Define the macros needed if on a UnixWare 7.x system. */
  23#if defined(__USLC__) && defined(__SCO_VERSION__)
  24#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
  25#endif
  26
  27#endif /*Py_PYCONFIG_H*/
  28])
  29
  30# We don't use PACKAGE_ variables, and they cause conflicts
  31# with other autoconf-based packages that include Python.h
  32grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new
  33rm confdefs.h
  34mv confdefs.h.new confdefs.h
  35
  36AC_SUBST(VERSION)
  37VERSION=PYTHON_VERSION
  38
  39AC_SUBST(SOVERSION)
  40SOVERSION=1.0
  41
  42# The later defininition of _XOPEN_SOURCE disables certain features
  43# on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
  44AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features])
  45
  46# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
  47# certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
  48# them.
  49AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
  50
  51# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
  52# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
  53# them.
  54AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
  55
  56# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
  57# u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
  58AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
  59
  60# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
  61# certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
  62# them.
  63AC_DEFINE(_DARWIN_C_SOURCE, 1, [Define on Darwin to activate all library features])
  64
  65
  66define_xopen_source=yes
  67
  68# Arguments passed to configure.
  69AC_SUBST(CONFIG_ARGS)
  70CONFIG_ARGS="$ac_configure_args"
  71
  72AC_ARG_ENABLE(universalsdk,
  73	AC_HELP_STRING(--enable-universalsdk@<:@=SDKDIR@:>@, Build against Mac OS X 10.4u SDK (ppc/i386)),
  74[
  75	case $enableval in
  76	yes)
  77		enableval=/Developer/SDKs/MacOSX10.4u.sdk
  78		;;
  79	esac
  80	case $enableval in
  81	no)
  82		UNIVERSALSDK=
  83		enable_universalsdk=
  84		;;
  85	*)
  86		UNIVERSALSDK=$enableval
  87		;;
  88	esac
  89],[
  90   	UNIVERSALSDK=
  91	enable_universalsdk=
  92])
  93AC_SUBST(UNIVERSALSDK)
  94
  95AC_SUBST(ARCH_RUN_32BIT)
  96
  97UNIVERSAL_ARCHS="32-bit"
  98AC_MSG_CHECKING(for --with-universal-archs)
  99AC_ARG_WITH(universal-archs,
 100    AC_HELP_STRING(--with-universal-archs=ARCH, select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")),
 101[
 102	AC_MSG_RESULT($withval)
 103	UNIVERSAL_ARCHS="$withval"
 104        if test "${enable_universalsdk}" ; then
 105		:
 106	else
 107		AC_MSG_ERROR([--with-universal-archs without --enable-universalsdk. See Mac/README])
 108	fi
 109],
 110[
 111 	AC_MSG_RESULT(32-bit)
 112])
 113
 114
 115
 116AC_ARG_WITH(framework-name,
 117              AC_HELP_STRING(--with-framework-name=FRAMEWORK, 
 118                             specify an alternate name of the framework built with --enable-framework),
 119[
 120    if test "${enable_framework}"; then
 121	    :
 122    else
 123	AC_MSG_ERROR([--with-framework-name without --enable-framework. See Mac/README])
 124    fi
 125    PYTHONFRAMEWORK=${withval}
 126    PYTHONFRAMEWORKDIR=${withval}.framework
 127    PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr '[A-Z]' '[a-z]'`
 128    ],[
 129    PYTHONFRAMEWORK=Python
 130    PYTHONFRAMEWORKDIR=Python.framework
 131    PYTHONFRAMEWORKIDENTIFIER=org.python.python
 132])
 133dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
 134AC_ARG_ENABLE(framework,
 135              AC_HELP_STRING(--enable-framework@<:@=INSTALLDIR@:>@, Build (MacOSX|Darwin) framework),
 136[
 137	case $enableval in
 138	yes) 
 139		enableval=/Library/Frameworks
 140	esac
 141	case $enableval in
 142	no)
 143		PYTHONFRAMEWORK=
 144		PYTHONFRAMEWORKDIR=no-framework
 145		PYTHONFRAMEWORKPREFIX=
 146		PYTHONFRAMEWORKINSTALLDIR=
 147		FRAMEWORKINSTALLFIRST=
 148		FRAMEWORKINSTALLLAST=
 149		FRAMEWORKALTINSTALLFIRST=
 150		FRAMEWORKALTINSTALLLAST=
 151		if test "x${prefix}" = "xNONE"; then
 152			FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
 153		else
 154			FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
 155		fi
 156		enable_framework=
 157		;;
 158	*)
 159		PYTHONFRAMEWORKPREFIX=$enableval
 160		PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
 161		FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
 162		FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
 163		if test "$UNIVERSAL_ARCHS" = "all"
 164		then
 165			FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkinstallunixtools4way"
 166			FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkaltinstallunixtools4way"
 167		else
 168			FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
 169			FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
 170		fi
 171
 172		if test "x${prefix}" = "xNONE" ; then
 173			FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
 174		else
 175			FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
 176		fi
 177		prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
 178
 179		# Add files for Mac specific code to the list of output
 180		# files:
 181		AC_CONFIG_FILES(Mac/Makefile)
 182		AC_CONFIG_FILES(Mac/PythonLauncher/Makefile)
 183		AC_CONFIG_FILES(Mac/IDLE/Makefile)
 184		AC_CONFIG_FILES(Mac/Resources/framework/Info.plist)
 185		AC_CONFIG_FILES(Mac/Resources/app/Info.plist)
 186	esac
 187	],[
 188	PYTHONFRAMEWORK=
 189	PYTHONFRAMEWORKDIR=no-framework
 190	PYTHONFRAMEWORKPREFIX=
 191	PYTHONFRAMEWORKINSTALLDIR=
 192	FRAMEWORKINSTALLFIRST=
 193	FRAMEWORKINSTALLLAST=
 194	FRAMEWORKALTINSTALLFIRST=
 195	FRAMEWORKALTINSTALLLAST=
 196	if test "x${prefix}" = "xNONE" ; then
 197		FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
 198	else
 199		FRAMEWORKUNIXTOOLSPREFIX="${prefix}"
 200	fi
 201	enable_framework=
 202
 203	if test "$UNIVERSAL_ARCHS" = "all" 
 204	then
 205		FRAMEWORKINSTALLLAST=update4wayuniversal
 206		FRAMEWORKALTINSTALLLAST=update4wayuniversal
 207	fi
 208])
 209AC_SUBST(PYTHONFRAMEWORK)
 210AC_SUBST(PYTHONFRAMEWORKIDENTIFIER)
 211AC_SUBST(PYTHONFRAMEWORKDIR)
 212AC_SUBST(PYTHONFRAMEWORKPREFIX)
 213AC_SUBST(PYTHONFRAMEWORKINSTALLDIR)
 214AC_SUBST(FRAMEWORKINSTALLFIRST)
 215AC_SUBST(FRAMEWORKINSTALLLAST)
 216AC_SUBST(FRAMEWORKALTINSTALLFIRST)
 217AC_SUBST(FRAMEWORKALTINSTALLLAST)
 218AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
 219
 220##AC_ARG_WITH(dyld,
 221##            AC_HELP_STRING(--with-dyld,
 222##                           Use (OpenStep|Rhapsody) dynamic linker))
 223##
 224# Set name for machine-dependent library files
 225AC_SUBST(MACHDEP)
 226AC_MSG_CHECKING(MACHDEP)
 227if test -z "$MACHDEP"
 228then
 229	ac_sys_system=`uname -s`
 230	if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
 231	-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
 232		ac_sys_release=`uname -v`
 233	else
 234		ac_sys_release=`uname -r`
 235	fi
 236	ac_md_system=`echo $ac_sys_system |
 237			   tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
 238	ac_md_release=`echo $ac_sys_release |
 239			   tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
 240	MACHDEP="$ac_md_system$ac_md_release"
 241
 242	case $MACHDEP in
 243	cygwin*) MACHDEP="cygwin";;
 244	darwin*) MACHDEP="darwin";;
 245	atheos*) MACHDEP="atheos";;
 246        irix646) MACHDEP="irix6";;
 247	'')	MACHDEP="unknown";;
 248	esac
 249fi
 250	
 251# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
 252# disable features if it is defined, without any means to access these
 253# features as extensions. For these systems, we skip the definition of
 254# _XOPEN_SOURCE. Before adding a system to the list to gain access to
 255# some feature, make sure there is no alternative way to access this
 256# feature. Also, when using wildcards, make sure you have verified the
 257# need for not defining _XOPEN_SOURCE on all systems matching the
 258# wildcard, and that the wildcard does not include future systems
 259# (which may remove their limitations).
 260dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
 261case $ac_sys_system/$ac_sys_release in
 262  # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
 263  # even though select is a POSIX function. Reported by J. Ribbens.
 264  # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
 265  OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0123@:>@) 
 266    define_xopen_source=no
 267    # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
 268    # also defined. This can be overridden by defining _BSD_SOURCE
 269    # As this has a different meaning on Linux, only define it on OpenBSD
 270    AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
 271    ;;
 272  # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
 273  # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
 274  # Marc Recht
 275  NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
 276    define_xopen_source=no;;
 277  # On Solaris 2.6, sys/wait.h is inconsistent in the usage
 278  # of union __?sigval. Reported by Stuart Bishop.
 279  SunOS/5.6)
 280    define_xopen_source=no;;
 281  # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
 282  # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
 283  # Reconfirmed for 7.1.4 by Martin v. Loewis.
 284  OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
 285    define_xopen_source=no;;
 286  # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
 287  # but used in struct sockaddr.sa_family. Reported by Tim Rice.
 288  SCO_SV/3.2)
 289    define_xopen_source=no;;
 290  # On FreeBSD 4, the math functions C89 does not cover are never defined
 291  # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
 292  FreeBSD/4.*)
 293    define_xopen_source=no;;
 294  # On MacOS X 10.2, a bug in ncurses.h means that it craps out if 
 295  # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
 296  # identifies itself as Darwin/7.*
 297  # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
 298  # disables platform specific features beyond repair.
 299  # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE 
 300  # has no effect, don't bother defining them
 301  Darwin/@<:@6789@:>@.*)
 302    define_xopen_source=no;;
 303  # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
 304  # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
 305  # or has another value. By not (re)defining it, the defaults come in place.
 306  AIX/4)
 307    define_xopen_source=no;;
 308  AIX/5)
 309    if test `uname -r` -eq 1; then
 310      define_xopen_source=no
 311    fi
 312    ;;
 313  # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
 314  # defining NI_NUMERICHOST.
 315  QNX/6.3.2)
 316    define_xopen_source=no
 317    ;;
 318
 319esac
 320
 321if test $define_xopen_source = yes
 322then
 323  # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
 324  # defined precisely as g++ defines it
 325  # Furthermore, on Solaris 10, XPG6 requires the use of a C99
 326  # compiler
 327  case $ac_sys_system/$ac_sys_release in
 328    SunOS/5.8|SunOS/5.9|SunOS/5.10)
 329      AC_DEFINE(_XOPEN_SOURCE, 500, 
 330                Define to the level of X/Open that your system supports)
 331      ;;
 332    *)
 333      AC_DEFINE(_XOPEN_SOURCE, 600, 
 334                Define to the level of X/Open that your system supports)
 335      ;;
 336  esac
 337
 338  # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
 339  # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
 340  # several APIs are not declared. Since this is also needed in some
 341  # cases for HP-UX, we define it globally.
 342  # except for Solaris 10, where it must not be defined, 
 343  # as it implies XPG4.2
 344  case $ac_sys_system/$ac_sys_release in
 345    SunOS/5.10)
 346      ;;
 347    *)
 348      AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
 349      		Define to activate Unix95-and-earlier features)
 350      ;;
 351  esac
 352
 353  AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
 354  
 355fi
 356
 357#
 358# SGI compilers allow the specification of the both the ABI and the
 359# ISA on the command line.  Depending on the values of these switches,
 360# different and often incompatable code will be generated.
 361#
 362# The SGI_ABI variable can be used to modify the CC and LDFLAGS and
 363# thus supply support for various ABI/ISA combinations.  The MACHDEP
 364# variable is also adjusted.
 365#
 366AC_SUBST(SGI_ABI)
 367if test ! -z "$SGI_ABI"
 368then
 369        CC="cc $SGI_ABI"
 370        LDFLAGS="$SGI_ABI $LDFLAGS"
 371        MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
 372fi
 373AC_MSG_RESULT($MACHDEP)
 374
 375# And add extra plat-mac for darwin
 376AC_SUBST(EXTRAPLATDIR)
 377AC_SUBST(EXTRAMACHDEPPATH)
 378AC_MSG_CHECKING(EXTRAPLATDIR)
 379if test -z "$EXTRAPLATDIR"
 380then
 381	case $MACHDEP in
 382	darwin)	
 383		EXTRAPLATDIR="\$(PLATMACDIRS)"
 384		EXTRAMACHDEPPATH="\$(PLATMACPATH)"
 385		;;
 386	*) 
 387		EXTRAPLATDIR=""
 388		EXTRAMACHDEPPATH=""
 389		;;
 390	esac
 391fi
 392AC_MSG_RESULT($EXTRAPLATDIR)
 393
 394# Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
 395# it may influence the way we can build extensions, so distutils
 396# needs to check it
 397AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET)
 398AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
 399CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
 400EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
 401
 402AC_MSG_CHECKING(machine type as reported by uname -m)
 403ac_sys_machine=`uname -m`
 404AC_MSG_RESULT($ac_sys_machine)
 405
 406# checks for alternative programs
 407
 408# compiler flags are generated in two sets, BASECFLAGS and OPT.  OPT is just
 409# for debug/optimization stuff.  BASECFLAGS is for flags that are required
 410# just to get things to compile and link.  Users are free to override OPT
 411# when running configure or make.  The build should not break if they do.
 412# BASECFLAGS should generally not be messed with, however.
 413
 414# XXX shouldn't some/most/all of this code be merged with the stuff later
 415# on that fiddles with OPT and BASECFLAGS?
 416AC_MSG_CHECKING(for --without-gcc)
 417AC_ARG_WITH(gcc,
 418            AC_HELP_STRING(--without-gcc,never use gcc),
 419[
 420	case $withval in
 421	no)	CC=${CC:-cc}
 422		without_gcc=yes;;
 423	yes)	CC=gcc
 424		without_gcc=no;;
 425	*)	CC=$withval
 426		without_gcc=$withval;;
 427	esac], [
 428	case $ac_sys_system in
 429	AIX*)   CC=cc_r
 430		without_gcc=;;
 431	BeOS*)
 432		case $BE_HOST_CPU in
 433		ppc)
 434			CC=mwcc
 435			without_gcc=yes
 436			BASECFLAGS="$BASECFLAGS -export pragma"
 437			OPT="$OPT -O"
 438			LDFLAGS="$LDFLAGS -nodup"
 439			;;
 440		x86)
 441			CC=gcc
 442			without_gcc=no
 443			OPT="$OPT -O"
 444			;;
 445		*)
 446			AC_MSG_ERROR([Unknown BeOS platform "$BE_HOST_CPU"])
 447			;;
 448		esac
 449		AR="\$(srcdir)/Modules/ar_beos"
 450		RANLIB=:
 451		;;
 452    Monterey*)
 453        RANLIB=:
 454        without_gcc=;;
 455	*)	without_gcc=no;;
 456	esac])
 457AC_MSG_RESULT($without_gcc)
 458
 459# If the user switches compilers, we can't believe the cache
 460if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
 461then
 462  AC_MSG_ERROR([cached CC is different -- throw away $cache_file
 463(it is also a good idea to do 'make clean' before compiling)])
 464fi
 465
 466# Check for --with-llvm=DIRECTORY or --without-llvm.
 467#
 468# Check for this really early so we can use it to toggle LINKCC.
 469#
 470# Expected behaviour:
 471#   - Omit --with-llvm: use llvm-config we find in the path or $LLVM_CONFIG
 472#   - --with-llvm (no DIRECTORY): Same
 473#   - --with-llvm=DIRECTORY: use the LLVM installed in DIRECTORY
 474#   - --without-llvm: disable everything that requires LLVM
 475dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
 476AC_ARG_VAR(LLVM_CONFIG, [LLVM configuration script])
 477AC_MSG_CHECKING(for --with(out)-llvm)
 478AC_ARG_WITH(llvm, 
 479            AC_HELP_STRING(--with(out)-llvm@<:@=DIRECTORY@:>@,
 480                           build against a preinstalled LLVM
 481                           or disable LLVM integration entirely. Note that
 482                           Python built with --without-llvm cannot load
 483                           extension modules built with --with-llvm or
 484                           vice-versa.),
 485            [with_llvm=$withval],
 486            [with_llvm=yes])
 487
 488if test "$with_llvm" = "no"
 489then
 490    AC_MSG_RESULT(disabled)
 491    WITH_LLVM=0
 492else
 493    AC_MSG_RESULT($with_llvm)
 494    WITH_LLVM=1
 495    if test "$with_llvm" = "yes"
 496    then
 497        AC_PATH_PROG(LLVM_CONFIG, llvm-config)
 498        if test -z "$LLVM_CONFIG"
 499        then
 500            AC_MSG_ERROR([cannot find llvm-config on the PATH])
 501        fi
 502    else
 503        AC_PATH_PROG(LLVM_CONFIG, llvm-config, [], [$with_llvm/bin])
 504        if test -z "$LLVM_CONFIG"
 505        then
 506            AC_MSG_ERROR([cannot find llvm-config in $with_llvm/bin])
 507        fi
 508    fi
 509
 510    LLVM_INC_DIR=`$LLVM_CONFIG --includedir`
 511    LLVM_BIN_DIR=`$LLVM_CONFIG --bindir`
 512    LLVM_CXXFLAGS=`$LLVM_CONFIG jit bitreader backend --cxxflags`
 513    LLVM_LDFLAGS=`$LLVM_CONFIG jit bitreader backend --ldflags --libs | awk '{ORS=" "} {print $0}'`
 514    LLVM_LIB_PATHS=`$LLVM_CONFIG jit bitreader backend --libfiles`
 515
 516    AC_CHECK_FILE("$LLVM_BIN_DIR/clang",
 517        [], [AC_MSG_ERROR([Did not find clang in $LLVM_BIN_DIR])])
 518    AC_CHECK_FILE("$LLVM_BIN_DIR/opt",
 519        [], [AC_MSG_ERROR([Did not find opt in $LLVM_BIN_DIR])])
 520    AC_CHECK_FILE("$LLVM_BIN_DIR/llvm-link",
 521        [], [AC_MSG_ERROR([Did not find llvm-link in $LLVM_BIN_DIR])])
 522    AC_CHECK_FILE("$LLVM_BIN_DIR/llvm-dis",
 523        [], [AC_MSG_ERROR([Did not find llvm-dis in $LLVM_BIN_DIR])])
 524
 525    AC_DEFINE(WITH_LLVM, 1,
 526        [Use LLVM for code generation. This makes things fast.])
 527fi
 528AC_SUBST(WITH_LLVM)
 529AC_SUBST(LLVM_INC_DIR)
 530AC_SUBST(LLVM_BIN_DIR)
 531AC_SUBST(LLVM_CXXFLAGS)
 532AC_SUBST(LLVM_LDFLAGS)
 533AC_SUBST(LLVM_LIB_PATHS)
 534
 535
 536save_CFLAGS=$CFLAGS
 537AC_PROG_CC
 538CFLAGS=$save_CFLAGS
 539
 540AC_SUBST(CXX)
 541AC_SUBST(MAINCC)
 542AC_MSG_CHECKING(for --with-cxx-main=<compiler>)
 543AC_ARG_WITH(cxx_main,
 544            AC_HELP_STRING([--with-cxx-main=<compiler>],
 545                           [compile main() and link python executable with C++ compiler]),
 546[
 547	case $withval in
 548	no)	with_cxx_main=no
 549		MAINCC='$(CC)';;
 550	yes)	with_cxx_main=yes
 551		MAINCC='$(CXX)';;
 552	*)	with_cxx_main=yes
 553		MAINCC=$withval
 554		if test -z "$CXX"
 555		then
 556			CXX=$withval
 557		fi;;
 558	esac
 559], [
 560	case "$with_llvm" in
 561	no)	with_cxx_main=no
 562		MAINCC='$(CC)';;
 563	*)	with_cxx_main=yes
 564		MAINCC='$(CXX)';;
 565	esac
 566])
 567AC_MSG_RESULT($with_cxx_main)
 568
 569if test "$with_cxx_main" = "no"
 570then
 571	if test "$with_llvm" != "no"
 572	then
 573		AC_MSG_ERROR("Cannot specify both --without-cxx-main and --with-llvm");
 574	fi
 575fi
 576
 577# Use this in preference to AC_PROG_CXX, since --with-cxx-main=foo will override
 578# CXX.
 579preset_cxx="$CXX"
 580if test -z "$CXX"
 581then
 582        case "$CC" in
 583        gcc)    AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;;
 584        cc)     AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;;
 585        esac
 586	if test "$CXX" = "notfound"
 587	then
 588		CXX=""
 589	fi
 590fi
 591if test -z "$CXX"
 592then
 593	AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
 594	if test "$CXX" = "notfound"
 595	then
 596		CXX=""
 597	fi
 598fi
 599if test "$preset_cxx" != "$CXX"
 600then
 601        AC_MSG_WARN([
 602
 603  By default, distutils will build C++ extension modules with "$CXX".
 604  If this is not intended, then set CXX on the configure command line.
 605  ])
 606fi
 607
 608
 609# checks for UNIX variants that set C preprocessor variables
 610AC_AIX
 611
 612# Check for unsupported systems
 613case $ac_sys_system/$ac_sys_release in
 614atheos*|Linux*/1*)
 615   echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
 616   echo See README for details.
 617   exit 1;;
 618esac
 619
 620AC_EXEEXT
 621AC_MSG_CHECKING(for --with-suffix)
 622AC_ARG_WITH(suffix,
 623            AC_HELP_STRING(--with-suffix=.exe, set executable suffix),
 624[
 625	case $withval in
 626	no)	EXEEXT=;;
 627	yes)	EXEEXT=.exe;;
 628	*)	EXEEXT=$withval;;
 629	esac])
 630AC_MSG_RESULT($EXEEXT)
 631
 632# Test whether we're running on a non-case-sensitive system, in which
 633# case we give a warning if no ext is given
 634AC_SUBST(BUILDEXEEXT)
 635AC_MSG_CHECKING(for case-insensitive build directory)
 636if test ! -d CaseSensitiveTestDir; then
 637mkdir CaseSensitiveTestDir
 638fi
 639
 640if test -d casesensitivetestdir
 641then
 642    AC_MSG_RESULT(yes)
 643    BUILDEXEEXT=.exe
 644else
 645	AC_MSG_RESULT(no)
 646	BUILDEXEEXT=$EXEEXT
 647fi
 648rmdir CaseSensitiveTestDir
 649
 650case $MACHDEP in
 651bsdos*)
 652    case $CC in
 653    gcc) CC="$CC -D_HAVE_BSDI";;
 654    esac;;
 655esac
 656
 657case $ac_sys_system in
 658hp*|HP*)
 659    case $CC in
 660    cc|*/cc) CC="$CC -Ae";;
 661    esac;;
 662Monterey*)
 663    case $CC in
 664    cc) CC="$CC -Wl,-Bexport";;
 665    esac;;
 666SunOS*)
 667    # Some functions have a prototype only with that define, e.g. confstr
 668    AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
 669    ;;
 670esac
 671
 672
 673AC_SUBST(LIBRARY)
 674AC_MSG_CHECKING(LIBRARY)
 675if test -z "$LIBRARY"
 676then
 677	LIBRARY='libpython$(VERSION).a'
 678fi
 679AC_MSG_RESULT($LIBRARY)
 680
 681# LDLIBRARY is the name of the library to link against (as opposed to the
 682# name of the library into which to insert object files). BLDLIBRARY is also
 683# the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
 684# is blank as the main program is not linked directly against LDLIBRARY.
 685# LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
 686# systems without shared libraries, LDLIBRARY is the same as LIBRARY
 687# (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,
 688# DLLLIBRARY is the shared (i.e., DLL) library.
 689# 
 690# RUNSHARED is used to run shared python without installed libraries
 691#
 692# INSTSONAME is the name of the shared library that will be use to install
 693# on the system - some systems like version suffix, others don't
 694AC_SUBST(LDLIBRARY)
 695AC_SUBST(DLLLIBRARY)
 696AC_SUBST(BLDLIBRARY)
 697AC_SUBST(LDLIBRARYDIR)
 698AC_SUBST(INSTSONAME)
 699AC_SUBST(RUNSHARED)
 700LDLIBRARY="$LIBRARY"
 701BLDLIBRARY='$(LDLIBRARY)'
 702INSTSONAME='$(LDLIBRARY)'
 703DLLLIBRARY=''
 704LDLIBRARYDIR=''
 705RUNSHARED=''
 706
 707# LINKCC is the command that links the python executable -- this depends on
 708# the values of --with-llvm and --with-cxx-main.
 709# This is altered for AIX in order to build the export list before
 710# linking. If --without-llvm was specified, we use $(CC) to avoid depending on
 711# libstdc++.
 712AC_SUBST(LINKCC)
 713AC_MSG_CHECKING(LINKCC)
 714if test -z "$LINKCC"
 715then
 716	LINKCC='$(PURIFY) $(MAINCC)'
 717	case $ac_sys_system in
 718	AIX*)
 719	   exp_extra="\"\""
 720	   if test $ac_sys_release -ge 5 -o \
 721		   $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then
 722	       exp_extra="."
 723	   fi
 724	   LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
 725	Monterey64*)
 726	   LINKCC="$LINKCC -L/usr/lib/ia64l64";;
 727	QNX*)
 728	   # qcc must be used because the other compilers do not
 729	   # support -N.
 730	   LINKCC=qcc;;
 731	esac
 732fi
 733AC_MSG_RESULT($LINKCC)
 734
 735AC_MSG_CHECKING(for --enable-shared)
 736AC_ARG_ENABLE(shared,
 737              AC_HELP_STRING(--enable-shared, disable/enable building shared python library))
 738
 739if test -z "$enable_shared"
 740then 
 741  case $ac_sys_system in
 742  CYGWIN* | atheos*)
 743    enable_shared="yes";;
 744  *)
 745    enable_shared="no";;
 746  esac
 747fi
 748AC_MSG_RESULT($enable_shared)
 749
 750AC_MSG_CHECKING(for --enable-profiling)
 751AC_ARG_ENABLE(profiling,
 752              AC_HELP_STRING(--enable-profiling, enable C-level code profiling),
 753[ac_save_cc="$CC"
 754 CC="$CC -pg"
 755 AC_TRY_RUN([int main() { return 0; }],
 756   ac_enable_profiling="yes",
 757   ac_enable_profiling="no",
 758   ac_enable_profiling="no")
 759 CC="$ac_save_cc"])
 760AC_MSG_RESULT($ac_enable_profiling)
 761
 762case "$ac_enable_profiling" in
 763    "yes")
 764	BASECFLAGS="-pg $BASECFLAGS"
 765	LDFLAGS="-pg $LDFLAGS"
 766    ;;
 767esac
 768
 769AC_MSG_CHECKING(LDLIBRARY)
 770
 771# MacOSX framework builds need more magic. LDLIBRARY is the dynamic
 772# library that we build, but we do not want to link against it (we
 773# will find it with a -framework option). For this reason there is an
 774# extra variable BLDLIBRARY against which Python and the extension
 775# modules are linked, BLDLIBRARY. This is normally the same as
 776# LDLIBRARY, but empty for MacOSX framework builds.
 777if test "$enable_framework"
 778then
 779  LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 780  RUNSHARED=DYLD_FRAMEWORK_PATH="$(shell pwd):$DYLD_FRAMEWORK_PATH"
 781  BLDLIBRARY=''
 782else
 783  BLDLIBRARY='$(LDLIBRARY)'
 784fi  
 785
 786# Other platforms follow
 787if test $enable_shared = "yes"; then
 788  AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
 789  case $ac_sys_system in
 790    BeOS*)
 791          LDLIBRARY='libpython$(VERSION).so'
 792          ;;
 793    CYGWIN*)
 794          LDLIBRARY='libpython$(VERSION).dll.a'
 795          DLLLIBRARY='libpython$(VERSION).dll'
 796          ;;
 797    SunOS*)
 798	  LDLIBRARY='libpython$(VERSION).so'
 799	  BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
 800	  RUNSHARED='LD_LIBRARY_PATH=$(shell pwd):${LD_LIBRARY_PATH}'
 801	  INSTSONAME="$LDLIBRARY".$SOVERSION
 802          ;;
 803    Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
 804	  LDLIBRARY='libpython$(VERSION).so'
 805	  BLDLIBRARY='-L. -lpython$(VERSION)'
 806	  RUNSHARED='LD_LIBRARY_PATH=$(shell pwd):${LD_LIBRARY_PATH}'
 807	  case $ac_sys_system in
 808	      FreeBSD*)
 809		SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
 810		;;
 811	  esac
 812	  INSTSONAME="$LDLIBRARY".$SOVERSION
 813	  ;;
 814    hp*|HP*)
 815	  case `uname -m` in
 816		ia64)
 817			LDLIBRARY='libpython$(VERSION).so'
 818			;;
 819		*)
 820			LDLIBRARY='libpython$(VERSION).sl'
 821			;;
 822	  esac
 823	  BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)'
 824	  RUNSHARED='SHLIB_PATH=$(shell pwd):${SHLIB_PATH}'
 825	  ;;
 826    OSF*)
 827	  LDLIBRARY='libpython$(VERSION).so'
 828	  BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
 829	  RUNSHARED='LD_LIBRARY_PATH=$(shell pwd):${LD_LIBRARY_PATH}'
 830	  ;;
 831    atheos*)
 832	  LDLIBRARY='libpython$(VERSION).so'
 833	  BLDLIBRARY='-L. -lpython$(VERSION)'
 834	  RUNSHARED='DLL_PATH=$(shell pwd):${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}'
 835	  ;;
 836    Darwin*)
 837    	LDLIBRARY='libpython$(VERSION).dylib'
 838	BLDLIBRARY='-L. -lpython$(VERSION)'
 839	RUNSHARED='DYLD_LIBRARY_PATH=$(shell pwd):${DYLD_LIBRARY_PATH}'
 840	;;
 841
 842  esac
 843else # shared is disabled
 844  case $ac_sys_system in
 845    CYGWIN*)
 846          BLDLIBRARY='$(LIBRARY)'
 847          LDLIBRARY='libpython$(VERSION).dll.a'
 848          ;;
 849  esac
 850fi
 851
 852AC_MSG_RESULT($LDLIBRARY)
 853
 854AC_PROG_RANLIB
 855AC_SUBST(AR)
 856AC_CHECK_PROGS(AR, ar aal, ar)
 857
 858AC_SUBST(SVNVERSION)
 859AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
 860if test $SVNVERSION = found
 861then
 862	SVNVERSION="svnversion \$(srcdir)"
 863else
 864	SVNVERSION="echo Unversioned directory"
 865fi
 866
 867case $MACHDEP in
 868bsdos*|hp*|HP*)
 869	# install -d does not work on BSDI or HP-UX
 870	if test -z "$INSTALL"
 871	then
 872		INSTALL="${srcdir}/install-sh -c"
 873	fi
 874esac
 875AC_PROG_INSTALL
 876
 877# Not every filesystem supports hard links
 878AC_SUBST(LN)
 879if test -z "$LN" ; then
 880	case $ac_sys_system in
 881		BeOS*) LN="ln -s";;
 882		CYGWIN*) LN="ln -s";;
 883		atheos*) LN="ln -s";;
 884		*) LN=ln;;
 885	esac
 886fi
 887
 888# Check for --with-pydebug
 889AC_MSG_CHECKING(for --with-pydebug)
 890AC_ARG_WITH(pydebug, 
 891            AC_HELP_STRING(--with-pydebug, build with Py_DEBUG defined),
 892[
 893if test "$withval" != no
 894then 
 895  AC_DEFINE(Py_DEBUG, 1, 
 896  [Define if you want to build an interpreter with many run-time checks.]) 
 897  AC_MSG_RESULT(yes); 
 898  Py_DEBUG='true'
 899else AC_MSG_RESULT(no); Py_DEBUG='false'
 900fi],
 901[AC_MSG_RESULT(no)])
 902
 903if test "$with_llvm" != "no"
 904then
 905    LLVM_BUILD_MODE=`$LLVM_CONFIG --build-mode`
 906    if echo $LLVM_BUILD_MODE | grep -e -Asserts &>/dev/null
 907    then
 908        if test "$Py_DEBUG" = "true"
 909        then
 910            AC_MSG_ERROR([--with-pydebug requires +Asserts LLVM. Got "$LLVM_BUILD_MODE"])
 911        fi
 912    else
 913        if test "$Py_DEBUG" != "true"
 914        then
 915            AC_MSG_ERROR([--without-pydebug requires -Asserts LLVM. Got "$LLVM_BUILD_MODE"])
 916        fi
 917    fi
 918fi
 919
 920# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
 921# merged with this chunk of code?
 922
 923# Optimizer/debugger flags
 924# ------------------------
 925# (The following bit of code is complicated enough - please keep things
 926# indented properly.  Just pretend you're editing Python code. ;-)
 927
 928# There are two parallel sets of case statements below, one that checks to
 929# see if OPT was set and one that does BASECFLAGS setting based upon
 930# compiler and platform.  BASECFLAGS tweaks need to be made even if the
 931# user set OPT.
 932
 933# tweak OPT based on compiler and platform, only if the user didn't set
 934# it on the command line
 935AC_SUBST(OPT)
 936if test -z "$OPT"
 937then
 938    case $GCC in
 939    yes)
 940	case $ac_cv_prog_cc_g in
 941	yes)
 942	    if test "$Py_DEBUG" = 'true' ; then
 943		# Optimization messes up debuggers, so turn it off for
 944		# debug builds.
 945		OPT="-g"
 946	    else
 947		OPT="-g -O3"
 948	    fi
 949	    ;;
 950	*)
 951	    OPT="-O3"
 952	    ;;
 953	esac
 954	case $ac_sys_system in
 955	    SCO_SV*) OPT="$OPT -m486 -DSCO5"
 956	    ;;
 957        esac
 958	;;
 959
 960    *)
 961	OPT="-O"
 962	;;
 963    esac
 964
 965    # The current (beta) Monterey compiler dies with optimizations
 966    # XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
 967    case $ac_sys_system in
 968	Monterey*)
 969	    OPT=""
 970	    ;;
 971    esac
 972
 973fi
 974
 975AC_SUBST(BASECFLAGS)
 976
 977# The -arch flags for universal builds on OSX
 978UNIVERSAL_ARCH_FLAGS=
 979AC_SUBST(UNIVERSAL_ARCH_FLAGS)
 980
 981# tweak BASECFLAGS based on compiler and platform
 982case $GCC in
 983yes)
 984    # Python violates C99 rules, by casting between incompatible
 985    # pointer types. GCC may generate bad code as a result of that,
 986    # so use -fno-strict-aliasing if supported.
 987    AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
 988     ac_save_cc="$CC"
 989     CC="$CC -fno-strict-aliasing"
 990     AC_TRY_RUN([int main() { return 0; }],
 991     ac_cv_no_strict_aliasing_ok=yes,
 992     ac_cv_no_strict_aliasing_ok=no,
 993     ac_cv_no_strict_aliasing_ok=no)
 994     CC="$ac_save_cc"
 995    AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
 996    if test $ac_cv_no_strict_aliasing_ok = yes
 997    then
 998      BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
 999    fi
1000
1001    # Python violates C99 rules by treating signed overflow as
1002    # 2s-compliment. GCC 4+ can generate bad code because of that, so
1003    # use -fwrapv if it's supported
1004    AC_MSG_CHECKING(whether $CC accepts -fwrapv)
1005     ac_save_cc="$CC"
1006     CC="$CC -fwrapv"
1007     AC_TRY_RUN([int main() { return 0; }],
1008     ac_cv_fwrapv_ok=yes,
1009     ac_cv_fwrapv_ok=no,
1010     ac_cv_fwrapv_ok=no)
1011     CC="$ac_save_cc"
1012    AC_MSG_RESULT($ac_cv_fwrapv_ok)
1013    if test $ac_cv_fwrapv_ok = yes
1014    then
1015      BASECFLAGS="$BASECFLAGS -fwrapv"
1016    fi
1017
1018    BASECFLAGS="$BASECFLAGS -Wall"
1019
1020    if test "$CC" != 'g++' ; then
1021        STRICT_PROTO="-Wstrict-prototypes"
1022    fi
1023
1024    # if using gcc on alpha, use -mieee to get (near) full IEEE 754
1025    # support.  Without this, treatment of subnormals doesn't follow
1026    # the standard.
1027    case $ac_sys_machine in
1028         alpha*)
1029                BASECFLAGS="$BASECFLAGS -mieee"
1030                ;;
1031    esac
1032
1033    case $ac_sys_system in
1034	SCO_SV*)
1035	    BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
1036	    ;;
1037	# is there any other compiler on Darwin besides gcc?
1038	Darwin*)
1039	    # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
1040	    # used to be here, but non-Apple gcc doesn't accept them.
1041
1042
1043	    if test "${enable_universalsdk}"; then
1044		UNIVERSAL_ARCH_FLAGS=""
1045	        if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
1046		   UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
1047		   ARCH_RUN_32BIT=""
1048
1049	         elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
1050		   UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
1051		   ARCH_RUN_32BIT="true"
1052
1053	         elif test "$UNIVERSAL_ARCHS" = "all" ; then
1054		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
1055		   ARCH_RUN_32BIT="arch -i386 -ppc"
1056
1057	         elif test "$UNIVERSAL_ARCHS" = "intel" ; then
1058		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
1059		   ARCH_RUN_32BIT="arch -i386"
1060
1061	         elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
1062		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
1063		   ARCH_RUN_32BIT="arch -i386 -ppc"
1064
1065		 else
1066	           AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
1067
1068		 fi
1069
1070
1071		BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
1072		tgt=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
1073		if test "${UNIVERSALSDK}" != "/" -a "${tgt}" '>' '10.4' ; then
1074			CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
1075		fi
1076	    fi
1077
1078	    # Calculate the right deployment target for this build.
1079	    #
1080	    cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
1081	    if test ${cur_target} '>' 10.2; then
1082		    cur_target=10.3
1083		    if test ${enable_universalsdk}; then
1084			    if test "${UNIVERSAL_ARCHS}" = "all"; then
1085				    # Ensure that the default platform for a 
1086				    # 4-way universal build is OSX 10.5, 
1087				    # that's the first OS release where 
1088				    # 4-way builds make sense.
1089				    cur_target='10.5'
1090
1091			    elif test "${UNIVERSAL_ARCHS}" = "3-way"; then
1092				    cur_target='10.5'
1093
1094			    elif test "${UNIVERSAL_ARCHS}" = "intel"; then
1095				    cur_target='10.5'
1096
1097			    elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then
1098				    cur_target='10.5'
1099			    fi
1100		    else
1101			    if test `arch` = "i386"; then
1102				    # On Intel macs default to a deployment
1103				    # target of 10.4, that's the first OSX
1104				    # release with Intel support.
1105				    cur_target="10.4"
1106			    fi
1107		    fi
1108	    fi
1109	    CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
1110	    
1111	    # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the 
1112	    # environment with a value that is the same as what we'll use
1113	    # in the Makefile to ensure that we'll get the same compiler
1114	    # environment during configure and build time.
1115	    MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
1116	    export MACOSX_DEPLOYMENT_TARGET
1117	    EXPORT_MACOSX_DEPLOYMENT_TARGET=''
1118
1119	    ;;
1120	OSF*)
1121	    BASECFLAGS="$BASECFLAGS -mieee"
1122	    ;;
1123    esac
1124    ;;
1125
1126*)
1127    case $ac_sys_system in
1128    OpenUNIX*|UnixWare*)
1129	BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
1130	;;
1131    OSF*)
1132	BASECFLAGS="$BASECFLAGS -ieee -std"
1133    	;;
1134    SCO_SV*)
1135	BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
1136	;;
1137    esac
1138    ;;
1139esac
1140
1141if test "$Py_DEBUG" = 'true'; then
1142  :
1143else
1144  OPT="-DNDEBUG $OPT"
1145fi
1146
1147if test "$ac_arch_flags"
1148then
1149	BASECFLAGS="$BASECFLAGS $ac_arch_flags"
1150fi
1151
1152# disable check for icc since it seems to pass, but generates a warning
1153if test "$CC" = icc
1154then
1155  ac_cv_opt_olimit_ok=no
1156fi
1157
1158AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
1159AC_CACHE_VAL(ac_cv_opt_olimit_ok,
1160[ac_save_cc="$CC"
1161CC="$CC -OPT:Olimit=0"
1162AC_TRY_RUN([int main() { return 0; }],
1163  ac_cv_opt_olimit_ok=yes,
1164  ac_cv_opt_olimit_ok=no,
1165  ac_cv_opt_olimit_ok=no)
1166CC="$ac_save_cc"])
1167AC_MSG_RESULT($ac_cv_opt_olimit_ok)
1168if test $ac_cv_opt_olimit_ok = yes; then
1169    case $ac_sys_system in
1170	# XXX is this branch needed? On MacOSX 10.2.2 the result of the
1171	# olimit_ok test is "no".  Is it "yes" in some other Darwin-esque
1172	# environment?
1173        Darwin*)
1174	    ;;
1175        *)
1176	    BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
1177	    ;;
1178    esac
1179else
1180  AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
1181  AC_CACHE_VAL(ac_cv_olimit_ok,
1182  [ac_save_cc="$CC"
1183  CC="$CC -Olimit 1500"
1184  AC_TRY_RUN([int main() { return 0; }],
1185    ac_cv_olimit_ok=yes,
1186    ac_cv_olimit_ok=no,
1187    ac_cv_olimit_ok=no)
1188  CC="$ac_save_cc"])
1189  AC_MSG_RESULT($ac_cv_olimit_ok)
1190  if test $ac_cv_olimit_ok = yes; then
1191    BASECFLAGS="$BASECFLAGS -Olimit 1500"
1192  fi
1193fi
1194
1195# Check whether GCC supports PyArg_ParseTuple format
1196if test "$GCC" = "yes"
1197then
1198  AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
1199  save_CFLAGS=$CFLAGS
1200  CFLAGS="$CFLAGS -Werror"
1201  AC_TRY_COMPILE([
1202    void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));
1203  ],,
1204  AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1, [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))])
1205  AC_MSG_RESULT(yes),
1206  AC_MSG_RESULT(no)
1207  )
1208  CFLAGS=$save_CFLAGS
1209fi
1210
1211# On some compilers, pthreads are available without further options
1212# (e.g. MacOS X). On some of these systems, the compiler will not
1213# complain if unaccepted options are passed (e.g. gcc on Mac OS X).
1214# So we have to see first whether pthreads are available without
1215# options before we can check whether -Kpthread improves anything.
1216AC_MSG_CHECKING(whether pthreads are available without options)
1217AC_CACHE_VAL(ac_cv_pthread_is_default,
1218[AC_TRY_RUN([
1219#include <pthread.h>
1220
1221void* routine(void* p){return NULL;}
1222
1223int main(){
1224  pthread_t p;
1225  if(pthread_create(&p,NULL,routine,NULL)!=0)
1226    return 1;
1227  (void)pthread_detach(p);
1228  return 0;
1229}
1230],
1231[
1232  ac_cv_pthread_is_default=yes
1233  ac_cv_kthread=no
1234  ac_cv_pthread=no
1235],
1236  ac_cv_pthread_is_default=no,
1237  ac_cv_pthread_is_default=no)
1238])
1239AC_MSG_RESULT($ac_cv_pthread_is_default)
1240
1241
1242if test $ac_cv_pthread_is_default = yes 
1243then
1244  ac_cv_kpthread=no
1245else
1246# -Kpthread, if available, provides the right #defines
1247# and linker options to make pthread_create available
1248# Some compilers won't report that they do not support -Kpthread,
1249# so we need to run a program to see whether it really made the
1250# function available.
1251AC_MSG_CHECKING(whether $CC accepts -Kpthread)
1252AC_CACHE_VAL(ac_cv_kpthread,
1253[ac_save_cc="$CC"
1254CC="$CC -Kpthread"
1255AC_TRY_RUN([
1256#include <pthread.h>
1257
1258void* routine(void* p){return NULL;}
1259
1260int main(){
1261  pthread_t p;
1262  if(pthread_create(&p,NULL,routine,NULL)!=0)
1263    return 1;
1264  (void)pthread_detach(p);
1265  return 0;
1266}
1267],
1268  ac_cv_kpthread=yes,
1269  ac_cv_kpthread=no,
1270  ac_cv_kpthread=no)
1271CC="$ac_save_cc"])
1272AC_MSG_RESULT($ac_cv_kpthread)
1273fi
1274
1275if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
1276then
1277# -Kthread, if available, provides the right #defines
1278# and linker options to make pthread_create available
1279# Some compilers won't report that they do not support -Kthread,
1280# so we need to run a program to see whether it really made the
1281# function available.
1282AC_MSG_CHECKING(whether $CC accepts -Kthread)
1283AC_CACHE_VAL(ac_cv_kthread,
1284[ac_save_cc="$CC"
1285CC="$CC -Kthread"
1286AC_TRY_RUN([
1287#include <pthread.h>
1288
1289void* routine(void* p){return NULL;}
1290
1291int main(){
1292  pthread_t p;
1293  if(pthread_create(&p,NULL,routine,NULL)!=0)
1294    return 1;
1295  (void)pthread_detach(p);
1296  return 0;
1297}
1298],
1299  ac_cv_kthread=yes,
1300  ac_cv_kthread=no,
1301  ac_cv_kthread=no)
1302CC="$ac_save_cc"])
1303AC_MSG_RESULT($ac_cv_kthread)
1304fi
1305
1306if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
1307then
1308# -pthread, if available, provides the right #defines
1309# and linker options to make pthread_create available
1310# Some compilers won't report that they do not support -pthread,
1311# so we need to run a program to see whether it really made the
1312# function available.
1313AC_MSG_CHECKING(whether $CC accepts -pthread)
1314AC_CACHE_VAL(ac_cv_thread,
1315[ac_save_cc="$CC"
1316CC="$CC -pthread"
1317AC_TRY_RUN([
1318#include <pthread.h>
1319
1320void* routine(void* p){return NULL;}
1321
1322int main(){
1323  pthread_t p;
1324  if(pthread_create(&p,NULL,routine,NULL)!=0)
1325    return 1;
1326  (void)pthread_detach(p);
1327  return 0;
1328}
1329],
1330  ac_cv_pthread=yes,
1331  ac_cv_pthread=no,
1332  ac_cv_pthread=no)
1333CC="$ac_save_cc"])
1334AC_MSG_RESULT($ac_cv_pthread)
1335fi
1336
1337# If we have set a CC compiler flag for thread support then
1338# check if it works for CXX, too.
1339ac_cv_cxx_thread=no
1340if test ! -z "$CXX"
1341then
1342AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
1343ac_save_cxx="$CXX"
1344
1345if test "$ac_cv_kpthread" = "yes"
1346then
1347  CXX="$CXX -Kpthread"  
1348  ac_cv_cxx_thread=yes
1349elif test "$ac_cv_kthread" = "yes"
1350then
1351  CXX="$CXX -Kthread"
1352  ac_cv_cxx_thread=yes
1353elif test "$ac_cv_pthread" = "yes"
1354then 
1355  CXX="$CXX -pthread"
1356  ac_cv_cxx_thread=yes
1357fi
1358
1359if test $ac_cv_cxx_thread = yes
1360then
1361  echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext
1362  $CXX -c conftest.$ac_ext 2>&5
1363  if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
1364     && test -s conftest$ac_exeext && ./conftest$ac_exeext
1365  then
1366    ac_cv_cxx_thread=yes
1367  else
1368    ac_cv_cxx_thread=no
1369  fi
1370  rm -fr conftest*
1371fi
1372AC_MSG_RESULT($ac_cv_cxx_thread)
1373fi
1374CXX="$ac_save_cxx"
1375
1376dnl # check for ANSI or K&R ("traditional") preprocessor
1377dnl AC_MSG_CHECKING(for C preprocessor type)
1378dnl AC_TRY_COMPILE([
1379dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
1380dnl int foo;
1381dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
1382dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional)
1383dnl AC_MSG_RESULT($cpp_type)
1384
1385# checks for header files
1386AC_HEADER_STDC
1387AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
1388fcntl.h grp.h \
1389ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
1390shadow.h signal.h stdint.h stropts.h termios.h thread.h \
1391unistd.h utime.h \
1392sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
1393sys/lock.h sys/mkdev.h sys/modem.h \
1394sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
1395sys/termio.h sys/time.h \
1396sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
1397sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
1398bluetooth/bluetooth.h linux/tipc.h)
1399AC_HEADER_DIRENT
1400AC_HEADER_MAJOR
1401
1402# On Solaris, term.h requires curses.h
1403AC_CHECK_HEADERS(term.h,,,[
1404#ifdef HAVE_CURSES_H
1405#include <curses.h>
1406#endif
1407])
1408
1409# On Linux, netlink.h requires asm/types.h
1410AC_CHECK_HEADERS(linux/netlink.h,,,[
1411#ifdef HAVE_ASM_TYPES_H
1412#include <asm/types.h>
1413#endif
1414#ifdef HAVE_SYS_SOCKET_H
1415#include <sys/socket.h>
1416#endif
1417])
1418
1419# checks for typedefs
1420was_it_defined=no
1421AC_MSG_CHECKING(for clock_t in time.h)
1422AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
1423    AC_DEFINE(clock_t, long, [Define to 'long' if <time.h> doesn't define.])
1424])
1425AC_MSG_RESULT($was_it_defined)
1426
1427# Check whether using makedev requires defining _OSF_SOURCE
1428AC_MSG_CHECKING(for makedev)
1429AC_TRY_LINK([#include <sys/types.h> ],
1430	    [ makedev(0, 0) ],
1431	    ac_cv_has_makedev=yes,
1432	    ac_cv_has_makedev=no)
1433if test "$ac_cv_has_makedev" = "no"; then
1434    # we didn't link, try if _OSF_SOURCE will allow us to link
1435    AC_TRY_LINK([
1436#define _OSF_SOURCE 1
1437#include <sys/types.h>
1438    ],
1439    [ makedev(0, 0) ],
1440    ac_cv_has_makedev=yes,
1441    ac_cv_has_makedev=no)
1442    if test "$ac_cv_has_makedev" = "yes"; then
1443        AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
1444    fi
1445fi
1446AC_MSG_RESULT($ac_cv_has_makedev)
1447if test "$ac_cv_has_makedev" = "yes"; then
1448    AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
1449fi
1450
1451# Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in
1452# the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are
1453# defined, but the compiler does not support pragma redefine_extname,
1454# and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit
1455# structures (such as rlimit64) without declaring them. As a
1456# work-around, disable LFS on such configurations
1457
1458use_lfs=yes
1459AC_MSG_CHECKING(Solaris LFS bug)
1460AC_TRY_COMPILE([
1461#define _LARGEFILE_SOURCE 1
1462#define _FILE_OFFSET_BITS 64
1463#include <sys/resource.h>
1464],struct rlimit foo;,sol_lfs_bug=no,sol_lfs_bug=yes)
1465AC_MSG_RESULT($sol_lfs_bug)
1466if test "$sol_lfs_bug" = "yes"; then
1467  use_lfs=no
1468fi
1469
1470if test "$use_lfs" = "yes"; then
1471# Two defines needed to enable largefile support on various platforms
1472# These may affect some typedefs
1473AC_DEFINE(_LARGEFILE_SOURCE, 1, 
1474[This must be defined on some systems to enable large file support.])
1475AC_DEFINE(_FILE_OFFSET_BITS, 64,
1476[This must be set to 64 on some systems to enable large file support.])
1477fi
1478
1479# Add some code to confdefs.h so that the test for off_t works on SCO
1480cat >> confdefs.h <<\EOF
1481#if defined(SCO_DS)
1482#undef _OFF_T
1483#endif
1484EOF
1485
1486# Type availability checks
1487AC_TYPE_MODE_T
1488AC_TYPE_OFF_T
1489AC_TYPE_PID_T
1490AC_TYPE_SIGNAL
1491AC_TYPE_SIZE_T
1492AC_TYPE_UID_T
1493AC_CHECK_TYPE(ssize_t,
1494  AC_DEFINE(HAVE_SSIZE_T, 1, Define if your compiler provides ssize_t),,)
1495
1496# Sizes of various common basic types
1497# ANSI C requires sizeof(char) == 1, so no need to check it
1498AC_CHECK_SIZEOF(int, 4)
1499AC_CHECK_SIZEOF(long, 4)
1500AC_CHECK_SIZEOF(void *, 4)
1501AC_CHECK_SIZEOF(short, 2)
1502AC_CHECK_SIZEOF(float, 4)
1503AC_CHECK_SIZEOF(double, 8)
1504AC_CHECK_SIZEOF(fpos_t, 4)
1505AC_CHECK_SIZEOF(size_t, 4)
1506AC_CHECK_SIZEOF(pid_t, 4)
1507
1508AC_MSG_CHECKING(for long long support)
1509have_long_long=no
1510AC_TRY_COMPILE([], [long long x; x = (long long)0;], [
1511  AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.]) 
1512  have_long_long=yes
1513])
1514AC_MSG_RESULT($have_long_long)
1515if test "$have_long_long" = yes ; then
1516AC_CHECK_SIZEOF(long long, 8)
1517fi
1518
1519AC_MSG_CHECKING(for long double support)
1520have_long_double=no
1521AC_TRY_COMPILE([], [long double x; x = (long double)0.;], [
1522  AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
1523  have_long_double=yes
1524])
1525AC_MSG_RESULT($have_long_double)
1526if test "$have_long_double" = yes ; then
1527AC_CHECK_SIZEOF(long double, 12)
1528fi
1529
1530AC_MSG_CHECKING(for _Bool support)
1531have_c99_bool=no
1532AC_TRY_COMPILE([], [_Bool x; x = (_Bool)0;], [
1533  AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.]) 
1534  have_c99_bool=yes
1535])
1536AC_MSG_RESULT($have_c99_bool)
1537if test "$have_c99_bool" = yes ; then
1538AC_CHECK_SIZEOF(_Bool, 1)
1539fi
1540
1541AC_CHECK_TYPES(uintptr_t, 
1542   [AC_CHECK_SIZEOF(uintptr_t, 4)], 
1543   [], [#ifdef HAVE_STDINT_H
1544        #include <stdint.h>
1545        #endif])
1546
1547
1548# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
1549AC_MSG_CHECKING(size of off_t)
1550AC_CACHE_VAL(ac_cv_sizeof_off_t,
1551[AC_TRY_RUN([#include <stdio.h>
1552#include <sys/types.h>
1553main()
1554{
1555  FILE *f=fopen("conftestval", "w");
1556  if (!f) exit(1);
1557  fprintf(f, "%d\n", sizeof(off_t));
1558  exit(0);
1559}],
1560ac_cv_sizeof_off_t=`cat conftestval`,
1561ac_cv_sizeof_off_t=0,
1562ac_cv_sizeof_off_t=4)
1563])
1564AC_MSG_RESULT($ac_cv_sizeof_off_t)
1565AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
1566[The number of bytes in an off_t.])
1567
1568AC_MSG_CHECKING(whether to enable large file support)
1569if test "$have_long_long" = yes -a \
1570	"$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
1571	"$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
1572  AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1, 
1573  [Defined to enable large file support when an off_t is bigger than a long
1574   and long long is available and at least as big as an off_t. You may need
1575   to add some flags for configuration and compilation to enable this mode.
1576   (For Solaris and Linux, the necessary defines are already defined.)])
1577  AC_MSG_RESULT(yes)
1578else
1579  AC_MSG_RESULT(no)
1580fi
1581
1582# AC_CHECK_SIZEOF() doesn't include <time.h>.
1583AC_MSG_CHECKING(size of time_t)
1584AC_CACHE_VAL(ac_cv_sizeof_time_t,
1585[AC_TRY_RUN([#include <stdio.h>
1586#include <time.h>
1587main()
1588{
1589  FILE *f=fopen("conftestval", "w");
1590  if (!f) exit(1);
1591  fprintf(f, "%d\n", sizeof(time_t));
1592  exit(0);
1593}],
1594ac_cv_sizeof_time_t=`cat conftestval`,
1595ac_cv_sizeof_time_t=0,
1596ac_cv_sizeof_time_t=4)
1597])
1598AC_MSG_RESULT($ac_cv_sizeof_time_t)
1599AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t, 
1600[The number of bytes in a time_t.])
1601
1602
1603# if have pthread_t then define SIZEOF_PTHREAD_T
1604ac_save_cc="$CC"
1605if test "$ac_cv_kpthread" = "yes"
1606then CC="$CC -Kpthread"
1607elif test "$ac_cv_kthread" = "yes"
1608then CC="$CC -Kthread"
1609elif test "$ac_cv_pthread" = "yes"
1610then CC="$CC -pthread"
1611fi
1612AC_MSG_CHECKING(for pthread_t)
1613have_pthread_t=no
1614AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
1615AC_MSG_RESULT($have_pthread_t)
1616if test "$have_pthread_t" = yes ; then
1617  # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
1618  AC_MSG_CHECKING(size of pthread_t)
1619  AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
1620  [AC_TRY_RUN([#include <stdio.h>
1621#include <pthread.h>
1622  main()
1623  {
1624    FILE *f=fopen("conftestval", "w");
1625    if (!f) exit(1);
1626    fprintf(f, "%d\n", sizeof(pthread_t));
1627    exit(0);
1628  }],
1629  ac_cv_sizeof_pthread_t=`cat conftestval`,
1630  ac_cv_sizeof_pthread_t=0,
1631  ac_cv_sizeof_pthread_t=4)
1632  ])
1633  AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
1634  AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
1635   [The number of bytes in a pthread_t.])
1636fi
1637CC="$ac_save_cc"
1638
1639AC_MSG_CHECKING(for --enable-toolbox-glue)
1640AC_ARG_ENABLE(toolbox-glue,
1641              AC_HELP_STRING(--enable-toolbox-glue, disable/enable MacOSX glue code for extensions))
1642
1643if test -z "$enable_toolbox_glue"
1644then 
1645	case $ac_sys_system/$ac_sys_release in
1646	Darwin/*)
1647		enable_toolbox_glue="yes";;
1648	*)
1649		enable_toolbox_glue="no";;
1650	esac
1651fi
1652case "$enable_toolbox_glue" in
1653yes)
1654	extra_machdep_objs="Python/mactoolboxglue.o"
1655	extra_undefs="-u _PyMac_Error"
1656	AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE, 1,
1657         [Define if you want to use MacPython modules on MacOSX in unix-Python.])
1658	;;
1659*)
1660	extra_machdep_objs=""
1661	extra_undefs=""
1662	;;
1663esac
1664AC_MSG_RESULT($enable_toolbox_glue)
1665
1666
1667AC_SUBST(OTHER_LIBTOOL_OPT)
1668case $ac_sys_system/$ac_sys_release in
1669  Darwin/@<:@01567@:>@\..*) 
1670    OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
1671    ;;
1672  Darwin/*)
1673    OTHER_LIBTOOL_OPT=""
1674    ;;
1675esac
1676
1677
1678ARCH_RUN_32BIT=""
1679AC_SUBST(LIBTOOL_CRUFT)
1680case $ac_sys_system/$ac_sys_release in
1681  Darwin/@<:@01567@:>@\..*) 
1682    LIBTOOL_CRUFT="-framework System -lcc_dynamic"
1683    if test "${enable_universalsdk}"; then
1684	    :
1685    else
1686        LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
1687    fi
1688    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1689    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
1690  Darwin/*)
1691    gcc_version=`gcc -v 2>&1 |  grep version | cut -d\  -f3`
1692    if test ${gcc_version} '<' 4.0
1693        then
1694            LIBTOOL_CRUFT="-lcc_dynamic"
1695        else 
1696            LIBTOOL_CRUFT=""
1697    fi
1698    AC_TRY_RUN([
1699    #include <unistd.h>
1700    int main(int argc, char*argv[])
1701    {
1702      if (sizeof(long) == 4) {
1703    	  return 0;
1704      } else {
1705      	  return 1;
1706      }
1707    }
1708    ], ac_osx_32bit=yes,
1709       ac_osx_32bit=no,
1710       ac_osx_32bit=yes)
1711    
1712    if test "${ac_osx_32bit}" = "yes"; then
1713    	case `arch` in
1714    	i386) 
1715    		MACOSX_DEFAULT_ARCH="i386" 
1716    		;;
1717    	ppc) 
1718    		MACOSX_DEFAULT_ARCH="ppc" 
1719    		;;
1720    	*)
1721    		AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
1722    		;;
1723    	esac
1724    else
1725    	case `arch` in
1726    	i386) 
1727    		MACOSX_DEFAULT_ARCH="x86_64" 
1728    		;;
1729    	ppc) 
1730    		MACOSX_DEFAULT_ARCH="ppc64" 
1731    		;;
1732    	*)
1733    		AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
1734    		;;
1735    	esac
1736
1737	#ARCH_RUN_32BIT="true"
1738    fi
1739
1740    LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
1741    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
1742    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
1743esac
1744
1745AC_MSG_CHECKING(for --enable-framework)
1746if test "$enable_framework"
1747then
1748	BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
1749	# -F. is needed to allow linking to the framework while 
1750	# in the build location.
1751	AC_DEFINE(WITH_NEXT_FRAMEWORK, 1, 
1752         [Define if you want to p…

Large files files are truncated, but you can click here to view the full file