[Python-checkins] r68938 - in python/branches/py3k-issue1717: Demo/classes/Complex.py Demo/classes/bitvec.py Demo/tix/grid.py Demo/tix/samples/Balloon.py Demo/tix/samples/BtnBox.py Demo/tix/samples/CmpImg.py Demo/tix/samples/ComboBox.py Demo/tix/samples/Control.py Demo/tix/samples/DirList.py Demo/tix/samples/DirTree.py Demo/tix/samples/NoteBook.py Demo/tix/samples/OptMenu.py Demo/tix/samples/PanedWin.py Demo/tix/samples/PopMenu.py Demo/tix/samples/SHList1.py Demo/tix/samples/SHList2.py Demo/tix/samples/Tree.py Demo/tix/tixwidgets.py Demo/tkinter/guido/AttrDialog.py Demo/tkinter/guido/ManPage.py Demo/tkinter/guido/MimeViewer.py Demo/tkinter/guido/ShellWindow.py Demo/tkinter/guido/brownian.py Demo/tkinter/guido/brownian2.py Demo/tkinter/guido/canvasevents.py Demo/tkinter/guido/dialog.py Demo/tkinter/guido/electrons.py Demo/tkinter/guido/hanoi.py Demo/tkinter/guido/hello.py Demo/tkinter/guido/imagedraw.py Demo/tkinter/guido/imageview.py Demo/tkinter/guido/kill.py Demo/tkinter/guido/listtree.py Demo/tkinter/guido/mbox.py Demo/tkinter/guido/newmenubardemo.py Demo/tkinter/guido/optionmenu.py Demo/tkinter/guido/paint.py Demo/tkinter/guido/rmt.py Demo/tkinter/guido/solitaire.py Demo/tkinter/guido/sortvisu.py Demo/tkinter/guido/ss1.py Demo/tkinter/guido/svkill.py Demo/tkinter/guido/switch.py Demo/tkinter/guido/tkman.py Demo/tkinter/matt/00-HELLO-WORLD.py Demo/tkinter/matt/animation-simple.py Demo/tkinter/matt/animation-w-velocity-ctrl.py Demo/tkinter/matt/bind-w-mult-calls-p-type.py Demo/tkinter/matt/canvas-demo-simple.py Demo/tkinter/matt/canvas-gridding.py Demo/tkinter/matt/canvas-moving-or-creating.py Demo/tkinter/matt/canvas-moving-w-mouse.py Demo/tkinter/matt/canvas-mult-item-sel.py Demo/tkinter/matt/canvas-reading-tag-info.py Demo/tkinter/matt/canvas-w-widget-draw-el.py Demo/tkinter/matt/canvas-with-scrollbars.py Demo/tkinter/matt/dialog-box.py Demo/tkinter/matt/entry-simple.py Demo/tkinter/matt/entry-with-shared-variable.py Demo/tkinter/matt/killing-window-w-wm.py Demo/tkinter/matt/menu-all-types-of-entries.py Demo/tkinter/matt/menu-simple.py Demo/tkinter/matt/not-what-you-might-think-1.py Demo/tkinter/matt/not-what-you-might-think-2.py Demo/tkinter/matt/packer-and-placer-together.py Demo/tkinter/matt/packer-simple.py Demo/tkinter/matt/placer-simple.py Demo/tkinter/matt/pong-demo-1.py Demo/tkinter/matt/printing-coords-of-items.py Demo/tkinter/matt/radiobutton-simple.py Demo/tkinter/matt/rubber-band-box-demo-1.py Demo/tkinter/matt/rubber-line-demo-1.py Demo/tkinter/matt/slider-demo-1.py Demo/tkinter/matt/subclass-existing-widgets.py Demo/tkinter/matt/two-radio-groups.py Demo/tkinter/matt/window-creation-more.py Demo/tkinter/matt/window-creation-simple.py Demo/tkinter/matt/window-creation-w-location.py Doc/ACKS.txt Doc/Makefile Doc/c-api/allocation.rst Doc/c-api/arg.rst Doc/c-api/buffer.rst Doc/c-api/bytes.rst Doc/c-api/conversion.rst Doc/c-api/file.rst Doc/c-api/init.rst Doc/c-api/intro.rst Doc/c-api/long.rst Doc/c-api/module.rst Doc/c-api/number.rst Doc/c-api/object.rst Doc/c-api/reflection.rst Doc/c-api/sequence.rst Doc/c-api/structures.rst Doc/c-api/sys.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst Doc/data/refcounts.dat Doc/distutils/apiref.rst Doc/distutils/builtdist.rst Doc/distutils/configfile.rst Doc/distutils/packageindex.rst Doc/distutils/setupscript.rst Doc/distutils/uploading.rst Doc/documenting/markup.rst Doc/extending/building.rst Doc/extending/extending.rst Doc/extending/newtypes.rst Doc/extending/windows.rst Doc/glossary.rst Doc/howto/curses.rst Doc/howto/doanddont.rst Doc/howto/functional.rst Doc/howto/regex.rst Doc/howto/sockets.rst Doc/howto/unicode.rst Doc/howto/urllib2.rst Doc/howto/webservers.rst Doc/install/index.rst Doc/library/2to3.rst Doc/library/abc.rst Doc/library/aifc.rst Doc/library/array.rst Doc/library/ast.rst Doc/library/audioop.rst Doc/library/base64.rst Doc/library/bdb.rst Doc/library/binascii.rst Doc/library/cmath.rst Doc/library/codeop.rst Doc/library/collections.rst Doc/library/configparser.rst Doc/library/constants.rst Doc/library/crypt.rst Doc/library/csv.rst Doc/library/ctypes.rst Doc/library/datetime.rst Doc/library/decimal.rst Doc/library/dis.rst Doc/library/email.mime.rst Doc/library/fileinput.rst Doc/library/fractions.rst Doc/library/ftplib.rst Doc/library/functions.rst Doc/library/gettext.rst Doc/library/gzip.rst Doc/library/hashlib.rst Doc/library/heapq.rst Doc/library/http.cookiejar.rst Doc/library/http.cookies.rst Doc/library/idle.rst Doc/library/importlib.rst Doc/library/inspect.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/json.rst Doc/library/locale.rst Doc/library/logging.rst Doc/library/mailbox.rst Doc/library/math.rst Doc/library/mmap.rst Doc/library/modules.rst Doc/library/msvcrt.rst Doc/library/multiprocessing.rst Doc/library/nntplib.rst Doc/library/numbers.rst Doc/library/operator.rst Doc/library/optparse.rst Doc/library/os.rst Doc/library/ossaudiodev.rst Doc/library/othergui.rst Doc/library/parser.rst Doc/library/pdb.rst Doc/library/pickle.rst Doc/library/profile.rst Doc/library/pyexpat.rst Doc/library/queue.rst Doc/library/random.rst Doc/library/re.rst Doc/library/reprlib.rst Doc/library/rlcompleter.rst Doc/library/sched.rst Doc/library/shutil.rst Doc/library/signal.rst Doc/library/smtplib.rst Doc/library/socket.rst Doc/library/sqlite3.rst Doc/library/ssl.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/subprocess.rst Doc/library/symtable.rst Doc/library/sys.rst Doc/library/tempfile.rst Doc/library/test.rst Doc/library/threading.rst Doc/library/tk.rst Doc/library/tkinter.rst Doc/library/tkinter.tix.rst Doc/library/tokenize.rst Doc/library/trace.rst Doc/library/traceback.rst Doc/library/turtle.rst Doc/library/unicodedata.rst Doc/library/unittest.rst Doc/library/urllib.parse.rst Doc/library/urllib.request.rst Doc/library/warnings.rst Doc/library/webbrowser.rst Doc/library/wsgiref.rst Doc/library/xml.etree.elementtree.rst Doc/library/xmlrpc.client.rst Doc/library/xmlrpc.server.rst Doc/library/zipfile.rst Doc/library/zipimport.rst Doc/library/zlib.rst Doc/license.rst Doc/make.bat Doc/reference/datamodel.rst Doc/reference/expressions.rst Doc/reference/lexical_analysis.rst Doc/reference/simple_stmts.rst Doc/tools Doc/tools/rstlint.py Doc/tools/sphinxext/pyspecific.py Doc/tools/sphinxext/susp-ignored.csv Doc/tools/sphinxext/suspicious.py Doc/tutorial/classes.rst Doc/tutorial/controlflow.rst Doc/tutorial/datastructures.rst Doc/tutorial/errors.rst Doc/tutorial/index.rst Doc/tutorial/inputoutput.rst Doc/tutorial/interpreter.rst Doc/tutorial/introduction.rst Doc/tutorial/modules.rst Doc/tutorial/stdlib.rst Doc/tutorial/stdlib2.rst Doc/tutorial/whatnow.rst Doc/using/cmdline.rst Doc/using/unix.rst Doc/using/windows.rst Doc/whatsnew/2.0.rst Doc/whatsnew/2.1.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.3.rst Doc/whatsnew/2.4.rst Doc/whatsnew/2.5.rst Doc/whatsnew/2.6.rst Doc/whatsnew/2.7.rst Doc/whatsnew/3.0.rst Doc/whatsnew/3.1.rst Include/abstract.h Include/longobject.h Include/memoryobject.h Include/object.h Include/pydebug.h Include/pyerrors.h Include/pymath.h Include/pyport.h Include/unicodeobject.h LICENSE Lib/_abcoll.py Lib/ast.py Lib/collections.py Lib/ctypes/test/__init__.py Lib/ctypes/test/test_pep3118.py Lib/ctypes/util.py Lib/decimal.py Lib/distutils/command/register.py Lib/distutils/command/sdist.py Lib/distutils/command/upload.py Lib/distutils/config.py Lib/distutils/dist.py Lib/distutils/tests/test_msvc9compiler.py Lib/distutils/tests/test_register.py Lib/distutils/tests/test_sdist.py Lib/distutils/tests/test_upload.py Lib/fractions.py Lib/gzip.py Lib/heapq.py Lib/http/client.py Lib/idlelib/EditorWindow.py Lib/idlelib/IOBinding.py Lib/idlelib/NEWS.txt Lib/idlelib/ScriptBinding.py Lib/idlelib/help.txt Lib/idlelib/macosxSupport.py Lib/importlib Lib/importlib/test Lib/importlib/test/builtin Lib/importlib/test/extension Lib/importlib/test/frozen Lib/importlib/test/import_ Lib/importlib/test/source Lib/inspect.py Lib/io.py Lib/lib2to3/fixer_util.py Lib/lib2to3/fixes/fix_execfile.py Lib/lib2to3/fixes/fix_import.py Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_imports2.py Lib/lib2to3/fixes/fix_long.py Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/main.py Lib/lib2to3/pgen2/driver.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/data/py3_test_grammar.py Lib/lib2to3/tests/test_fixers.py Lib/logging/__init__.py Lib/logging/handlers.py Lib/multiprocessing/__init__.py Lib/multiprocessing/forking.py Lib/multiprocessing/managers.py Lib/multiprocessing/sharedctypes.py Lib/multiprocessing/util.py Lib/pickle.py Lib/pickletools.py Lib/random.py Lib/smtplib.py Lib/socket.py Lib/test/crashers/iter.py Lib/test/inspect_fodder2.py Lib/test/pickletester.py Lib/test/support.py Lib/test/test_ast.py Lib/test/test_binop.py Lib/test/test_bz2.py Lib/test/test_capi.py Lib/test/test_cmath.py Lib/test/test_cmd_line.py Lib/test/test_codeccallbacks.py Lib/test/test_codecs.py Lib/test/test_collections.py Lib/test/test_datetime.py Lib/test/test_decimal.py Lib/test/test_fileio.py Lib/test/test_fractions.py Lib/test/test_gzip.py Lib/test/test_hashlib.py Lib/test/test_import.py Lib/test/test_importlib.py Lib/test/test_inspect.py Lib/test/test_io.py Lib/test/test_iter.py Lib/test/test_itertools.py Lib/test/test_kqueue.py Lib/test/test_long.py Lib/test/test_memoryview.py Lib/test/test_multibytecodec.py Lib/test/test_multiprocessing.py Lib/test/test_os.py Lib/test/test_socket.py Lib/test/test_struct.py Lib/test/test_sys.py Lib/test/test_urllib.py Lib/test/test_wsgiref.py Lib/test/test_xmlrpc.py Lib/test/test_zipfile.py Lib/test/zipdir.zip Lib/tkinter/__init__.py Lib/tkinter/_fix.py Lib/tkinter/tix.py Lib/unittest.py Lib/wsgiref/handlers.py Lib/wsgiref/headers.py Lib/wsgiref/simple_server.py Lib/wsgiref/util.py Lib/wsgiref/validate.py Lib/zipfile.py Makefile.pre.in Misc/ACKS Misc/NEWS Misc/build.sh Modules/_codecsmodule.c Modules/_collectionsmodule.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/libffi_msvc/ffi.c Modules/_dbmmodule.c Modules/_fileio.c Modules/_hashopenssl.c Modules/_multiprocessing/connection.h Modules/_multiprocessing/pipe_connection.c Modules/_multiprocessing/socket_connection.c Modules/_pickle.c Modules/_struct.c Modules/_testcapimodule.c Modules/_tkinter.c Modules/bz2module.c Modules/cjkcodecs/multibytecodec.c Modules/datetimemodule.c Modules/gcmodule.c Modules/grpmodule.c Modules/itertoolsmodule.c Modules/main.c Modules/posixmodule.c Modules/selectmodule.c Modules/socketmodule.c Modules/zlibmodule.c Objects/abstract.c Objects/boolobject.c Objects/bytesobject.c Objects/complexobject.c Objects/exceptions.c Objects/floatobject.c Objects/longobject.c Objects/memoryobject.c Objects/moduleobject.c Objects/object.c Objects/setobject.c Objects/stringlib/fastsearch.h Objects/stringlib/transmogrify.h Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c Objects/weakrefobject.c PC/VC6/_tkinter.dsp PC/VC6/build_tkinter.py PC/VC6/bz2.dsp PC/VC6/pythoncore.dsp PC/VC6/readme.txt PC/VC6/tcl852.patch PC/VS7.1/pythoncore.vcproj PC/VS8.0/pythoncore.vcproj PC/example_nt/example.c PC/os2emx/Makefile PC/os2emx/python27.def PC/os2vacpp/makefile PC/os2vacpp/makefile.omk PC/os2vacpp/python.def PC/pyconfig.h PC/winreg.c PCbuild/pythoncore.vcproj Parser/asdl.py Parser/printgrammar.c Python/Python-ast.c Python/ast.c Python/bltinmodule.c Python/ceval.c Python/compile.c Python/getcopyright.c Python/getmtime.c Python/graminit.c Python/import.c Python/makeopcodetargets.py Python/opcode_targets.h Python/pythonrun.c Python/sysmodule.c Python/thread.c Python/thread_nt.h README Tools/scripts/patchcheck.py configure configure.in pyconfig.h.in setup.py

mark.dickinson python-checkins at python.org
Sun Jan 25 21:08:28 CET 2009


Author: mark.dickinson
Date: Sun Jan 25 21:08:20 2009
New Revision: 68938

Log:
Merged revisions 68155,68165,68168-68170,68175,68178,68181,68184,68193,68198,68200,68204-68206,68211-68212,68216,68223-68229,68233,68237,68241-68242,68245-68249,68285,68300-68301,68303,68305,68309,68315-68316,68321,68323,68327,68341-68342,68359,68363,68375,68379,68401,68409,68411,68417,68427,68433-68434,68436,68438,68440,68443,68445,68451,68453-68454,68463,68465,68467,68474-68475,68477,68479,68482-68483,68486,68488-68489,68491,68497,68500,68502,68508,68511,68516,68525,68528-68529,68533,68537-68539,68541,68543,68553,68561,68564,68581,68585-68587,68590-68591,68593,68606,68615,68619,68629-68630,68638,68643,68647,68650-68653,68662,68669,68675,68677,68686,68690-68691,68695-68696,68698,68700-68702,68707,68709,68712,68716-68717,68719,68728-68730,68732,68736,68740,68744,68746,68749,68751,68761-68762,68767,68769-68770,68778,68780,68782,68786,68788,68790-68791,68794-68795,68798-68799,68802,68804,68806,68808-68810,68814-68815,68819,68832-68833,68836,68841,68844,68846-68848,68851,68854-68855,68857,68860-68861,68863-68870,68872-68873,68875,68878,68882-68883,68887,68889,68895,68898,68900,68908,68916,68918-68919,68922,68924,68926 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r68155 | ronald.oussoren | 2009-01-02 13:10:34 +0000 (Fri, 02 Jan 2009) | 17 lines
  
  Recorded merge of revisions 68153 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68153 | ronald.oussoren | 2009-01-02 13:59:32 +0100 (Fri, 02 Jan 2009) | 10 lines
    
    Fix for issue3559: No preferences menu in IDLE on OSX
    
    1) Add a comment to the help file to that points to the 
       preferences menu.
    
    2) An earlier checkin tried to detect Tk >= 8.10.14,
       but did this in the wrong way. The end result of this
       was that the IDLE->Preferences... menu got surpressed
       when using the system version of Tcl/Tk
  ........
................
  r68165 | antoine.pitrou | 2009-01-02 17:34:35 +0000 (Fri, 02 Jan 2009) | 3 lines
  
  Issue #4738: finer-grained locking in the zlib module.
................
  r68168 | vinay.sajip | 2009-01-02 18:53:45 +0000 (Fri, 02 Jan 2009) | 1 line
  
  Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser.
................
  r68169 | georg.brandl | 2009-01-02 19:20:26 +0000 (Fri, 02 Jan 2009) | 2 lines
  
  Remove traces of Py_InitModule*.
................
  r68170 | georg.brandl | 2009-01-02 20:10:05 +0000 (Fri, 02 Jan 2009) | 2 lines
  
  #4808: move old API below new API doc.
................
  r68175 | martin.v.loewis | 2009-01-02 20:47:48 +0000 (Fri, 02 Jan 2009) | 13 lines
  
  Merged revisions 68172-68173 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68172 | martin.v.loewis | 2009-01-02 21:32:55 +0100 (Fr, 02 Jan 2009) | 2 lines
    
    Issue #4075: Use OutputDebugStringW in Py_FatalError.
  ........
    r68173 | martin.v.loewis | 2009-01-02 21:40:14 +0100 (Fr, 02 Jan 2009) | 2 lines
    
    Issue #4051: Prevent conflict of UNICODE macros in cPickle.
  ........
................
  r68178 | benjamin.peterson | 2009-01-02 21:24:04 +0000 (Fri, 02 Jan 2009) | 9 lines
  
  Merged revisions 68174 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68174 | benjamin.peterson | 2009-01-02 14:47:27 -0600 (Fri, 02 Jan 2009) | 1 line
    
    fix compilation on non-Windows platforms
  ........
................
  r68181 | raymond.hettinger | 2009-01-02 21:39:07 +0000 (Fri, 02 Jan 2009) | 1 line
  
  Issue #4615.  Document how to use itertools for de-duping.
................
  r68184 | mark.dickinson | 2009-01-02 23:23:21 +0000 (Fri, 02 Jan 2009) | 10 lines
  
  Merged revisions 68182 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68182 | mark.dickinson | 2009-01-02 23:07:08 +0000 (Fri, 02 Jan 2009) | 4 lines
    
    Issue #4812: add missing underscore prefix to some internal-use-only
    constants in the decimal module.  (Dec_0 becomes _Dec_0, etc.)
  ........
................
  r68193 | mark.dickinson | 2009-01-03 12:11:47 +0000 (Sat, 03 Jan 2009) | 9 lines
  
  Merged revisions 68191 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68191 | mark.dickinson | 2009-01-03 12:07:20 +0000 (Sat, 03 Jan 2009) | 2 lines
    
    Issue #4812:  further renaming of internal Decimal constants, for clarity.
  ........
................
  r68198 | benjamin.peterson | 2009-01-03 16:53:14 +0000 (Sat, 03 Jan 2009) | 62 lines
  
  Merged revisions 68197 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ................
    r68197 | benjamin.peterson | 2009-01-03 10:34:02 -0600 (Sat, 03 Jan 2009) | 55 lines
    
    Merged revisions 67900-67901,67919,67928,67984,67991-67993,68106-68108,68110 via svnmerge from 
    svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
    
    ........
      r67900 | benjamin.peterson | 2008-12-22 14:02:45 -0600 (Mon, 22 Dec 2008) | 4 lines
      
      fix_execfile: wrap the open(fn).read() call in compile(), so the filename is preserved
      
      also add unittests for the fixer
    ........
      r67901 | benjamin.peterson | 2008-12-22 14:09:55 -0600 (Mon, 22 Dec 2008) | 1 line
      
      remove unused import
    ........
      r67919 | benjamin.peterson | 2008-12-23 13:12:22 -0600 (Tue, 23 Dec 2008) | 1 line
      
      copy permission bits from the backup to the original
    ........
      r67928 | benjamin.peterson | 2008-12-26 20:49:30 -0600 (Fri, 26 Dec 2008) | 1 line
      
      don't be so idiot about multiple local imports in fix_import; still won't handle absolute and local imports on the same line
    ........
      r67984 | benjamin.peterson | 2008-12-28 09:55:16 -0600 (Sun, 28 Dec 2008) | 1 line
      
      don't need loop
    ........
      r67991 | benjamin.peterson | 2008-12-28 14:30:26 -0600 (Sun, 28 Dec 2008) | 1 line
      
      actually call finish_tree()
    ........
      r67992 | benjamin.peterson | 2008-12-28 14:34:47 -0600 (Sun, 28 Dec 2008) | 1 line
      
      remove useless test
    ........
      r67993 | benjamin.peterson | 2008-12-28 15:04:32 -0600 (Sun, 28 Dec 2008) | 1 line
      
      update pyk3's test grammar
    ........
      r68106 | benjamin.peterson | 2008-12-31 11:53:58 -0600 (Wed, 31 Dec 2008) | 1 line
      
      #2734 don't convert every instance of long (eg if it's an attribute)
    ........
      r68107 | benjamin.peterson | 2008-12-31 11:55:10 -0600 (Wed, 31 Dec 2008) | 1 line
      
      add another test
    ........
      r68108 | benjamin.peterson | 2008-12-31 12:00:12 -0600 (Wed, 31 Dec 2008) | 1 line
      
      don't change long even if it's the only argument name
    ........
      r68110 | benjamin.peterson | 2008-12-31 14:13:26 -0600 (Wed, 31 Dec 2008) | 1 line
      
      remove unused import
    ........
  ................
................
  r68200 | antoine.pitrou | 2009-01-03 16:59:18 +0000 (Sat, 03 Jan 2009) | 8 lines
  
  Issue #4580: slicing of memoryviews when itemsize != 1 is wrong.
  Also fix len() to return number of items rather than length in bytes.
  
  I'm sorry it was not possible for me to work on this without reindenting
  a bit some stuff around. The indentation in memoryobject.c is a mess,
  I'll open a separate bug for it.
................
  r68204 | martin.v.loewis | 2009-01-03 17:22:40 +0000 (Sat, 03 Jan 2009) | 9 lines
  
  Merged revisions 68203 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68203 | martin.v.loewis | 2009-01-03 18:19:26 +0100 (Sa, 03 Jan 2009) | 2 lines
    
    Issue #4817: Remove unused function PyOS_GetLastModificationTime.
  ........
................
  r68205 | antoine.pitrou | 2009-01-03 18:41:49 +0000 (Sat, 03 Jan 2009) | 4 lines
  
  Issue #4718: Adapt the wsgiref package so that it actually works with Python 3.x,
  in accordance with http://www.wsgi.org/wsgi/Amendments_1.0
................
  r68206 | antoine.pitrou | 2009-01-03 18:49:41 +0000 (Sat, 03 Jan 2009) | 3 lines
  
  Actually make test_wsgiref independent from the Python version.
................
  r68211 | raymond.hettinger | 2009-01-03 19:20:32 +0000 (Sat, 03 Jan 2009) | 1 line
  
  Issue 4796: Add from_float methods to the decimal module.
................
  r68212 | antoine.pitrou | 2009-01-03 19:20:36 +0000 (Sat, 03 Jan 2009) | 4 lines
  
  Issue #4822: fix messy indentation in memoryobject.c/.h, before we may backport it to trunk.
  Reviewed on IRC by Georg Brandl, with assistance by Benjamin Peterson.
................
  r68216 | antoine.pitrou | 2009-01-03 20:28:05 +0000 (Sat, 03 Jan 2009) | 3 lines
  
  Fix BytesWarning with -bb in wsgiref.headers.Headers.
................
  r68223 | georg.brandl | 2009-01-03 21:15:20 +0000 (Sat, 03 Jan 2009) | 21 lines
  
  Merged revisions 68214-68215,68217-68218 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68214 | georg.brandl | 2009-01-03 20:44:48 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Make indentation consistent.
  ........
    r68215 | georg.brandl | 2009-01-03 21:15:14 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Fix role name.
  ........
    r68217 | georg.brandl | 2009-01-03 21:30:15 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Add rstlint, a little tool to find subtle markup problems and inconsistencies in the Doc sources.
  ........
    r68218 | georg.brandl | 2009-01-03 21:38:59 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Recognize usage of the default role.
  ........
................
  r68224 | georg.brandl | 2009-01-03 21:17:04 +0000 (Sat, 03 Jan 2009) | 9 lines
  
  Merged revisions 68219 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68219 | georg.brandl | 2009-01-03 21:47:01 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Fix uses of the default role.
  ........
................
  r68225 | georg.brandl | 2009-01-03 21:17:44 +0000 (Sat, 03 Jan 2009) | 8 lines
  
  Blocked revisions 68220 via svnmerge
  
  ........
    r68220 | georg.brandl | 2009-01-03 21:55:06 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Remove trailing whitespace.
  ........
................
  r68226 | georg.brandl | 2009-01-03 21:18:54 +0000 (Sat, 03 Jan 2009) | 2 lines
  
  Remove trailing whitespace.
................
  r68227 | georg.brandl | 2009-01-03 21:26:05 +0000 (Sat, 03 Jan 2009) | 9 lines
  
  Merged revisions 68221 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68221 | georg.brandl | 2009-01-03 22:04:55 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Remove tabs from the documentation.
  ........
................
  r68228 | georg.brandl | 2009-01-03 21:30:40 +0000 (Sat, 03 Jan 2009) | 9 lines
  
  Merged revisions 68222 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68222 | georg.brandl | 2009-01-03 22:11:58 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Disable the line length checker by default.
  ........
................
  r68229 | georg.brandl | 2009-01-03 21:31:47 +0000 (Sat, 03 Jan 2009) | 2 lines
  
  Fix a few remaining problems found by rstlint.
................
  r68233 | guilherme.polo | 2009-01-03 21:53:34 +0000 (Sat, 03 Jan 2009) | 10 lines
  
  Blocked revisions 68231 via svnmerge
  
  ........
    r68231 | guilherme.polo | 2009-01-03 19:51:09 -0200 (Sat, 03 Jan 2009) | 4 lines
    
    The _tkinter module functions "createfilehandler", "deletefilehandler",
    "createtimerhandler", "mainloop", "dooneevent" and "quit" have been
    deprecated for removal in 3.x (part of issue #3638).
  ........
................
  r68237 | guilherme.polo | 2009-01-03 22:00:39 +0000 (Sat, 03 Jan 2009) | 3 lines
  
  Fix for issue #3638: Remove module level functions in _tkinter that 
  depend on TkappObject
................
  r68241 | georg.brandl | 2009-01-03 22:07:57 +0000 (Sat, 03 Jan 2009) | 2 lines
  
  Manually merge r68096,68189 from 3.0 branch.
................
  r68242 | guilherme.polo | 2009-01-03 22:13:31 +0000 (Sat, 03 Jan 2009) | 2 lines
  
  Forgot to remove no longer needed code since r68237
................
  r68245 | georg.brandl | 2009-01-03 22:33:39 +0000 (Sat, 03 Jan 2009) | 49 lines
  
  Merged revisions 68112,68115,68120,68133,68141-68142,68145-68146,68148-68149 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68112 | benjamin.peterson | 2009-01-01 00:48:39 +0100 (Thu, 01 Jan 2009) | 1 line
    
    #4795 inspect.isgeneratorfunction() should return False instead of None
  ........
    r68115 | benjamin.peterson | 2009-01-01 05:04:41 +0100 (Thu, 01 Jan 2009) | 1 line
    
    simplfy code
  ........
    r68120 | georg.brandl | 2009-01-01 13:15:31 +0100 (Thu, 01 Jan 2009) | 4 lines
    
    #4228: Pack negative values the same way as 2.4 
    in struct's L format.
  ........
    r68133 | antoine.pitrou | 2009-01-01 16:38:03 +0100 (Thu, 01 Jan 2009) | 1 line
    
    fill in actual issue number in tests
  ........
    r68141 | benjamin.peterson | 2009-01-01 17:43:12 +0100 (Thu, 01 Jan 2009) | 1 line
    
    fix highlighting
  ........
    r68142 | benjamin.peterson | 2009-01-01 18:29:49 +0100 (Thu, 01 Jan 2009) | 2 lines
    
    welcome to 2009, Python!
  ........
    r68145 | amaury.forgeotdarc | 2009-01-02 01:03:54 +0100 (Fri, 02 Jan 2009) | 5 lines
    
    #4801 _collections module fails to build on cygwin.
    
    _PyObject_GC_TRACK is the macro version of PyObject_GC_Track, 
    and according to documentation it should not be used for extension modules.
  ........
    r68146 | ronald.oussoren | 2009-01-02 11:44:46 +0100 (Fri, 02 Jan 2009) | 2 lines
    
    Fix for issue4472: "configure --enable-shared doesn't work on OSX"
  ........
    r68148 | ronald.oussoren | 2009-01-02 11:48:31 +0100 (Fri, 02 Jan 2009) | 2 lines
    
    Forgot to add a NEWS item in my previous checkin
  ........
    r68149 | ronald.oussoren | 2009-01-02 11:50:48 +0100 (Fri, 02 Jan 2009) | 2 lines
    
    Fix for issue4780
  ........
................
  r68246 | georg.brandl | 2009-01-03 22:37:17 +0000 (Sat, 03 Jan 2009) | 32 lines
  
  Blocked revisions 68150,68156,68158-68161,68163 via svnmerge
  
  ........
    r68150 | ronald.oussoren | 2009-01-02 12:46:05 +0100 (Fri, 02 Jan 2009) | 1 line
    
    Fix for issue 3433
  ........
    r68156 | ronald.oussoren | 2009-01-02 15:10:20 +0100 (Fri, 02 Jan 2009) | 1 line
    
    Fix for issue1594
  ........
    r68158 | ronald.oussoren | 2009-01-02 15:46:19 +0100 (Fri, 02 Jan 2009) | 2 lines
    
    Fix for issue 900949
  ........
    r68159 | ronald.oussoren | 2009-01-02 15:48:17 +0100 (Fri, 02 Jan 2009) | 2 lines
    
    Fix for issue 1627952
  ........
    r68160 | ronald.oussoren | 2009-01-02 15:52:09 +0100 (Fri, 02 Jan 2009) | 2 lines
    
    Fix for issue r1737832
  ........
    r68161 | ronald.oussoren | 2009-01-02 16:00:05 +0100 (Fri, 02 Jan 2009) | 3 lines
    
    Fix for issue 1149804
  ........
    r68163 | ronald.oussoren | 2009-01-02 16:25:36 +0100 (Fri, 02 Jan 2009) | 2 lines
    
    Fix for issues #841800 and #900506
  ........
................
  r68247 | georg.brandl | 2009-01-03 22:47:39 +0000 (Sat, 03 Jan 2009) | 39 lines
  
  Merged revisions 68162,68166,68171,68176,68195-68196,68210,68232 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68162 | ronald.oussoren | 2009-01-02 16:06:00 +0100 (Fri, 02 Jan 2009) | 3 lines
    
    Fix for issue 4472 is incompatible with Cygwin, this patch
    should fix that.
  ........
    r68166 | benjamin.peterson | 2009-01-02 19:26:23 +0100 (Fri, 02 Jan 2009) | 1 line
    
    document PyMemberDef
  ........
    r68171 | georg.brandl | 2009-01-02 21:25:14 +0100 (Fri, 02 Jan 2009) | 3 lines
    
    #4811: fix markup glitches (mostly remains of the conversion),
    found by Gabriel Genellina.
  ........
    r68176 | andrew.kuchling | 2009-01-02 22:00:35 +0100 (Fri, 02 Jan 2009) | 1 line
    
    Add various items
  ........
    r68195 | georg.brandl | 2009-01-03 14:45:15 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Remove useless string literal.
  ........
    r68196 | georg.brandl | 2009-01-03 15:29:53 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Fix indentation.
  ........
    r68210 | georg.brandl | 2009-01-03 20:10:12 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Set eol-style correctly for mp_distributing.py.
  ........
    r68232 | georg.brandl | 2009-01-03 22:52:16 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Grammar fix.
  ........
................
  r68248 | georg.brandl | 2009-01-03 22:48:18 +0000 (Sat, 03 Jan 2009) | 24 lines
  
  Blocked revisions 68179,68208-68209,68238,68240 via svnmerge
  
  ........
    r68179 | raymond.hettinger | 2009-01-02 22:26:45 +0100 (Fri, 02 Jan 2009) | 1 line
    
    Issue #4615.  Document how to use itertools for de-duping.
  ........
    r68208 | raymond.hettinger | 2009-01-03 20:02:23 +0100 (Sat, 03 Jan 2009) | 1 line
    
    Issue 4796: Add from_float methods to the decimal module.
  ........
    r68209 | raymond.hettinger | 2009-01-03 20:08:10 +0100 (Sat, 03 Jan 2009) | 1 line
    
    Reapply r68191.
  ........
    r68238 | georg.brandl | 2009-01-03 23:03:11 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Manually merge r68095,68186,68187,68188,68190 from 2.6 branch.
  ........
    r68240 | georg.brandl | 2009-01-03 23:05:22 +0100 (Sat, 03 Jan 2009) | 2 lines
    
    Manually merge r67868 from 2.6 branch.
  ........
................
  r68249 | antoine.pitrou | 2009-01-03 22:55:38 +0000 (Sat, 03 Jan 2009) | 3 lines
  
  test_urllib would set environment variable NO_PROXY without removing it afterwards.
................
  r68285 | georg.brandl | 2009-01-04 00:28:14 +0000 (Sun, 04 Jan 2009) | 2 lines
  
  Remove 2.6 versionchanges, turn 2.7 ones into 3.1.
................
  r68300 | mark.dickinson | 2009-01-04 15:09:02 +0000 (Sun, 04 Jan 2009) | 19 lines
  
  Merged revisions 68296,68299 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68296 | mark.dickinson | 2009-01-04 12:29:36 +0000 (Sun, 04 Jan 2009) | 6 lines
    
    Add autoconf test to detect x87-style double rounding, as described in
    issue #2937.  This information can be helpful for diagnosing platform-
    specific problems in math and cmath.  The result of the test also
    serves as a fairly reliable indicator of whether the x87 floating-point
    instructions (as opposed to SSE2) are in use on Intel x86/x86_64 systems.
  ........
    r68299 | mark.dickinson | 2009-01-04 13:57:26 +0000 (Sun, 04 Jan 2009) | 4 lines
    
    isinf and isnan are macros, not functions; fix configure script
    to use AC_CHECK_DECLS instead of AC_CHECK_FUNCS for these.
    (See discussion in issue #4506)
  ........
................
  r68301 | benjamin.peterson | 2009-01-04 15:30:39 +0000 (Sun, 04 Jan 2009) | 1 line
  
  #4826 exec() doesn't take a file object anymore
................
  r68303 | mark.dickinson | 2009-01-04 16:41:08 +0000 (Sun, 04 Jan 2009) | 11 lines
  
  Merged revisions 68302 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68302 | mark.dickinson | 2009-01-04 16:06:40 +0000 (Sun, 04 Jan 2009) | 4 lines
    
    Oops.  Need to check not only that HAVE_DECL_ISINF is defined, but also
    that it's equal to 1.  (If isinf isn't defined, HAVE_DECL_ISINF is
    defined to be 0, rather than being undefined.)
  ........
................
  r68305 | mark.dickinson | 2009-01-04 17:02:56 +0000 (Sun, 04 Jan 2009) | 9 lines
  
  Merged revisions 68304 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68304 | mark.dickinson | 2009-01-04 17:02:05 +0000 (Sun, 04 Jan 2009) | 2 lines
    
    Fix HAVE_DECL_ISINF/ISNAN test (again).
  ........
................
  r68309 | benjamin.peterson | 2009-01-04 18:53:28 +0000 (Sun, 04 Jan 2009) | 1 line
  
  fix a lot of Tkinter imports
................
  r68315 | antoine.pitrou | 2009-01-04 21:11:10 +0000 (Sun, 04 Jan 2009) | 3 lines
  
  Buglet: restore functioning of gzip as an executable when (de)compressing from stdin to stdout
................
  r68316 | mark.dickinson | 2009-01-04 21:17:43 +0000 (Sun, 04 Jan 2009) | 12 lines
  
  Merged revisions 68314 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68314 | mark.dickinson | 2009-01-04 21:10:56 +0000 (Sun, 04 Jan 2009) | 5 lines
    
    Fix Decimal.from_float to use valid Python 2.3 syntax, as per
    comments at top of decimal.py.  (But note that the from_float
    method itself with still not be usable before Python 2.7.)
    See issue 4796 for discussion.
  ........
................
  r68321 | mark.dickinson | 2009-01-04 21:34:18 +0000 (Sun, 04 Jan 2009) | 13 lines
  
  Merged revisions 68317-68318 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68317 | mark.dickinson | 2009-01-04 21:22:02 +0000 (Sun, 04 Jan 2009) | 2 lines
    
    More Python 2.3 compatibility fixes for decimal.py.
  ........
    r68318 | mark.dickinson | 2009-01-04 21:25:40 +0000 (Sun, 04 Jan 2009) | 2 lines
    
    Misc/NEWS entry for r68317
  ........
................
  r68323 | antoine.pitrou | 2009-01-04 21:37:59 +0000 (Sun, 04 Jan 2009) | 9 lines
  
  Merged revisions 68319 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68319 | antoine.pitrou | 2009-01-04 22:29:23 +0100 (dim., 04 janv. 2009) | 3 lines
    
    Issue #4272: Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream.
  ........
................
  r68327 | georg.brandl | 2009-01-04 23:20:14 +0000 (Sun, 04 Jan 2009) | 1 line
  
  #4614: document PyModule_Create and PyModuleDef struct.
................
  r68341 | mark.dickinson | 2009-01-05 17:08:27 +0000 (Mon, 05 Jan 2009) | 9 lines
  
  Merged revisions 68311 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68311 | mark.dickinson | 2009-01-04 19:53:00 +0000 (Sun, 04 Jan 2009) | 2 lines
    
    Use C99 'isfinite' macro in preference to BSD-derived 'finite' function.
  ........
................
  r68342 | mark.dickinson | 2009-01-05 17:10:09 +0000 (Mon, 05 Jan 2009) | 11 lines
  
  Merged revisions 68312 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68312 | mark.dickinson | 2009-01-04 20:19:41 +0000 (Sun, 04 Jan 2009) | 4 lines
    
    It's wrong to use AC_REPLACE_FUNCS for hypot, since there's no longer any
    Python/hypot.c replacement file.  Use AC_CHECK_FUNCS instead.  This change
    should be backported to 2.6 and 3.0.
  ........
................
  r68359 | raymond.hettinger | 2009-01-06 09:37:13 +0000 (Tue, 06 Jan 2009) | 1 line
  
  Mini-optimization: use pack/unpack functions for argument tuples.
................
  r68363 | antoine.pitrou | 2009-01-06 19:02:24 +0000 (Tue, 06 Jan 2009) | 17 lines
  
  Merged revisions 68360-68361 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68360 | antoine.pitrou | 2009-01-06 19:10:47 +0100 (mar., 06 janv. 2009) | 7 lines
    
    Issue #1180193: When importing a module from a .pyc (or .pyo) file with
    an existing .py counterpart, override the co_filename attributes of all
    code objects if the original filename is obsolete (which can happen if the
    file has been renamed, moved, or if it is accessed through different paths).
    Patch by Ziga Seilnacht and Jean-Paul Calderone.
  ........
    r68361 | antoine.pitrou | 2009-01-06 19:34:08 +0100 (mar., 06 janv. 2009) | 3 lines
    
    Use shutil.rmtree rather than os.rmdir.
  ........
................
  r68375 | hirokazu.yamamoto | 2009-01-07 10:11:17 +0000 (Wed, 07 Jan 2009) | 10 lines
  
  Merged revisions 68373 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68373 | hirokazu.yamamoto | 2009-01-07 18:42:28 +0900 | 2 lines
    
    Issue #4864: test_msvc9compiler failed on VC6/7.
    Reviewed by Amaury Forgeot d'Arc.
  ........
................
  r68379 | mark.dickinson | 2009-01-07 17:54:07 +0000 (Wed, 07 Jan 2009) | 9 lines
  
  Merged revisions 68378 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68378 | mark.dickinson | 2009-01-07 17:48:33 +0000 (Wed, 07 Jan 2009) | 2 lines
    
    Issue #4869: clarify documentation for random.expovariate.
  ........
................
  r68401 | thomas.heller | 2009-01-08 09:34:20 +0000 (Thu, 08 Jan 2009) | 2 lines
  
  Fixed a crash in ctypes, when HAVE_USABLE_WCHAR_T is false.
  Fixes issue #4867.
................
  r68409 | raymond.hettinger | 2009-01-08 21:01:54 +0000 (Thu, 08 Jan 2009) | 1 line
  
  Merge in r68394 fixing itertools.permutations() and combinations().
................
  r68411 | antoine.pitrou | 2009-01-08 21:17:16 +0000 (Thu, 08 Jan 2009) | 5 lines
  
  Issue #4751: hashlib now releases the GIL when hashing large buffers
  (with a hardwired threshold of 2048 bytes), allowing better parallelization
  on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.
................
  r68417 | tarek.ziade | 2009-01-09 00:15:45 +0000 (Fri, 09 Jan 2009) | 9 lines
  
  Merged revisions 68415 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68415 | tarek.ziade | 2009-01-09 00:56:31 +0100 (Fri, 09 Jan 2009) | 1 line
    
    fixed #4394 make the storage of the password optional in .pypirc
  ........
................
  r68427 | benjamin.peterson | 2009-01-09 03:03:23 +0000 (Fri, 09 Jan 2009) | 74 lines
  
  Merged revisions 68288-68291,68325-68326,68338,68388,68393,68423 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ................
    r68288 | benjamin.peterson | 2009-01-03 18:39:07 -0600 (Sat, 03 Jan 2009) | 1 line
    
    only check the actual compile() call for a SyntaxError
  ................
    r68289 | georg.brandl | 2009-01-04 02:26:10 -0600 (Sun, 04 Jan 2009) | 2 lines
    
    Test commit.
  ................
    r68290 | georg.brandl | 2009-01-04 04:23:49 -0600 (Sun, 04 Jan 2009) | 4 lines
    
    Add "suspicious" builder which finds leftover markup in the HTML files.
    
    Patch by Gabriel Genellina.
  ................
    r68291 | georg.brandl | 2009-01-04 04:24:09 -0600 (Sun, 04 Jan 2009) | 2 lines
    
    Fix two issues found by the suspicious builder.
  ................
    r68325 | benjamin.peterson | 2009-01-04 16:00:18 -0600 (Sun, 04 Jan 2009) | 1 line
    
    use Jinja 2.1.1
  ................
    r68326 | georg.brandl | 2009-01-04 16:03:10 -0600 (Sun, 04 Jan 2009) | 2 lines
    
    Update make.bat.
  ................
    r68338 | neal.norwitz | 2009-01-04 21:57:25 -0600 (Sun, 04 Jan 2009) | 1 line
    
    Make sure to checkout any new packages
  ................
    r68388 | benjamin.peterson | 2009-01-07 21:39:46 -0600 (Wed, 07 Jan 2009) | 1 line
    
    string exceptions are gone
  ................
    r68393 | benjamin.peterson | 2009-01-07 22:01:00 -0600 (Wed, 07 Jan 2009) | 1 line
    
    use new sphinx modules
  ................
    r68423 | benjamin.peterson | 2009-01-08 20:13:34 -0600 (Thu, 08 Jan 2009) | 29 lines
    
    Merged revisions 68306-68308,68340,68368,68422 via svnmerge from 
    svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
    
    ........
      r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line
      
      fix_urllib: add mappings for the url parsing functions
    ........
      r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line
      
      remove duplicated function
    ........
      r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line
      
      turtle is no longer renamed
    ........
      r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines
      
      Fix undefined locals in parse_tokens().
    ........
      r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line
      
      fix typo (thanks to Robert Lehmann)
    ........
      r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line
      
      run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876
    ........
  ................
................
  r68433 | benjamin.peterson | 2009-01-09 03:16:55 +0000 (Fri, 09 Jan 2009) | 24 lines
  
  Blocked revisions 68424-68426,68429-68430 via svnmerge
  
  ........
    r68424 | benjamin.peterson | 2009-01-08 20:53:35 -0600 (Thu, 08 Jan 2009) | 1 line
    
    specify what -3 warnings are about
  ........
    r68425 | benjamin.peterson | 2009-01-08 20:56:32 -0600 (Thu, 08 Jan 2009) | 1 line
    
    fix markup
  ........
    r68426 | benjamin.peterson | 2009-01-08 21:03:05 -0600 (Thu, 08 Jan 2009) | 1 line
    
    fix spelling
  ........
    r68429 | benjamin.peterson | 2009-01-08 21:05:14 -0600 (Thu, 08 Jan 2009) | 1 line
    
    add -3 to manpage
  ........
    r68430 | benjamin.peterson | 2009-01-08 21:07:27 -0600 (Thu, 08 Jan 2009) | 1 line
    
    be more specific in -3 option help
  ........
................
  r68434 | benjamin.peterson | 2009-01-09 03:24:29 +0000 (Fri, 09 Jan 2009) | 16 lines
  
  Blocked revisions 68243,68395,68432 via svnmerge
  
  ........
    r68243 | georg.brandl | 2009-01-03 16:15:42 -0600 (Sat, 03 Jan 2009) | 2 lines
    
    Add temporary code to fix the automatic doc build failure.
  ........
    r68395 | raymond.hettinger | 2009-01-08 00:39:04 -0600 (Thu, 08 Jan 2009) | 1 line
    
    Forward port r68394 for issue 4816.
  ........
    r68432 | benjamin.peterson | 2009-01-08 21:15:00 -0600 (Thu, 08 Jan 2009) | 1 line
    
    remove temporary code now
  ........
................
  r68436 | benjamin.peterson | 2009-01-09 03:42:38 +0000 (Fri, 09 Jan 2009) | 10 lines
  
  Merged revisions 67985 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r67985 | antoine.pitrou | 2008-12-28 10:01:11 -0600 (Sun, 28 Dec 2008) | 4 lines
    
    Issue #2153: modernize coding style of unittest.py, remove obsolete compatibility stuff.
    Patch by Virgil Dupras.
  ........
................
  r68438 | raymond.hettinger | 2009-01-09 03:58:09 +0000 (Fri, 09 Jan 2009) | 1 line
  
  Reduce the size of the _PyLong_DigitValue table.
................
  r68440 | benjamin.peterson | 2009-01-09 04:11:44 +0000 (Fri, 09 Jan 2009) | 30 lines
  
  Merged revisions 68167,68276,68292-68293,68344 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68167 | vinay.sajip | 2009-01-02 12:53:04 -0600 (Fri, 02 Jan 2009) | 1 line
    
    Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser.
  ........
    r68276 | tarek.ziade | 2009-01-03 18:04:49 -0600 (Sat, 03 Jan 2009) | 1 line
    
    fixed #1702551: distutils sdist was not pruning VCS directories under win32
  ........
    r68292 | skip.montanaro | 2009-01-04 04:36:58 -0600 (Sun, 04 Jan 2009) | 3 lines
    
    If user configures --without-gcc give preference to $CC instead of blindly
    assuming the compiler will be "cc".
  ........
    r68293 | tarek.ziade | 2009-01-04 04:37:52 -0600 (Sun, 04 Jan 2009) | 1 line
    
    using clearer syntax
  ........
    r68344 | marc-andre.lemburg | 2009-01-05 13:43:35 -0600 (Mon, 05 Jan 2009) | 7 lines
    
    Fix #4846 (Py_UNICODE_ISSPACE causes linker error) by moving the declaration
    into the extern "C" section.
    
    Add a few more comments and apply some minor edits to make the file contents
    fit the original structure again.
  ........
................
  r68443 | hirokazu.yamamoto | 2009-01-09 04:41:03 +0000 (Fri, 09 Jan 2009) | 9 lines
  
  Merged revisions 68435 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68435 | hirokazu.yamamoto | 2009-01-09 12:32:46 +0900 | 1 line
    
    Bump up bzip2 version on VC6. (bzip2-1.0.3 -> bzip2-1.0.5)
  ........
................
  r68445 | hirokazu.yamamoto | 2009-01-09 04:48:19 +0000 (Fri, 09 Jan 2009) | 8 lines
  
  Blocked revisions 68439 via svnmerge
  
  ........
    r68439 | hirokazu.yamamoto | 2009-01-09 13:10:40 +0900 | 1 line
    
    Bump up bsddb version on VC6. (db-4.4.20 -> db-4.7.25)
  ........
................
  r68451 | antoine.pitrou | 2009-01-09 18:53:14 +0000 (Fri, 09 Jan 2009) | 6 lines
  
  Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
  flag to work properly. Furthermore, when specifying -u, the text stdout
  and stderr streams have line-by-line buffering enabled (the default being
  to buffer arbitrary chunks of data). Patch by Victor Stinner, test by me.
................
  r68453 | antoine.pitrou | 2009-01-09 19:29:16 +0000 (Fri, 09 Jan 2009) | 3 lines
  
  Buglet: fix unittest.main()
................
  r68454 | antoine.pitrou | 2009-01-09 19:54:29 +0000 (Fri, 09 Jan 2009) | 5 lines
  
  Issue #4604: Some objects of the I/O library could still be used after 
  having been closed (for instance, a read() call could return some
  previously buffered data). Patch by Dmitry Vasiliev.
................
  r68463 | antoine.pitrou | 2009-01-09 22:12:30 +0000 (Fri, 09 Jan 2009) | 4 lines
  
  Fix bug introduced in r68451: stdio must always be opened in line-buffered mode
  if isatty() is true.
................
  r68465 | antoine.pitrou | 2009-01-09 22:27:08 +0000 (Fri, 09 Jan 2009) | 12 lines
  
  Merged revisions 68462 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68462 | antoine.pitrou | 2009-01-09 22:40:55 +0100 (ven., 09 janv. 2009) | 6 lines
    
    Issue #4074: Change the criteria for doing a full garbage collection (i.e.
    collecting the oldest generation) so that allocating lots of objects without
    destroying them does not show quadratic performance. Based on a proposal by
    Martin von Löwis at http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
  ........
................
  r68467 | benjamin.peterson | 2009-01-10 04:11:21 +0000 (Sat, 10 Jan 2009) | 8 lines
  
  Unblocked revisions 68425 via svnmerge
  
  ........
    r68425 | benjamin.peterson | 2009-01-08 20:56:32 -0600 (Thu, 08 Jan 2009) | 1 line
    
    fix markup
  ........
................
  r68474 | hirokazu.yamamoto | 2009-01-10 11:48:27 +0000 (Sat, 10 Jan 2009) | 17 lines
  
  Merged revisions 68468-68470 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68468 | hirokazu.yamamoto | 2009-01-10 17:09:43 +0900 | 1 line
    
    Bump up Tcl/Tk version on VC6. (tcl8.4.12 -> tcl8.5.2, tk8.4.12 -> tk8.5.2, tix8.4.0 -> tix8.4.3)
  ........
    r68469 | hirokazu.yamamoto | 2009-01-10 17:12:09 +0900 | 1 line
    
    Link to debug version of Tcl/Tk when python is built as debug version.
  ........
    r68470 | hirokazu.yamamoto | 2009-01-10 18:18:16 +0900 | 1 line
    
    Added helper script to build Tcl/Tk.
  ........
................
  r68475 | hirokazu.yamamoto | 2009-01-10 11:55:57 +0000 (Sat, 10 Jan 2009) | 1 line
  
  Commit miss.
................
  r68477 | hirokazu.yamamoto | 2009-01-10 12:15:23 +0000 (Sat, 10 Jan 2009) | 1 line
  
  Fixed 2to3 issue on tix module.
................
  r68479 | vinay.sajip | 2009-01-10 13:37:26 +0000 (Sat, 10 Jan 2009) | 1 line
  
  Minor documentation changes relating to NullHandler, the module used for handlers and references to ConfigParser.
................
  r68482 | vinay.sajip | 2009-01-10 13:42:23 +0000 (Sat, 10 Jan 2009) | 1 line
  
  Corrected an incorrect self-reference.
................
  r68483 | antoine.pitrou | 2009-01-10 15:40:25 +0000 (Sat, 10 Jan 2009) | 8 lines
  
  Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
  common cases are optimized thanks to a dedicated fast path and a moderate
  amount of loop unrolling.
  
  This will especially help text I/O (we already register a 30% speedup on large
  reads on the io-c branch).
................
  r68486 | antoine.pitrou | 2009-01-10 16:22:51 +0000 (Sat, 10 Jan 2009) | 13 lines
  
  Merged revisions 68484-68485 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68484 | antoine.pitrou | 2009-01-10 17:13:45 +0100 (sam., 10 janv. 2009) | 3 lines
    
    Issue #3860: GzipFile and BZ2File now support the context manager protocol.
  ........
    r68485 | antoine.pitrou | 2009-01-10 17:15:24 +0100 (sam., 10 janv. 2009) | 1 line
    
    Add NEWS entry for r68484.
  ........
................
  r68488 | benjamin.peterson | 2009-01-10 17:05:44 +0000 (Sat, 10 Jan 2009) | 1 line
  
  fix typo #4904
................
  r68489 | matthias.klose | 2009-01-10 17:08:25 +0000 (Sat, 10 Jan 2009) | 5 lines
  
  Merge r68487 from svn+ssh://pythondev@svn.python.org/python/trunk:
  
  - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
    biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
................
  r68491 | benjamin.peterson | 2009-01-10 17:14:04 +0000 (Sat, 10 Jan 2009) | 9 lines
  
  Blocked revisions 68487 via svnmerge
  
  ........
    r68487 | matthias.klose | 2009-01-10 11:00:42 -0600 (Sat, 10 Jan 2009) | 3 lines
    
    - Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
      biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
  ........
................
  r68497 | antoine.pitrou | 2009-01-10 18:38:45 +0000 (Sat, 10 Jan 2009) | 9 lines
  
  Merged revisions 68496 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68496 | antoine.pitrou | 2009-01-10 19:33:21 +0100 (sam., 10 janv. 2009) | 3 lines
    
    Add ACKS entries for some of the patches I've been committing.
  ........
................
  r68500 | mark.dickinson | 2009-01-10 19:16:40 +0000 (Sat, 10 Jan 2009) | 9 lines
  
  Merged revisions 68499 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68499 | mark.dickinson | 2009-01-10 19:14:55 +0000 (Sat, 10 Jan 2009) | 2 lines
    
    Remove an unnecessary check from test_decimal.
  ........
................
  r68502 | vinay.sajip | 2009-01-10 19:23:34 +0000 (Sat, 10 Jan 2009) | 1 line
  
  Corrected minor typo and added .currentmodule directives to fix missing cross-references.
................
  r68508 | mark.dickinson | 2009-01-10 22:14:33 +0000 (Sat, 10 Jan 2009) | 3 lines
  
  Issue #4910: replace "long" with "int" in docstring for __long__ slot and
  in documentation for PyNumber_Long.
................
  r68511 | benjamin.peterson | 2009-01-10 22:37:11 +0000 (Sat, 10 Jan 2009) | 1 line
  
  fix syntax in ctypes.util
................
  r68516 | benjamin.peterson | 2009-01-10 23:49:20 +0000 (Sat, 10 Jan 2009) | 1 line
  
  ricos isn't supported
................
  r68525 | martin.v.loewis | 2009-01-11 09:30:50 +0000 (Sun, 11 Jan 2009) | 9 lines
  
  Merged revisions 68523 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68523 | martin.v.loewis | 2009-01-11 10:26:54 +0100 (So, 11 Jan 2009) | 2 lines
    
    Issue #4279: Fix build of parsermodule under Cygwin.
  ........
................
  r68528 | martin.v.loewis | 2009-01-11 09:45:11 +0000 (Sun, 11 Jan 2009) | 9 lines
  
  Merged revisions 68527 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68527 | martin.v.loewis | 2009-01-11 10:43:55 +0100 (So, 11 Jan 2009) | 2 lines
    
    Issue #4895: Use _strdup on Windows CE.
  ........
................
  r68529 | mark.dickinson | 2009-01-11 11:54:02 +0000 (Sun, 11 Jan 2009) | 2 lines
  
  Remove __long__ methods from UserString and from Demo/ classes.
................
  r68533 | benjamin.peterson | 2009-01-11 17:13:55 +0000 (Sun, 11 Jan 2009) | 9 lines
  
  Merged revisions 68381 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68381 | martin.v.loewis | 2009-01-07 12:40:40 -0600 (Wed, 07 Jan 2009) | 2 lines
    
    Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t.
  ........
................
  r68537 | antoine.pitrou | 2009-01-11 23:56:55 +0000 (Sun, 11 Jan 2009) | 3 lines
  
  Issue #4916: fix little-endian UTF-16 decoding bug on big-endian UCS-4 builds, introduced by r68483.
................
  r68538 | benjamin.peterson | 2009-01-12 00:28:16 +0000 (Mon, 12 Jan 2009) | 1 line
  
  remove docs for PyBytes_Format #4917
................
  r68539 | gregory.p.smith | 2009-01-12 04:50:11 +0000 (Mon, 12 Jan 2009) | 6 lines
  
  Fixes issue #3826 and #4791: 
  Have SocketIO objects update their reference count in the underlying
  socket object on close() so that the underlying socket object is
  closed immediately when the last user is done rather than at an
  unknown later time when garbage collection can do it.
................
  r68541 | martin.v.loewis | 2009-01-12 07:59:10 +0000 (Mon, 12 Jan 2009) | 9 lines
  
  Merged revisions 68540 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68540 | martin.v.loewis | 2009-01-12 08:57:11 +0100 (Mo, 12 Jan 2009) | 2 lines
    
    Issue #4915: Port sysmodule to Windows CE.
  ........
................
  r68543 | martin.v.loewis | 2009-01-12 08:21:03 +0000 (Mon, 12 Jan 2009) | 17 lines
  
  Merged revisions 68455,68476,68542 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68455 | kristjan.jonsson | 2009-01-09 21:03:27 +0100 (Fr, 09 Jan 2009) | 1 line
    
    Issue 3582.  Improved thread support and TLS for Windows
  ........
    r68476 | kristjan.jonsson | 2009-01-10 13:14:31 +0100 (Sa, 10 Jan 2009) | 1 line
    
    Issue 4906:  Preserve windows error state across PyThread_get_key_value
  ........
    r68542 | martin.v.loewis | 2009-01-12 09:11:24 +0100 (Mo, 12 Jan 2009) | 2 lines
    
    Issue #4893: Use NT threading on CE.
  ........
................
  r68553 | mark.dickinson | 2009-01-12 20:49:19 +0000 (Mon, 12 Jan 2009) | 8 lines
  
  Issue #4910 (1st patch of a series):  fix int() and the corresponding
  PyNumber_Int/PyNumber_Long API function so that it no longer attempts
  to call the __long__ method for conversion.  Only the __int__ and __trunc__
  methods are used.  (This removes a major remaining use of the nb_long
  slot from the Python 3.x core.)
  
  Thanks Benjamin for review.
................
  r68561 | amaury.forgeotdarc | 2009-01-12 23:58:21 +0000 (Mon, 12 Jan 2009) | 13 lines
  
  Merged revisions 68560 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68560 | amaury.forgeotdarc | 2009-01-13 00:36:55 +0100 (mar., 13 janv. 2009) | 6 lines
    
    #3720: Interpreter crashes when an evil iterator removes its own next function.
    
    Now the slot is filled with a function that always raises.
    
    Will not backport: extensions compiled with 2.6.x would not run on 2.6.0.
  ........
................
  r68564 | benjamin.peterson | 2009-01-13 02:11:23 +0000 (Tue, 13 Jan 2009) | 18 lines
  
  Merged revisions 68425,68461,68498 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68425 | benjamin.peterson | 2009-01-08 20:56:32 -0600 (Thu, 08 Jan 2009) | 1 line
    
    fix markup
  ........
    r68461 | kristjan.jonsson | 2009-01-09 15:35:16 -0600 (Fri, 09 Jan 2009) | 2 lines
    
    Issue 4293:  Make Py_AddPendingCall() thread safe
    Add test cases and documentation
  ........
    r68498 | benjamin.peterson | 2009-01-10 13:08:49 -0600 (Sat, 10 Jan 2009) | 1 line
    
    fix encoding
  ........
................
  r68581 | benjamin.peterson | 2009-01-13 21:53:28 +0000 (Tue, 13 Jan 2009) | 1 line
  
  make bytearrayobject.o depend on the stringlib headers #4936
................
  r68585 | benjamin.peterson | 2009-01-13 22:25:18 +0000 (Tue, 13 Jan 2009) | 1 line
  
  de-spacify
................
  r68586 | benjamin.peterson | 2009-01-13 22:33:14 +0000 (Tue, 13 Jan 2009) | 16 lines
  
  Blocked revisions 68579-68580,68584 via svnmerge
  
  ........
    r68579 | benjamin.peterson | 2009-01-13 15:42:23 -0600 (Tue, 13 Jan 2009) | 1 line
    
    make bytearrayobject.o depend on the stringlib #4936
  ........
    r68580 | benjamin.peterson | 2009-01-13 15:43:11 -0600 (Tue, 13 Jan 2009) | 1 line
    
    add bytearrayobject.h to PYTHON_HEADERS
  ........
    r68584 | benjamin.peterson | 2009-01-13 16:22:41 -0600 (Tue, 13 Jan 2009) | 1 line
    
    de-spacify
  ........
................
  r68587 | antoine.pitrou | 2009-01-13 22:59:11 +0000 (Tue, 13 Jan 2009) | 7 lines
  
  Issue #4935: The overflow checking code in the expandtabs() method common
  to str, bytes and bytearray could be optimized away by the compiler (*), letting
  the interpreter segfault instead of raising an error.
  
  (*) or at least it is our interpretation
................
  r68590 | benjamin.peterson | 2009-01-13 23:14:04 +0000 (Tue, 13 Jan 2009) | 1 line
  
  encoding returns bytes objects
................
  r68591 | antoine.pitrou | 2009-01-13 23:14:47 +0000 (Tue, 13 Jan 2009) | 10 lines
  
  Blocked revisions 68589 via svnmerge
  
  ........
    r68589 | antoine.pitrou | 2009-01-14 00:13:52 +0100 (mer., 14 janv. 2009) | 5 lines
    
    Issue #4935: The overflow checking code in the expandtabs() method common
    to str, bytes and bytearray could be optimized away by the compiler, letting
    the interpreter segfault instead of raising an error.
  ........
................
  r68593 | amaury.forgeotdarc | 2009-01-13 23:21:11 +0000 (Tue, 13 Jan 2009) | 11 lines
  
  Blocked revisions 68592 via svnmerge
  
  ........
    r68592 | amaury.forgeotdarc | 2009-01-14 00:19:08 +0100 (mer., 14 janv. 2009) | 5 lines
    
    #4807: Remove a wrong usage of wsprintf in the winreg module
    ("windows sprintf", different than swprintf)
    
    Needed for the windows CE port.
  ........
................
  r68606 | raymond.hettinger | 2009-01-14 02:20:07 +0000 (Wed, 14 Jan 2009) | 5 lines
  
  Issue #1696199:  Add collections.Counter().
  
  Forward port from Py2.7.
................
  r68615 | mark.dickinson | 2009-01-15 15:36:10 +0000 (Thu, 15 Jan 2009) | 17 lines
  
  Merged revisions 68611-68613 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68611 | mark.dickinson | 2009-01-15 14:54:37 +0000 (Thu, 15 Jan 2009) | 2 lines
    
    Issue #4397.  Fix occasional test_socket failure on OS X.
  ........
    r68612 | mark.dickinson | 2009-01-15 14:58:28 +0000 (Thu, 15 Jan 2009) | 2 lines
    
    Comment typo
  ........
    r68613 | mark.dickinson | 2009-01-15 15:17:43 +0000 (Thu, 15 Jan 2009) | 2 lines
    
    Another typo fix.
  ........
................
  r68619 | mark.dickinson | 2009-01-15 19:32:23 +0000 (Thu, 15 Jan 2009) | 8 lines
  
  Issue 4910, patch 2 of (probably) 3: pave the way for renaming of
  nb_long:  remove last remaining use of nb_long
  (in the struct module) from the core, set nb_long slots on all builtin
  and extension types to 0, and remove uses of __long__ in test_complex
  and test_binop.
  
  Reviewed by Benjamin Peterson.
................
  r68629 | benjamin.peterson | 2009-01-16 03:06:57 +0000 (Fri, 16 Jan 2009) | 1 line
  
  remove duplicate definition of PyExc_BufferError #4950
................
  r68630 | benjamin.peterson | 2009-01-16 03:54:08 +0000 (Fri, 16 Jan 2009) | 108 lines
  
  Merged revisions 68450,68480-68481,68493,68495,68501,68512,68514-68515,68534-68536,68552,68563,68570-68572,68575,68582,68596,68623-68624,68628 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68450 | jeffrey.yasskin | 2009-01-09 10:47:07 -0600 (Fri, 09 Jan 2009) | 3 lines
    
    Fix issue 4884, preventing a crash in the socket code when python is compiled
    with llvm-gcc and run with a glibc <2.10.
  ........
    r68480 | vinay.sajip | 2009-01-10 07:38:04 -0600 (Sat, 10 Jan 2009) | 1 line
    
    Minor documentation changes cross-referencing NullHandler to the documentation on configuring logging in a library.
  ........
    r68481 | vinay.sajip | 2009-01-10 07:42:04 -0600 (Sat, 10 Jan 2009) | 1 line
    
    Corrected an incorrect self-reference.
  ........
    r68493 | benjamin.peterson | 2009-01-10 11:18:55 -0600 (Sat, 10 Jan 2009) | 1 line
    
    rewrite verbose conditionals
  ........
    r68495 | benjamin.peterson | 2009-01-10 11:36:44 -0600 (Sat, 10 Jan 2009) | 1 line
    
    tp_iter only exists with Py_TPFLAGS_HAVE_ITER #4901
  ........
    r68501 | vinay.sajip | 2009-01-10 13:22:57 -0600 (Sat, 10 Jan 2009) | 1 line
    
    Corrected minor typo and added .currentmodule directives to fix missing cross-references.
  ........
    r68512 | benjamin.peterson | 2009-01-10 16:42:10 -0600 (Sat, 10 Jan 2009) | 1 line
    
    make tests fail if they can't be imported
  ........
    r68514 | benjamin.peterson | 2009-01-10 17:41:59 -0600 (Sat, 10 Jan 2009) | 1 line
    
    move seealso to a more appropiate place
  ........
    r68515 | benjamin.peterson | 2009-01-10 17:49:08 -0600 (Sat, 10 Jan 2009) | 1 line
    
    macos 9 isn't supported
  ........
    r68534 | gregory.p.smith | 2009-01-11 11:53:33 -0600 (Sun, 11 Jan 2009) | 2 lines
    
    correct email address
  ........
    r68535 | gregory.p.smith | 2009-01-11 11:57:54 -0600 (Sun, 11 Jan 2009) | 9 lines
    
    Update the documentation for binascii and zlib crc32/adler32 functions
    to better describe the signed vs unsigned return value behavior on
    different platforms and versions of python.  Mention the workaround to
    make them all return the same thing by using & 0xffffffff.
    
    Fixes issue4903.
    
    Also needs to be merged into release26-maint, release30-maint, & py3k.
  ........
    r68536 | benjamin.peterson | 2009-01-11 13:48:15 -0600 (Sun, 11 Jan 2009) | 1 line
    
    add email addresses
  ........
    r68552 | vinay.sajip | 2009-01-12 14:36:18 -0600 (Mon, 12 Jan 2009) | 1 line
    
    Minor changes/corrections in markup.
  ........
    r68563 | benjamin.peterson | 2009-01-12 19:49:10 -0600 (Mon, 12 Jan 2009) | 1 line
    
    small logic correction
  ........
    r68570 | raymond.hettinger | 2009-01-13 03:08:32 -0600 (Tue, 13 Jan 2009) | 5 lines
    
    Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard().
    
    Needs to be backported to 2.6 and forward ported to 3.0 and 3.1.
  ........
    r68571 | armin.ronacher | 2009-01-13 05:52:23 -0600 (Tue, 13 Jan 2009) | 3 lines
    
    ast.literal_eval can properly evaluate complex numbers now.  This fixes issue4907.
  ........
    r68572 | andrew.kuchling | 2009-01-13 07:40:54 -0600 (Tue, 13 Jan 2009) | 1 line
    
    Note that first coord. is left alone
  ........
    r68575 | thomas.heller | 2009-01-13 11:32:28 -0600 (Tue, 13 Jan 2009) | 1 line
    
    Fix refcount leak in error cases.  Bug found by coverity.
  ........
    r68582 | georg.brandl | 2009-01-13 16:14:01 -0600 (Tue, 13 Jan 2009) | 2 lines
    
    Use assertRaises.
  ........
    r68596 | amaury.forgeotdarc | 2009-01-13 17:39:22 -0600 (Tue, 13 Jan 2009) | 3 lines
    
    #1162154: inspect.getmembers() now skips attributes that raise AttributeError,
    e.g. a __slots__ attribute which has not been set.
  ........
    r68623 | vinay.sajip | 2009-01-15 16:48:13 -0600 (Thu, 15 Jan 2009) | 1 line
    
    Made minor changes/corrections in markup. Added a couple of section headings.
  ........
    r68624 | vinay.sajip | 2009-01-15 17:04:47 -0600 (Thu, 15 Jan 2009) | 1 line
    
    Minor changes/corrections in markup.
  ........
    r68628 | benjamin.peterson | 2009-01-15 20:55:24 -0600 (Thu, 15 Jan 2009) | 1 line
    
    compare with == not is #4946
  ........
................
  r68638 | mark.dickinson | 2009-01-16 19:31:13 +0000 (Fri, 16 Jan 2009) | 3 lines
  
  Define PY_SSIZE_T_CLEAN at the top of the dbm module.  This should fix the
  segfaults on the PPC64/Debian buildbots.
................
  r68643 | antoine.pitrou | 2009-01-17 02:40:13 +0000 (Sat, 17 Jan 2009) | 3 lines
  
  Make test_io faster
................
  r68647 | benjamin.peterson | 2009-01-17 04:15:01 +0000 (Sat, 17 Jan 2009) | 1 line
  
  fix inspect.formatargspec on functions with keyword-only arguments without defaults #4959
................
  r68650 | mark.dickinson | 2009-01-17 09:45:37 +0000 (Sat, 17 Jan 2009) | 2 lines
  
  Remove a couple of references to long in the c-api docs
................
  r68651 | mark.dickinson | 2009-01-17 10:04:45 +0000 (Sat, 17 Jan 2009) | 2 lines
  
  Issue #4910, patch 3/3:  rename nb_long to nb_reserved
................
  r68652 | mark.dickinson | 2009-01-17 10:21:23 +0000 (Sat, 17 Jan 2009) | 2 lines
  
  Fix a few more references to long integers in the docs.
................
  r68653 | mark.dickinson | 2009-01-17 10:48:28 +0000 (Sat, 17 Jan 2009) | 2 lines
  
  Remove attempted long->int conversions in py3k version of float.as_integer_ratio.
................
  r68662 | amaury.forgeotdarc | 2009-01-17 16:42:26 +0000 (Sat, 17 Jan 2009) | 12 lines
  
  Merged revisions 68661 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68661 | amaury.forgeotdarc | 2009-01-17 17:40:17 +0100 (Sat, 17 Jan 2009) | 5 lines
    
    #3997: zipfiles generated with more than 65536 files could not be opened 
    with other applications.
    
    Reviewed by Martin, will backport to 2.6 and 3.0
  ........
................
  r68669 | antoine.pitrou | 2009-01-17 21:06:43 +0000 (Sat, 17 Jan 2009) | 3 lines
  
  Issue #4838: When a module is deallocated, free the memory backing the optional module state data.
................
  r68675 | mark.dickinson | 2009-01-17 21:57:11 +0000 (Sat, 17 Jan 2009) | 2 lines
  
  Replace PyNumber_Int with PyNumber_Long.
................
  r68677 | benjamin.peterson | 2009-01-17 22:41:18 +0000 (Sat, 17 Jan 2009) | 9 lines
  
  Merged revisions 68676 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68676 | benjamin.peterson | 2009-01-17 16:27:54 -0600 (Sat, 17 Jan 2009) | 1 line
    
    fix inspect.isclass() on instances with a custom __getattr__ #1225107
  ........
................
  r68686 | benjamin.peterson | 2009-01-17 23:28:17 +0000 (Sat, 17 Jan 2009) | 50 lines
  
  I'm just going to assume that all of these revisions don't need to be merge, since it's not indicated:
  
  Blocked revisions 68559,68562,68565-68567,68569,68603-68605 via svnmerge
  
  ........
    r68559 | raymond.hettinger | 2009-01-12 16:58:41 -0600 (Mon, 12 Jan 2009) | 1 line
    
    Issue 1696199: Add collections.Counter().
  ........
    r68562 | raymond.hettinger | 2009-01-12 19:05:03 -0600 (Mon, 12 Jan 2009) | 7 lines
    
    Simplify Counter() API.  Replace items keyword argument
    with a mapping.  Makes Counter() idempotent, makes update()
    API the same as Counter.__init__(), makes a more readable
    repr, makes the API more dict-like, and allows Steven
    Bethard's update() example to work.
  ........
    r68565 | raymond.hettinger | 2009-01-12 21:49:43 -0600 (Mon, 12 Jan 2009) | 1 line
    
    Minor documentation tweaks and simpler update() example.
  ........
    r68566 | raymond.hettinger | 2009-01-12 22:13:53 -0600 (Mon, 12 Jan 2009) | 1 line
    
    Fixup and simplify docstrings and doctests.
  ........
    r68567 | raymond.hettinger | 2009-01-12 22:50:35 -0600 (Mon, 12 Jan 2009) | 1 line
    
    Speed-up __repr__.  Eliminate duplicate tests.  Use a from-irmport.
  ........
    r68569 | raymond.hettinger | 2009-01-13 02:38:14 -0600 (Tue, 13 Jan 2009) | 7 lines
    
    Add table of idioms/patterns for using Counter objects.
    Improve the appearance and flow of the References section -- it used
    to have a box around it that wasn't distinct from the preceding code
    boxes and it had a weird bolding pattern and hanging indents that
    made the section disproportionately large.
  ........
    r68603 | raymond.hettinger | 2009-01-13 18:15:21 -0600 (Tue, 13 Jan 2009) | 1 line
    
    Minor doc tweaks.
  ........
    r68604 | raymond.hettinger | 2009-01-13 19:15:06 -0600 (Tue, 13 Jan 2009) | 1 line
    
    Add tests for __init__() and update() with no args.
  ........
    r68605 | raymond.hettinger | 2009-01-13 19:39:51 -0600 (Tue, 13 Jan 2009) | 1 line
    
    Fix-up indentation of sample code blocks for namedtuple mthod definitions.
  ........
................
  r68690 | benjamin.peterson | 2009-01-17 23:43:58 +0000 (Sat, 17 Jan 2009) | 9 lines
  
  Merged revisions 68460 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68460 | kristjan.jonsson | 2009-01-09 14:31:26 -0600 (Fri, 09 Jan 2009) | 1 line
    
    Issue 4293:  Make Py_AddPendingCall() thread safe
  ........
................
  r68691 | benjamin.peterson | 2009-01-17 23:46:54 +0000 (Sat, 17 Jan 2009) | 1 line
  
  fix compiler warning
................
  r68695 | benjamin.peterson | 2009-01-18 00:04:57 +0000 (Sun, 18 Jan 2009) | 9 lines
  
  Merged revisions 68458 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68458 | kristjan.jonsson | 2009-01-09 14:23:16 -0600 (Fri, 09 Jan 2009) | 1 line
    
    Issue 4336:  HTTPRequest._send_output() now deals with the case of the message body not being a string.  This allows clients to use endheaders(message_body) instead of endheaders() + send(message_body) without making any extra checks.
  ........
................
  r68696 | benjamin.peterson | 2009-01-18 00:08:45 +0000 (Sun, 18 Jan 2009) | 9 lines
  
  Merged revisions 68459 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68459 | kristjan.jonsson | 2009-01-09 14:27:16 -0600 (Fri, 09 Jan 2009) | 1 line
    
    Issue 4336:  Let users of HTTPConnection.endheaders() submit a message body to the function if required.
  ........
................
  r68698 | brett.cannon | 2009-01-18 00:24:28 +0000 (Sun, 18 Jan 2009) | 6 lines
  
  Add initial implementation of importlib. See the NOTES files for what is
  planned for the package.
  
  There are no docs yet, but they are coming once the API for the first new
  function, importlib.import_module() is finalized.
................
  r68700 | amaury.forgeotdarc | 2009-01-18 00:29:02 +0000 (Sun, 18 Jan 2009) | 10 lines
  
  Merged revisions 68678 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68678 | amaury.forgeotdarc | 2009-01-17 23:43:50 +0100 (Sat, 17 Jan 2009) | 3 lines
    
    follow-up of #3997: since 0xFFFF numbers are not enough to indicate a zip64 format,
    always try to read the "zip64 end of directory structure".
  ........
................
  r68701 | brett.cannon | 2009-01-18 00:36:22 +0000 (Sun, 18 Jan 2009) | 2 lines
  
  Skip over any file or folder that starts with a dot (e.g. .svn).
................
  r68702 | brett.cannon | 2009-01-18 00:36:55 +0000 (Sun, 18 Jan 2009) | 2 lines
  
  NOTES for importlib should mention the ultimate end-goal for the package.
................
  r68707 | benjamin.peterson | 2009-01-18 01:29:28 +0000 (Sun, 18 Jan 2009) | 8 lines
  
  Blocked revisions 68705 via svnmerge
  
  ........
    r68705 | benjamin.peterson | 2009-01-17 19:28:09 -0600 (Sat, 17 Jan 2009) | 1 line
    
    bytearrays are mutable sequences
  ........
................
  r68709 | jesse.noller | 2009-01-18 03:11:38 +0000 (Sun, 18 Jan 2009) | 1 line
  
  Merge r68708 to py3k, fixes 4449
................
  r68712 | brett.cannon | 2009-01-18 06:55:05 +0000 (Sun, 18 Jan 2009) | 5 lines
  
  Tests of case-sensitivity were being executed on OSs which did not have a
  case-insensitive file system, leading to test failures. This was due to using
  the TestCase objects directly instead of the guard in the test_main() function.
  Move over to a class decorator instead to control if the tests should be run.
................
  r68716 | georg.brandl | 2009-01-18 10:38:16 +0000 (Sun, 18 Jan 2009) | 1 line
  
  #4984: fix number of types.
................
  r68717 | georg.brandl | 2009-01-18 10:40:25 +0000 (Sun, 18 Jan 2009) | 1 line
  
  #4983: clarify what "byte sequence" is.
................
  r68719 | georg.brandl | 2009-01-18 10:43:58 +0000 (Sun, 18 Jan 2009) | 1 line
  
  #4975: fix bytes/str issue.
................
  r68728 | jesse.noller | 2009-01-18 19:44:02 +0000 (Sun, 18 Jan 2009) | 1 line
  
  Issues #10867: remove old cPickle imports from multiprocessing
................
  r68729 | jesse.noller | 2009-01-18 19:45:18 +0000 (Sun, 18 Jan 2009) | 1 line
  
  Correct issue number for 68728 checkin
................
  r68730 | martin.v.loewis | 2009-01-18 20:15:42 +0000 (Sun, 18 Jan 2009) | 2 lines
  
  Issue #4008: Fix problems with non-ASCII source files.
................
  r68732 | martin.v.loewis | 2009-01-18 20:23:36 +0000 (Sun, 18 Jan 2009) | 3 lines
  
  Issue #4815: Offer conversion to UTF-8 if source files have
  no encoding declaration and are not encoded in UTF-8.
................
  r68736 | benjamin.peterson | 2009-01-18 21:02:37 +0000 (Sun, 18 Jan 2009) | 40 lines
  
  Merged revisions 68547,68607,68610,68618,68621-68622,68649,68722 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68547 | kristjan.jonsson | 2009-01-12 12:09:27 -0600 (Mon, 12 Jan 2009) | 1 line
    
    Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module.
  ........
    r68607 | kristjan.jonsson | 2009-01-14 04:50:57 -0600 (Wed, 14 Jan 2009) | 2 lines
    
    Re-enable all tests for windows platforms.
    Also, explicitly connect to the IPV4 address.  On windows platforms supporting AF_INET6, the SocketProxy would connect using socket.create_connection('localhost', port) which would cycle through all address families and try to connect.  It would try connecting using AF_INET6 first and this would cause a delay of up to a second.
  ........
    r68610 | kristjan.jonsson | 2009-01-15 03:09:13 -0600 (Thu, 15 Jan 2009) | 3 lines
    
    Fix recently introduced test cases.
    For datetime, gentoo didn't seem to mind the %e format for strftime.  So, we just excercise those instead making sure that we don't crash.
    For test_os, two cases were incorrect.
  ........
    r68618 | kristjan.jonsson | 2009-01-15 11:20:21 -0600 (Thu, 15 Jan 2009) | 1 line
    
    Issue 4929:  Handle socket errors when receiving
  ........
    r68621 | kristjan.jonsson | 2009-01-15 16:40:03 -0600 (Thu, 15 Jan 2009) | 1 line
    
    Fix two test cases in test_os.  ftruncate raises IOError unlike all the others which raise OSError.  And close() on some platforms doesn't complain when given an invalid file descriptor.
  ........
    r68622 | kristjan.jonsson | 2009-01-15 16:46:26 -0600 (Thu, 15 Jan 2009) | 1 line
    
    Make all the invalid fd tests for os subject to the function being available.
  ........
    r68649 | benjamin.peterson | 2009-01-16 22:39:05 -0600 (Fri, 16 Jan 2009) | 1 line
    
    trying to find some fpathconf() settings that all unixs support...
  ........
    r68722 | kristjan.jonsson | 2009-01-18 04:58:44 -0600 (Sun, 18 Jan 2009) | 1 line
    
    issue 4293:  make test_capi.py more robutst, it times out on some platforms, presumably waiting for threads.  Lower the thread count to 16.
  ........
................
  r68740 | jesse.noller | 2009-01-18 21:12:58 +0000 (Sun, 18 Jan 2009) | 1 line
  
  merge cl r68737 to py3k
................
  r68744 | benjamin.peterson | 2009-01-18 22:10:38 +0000 (Sun, 18 Jan 2009) | 14 lines
  
  Merged revisions 68568,68665 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68568 | georg.brandl | 2009-01-13 02:11:07 -0600 (Tue, 13 Jan 2009) | 2 lines
    
    Fix call signature and markup.
  ........
    r68665 | amaury.forgeotdarc | 2009-01-17 11:11:50 -0600 (Sat, 17 Jan 2009) | 3 lines
    
    #4930: Slightly cleaner (and faster) code in type creation:
    compare slots by address, not by name.
  ........
................
  r68746 | benjamin.peterson | 2009-01-18 22:27:04 +0000 (Sun, 18 Jan 2009) | 55 lines
  
  Merged revisions 68633,68648,68667,68706,68718,68720-68721,68724-68727,68739 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68633 | thomas.heller | 2009-01-16 12:53:44 -0600 (Fri, 16 Jan 2009) | 3 lines
    
    Change an example in the docs to avoid a mistake when the code is copy
    pasted and changed afterwards.
  ........
    r68648 | benjamin.peterson | 2009-01-16 22:28:57 -0600 (Fri, 16 Jan 2009) | 1 line
    
    use enumerate
  ........
    r68667 | amaury.forgeotdarc | 2009-01-17 14:18:59 -0600 (Sat, 17 Jan 2009) | 3 lines
    
    #4077: No need to append \n when calling Py_FatalError
    + fix a declaration to make it match the one in pythonrun.h
  ........
    r68706 | benjamin.peterson | 2009-01-17 19:28:46 -0600 (Sat, 17 Jan 2009) | 1 line
    
    fix grammar
  ........
    r68718 | georg.brandl | 2009-01-18 04:42:35 -0600 (Sun, 18 Jan 2009) | 1 line
    
    #4976: union() and intersection() take multiple args, but talk about "the other".
  ........
    r68720 | georg.brandl | 2009-01-18 04:45:22 -0600 (Sun, 18 Jan 2009) | 1 line
    
    #4974: fix redundant mention of lists and tuples.
  ........
    r68721 | georg.brandl | 2009-01-18 04:48:16 -0600 (Sun, 18 Jan 2009) | 1 line
    
    #4914: trunc is in math.
  ........
    r68724 | georg.brandl | 2009-01-18 07:24:10 -0600 (Sun, 18 Jan 2009) | 1 line
    
    #4979: correct result range for some random functions.
  ........
    r68725 | georg.brandl | 2009-01-18 07:47:26 -0600 (Sun, 18 Jan 2009) | 1 line
    
    #4857: fix augmented assignment target spec.
  ........
    r68726 | georg.brandl | 2009-01-18 08:41:52 -0600 (Sun, 18 Jan 2009) | 1 line
    
    #4923: clarify what was added.
  ........
    r68727 | georg.brandl | 2009-01-18 12:25:30 -0600 (Sun, 18 Jan 2009) | 1 line
    
    #4986: augassigns are not expressions.
  ........
    r68739 | benjamin.peterson | 2009-01-18 15:11:38 -0600 (Sun, 18 Jan 2009) | 1 line
    
    fix test that wasn't working as expected #4990
  ........
................
  r68749 | benjamin.peterson | 2009-01-18 22:46:33 +0000 (Sun, 18 Jan 2009) | 9 lines
  
  Merged revisions 68546 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68546 | raymond.hettinger | 2009-01-12 04:37:32 -0600 (Mon, 12 Jan 2009) | 1 line
    
    Optimize heapq.nsmallest/nlargest for cases where n==1 or n>=size.
  ........
................
  r68751 | benjamin.peterson | 2009-01-18 22:58:55 +0000 (Sun, 18 Jan 2009) | 16 lines
  
  Blocked revisions 68544-68545,68597 via svnmerge
  
  ........
    r68544 | kristjan.jonsson | 2009-01-12 03:20:34 -0600 (Mon, 12 Jan 2009) | 1 line
    
    Update Misc/NEWS for issue 3582
  ........
    r68545 | kristjan.jonsson | 2009-01-12 03:24:04 -0600 (Mon, 12 Jan 2009) | 1 line
    
    Misc/NEWS for issue 4293
  ........
    r68597 | benjamin.peterson | 2009-01-13 17:43:50 -0600 (Tue, 13 Jan 2009) | 1 line
    
    fix test_xmlrpc failures #4939
  ........
................
  r68761 | brett.cannon | 2009-01-19 06:56:16 +0000 (Mon, 19 Jan 2009) | 4 lines
  
  Fix a typo in some code that is not tested or supported yet.
  
  Closes issue 4993. Thanks Antoine Pitrou for the catch.
................
  r68762 | brett.cannon | 2009-01-19 07:07:58 +0000 (Mon, 19 Jan 2009) | 2 lines
  
  Remove a debugging print statement that accidentally got left in.
................
  r68767 | benjamin.peterson | 2009-01-19 15:11:51 +0000 (Mon, 19 Jan 2009) | 9 lines
  
  Merged revisions 68755 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68755 | benjamin.peterson | 2009-01-18 18:08:08 -0600 (Sun, 18 Jan 2009) | 1 line
    
    raise an OSError for invalid fds #4991
  ........
................
  r68769 | benjamin.peterson | 2009-01-19 15:15:02 +0000 (Mon, 19 Jan 2009) | 1 line
  
  reenable the invalid fd test for fdopen
................
  r68770 | benjamin.peterson | 2009-01-19 15:19:46 +0000 (Mon, 19 Jan 2009) | 1 line
  
  fix compiler warning
................
  r68778 | jesse.noller | 2009-01-19 16:23:53 +0000 (Mon, 19 Jan 2009) | 1 line
  
  merge r68768 to py3k
................
  r68780 | benjamin.peterson | 2009-01-19 17:53:36 +0000 (Mon, 19 Jan 2009) | 14 lines
  
  Merged revisions 68763,68773 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68763 | kristjan.jonsson | 2009-01-19 07:10:27 -0600 (Mon, 19 Jan 2009) | 2 lines
    
    Issue 4957
    Let os.ftruncate raise OSError like documented.
  ........
    r68773 | benjamin.peterson | 2009-01-19 09:51:27 -0600 (Mon, 19 Jan 2009) | 1 line
    
    simplify code
  ........
................
  r68782 | benjamin.peterson | 2009-01-19 21:00:09 +0000 (Mon, 19 Jan 2009) | 9 lines
  
  Merged revisions 68779 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68779 | benjamin.peterson | 2009-01-19 11:37:42 -0600 (Mon, 19 Jan 2009) | 1 line
    
    make bad file descriptor tests more robust
  ........
................
  r68786 | benjamin.peterson | 2009-01-19 21:11:05 +0000 (Mon, 19 Jan 2009) | 8 lines
  
  Blocked revisions 68785 via svnmerge
  
  ........
    r68785 | benjamin.peterson | 2009-01-19 15:08:37 -0600 (Mon, 19 Jan 2009) | 1 line
    
    I'm sick of these deprecations warnings in test_os
  ........
................
  r68788 | jesse.noller | 2009-01-20 00:23:01 +0000 (Tue, 20 Jan 2009) | 1 line
  
  merge r68787 to py3k
................
  r68790 | brett.cannon | 2009-01-20 02:09:18 +0000 (Tue, 20 Jan 2009) | 2 lines
  
  Clarify how the specify the name of a module with the 'module' directive.
................
  r68791 | brett.cannon | 2009-01-20 02:21:27 +0000 (Tue, 20 Jan 2009) | 3 lines
  
  Document the (very small) public API for importlib. As time goes on and some
  key refactorings occur more of the API will be exposed and documented.
................
  r68794 | raymond.hettinger | 2009-01-20 03:41:22 +0000 (Tue, 20 Jan 2009) | 1 line
  
  Forward port r68792 and r68789 putting Counter in __all__ and adding Counter buildouts.
................
  r68795 | benjamin.peterson | 2009-01-20 04:02:27 +0000 (Tue, 20 Jan 2009) | 15 lines
  
  Blocked revisions 68789,68792 via svnmerge
  
  ........
    r68789 | raymond.hettinger | 2009-01-19 19:19:26 -0600 (Mon, 19 Jan 2009) | 6 lines
    
    Build-outs for Counter() class:
    * Constructor and update() support keyword args (like their dict counterparts).
    * The 'del' statement no longer raises KeyError for missing values.
    * Add multiset operations:  __add__, __sub__, __and__, __or__.
  ........
    r68792 | raymond.hettinger | 2009-01-19 20:24:38 -0600 (Mon, 19 Jan 2009) | 1 line
    
    Add Counter() to __all__.
  ........
................
  r68798 | raymond.hettinger | 2009-01-20 07:15:22 +0000 (Tue, 20 Jan 2009) | 1 line
  
  Forward port r68797: Fix-up jump targets in collections docs.
................
  r68799 | raymond.hettinger | 2009-01-20 07:24:44 +0000 (Tue, 20 Jan 2009) | 1 line
  
  Issue 4998: Decimal should not subclass or register with numbers.Real.
................
  r68802 | antoine.pitrou | 2009-01-20 11:42:11 +0000 (Tue, 20 Jan 2009) | 3 lines
  
  Fix typo
................
  r68804 | raymond.hettinger | 2009-01-20 13:00:59 +0000 (Tue, 20 Jan 2009) | 1 line
  
  Fix typos.
................
  r68806 | benjamin.peterson | 2009-01-20 14:24:13 +0000 (Tue, 20 Jan 2009) | 12 lines
  
  Blocked revisions 68803,68805 via svnmerge
  
  ........
    r68803 | raymond.hettinger | 2009-01-20 06:59:36 -0600 (Tue, 20 Jan 2009) | 1 line
    
    Fix typos.
  ........
    r68805 | benjamin.peterson | 2009-01-20 08:21:16 -0600 (Tue, 20 Jan 2009) | 1 line
    
    allow unicode keyword arguments for the ** syntax #4978
  ........
................
  r68808 | benjamin.peterson | 2009-01-20 14:33:15 +0000 (Tue, 20 Jan 2009) | 8 lines
  
  Blocked revisions 68807 via svnmerge
  
  ........
    r68807 | benjamin.peterson | 2009-01-20 08:31:08 -0600 (Tue, 20 Jan 2009) | 1 line
    
    backport r68802 (bugfix)
  ........
................
  r68809 | benjamin.peterson | 2009-01-20 15:01:54 +0000 (Tue, 20 Jan 2009) | 22 lines
  
  Merged revisions 68797,68801 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68797 | raymond.hettinger | 2009-01-20 01:11:47 -0600 (Tue, 20 Jan 2009) | 11 lines
    
    Don't disrupt automatic url target name generation
    with manually specified, conflicting names.
    
    Before: 
        http://docs.python.org/dev/library/collections.html#id1
    
    After:
        http://docs.python.org/dev/library/collections.html#counter-objects
  ........
    r68801 | raymond.hettinger | 2009-01-20 04:46:23 -0600 (Tue, 20 Jan 2009) | 5 lines
    
    Use Georg's new permalinks to documentation by version number.
    That assures that IDLE's help always points to the correct
    version and the latest update with all bug fixes.
  ........
................
  r68810 | benjamin.peterson | 2009-01-20 18:50:52 +0000 (Tue, 20 Jan 2009) | 14 lines
  
  Blocked revisions 68764,68766 via svnmerge
  
  ........
    r68764 | benjamin.peterson | 2009-01-19 09:04:35 -0600 (Mon, 19 Jan 2009) | 3 lines
    
    Removed merge tracking for "svnmerge" for 
    svn+ssh://pythondev@svn.python.org/python/branches/trunk-math
  ........
    r68766 | benjamin.peterson | 2009-01-19 09:06:33 -0600 (Mon, 19 Jan 2009) | 3 lines
    
    Removed merge tracking for "svnmerge" for 
    svn+ssh://pythondev@svn.python.org/python/branches/tnelson-trunk-bsddb-47-upgrade
  ........
................
  r68814 | mark.dickinson | 2009-01-20 20:43:58 +0000 (Tue, 20 Jan 2009) | 5 lines
  
  Issue #4842, patch 1/2: fix pickle in Python 3.x so that pickling with the
  'L' opcode always appends an 'L' on output, just as 2.x does.  When
  unpickling, remove the trailing 'L' (if present) before passing the
  result to PyLong_FromString.
................
  r68815 | mark.dickinson | 2009-01-20 20:45:53 +0000 (Tue, 20 Jan 2009) | 2 lines
  
  Issue 4842, patch 2/2:  int('3L') should be invalid in Python 3.x.
................
  r68819 | raymond.hettinger | 2009-01-20 21:25:32 +0000 (Tue, 20 Jan 2009) | 1 line
  
  Revert part of r68799 which unintentionally updated this file.
................
  r68832 | raymond.hettinger | 2009-01-20 23:44:31 +0000 (Tue, 20 Jan 2009) | 1 line
  
  Beautify and cleanup the references section.
................
  r68833 | vinay.sajip | 2009-01-21 00:19:28 +0000 (Wed, 21 Jan 2009) | 1 line
  
  Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly.
................
  r68836 | antoine.pitrou | 2009-01-21 00:55:13 +0000 (Wed, 21 Jan 2009) | 12 lines
  
  Merged revisions 68835 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68835 | antoine.pitrou | 2009-01-21 01:45:36 +0100 (mer., 21 janv. 2009) | 6 lines
    
    Issue #5008: When a file is opened in append mode with the new IO library,
    do an explicit seek to the end of file (so that e.g. tell() returns the
    file size rather than 0). This is consistent with the behaviour of the
    traditional 2.x file object.
  ........
................
  r68841 | jesse.noller | 2009-01-21 02:15:48 +0000 (Wed, 21 Jan 2009) | 1 line
  
  merge r68839 forward to py3k
................
  r68844 | raymond.hettinger | 2009-01-21 20:36:27 +0000 (Wed, 21 Jan 2009) | 1 line
  
  Simplify explanation of multiset operations by removing restrictions on negative inputs.
................
  r68846 | raymond.hettinger | 2009-01-21 23:14:07 +0000 (Wed, 21 Jan 2009) | 1 line
  
  Tighten-up the docs for Counter().
................
  r68847 | benjamin.peterson | 2009-01-22 02:24:32 +0000 (Thu, 22 Jan 2009) | 12 lines
  
  Blocked revisions 68843,68845 via svnmerge
  
  ........
    r68843 | raymond.hettinger | 2009-01-21 14:31:50 -0600 (Wed, 21 Jan 2009) | 1 line
    
    Simplify explanation of multiset operations by removing restrictions on negative inputs.
  ........
    r68845 | raymond.hettinger | 2009-01-21 17:12:51 -0600 (Wed, 21 Jan 2009) | 1 line
    
    Tighten-up the docs for Counter().
  ........
................
  r68848 | benjamin.peterson | 2009-01-22 03:21:11 +0000 (Thu, 22 Jan 2009) | 28 lines
  
  Blocked revisions 68760,68793,68813,68826,68829,68831 via svnmerge
  
  ........
    r68760 | vinay.sajip | 2009-01-19 00:49:19 -0600 (Mon, 19 Jan 2009) | 1 line
    
    Added more cross-reference targets and tidied up list of useful handlers.
  ........
    r68793 | raymond.hettinger | 2009-01-19 21:36:36 -0600 (Mon, 19 Jan 2009) | 1 line
    
    Make merging easier by formattng comment blocks the same in Py3.1
  ........
    r68813 | raymond.hettinger | 2009-01-20 14:34:19 -0600 (Tue, 20 Jan 2009) | 3 lines
    
    Issue 4998:  __slots__ on Fractions was useless.
  ........
    r68826 | vinay.sajip | 2009-01-20 16:43:17 -0600 (Tue, 20 Jan 2009) | 1 line
    
    Issue 5013: Fixed bug in FileHandler when delay was set.
  ........
    r68829 | vinay.sajip | 2009-01-20 17:16:08 -0600 (Tue, 20 Jan 2009) | 1 line
    
    Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly.
  ........
    r68831 | raymond.hettinger | 2009-01-20 17:42:54 -0600 (Tue, 20 Jan 2009) | 1 line
    
    Beautify and cleanup the references section.
  ........
................
  r68851 | raymond.hettinger | 2009-01-22 05:27:37 +0000 (Thu, 22 Jan 2009) | 1 line
  
  More doc tweaks.
................
  r68854 | raymond.hettinger | 2009-01-22 09:09:55 +0000 (Thu, 22 Jan 2009) | 1 line
  
  Update comments and add an optimized path for Counter.update().
................
  r68855 | antoine.pitrou | 2009-01-22 10:11:36 +0000 (Thu, 22 Jan 2009) | 3 lines
  
  Issue #4874: Most builtin decoders now reject unicode input.
................
  r68857 | antoine.pitrou | 2009-01-22 11:59:55 +0000 (Thu, 22 Jan 2009) | 3 lines
  
  Followup of #4874: also fix multibytecodec.c
................
  r68860 | brett.cannon | 2009-01-22 18:37:20 +0000 (Thu, 22 Jan 2009) | 1 line
  
  Fix markup for arguments in importlib docs.
................
  r68861 | benjamin.peterson | 2009-01-22 21:50:27 +0000 (Thu, 22 Jan 2009) | 12 lines
  
  Blocked revisions 68850,68853 via svnmerge
  
  ........
    r68850 | raymond.hettinger | 2009-01-21 23:20:47 -0600 (Wed, 21 Jan 2009) | 1 line
    
    More doc tweaks.
  ........
    r68853 | raymond.hettinger | 2009-01-22 03:05:43 -0600 (Thu, 22 Jan 2009) | 1 line
    
    Update comments and add an optimized path for Counter.update().
  ........
................
  r68863 | jesse.noller | 2009-01-22 21:56:13 +0000 (Thu, 22 Jan 2009) | 1 line
  
  merge r68862 to py3k
................
  r68864 | brett.cannon | 2009-01-22 22:43:07 +0000 (Thu, 22 Jan 2009) | 7 lines
  
  Add importlib.machinery with its first tenants, BuitinImporter and
  FrozenImporter. Docs forthcoming.
  
  I plan on all finders and loaders (and most likely hooks) to live
  in imoprtlib.machinery. Utility stuff will end up in importlib.util.
  Higher-level API stuff will stay on imoprtlib directly (e.g. import_module).
................
  r68865 | brett.cannon | 2009-01-22 22:44:04 +0000 (Thu, 22 Jan 2009) | 4 lines
  
  Add some comment markers to more clearly delineate what different parts of the
  code are for. Also add a note that the import * at the end of the file should
  eventually go away.
................
  r68866 | brett.cannon | 2009-01-22 22:45:00 +0000 (Thu, 22 Jan 2009) | 2 lines
  
  Ignore pyc and pyo files.
................
  r68867 | benjamin.peterson | 2009-01-23 03:26:36 +0000 (Fri, 23 Jan 2009) | 29 lines
  
  Merged revisions 68750,68776-68777,68811,68842,68859 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68750 | benjamin.peterson | 2009-01-18 16:47:04 -0600 (Sun, 18 Jan 2009) | 1 line
    
    fix encoding cookie case
  ........
    r68776 | benjamin.peterson | 2009-01-19 10:17:54 -0600 (Mon, 19 Jan 2009) | 1 line
    
    move BufferedIOBase into the base class section
  ........
    r68777 | benjamin.peterson | 2009-01-19 10:18:27 -0600 (Mon, 19 Jan 2009) | 1 line
    
    add email address
  ........
    r68811 | benjamin.peterson | 2009-01-20 12:58:27 -0600 (Tue, 20 Jan 2009) | 1 line
    
    fix url
  ........
    r68842 | andrew.kuchling | 2009-01-20 20:16:26 -0600 (Tue, 20 Jan 2009) | 1 line
    
    Markup fixes
  ........
    r68859 | georg.brandl | 2009-01-22 12:29:28 -0600 (Thu, 22 Jan 2009) | 2 lines
    
    Clarify wording.
  ........
................
  r68868 | alexandre.vassalotti | 2009-01-23 04:43:46 +0000 (Fri, 23 Jan 2009) | 2 lines
  
  Remove unnecessary copying in load_long().
................
  r68869 | alexandre.vassalotti | 2009-01-23 04:46:05 +0000 (Fri, 23 Jan 2009) | 2 lines
  
  Remove obsolete note on binary-mode vs. text-mode file.
................
  r68870 | alexandre.vassalotti | 2009-01-23 04:50:05 +0000 (Fri, 23 Jan 2009) | 2 lines
  
  Issue 2980: Protocol 0 is not truly restricted to ASCII.
................
  r68872 | alexandre.vassalotti | 2009-01-23 05:28:16 +0000 (Fri, 23 Jan 2009) | 2 lines
  
  Clean up pickle usage examples.
................
  r68873 | hirokazu.yamamoto | 2009-01-23 07:23:03 +0000 (Fri, 23 Jan 2009) | 9 lines
  
  Merged revisions 68457 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68457 | kristjan.jonsson | 2009-01-10 05:10:59 +0900 | 1 line
    
    Issue 3677:  Fix import from UNC paths on Windows.
  ........
................
  r68875 | jesse.noller | 2009-01-23 14:09:08 +0000 (Fri, 23 Jan 2009) | 1 line
  
  merge 68874 to py3kwq!
................
  r68878 | alexandre.vassalotti | 2009-01-24 01:47:57 +0000 (Sat, 24 Jan 2009) | 4 lines
  
  Factor common branch in load_long().
  
  Suggested by Neal Norwitz.
................
  r68882 | kristjan.jonsson | 2009-01-24 10:33:25 +0000 (Sat, 24 Jan 2009) | 1 line
  
  Issue 3677: Release the path string on py3k
................
  r68883 | kristjan.jonsson | 2009-01-24 10:50:45 +0000 (Sat, 24 Jan 2009) | 1 line
  
  Add a test for UNC import paths, see issue 3677
................
  r68887 | martin.v.loewis | 2009-01-24 14:10:07 +0000 (Sat, 24 Jan 2009) | 10 lines
  
  Merged revisions 68885 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68885 | martin.v.loewis | 2009-01-24 15:00:33 +0100 (Sa, 24 Jan 2009) | 3 lines
    
    Issue #4710: Extract directories properly in the zipfile module;
    allow adding directories to a zipfile.
  ........
................
  r68889 | mark.dickinson | 2009-01-24 15:02:35 +0000 (Sat, 24 Jan 2009) | 9 lines
  
  Some minor cleanups in PyLong_FromLong:
   - fast path wasn't being properly taken for negative ints;
     thanks Victor Stinner for pointing this out.
   - use Py_SAFE_DOWNCAST instead of direct casting to digit
     (it's safer, especially if we ever consider moving to 30-bit
     digits)
   - cleaner way to write negation
................
  r68895 | mark.dickinson | 2009-01-24 15:56:57 +0000 (Sat, 24 Jan 2009) | 13 lines
  
  Merged revisions 68890 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68890 | mark.dickinson | 2009-01-24 15:27:44 +0000 (Sat, 24 Jan 2009) | 6 lines
    
    Issue #4393: fix 3 classes of potential portability problems in longobject.c:
     - fix some places where counters into ob_digit were declared as
       int instead of Py_ssize_t
     - add (twodigit) casts where necessary
     - fix code in _PyLong_AsByteArray that uses << on negative values
  ........
................
  r68898 | martin.v.loewis | 2009-01-24 16:19:45 +0000 (Sat, 24 Jan 2009) | 10 lines
  
  Merged revisions 68893 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68893 | martin.v.loewis | 2009-01-24 16:47:27 +0100 (Sa, 24 Jan 2009) | 3 lines
    
    Issue #3881: Help Tcl to load even when started through the
    unreadable local symlink to "Program Files" on Vista.
  ........
................
  r68900 | mark.dickinson | 2009-01-24 16:22:21 +0000 (Sat, 24 Jan 2009) | 9 lines
  
  Merged revisions 68897 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68897 | mark.dickinson | 2009-01-24 16:17:27 +0000 (Sat, 24 Jan 2009) | 2 lines
    
    Issue #5025: Fix occasional test_kqueue failure on OS X.
  ........
................
  r68908 | mark.dickinson | 2009-01-24 21:46:33 +0000 (Sat, 24 Jan 2009) | 15 lines
  
  Merged revisions 68903,68906 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68903 | mark.dickinson | 2009-01-24 16:40:29 +0000 (Sat, 24 Jan 2009) | 5 lines
    
    Issue #1672332: Fix unpickling of subnormal floats, which was raising
    ValueError on some platforms as a result of the platform strtod setting
    errno on underflow.
  ........
    r68906 | mark.dickinson | 2009-01-24 21:08:38 +0000 (Sat, 24 Jan 2009) | 2 lines
    
    Issue #3657: fix occasional test_pickletools failures.
  ........
................
  r68916 | jesse.noller | 2009-01-25 03:45:53 +0000 (Sun, 25 Jan 2009) | 1 line
  
  merge r68915 to py3k
................
  r68918 | brett.cannon | 2009-01-25 04:21:39 +0000 (Sun, 25 Jan 2009) | 2 lines
  
  Add the terms "finder", "loader", and "importer" to the glossary.
................
  r68919 | brett.cannon | 2009-01-25 04:56:30 +0000 (Sun, 25 Jan 2009) | 2 lines
  
  Document both importlib.machinery.BuiltinImporter and FrozenImporter.
................
  r68922 | mark.dickinson | 2009-01-25 10:48:51 +0000 (Sun, 25 Jan 2009) | 9 lines
  
  Merged revisions 68920 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r68920 | mark.dickinson | 2009-01-25 10:39:15 +0000 (Sun, 25 Jan 2009) | 2 lines
    
    Remove uses of cmp from the decimal module.
  ........
................
  r68924 | antoine.pitrou | 2009-01-25 16:34:23 +0000 (Sun, 25 Jan 2009) | 6 lines
  
  Issue #4753: By enabling a configure option named '--with-computed-gotos'
  on compilers that support it (notably: gcc, SunPro, icc), the bytecode
  evaluation loop is compiled with a new dispatch mechanism which gives
  speedups of up to 20%, depending on the system, on various benchmarks.
................
  r68926 | benjamin.peterson | 2009-01-25 17:19:17 +0000 (Sun, 25 Jan 2009) | 11 lines
  
  Blocked revisions 68925 via svnmerge
  
  ........
    r68925 | benjamin.peterson | 2009-01-25 11:15:10 -0600 (Sun, 25 Jan 2009) | 5 lines
    
    fix building the core with --disable-unicode
    
    I changed some bytearray methods to use strings instead of unicode like bytes_repr
    Also, bytearray.fromhex() can take strings as well as unicode
  ........
................


Added:
   python/branches/py3k-issue1717/Doc/library/importlib.rst
      - copied unchanged from r68926, /python/branches/py3k/Doc/library/importlib.rst
   python/branches/py3k-issue1717/Doc/tools/rstlint.py
      - copied unchanged from r68926, /python/branches/py3k/Doc/tools/rstlint.py
   python/branches/py3k-issue1717/Doc/tools/sphinxext/susp-ignored.csv
      - copied unchanged from r68926, /python/branches/py3k/Doc/tools/sphinxext/susp-ignored.csv
   python/branches/py3k-issue1717/Doc/tools/sphinxext/suspicious.py
      - copied unchanged from r68926, /python/branches/py3k/Doc/tools/sphinxext/suspicious.py
   python/branches/py3k-issue1717/Lib/distutils/tests/test_sdist.py
      - copied unchanged from r68926, /python/branches/py3k/Lib/distutils/tests/test_sdist.py
   python/branches/py3k-issue1717/Lib/importlib/   (props changed)
      - copied from r68926, /python/branches/py3k/Lib/importlib/
   python/branches/py3k-issue1717/Lib/test/test_importlib.py
      - copied unchanged from r68926, /python/branches/py3k/Lib/test/test_importlib.py
   python/branches/py3k-issue1717/Lib/test/zipdir.zip
      - copied unchanged from r68926, /python/branches/py3k/Lib/test/zipdir.zip
   python/branches/py3k-issue1717/PC/VC6/build_tkinter.py
      - copied unchanged from r68926, /python/branches/py3k/PC/VC6/build_tkinter.py
   python/branches/py3k-issue1717/PC/VC6/tcl852.patch
      - copied unchanged from r68926, /python/branches/py3k/PC/VC6/tcl852.patch
   python/branches/py3k-issue1717/Python/makeopcodetargets.py
      - copied unchanged from r68926, /python/branches/py3k/Python/makeopcodetargets.py
   python/branches/py3k-issue1717/Python/opcode_targets.h
      - copied unchanged from r68926, /python/branches/py3k/Python/opcode_targets.h
Removed:
   python/branches/py3k-issue1717/Lib/test/crashers/iter.py
   python/branches/py3k-issue1717/Python/getmtime.c
Modified:
   python/branches/py3k-issue1717/   (props changed)
   python/branches/py3k-issue1717/Demo/classes/Complex.py
   python/branches/py3k-issue1717/Demo/classes/bitvec.py
   python/branches/py3k-issue1717/Demo/tix/grid.py
   python/branches/py3k-issue1717/Demo/tix/samples/Balloon.py
   python/branches/py3k-issue1717/Demo/tix/samples/BtnBox.py
   python/branches/py3k-issue1717/Demo/tix/samples/CmpImg.py
   python/branches/py3k-issue1717/Demo/tix/samples/ComboBox.py
   python/branches/py3k-issue1717/Demo/tix/samples/Control.py
   python/branches/py3k-issue1717/Demo/tix/samples/DirList.py
   python/branches/py3k-issue1717/Demo/tix/samples/DirTree.py
   python/branches/py3k-issue1717/Demo/tix/samples/NoteBook.py
   python/branches/py3k-issue1717/Demo/tix/samples/OptMenu.py
   python/branches/py3k-issue1717/Demo/tix/samples/PanedWin.py
   python/branches/py3k-issue1717/Demo/tix/samples/PopMenu.py
   python/branches/py3k-issue1717/Demo/tix/samples/SHList1.py
   python/branches/py3k-issue1717/Demo/tix/samples/SHList2.py
   python/branches/py3k-issue1717/Demo/tix/samples/Tree.py
   python/branches/py3k-issue1717/Demo/tix/tixwidgets.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/AttrDialog.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/ManPage.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/MimeViewer.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/ShellWindow.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/brownian.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/brownian2.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/canvasevents.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/dialog.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/electrons.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/hanoi.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/hello.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/imagedraw.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/imageview.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/kill.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/listtree.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/mbox.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/newmenubardemo.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/optionmenu.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/paint.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/rmt.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/solitaire.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/sortvisu.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/ss1.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/svkill.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/switch.py
   python/branches/py3k-issue1717/Demo/tkinter/guido/tkman.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/00-HELLO-WORLD.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/animation-simple.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/animation-w-velocity-ctrl.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/bind-w-mult-calls-p-type.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-demo-simple.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-gridding.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-or-creating.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-w-mouse.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-mult-item-sel.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-reading-tag-info.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-w-widget-draw-el.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-with-scrollbars.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/dialog-box.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/entry-simple.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/entry-with-shared-variable.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/killing-window-w-wm.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/menu-all-types-of-entries.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/menu-simple.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-1.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-2.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/packer-and-placer-together.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/packer-simple.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/placer-simple.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/pong-demo-1.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/printing-coords-of-items.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/radiobutton-simple.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-band-box-demo-1.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-line-demo-1.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/slider-demo-1.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/subclass-existing-widgets.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/two-radio-groups.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-more.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-simple.py
   python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-w-location.py
   python/branches/py3k-issue1717/Doc/ACKS.txt
   python/branches/py3k-issue1717/Doc/Makefile
   python/branches/py3k-issue1717/Doc/c-api/allocation.rst
   python/branches/py3k-issue1717/Doc/c-api/arg.rst
   python/branches/py3k-issue1717/Doc/c-api/buffer.rst
   python/branches/py3k-issue1717/Doc/c-api/bytes.rst
   python/branches/py3k-issue1717/Doc/c-api/conversion.rst
   python/branches/py3k-issue1717/Doc/c-api/file.rst
   python/branches/py3k-issue1717/Doc/c-api/init.rst
   python/branches/py3k-issue1717/Doc/c-api/intro.rst
   python/branches/py3k-issue1717/Doc/c-api/long.rst
   python/branches/py3k-issue1717/Doc/c-api/module.rst
   python/branches/py3k-issue1717/Doc/c-api/number.rst
   python/branches/py3k-issue1717/Doc/c-api/object.rst
   python/branches/py3k-issue1717/Doc/c-api/reflection.rst
   python/branches/py3k-issue1717/Doc/c-api/sequence.rst
   python/branches/py3k-issue1717/Doc/c-api/structures.rst
   python/branches/py3k-issue1717/Doc/c-api/sys.rst
   python/branches/py3k-issue1717/Doc/c-api/typeobj.rst
   python/branches/py3k-issue1717/Doc/c-api/unicode.rst
   python/branches/py3k-issue1717/Doc/data/refcounts.dat
   python/branches/py3k-issue1717/Doc/distutils/apiref.rst
   python/branches/py3k-issue1717/Doc/distutils/builtdist.rst
   python/branches/py3k-issue1717/Doc/distutils/configfile.rst
   python/branches/py3k-issue1717/Doc/distutils/packageindex.rst
   python/branches/py3k-issue1717/Doc/distutils/setupscript.rst
   python/branches/py3k-issue1717/Doc/distutils/uploading.rst
   python/branches/py3k-issue1717/Doc/documenting/markup.rst
   python/branches/py3k-issue1717/Doc/extending/building.rst
   python/branches/py3k-issue1717/Doc/extending/extending.rst
   python/branches/py3k-issue1717/Doc/extending/newtypes.rst
   python/branches/py3k-issue1717/Doc/extending/windows.rst
   python/branches/py3k-issue1717/Doc/glossary.rst
   python/branches/py3k-issue1717/Doc/howto/curses.rst
   python/branches/py3k-issue1717/Doc/howto/doanddont.rst
   python/branches/py3k-issue1717/Doc/howto/functional.rst
   python/branches/py3k-issue1717/Doc/howto/regex.rst
   python/branches/py3k-issue1717/Doc/howto/sockets.rst
   python/branches/py3k-issue1717/Doc/howto/unicode.rst
   python/branches/py3k-issue1717/Doc/howto/urllib2.rst
   python/branches/py3k-issue1717/Doc/howto/webservers.rst
   python/branches/py3k-issue1717/Doc/install/index.rst
   python/branches/py3k-issue1717/Doc/library/2to3.rst
   python/branches/py3k-issue1717/Doc/library/abc.rst
   python/branches/py3k-issue1717/Doc/library/aifc.rst
   python/branches/py3k-issue1717/Doc/library/array.rst
   python/branches/py3k-issue1717/Doc/library/ast.rst
   python/branches/py3k-issue1717/Doc/library/audioop.rst
   python/branches/py3k-issue1717/Doc/library/base64.rst
   python/branches/py3k-issue1717/Doc/library/bdb.rst
   python/branches/py3k-issue1717/Doc/library/binascii.rst
   python/branches/py3k-issue1717/Doc/library/cmath.rst
   python/branches/py3k-issue1717/Doc/library/codeop.rst
   python/branches/py3k-issue1717/Doc/library/collections.rst
   python/branches/py3k-issue1717/Doc/library/configparser.rst
   python/branches/py3k-issue1717/Doc/library/constants.rst
   python/branches/py3k-issue1717/Doc/library/crypt.rst
   python/branches/py3k-issue1717/Doc/library/csv.rst
   python/branches/py3k-issue1717/Doc/library/ctypes.rst
   python/branches/py3k-issue1717/Doc/library/datetime.rst
   python/branches/py3k-issue1717/Doc/library/decimal.rst
   python/branches/py3k-issue1717/Doc/library/dis.rst
   python/branches/py3k-issue1717/Doc/library/email.mime.rst
   python/branches/py3k-issue1717/Doc/library/fileinput.rst
   python/branches/py3k-issue1717/Doc/library/fractions.rst
   python/branches/py3k-issue1717/Doc/library/ftplib.rst
   python/branches/py3k-issue1717/Doc/library/functions.rst
   python/branches/py3k-issue1717/Doc/library/gettext.rst
   python/branches/py3k-issue1717/Doc/library/gzip.rst
   python/branches/py3k-issue1717/Doc/library/hashlib.rst
   python/branches/py3k-issue1717/Doc/library/heapq.rst
   python/branches/py3k-issue1717/Doc/library/http.cookiejar.rst
   python/branches/py3k-issue1717/Doc/library/http.cookies.rst
   python/branches/py3k-issue1717/Doc/library/idle.rst
   python/branches/py3k-issue1717/Doc/library/inspect.rst
   python/branches/py3k-issue1717/Doc/library/io.rst
   python/branches/py3k-issue1717/Doc/library/itertools.rst
   python/branches/py3k-issue1717/Doc/library/json.rst
   python/branches/py3k-issue1717/Doc/library/locale.rst
   python/branches/py3k-issue1717/Doc/library/logging.rst
   python/branches/py3k-issue1717/Doc/library/mailbox.rst
   python/branches/py3k-issue1717/Doc/library/math.rst
   python/branches/py3k-issue1717/Doc/library/mmap.rst
   python/branches/py3k-issue1717/Doc/library/modules.rst
   python/branches/py3k-issue1717/Doc/library/msvcrt.rst
   python/branches/py3k-issue1717/Doc/library/multiprocessing.rst
   python/branches/py3k-issue1717/Doc/library/nntplib.rst
   python/branches/py3k-issue1717/Doc/library/numbers.rst
   python/branches/py3k-issue1717/Doc/library/operator.rst
   python/branches/py3k-issue1717/Doc/library/optparse.rst
   python/branches/py3k-issue1717/Doc/library/os.rst
   python/branches/py3k-issue1717/Doc/library/ossaudiodev.rst
   python/branches/py3k-issue1717/Doc/library/othergui.rst
   python/branches/py3k-issue1717/Doc/library/parser.rst
   python/branches/py3k-issue1717/Doc/library/pdb.rst
   python/branches/py3k-issue1717/Doc/library/pickle.rst
   python/branches/py3k-issue1717/Doc/library/profile.rst
   python/branches/py3k-issue1717/Doc/library/pyexpat.rst
   python/branches/py3k-issue1717/Doc/library/queue.rst
   python/branches/py3k-issue1717/Doc/library/random.rst
   python/branches/py3k-issue1717/Doc/library/re.rst
   python/branches/py3k-issue1717/Doc/library/reprlib.rst
   python/branches/py3k-issue1717/Doc/library/rlcompleter.rst
   python/branches/py3k-issue1717/Doc/library/sched.rst
   python/branches/py3k-issue1717/Doc/library/shutil.rst
   python/branches/py3k-issue1717/Doc/library/signal.rst
   python/branches/py3k-issue1717/Doc/library/smtplib.rst
   python/branches/py3k-issue1717/Doc/library/socket.rst
   python/branches/py3k-issue1717/Doc/library/sqlite3.rst
   python/branches/py3k-issue1717/Doc/library/ssl.rst
   python/branches/py3k-issue1717/Doc/library/stdtypes.rst
   python/branches/py3k-issue1717/Doc/library/string.rst
   python/branches/py3k-issue1717/Doc/library/subprocess.rst
   python/branches/py3k-issue1717/Doc/library/symtable.rst
   python/branches/py3k-issue1717/Doc/library/sys.rst
   python/branches/py3k-issue1717/Doc/library/tempfile.rst
   python/branches/py3k-issue1717/Doc/library/test.rst
   python/branches/py3k-issue1717/Doc/library/threading.rst
   python/branches/py3k-issue1717/Doc/library/tk.rst
   python/branches/py3k-issue1717/Doc/library/tkinter.rst
   python/branches/py3k-issue1717/Doc/library/tkinter.tix.rst
   python/branches/py3k-issue1717/Doc/library/tokenize.rst
   python/branches/py3k-issue1717/Doc/library/trace.rst
   python/branches/py3k-issue1717/Doc/library/traceback.rst
   python/branches/py3k-issue1717/Doc/library/turtle.rst
   python/branches/py3k-issue1717/Doc/library/unicodedata.rst
   python/branches/py3k-issue1717/Doc/library/unittest.rst
   python/branches/py3k-issue1717/Doc/library/urllib.parse.rst
   python/branches/py3k-issue1717/Doc/library/urllib.request.rst
   python/branches/py3k-issue1717/Doc/library/warnings.rst
   python/branches/py3k-issue1717/Doc/library/webbrowser.rst
   python/branches/py3k-issue1717/Doc/library/wsgiref.rst
   python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst
   python/branches/py3k-issue1717/Doc/library/xmlrpc.client.rst
   python/branches/py3k-issue1717/Doc/library/xmlrpc.server.rst
   python/branches/py3k-issue1717/Doc/library/zipfile.rst
   python/branches/py3k-issue1717/Doc/library/zipimport.rst
   python/branches/py3k-issue1717/Doc/library/zlib.rst
   python/branches/py3k-issue1717/Doc/license.rst
   python/branches/py3k-issue1717/Doc/make.bat
   python/branches/py3k-issue1717/Doc/reference/datamodel.rst
   python/branches/py3k-issue1717/Doc/reference/expressions.rst
   python/branches/py3k-issue1717/Doc/reference/lexical_analysis.rst
   python/branches/py3k-issue1717/Doc/reference/simple_stmts.rst
   python/branches/py3k-issue1717/Doc/tools/   (props changed)
   python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py
   python/branches/py3k-issue1717/Doc/tutorial/classes.rst
   python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst
   python/branches/py3k-issue1717/Doc/tutorial/datastructures.rst
   python/branches/py3k-issue1717/Doc/tutorial/errors.rst
   python/branches/py3k-issue1717/Doc/tutorial/index.rst
   python/branches/py3k-issue1717/Doc/tutorial/inputoutput.rst
   python/branches/py3k-issue1717/Doc/tutorial/interpreter.rst
   python/branches/py3k-issue1717/Doc/tutorial/introduction.rst
   python/branches/py3k-issue1717/Doc/tutorial/modules.rst
   python/branches/py3k-issue1717/Doc/tutorial/stdlib.rst
   python/branches/py3k-issue1717/Doc/tutorial/stdlib2.rst
   python/branches/py3k-issue1717/Doc/tutorial/whatnow.rst
   python/branches/py3k-issue1717/Doc/using/cmdline.rst
   python/branches/py3k-issue1717/Doc/using/unix.rst
   python/branches/py3k-issue1717/Doc/using/windows.rst
   python/branches/py3k-issue1717/Doc/whatsnew/2.0.rst
   python/branches/py3k-issue1717/Doc/whatsnew/2.1.rst
   python/branches/py3k-issue1717/Doc/whatsnew/2.2.rst
   python/branches/py3k-issue1717/Doc/whatsnew/2.3.rst
   python/branches/py3k-issue1717/Doc/whatsnew/2.4.rst
   python/branches/py3k-issue1717/Doc/whatsnew/2.5.rst
   python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst
   python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst
   python/branches/py3k-issue1717/Doc/whatsnew/3.0.rst
   python/branches/py3k-issue1717/Doc/whatsnew/3.1.rst
   python/branches/py3k-issue1717/Include/abstract.h
   python/branches/py3k-issue1717/Include/longobject.h
   python/branches/py3k-issue1717/Include/memoryobject.h
   python/branches/py3k-issue1717/Include/object.h
   python/branches/py3k-issue1717/Include/pydebug.h
   python/branches/py3k-issue1717/Include/pyerrors.h
   python/branches/py3k-issue1717/Include/pymath.h
   python/branches/py3k-issue1717/Include/pyport.h
   python/branches/py3k-issue1717/Include/unicodeobject.h
   python/branches/py3k-issue1717/LICENSE
   python/branches/py3k-issue1717/Lib/_abcoll.py
   python/branches/py3k-issue1717/Lib/ast.py
   python/branches/py3k-issue1717/Lib/collections.py
   python/branches/py3k-issue1717/Lib/ctypes/test/__init__.py
   python/branches/py3k-issue1717/Lib/ctypes/test/test_pep3118.py
   python/branches/py3k-issue1717/Lib/ctypes/util.py
   python/branches/py3k-issue1717/Lib/decimal.py
   python/branches/py3k-issue1717/Lib/distutils/command/register.py
   python/branches/py3k-issue1717/Lib/distutils/command/sdist.py
   python/branches/py3k-issue1717/Lib/distutils/command/upload.py
   python/branches/py3k-issue1717/Lib/distutils/config.py
   python/branches/py3k-issue1717/Lib/distutils/dist.py
   python/branches/py3k-issue1717/Lib/distutils/tests/test_msvc9compiler.py
   python/branches/py3k-issue1717/Lib/distutils/tests/test_register.py
   python/branches/py3k-issue1717/Lib/distutils/tests/test_upload.py
   python/branches/py3k-issue1717/Lib/fractions.py
   python/branches/py3k-issue1717/Lib/gzip.py
   python/branches/py3k-issue1717/Lib/heapq.py
   python/branches/py3k-issue1717/Lib/http/client.py
   python/branches/py3k-issue1717/Lib/idlelib/EditorWindow.py
   python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py
   python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt
   python/branches/py3k-issue1717/Lib/idlelib/ScriptBinding.py
   python/branches/py3k-issue1717/Lib/idlelib/help.txt
   python/branches/py3k-issue1717/Lib/idlelib/macosxSupport.py
   python/branches/py3k-issue1717/Lib/importlib/test/   (props changed)
   python/branches/py3k-issue1717/Lib/importlib/test/builtin/   (props changed)
   python/branches/py3k-issue1717/Lib/importlib/test/extension/   (props changed)
   python/branches/py3k-issue1717/Lib/importlib/test/frozen/   (props changed)
   python/branches/py3k-issue1717/Lib/importlib/test/import_/   (props changed)
   python/branches/py3k-issue1717/Lib/importlib/test/source/   (props changed)
   python/branches/py3k-issue1717/Lib/inspect.py
   python/branches/py3k-issue1717/Lib/io.py
   python/branches/py3k-issue1717/Lib/lib2to3/fixer_util.py
   python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_execfile.py
   python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_import.py
   python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports.py
   python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports2.py
   python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_long.py
   python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_urllib.py
   python/branches/py3k-issue1717/Lib/lib2to3/main.py
   python/branches/py3k-issue1717/Lib/lib2to3/pgen2/driver.py
   python/branches/py3k-issue1717/Lib/lib2to3/refactor.py
   python/branches/py3k-issue1717/Lib/lib2to3/tests/data/py3_test_grammar.py
   python/branches/py3k-issue1717/Lib/lib2to3/tests/test_fixers.py
   python/branches/py3k-issue1717/Lib/logging/__init__.py
   python/branches/py3k-issue1717/Lib/logging/handlers.py
   python/branches/py3k-issue1717/Lib/multiprocessing/__init__.py
   python/branches/py3k-issue1717/Lib/multiprocessing/forking.py
   python/branches/py3k-issue1717/Lib/multiprocessing/managers.py
   python/branches/py3k-issue1717/Lib/multiprocessing/sharedctypes.py
   python/branches/py3k-issue1717/Lib/multiprocessing/util.py
   python/branches/py3k-issue1717/Lib/pickle.py
   python/branches/py3k-issue1717/Lib/pickletools.py
   python/branches/py3k-issue1717/Lib/random.py
   python/branches/py3k-issue1717/Lib/smtplib.py
   python/branches/py3k-issue1717/Lib/socket.py
   python/branches/py3k-issue1717/Lib/test/inspect_fodder2.py
   python/branches/py3k-issue1717/Lib/test/pickletester.py
   python/branches/py3k-issue1717/Lib/test/support.py
   python/branches/py3k-issue1717/Lib/test/test_ast.py
   python/branches/py3k-issue1717/Lib/test/test_binop.py
   python/branches/py3k-issue1717/Lib/test/test_bz2.py
   python/branches/py3k-issue1717/Lib/test/test_capi.py
   python/branches/py3k-issue1717/Lib/test/test_cmath.py
   python/branches/py3k-issue1717/Lib/test/test_cmd_line.py
   python/branches/py3k-issue1717/Lib/test/test_codeccallbacks.py
   python/branches/py3k-issue1717/Lib/test/test_codecs.py
   python/branches/py3k-issue1717/Lib/test/test_collections.py
   python/branches/py3k-issue1717/Lib/test/test_datetime.py
   python/branches/py3k-issue1717/Lib/test/test_decimal.py
   python/branches/py3k-issue1717/Lib/test/test_fileio.py
   python/branches/py3k-issue1717/Lib/test/test_fractions.py
   python/branches/py3k-issue1717/Lib/test/test_gzip.py
   python/branches/py3k-issue1717/Lib/test/test_hashlib.py
   python/branches/py3k-issue1717/Lib/test/test_import.py
   python/branches/py3k-issue1717/Lib/test/test_inspect.py
   python/branches/py3k-issue1717/Lib/test/test_io.py
   python/branches/py3k-issue1717/Lib/test/test_iter.py
   python/branches/py3k-issue1717/Lib/test/test_itertools.py
   python/branches/py3k-issue1717/Lib/test/test_kqueue.py
   python/branches/py3k-issue1717/Lib/test/test_long.py
   python/branches/py3k-issue1717/Lib/test/test_memoryview.py
   python/branches/py3k-issue1717/Lib/test/test_multibytecodec.py
   python/branches/py3k-issue1717/Lib/test/test_multiprocessing.py
   python/branches/py3k-issue1717/Lib/test/test_os.py
   python/branches/py3k-issue1717/Lib/test/test_socket.py
   python/branches/py3k-issue1717/Lib/test/test_struct.py
   python/branches/py3k-issue1717/Lib/test/test_sys.py
   python/branches/py3k-issue1717/Lib/test/test_urllib.py
   python/branches/py3k-issue1717/Lib/test/test_wsgiref.py
   python/branches/py3k-issue1717/Lib/test/test_xmlrpc.py
   python/branches/py3k-issue1717/Lib/test/test_zipfile.py
   python/branches/py3k-issue1717/Lib/tkinter/__init__.py
   python/branches/py3k-issue1717/Lib/tkinter/_fix.py
   python/branches/py3k-issue1717/Lib/tkinter/tix.py
   python/branches/py3k-issue1717/Lib/unittest.py
   python/branches/py3k-issue1717/Lib/wsgiref/handlers.py
   python/branches/py3k-issue1717/Lib/wsgiref/headers.py
   python/branches/py3k-issue1717/Lib/wsgiref/simple_server.py
   python/branches/py3k-issue1717/Lib/wsgiref/util.py
   python/branches/py3k-issue1717/Lib/wsgiref/validate.py
   python/branches/py3k-issue1717/Lib/zipfile.py
   python/branches/py3k-issue1717/Makefile.pre.in
   python/branches/py3k-issue1717/Misc/ACKS
   python/branches/py3k-issue1717/Misc/NEWS
   python/branches/py3k-issue1717/Misc/build.sh
   python/branches/py3k-issue1717/Modules/_codecsmodule.c
   python/branches/py3k-issue1717/Modules/_collectionsmodule.c
   python/branches/py3k-issue1717/Modules/_ctypes/callproc.c
   python/branches/py3k-issue1717/Modules/_ctypes/cfield.c
   python/branches/py3k-issue1717/Modules/_ctypes/libffi_msvc/ffi.c
   python/branches/py3k-issue1717/Modules/_dbmmodule.c
   python/branches/py3k-issue1717/Modules/_fileio.c
   python/branches/py3k-issue1717/Modules/_hashopenssl.c
   python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h
   python/branches/py3k-issue1717/Modules/_multiprocessing/pipe_connection.c
   python/branches/py3k-issue1717/Modules/_multiprocessing/socket_connection.c
   python/branches/py3k-issue1717/Modules/_pickle.c
   python/branches/py3k-issue1717/Modules/_struct.c
   python/branches/py3k-issue1717/Modules/_testcapimodule.c
   python/branches/py3k-issue1717/Modules/_tkinter.c
   python/branches/py3k-issue1717/Modules/bz2module.c
   python/branches/py3k-issue1717/Modules/cjkcodecs/multibytecodec.c
   python/branches/py3k-issue1717/Modules/datetimemodule.c
   python/branches/py3k-issue1717/Modules/gcmodule.c
   python/branches/py3k-issue1717/Modules/grpmodule.c
   python/branches/py3k-issue1717/Modules/itertoolsmodule.c
   python/branches/py3k-issue1717/Modules/main.c
   python/branches/py3k-issue1717/Modules/posixmodule.c
   python/branches/py3k-issue1717/Modules/selectmodule.c
   python/branches/py3k-issue1717/Modules/socketmodule.c
   python/branches/py3k-issue1717/Modules/zlibmodule.c
   python/branches/py3k-issue1717/Objects/abstract.c
   python/branches/py3k-issue1717/Objects/boolobject.c
   python/branches/py3k-issue1717/Objects/bytesobject.c
   python/branches/py3k-issue1717/Objects/complexobject.c
   python/branches/py3k-issue1717/Objects/exceptions.c
   python/branches/py3k-issue1717/Objects/floatobject.c
   python/branches/py3k-issue1717/Objects/longobject.c
   python/branches/py3k-issue1717/Objects/memoryobject.c
   python/branches/py3k-issue1717/Objects/moduleobject.c
   python/branches/py3k-issue1717/Objects/object.c
   python/branches/py3k-issue1717/Objects/setobject.c
   python/branches/py3k-issue1717/Objects/stringlib/fastsearch.h
   python/branches/py3k-issue1717/Objects/stringlib/transmogrify.h
   python/branches/py3k-issue1717/Objects/tupleobject.c
   python/branches/py3k-issue1717/Objects/typeobject.c
   python/branches/py3k-issue1717/Objects/unicodeobject.c
   python/branches/py3k-issue1717/Objects/weakrefobject.c
   python/branches/py3k-issue1717/PC/VC6/_tkinter.dsp
   python/branches/py3k-issue1717/PC/VC6/bz2.dsp
   python/branches/py3k-issue1717/PC/VC6/pythoncore.dsp
   python/branches/py3k-issue1717/PC/VC6/readme.txt
   python/branches/py3k-issue1717/PC/VS7.1/pythoncore.vcproj
   python/branches/py3k-issue1717/PC/VS8.0/pythoncore.vcproj
   python/branches/py3k-issue1717/PC/example_nt/example.c
   python/branches/py3k-issue1717/PC/os2emx/Makefile
   python/branches/py3k-issue1717/PC/os2emx/python27.def
   python/branches/py3k-issue1717/PC/os2vacpp/makefile
   python/branches/py3k-issue1717/PC/os2vacpp/makefile.omk
   python/branches/py3k-issue1717/PC/os2vacpp/python.def
   python/branches/py3k-issue1717/PC/pyconfig.h
   python/branches/py3k-issue1717/PC/winreg.c
   python/branches/py3k-issue1717/PCbuild/pythoncore.vcproj
   python/branches/py3k-issue1717/Parser/asdl.py
   python/branches/py3k-issue1717/Parser/printgrammar.c
   python/branches/py3k-issue1717/Python/Python-ast.c
   python/branches/py3k-issue1717/Python/ast.c
   python/branches/py3k-issue1717/Python/bltinmodule.c
   python/branches/py3k-issue1717/Python/ceval.c
   python/branches/py3k-issue1717/Python/compile.c
   python/branches/py3k-issue1717/Python/getcopyright.c
   python/branches/py3k-issue1717/Python/graminit.c
   python/branches/py3k-issue1717/Python/import.c
   python/branches/py3k-issue1717/Python/pythonrun.c
   python/branches/py3k-issue1717/Python/sysmodule.c
   python/branches/py3k-issue1717/Python/thread.c
   python/branches/py3k-issue1717/Python/thread_nt.h
   python/branches/py3k-issue1717/README
   python/branches/py3k-issue1717/Tools/scripts/patchcheck.py
   python/branches/py3k-issue1717/configure
   python/branches/py3k-issue1717/configure.in
   python/branches/py3k-issue1717/pyconfig.h.in
   python/branches/py3k-issue1717/setup.py

Modified: python/branches/py3k-issue1717/Demo/classes/Complex.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/classes/Complex.py	(original)
+++ python/branches/py3k-issue1717/Demo/classes/Complex.py	Sun Jan 25 21:08:20 2009
@@ -39,7 +39,6 @@
 #
 # These conversions accept complex arguments only if their imaginary part is zero:
 # int(z)
-# long(z)
 # float(z)
 #
 # The following operators accept two complex numbers, or one complex number
@@ -147,11 +146,6 @@
             raise ValueError("can't convert Complex with nonzero im to int")
         return int(self.re)
 
-    def __long__(self):
-        if self.im:
-            raise ValueError("can't convert Complex with nonzero im to long")
-        return int(self.re)
-
     def __float__(self):
         if self.im:
             raise ValueError("can't convert Complex with nonzero im to float")

Modified: python/branches/py3k-issue1717/Demo/classes/bitvec.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/classes/bitvec.py	(original)
+++ python/branches/py3k-issue1717/Demo/classes/bitvec.py	Sun Jan 25 21:08:20 2009
@@ -315,9 +315,6 @@
     def __int__(self):
         return int(self._data)
 
-    def __long__(self):
-        return int(self._data)
-
     def __float__(self):
         return float(self._data)
 

Modified: python/branches/py3k-issue1717/Demo/tix/grid.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/grid.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/grid.py	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ###
-import Tix as tk
+import tkinter.tix as tk
 from pprint import pprint
 
 r= tk.Tk()

Modified: python/branches/py3k-issue1717/Demo/tix/samples/Balloon.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/Balloon.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/Balloon.py	Sun Jan 25 21:08:20 2009
@@ -15,7 +15,7 @@
 # Your can display the help message in a "balloon" and a status bar widget.
 #
 
-import Tix
+import tkinter.tix
 
 TCL_ALL_EVENTS          = 0
 
@@ -32,20 +32,20 @@
         z = w.winfo_toplevel()
         z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
 
-        status = Tix.Label(w, width=40, relief=Tix.SUNKEN, bd=1)
-        status.pack(side=Tix.BOTTOM, fill=Tix.Y, padx=2, pady=1)
+        status = tkinter.tix.Label(w, width=40, relief=tkinter.tix.SUNKEN, bd=1)
+        status.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.Y, padx=2, pady=1)
 
         # Create two mysterious widgets that need balloon help
-        button1 = Tix.Button(w, text='Something Unexpected',
+        button1 = tkinter.tix.Button(w, text='Something Unexpected',
                              command=self.quitcmd)
-        button2 = Tix.Button(w, text='Something Else Unexpected')
+        button2 = tkinter.tix.Button(w, text='Something Else Unexpected')
         button2['command'] = lambda w=button2: w.destroy()
-        button1.pack(side=Tix.TOP, expand=1)
-        button2.pack(side=Tix.TOP, expand=1)
+        button1.pack(side=tkinter.tix.TOP, expand=1)
+        button2.pack(side=tkinter.tix.TOP, expand=1)
 
         # Create the balloon widget and associate it with the widgets that we want
         # to provide tips for:
-        b = Tix.Balloon(w, statusbar=status)
+        b = tkinter.tix.Balloon(w, statusbar=status)
 
         b.bind_widget(button1, balloonmsg='Close Window',
                       statusmsg='Press this button to close this window')
@@ -64,5 +64,5 @@
         self.root.destroy()
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)

Modified: python/branches/py3k-issue1717/Demo/tix/samples/BtnBox.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/BtnBox.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/BtnBox.py	Sun Jan 25 21:08:20 2009
@@ -15,13 +15,13 @@
 # for example.
 #
 
-import Tix
+import tkinter.tix
 
 def RunSample(w):
     # Create the label on the top of the dialog box
     #
-    top = Tix.Label(w, padx=20, pady=10, bd=1, relief=Tix.RAISED,
-                    anchor=Tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget')
+    top = tkinter.tix.Label(w, padx=20, pady=10, bd=1, relief=tkinter.tix.RAISED,
+                    anchor=tkinter.tix.CENTER, text='This dialog box is\n a demonstration of the\n tixButtonBox widget')
 
     # Create the button box and add a few buttons in it. Set the
     # -width of all the buttons to the same value so that they
@@ -30,15 +30,15 @@
     # Note that the -text, -underline, -command and -width options are all
     # standard options of the button widgets.
     #
-    box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
+    box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
     box.add('ok', text='OK', underline=0, width=5,
             command=lambda w=w: w.destroy())
     box.add('close', text='Cancel', underline=0, width=5,
             command=lambda w=w: w.destroy())
-    box.pack(side=Tix.BOTTOM, fill=Tix.X)
-    top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
+    box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
+    top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)
     root.mainloop()

Modified: python/branches/py3k-issue1717/Demo/tix/samples/CmpImg.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/CmpImg.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/CmpImg.py	Sun Jan 25 21:08:20 2009
@@ -15,7 +15,7 @@
 # buttons
 #
 
-import Tix
+import tkinter.tix
 
 network_pixmap = """/* XPM */
 static char * netw_xpm[] = {
@@ -144,15 +144,15 @@
 """
 
 def RunSample(w):
-    w.img0 = Tix.Image('pixmap', data=network_pixmap)
+    w.img0 = tkinter.tix.Image('pixmap', data=network_pixmap)
     if not w.img0:
-        w.img0 = Tix.Image('bitmap', data=network_bitmap)
-    w.img1 = Tix.Image('pixmap', data=hard_disk_pixmap)
+        w.img0 = tkinter.tix.Image('bitmap', data=network_bitmap)
+    w.img1 = tkinter.tix.Image('pixmap', data=hard_disk_pixmap)
     if not w.img0:
-        w.img1 = Tix.Image('bitmap', data=hard_disk_bitmap)
+        w.img1 = tkinter.tix.Image('bitmap', data=hard_disk_bitmap)
 
-    hdd = Tix.Button(w, padx=4, pady=1, width=120)
-    net = Tix.Button(w, padx=4, pady=1, width=120)
+    hdd = tkinter.tix.Button(w, padx=4, pady=1, width=120)
+    net = tkinter.tix.Button(w, padx=4, pady=1, width=120)
 
     # Create the first image: we create a line, then put a string,
     # a space and a image into this line, from left to right.
@@ -160,7 +160,7 @@
     # individual items
     #
     # The tk.calls should be methods in Tix ...
-    w.hdd_img = Tix.Image('compound', window=hdd)
+    w.hdd_img = tkinter.tix.Image('compound', window=hdd)
     w.hdd_img.tk.call(str(w.hdd_img), 'add', 'line')
     w.hdd_img.tk.call(str(w.hdd_img), 'add', 'text', '-text', 'Hard Disk',
                     '-underline', '0')
@@ -172,7 +172,7 @@
     hdd['image'] = w.hdd_img
 
     # Next button
-    w.net_img = Tix.Image('compound', window=net)
+    w.net_img = tkinter.tix.Image('compound', window=net)
     w.net_img.tk.call(str(w.net_img), 'add', 'line')
     w.net_img.tk.call(str(w.net_img), 'add', 'text', '-text', 'Network',
                     '-underline', '0')
@@ -183,14 +183,14 @@
     #
     net['image'] = w.net_img
 
-    close = Tix.Button(w, pady=1, text='Close',
+    close = tkinter.tix.Button(w, pady=1, text='Close',
                        command=lambda w=w: w.destroy())
 
-    hdd.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1)
-    net.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1)
-    close.pack(side=Tix.LEFT, padx=10, pady=10, fill=Tix.Y, expand=1)
+    hdd.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1)
+    net.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1)
+    close.pack(side=tkinter.tix.LEFT, padx=10, pady=10, fill=tkinter.tix.Y, expand=1)
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)
     root.mainloop()

Modified: python/branches/py3k-issue1717/Demo/tix/samples/ComboBox.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/ComboBox.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/ComboBox.py	Sun Jan 25 21:08:20 2009
@@ -13,15 +13,15 @@
 # This file demonstrates the use of the tixComboBox widget, which is close
 # to the MS Window Combo Box control.
 #
-import Tix
+import tkinter.tix
 
 def RunSample(w):
     global demo_month, demo_year
 
-    top = Tix.Frame(w, bd=1, relief=Tix.RAISED)
+    top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED)
 
-    demo_month = Tix.StringVar()
-    demo_year = Tix.StringVar()
+    demo_month = tkinter.tix.StringVar()
+    demo_year = tkinter.tix.StringVar()
 
     # $w.top.a is a drop-down combo box. It is not editable -- who wants
     # to invent new months?
@@ -30,7 +30,7 @@
     # [Hint] We set the label.width subwidget option of both comboboxes to
     #        be 10 so that their labels appear to be aligned.
     #
-    a = Tix.ComboBox(top, label="Month: ", dropdown=1,
+    a = tkinter.tix.ComboBox(top, label="Month: ", dropdown=1,
         command=select_month, editable=0, variable=demo_month,
         options='listbox.height 6 label.width 10 label.anchor e')
 
@@ -43,31 +43,31 @@
     # [Hint] Notice that you should use padY (the NAME of the option) and not
     #        pady (the SWITCH of the option).
     #
-    b = Tix.ComboBox(top, label="Year: ", dropdown=0,
+    b = tkinter.tix.ComboBox(top, label="Year: ", dropdown=0,
         command=select_year, editable=1, variable=demo_year,
         options='listbox.height 4 label.padY 5 label.width 10 label.anchor ne')
 
-    a.pack(side=Tix.TOP, anchor=Tix.W)
-    b.pack(side=Tix.TOP, anchor=Tix.W)
+    a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
+    b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
 
-    a.insert(Tix.END, 'January')
-    a.insert(Tix.END, 'February')
-    a.insert(Tix.END, 'March')
-    a.insert(Tix.END, 'April')
-    a.insert(Tix.END, 'May')
-    a.insert(Tix.END, 'June')
-    a.insert(Tix.END, 'July')
-    a.insert(Tix.END, 'August')
-    a.insert(Tix.END, 'September')
-    a.insert(Tix.END, 'October')
-    a.insert(Tix.END, 'November')
-    a.insert(Tix.END, 'December')
-
-    b.insert(Tix.END, '1992')
-    b.insert(Tix.END, '1993')
-    b.insert(Tix.END, '1994')
-    b.insert(Tix.END, '1995')
-    b.insert(Tix.END, '1996')
+    a.insert(tkinter.tix.END, 'January')
+    a.insert(tkinter.tix.END, 'February')
+    a.insert(tkinter.tix.END, 'March')
+    a.insert(tkinter.tix.END, 'April')
+    a.insert(tkinter.tix.END, 'May')
+    a.insert(tkinter.tix.END, 'June')
+    a.insert(tkinter.tix.END, 'July')
+    a.insert(tkinter.tix.END, 'August')
+    a.insert(tkinter.tix.END, 'September')
+    a.insert(tkinter.tix.END, 'October')
+    a.insert(tkinter.tix.END, 'November')
+    a.insert(tkinter.tix.END, 'December')
+
+    b.insert(tkinter.tix.END, '1992')
+    b.insert(tkinter.tix.END, '1993')
+    b.insert(tkinter.tix.END, '1994')
+    b.insert(tkinter.tix.END, '1995')
+    b.insert(tkinter.tix.END, '1996')
 
     # Use "tixSetSilent" to set the values of the combo box if you
     # don't want your -command procedures (cbx:select_month and
@@ -76,13 +76,13 @@
     a.set_silent('January')
     b.set_silent('1995')
 
-    box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
+    box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
     box.add('ok', text='Ok', underline=0, width=6,
             command=lambda w=w: ok_command(w))
     box.add('cancel', text='Cancel', underline=0, width=6,
             command=lambda w=w: w.destroy())
-    box.pack(side=Tix.BOTTOM, fill=Tix.X)
-    top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
+    box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
+    top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
 
 def select_month(event=None):
     # tixDemo:Status "Month = %s" % demo_month.get()
@@ -97,6 +97,6 @@
     w.destroy()
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)
     root.mainloop()

Modified: python/branches/py3k-issue1717/Demo/tix/samples/Control.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/Control.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/Control.py	Sun Jan 25 21:08:20 2009
@@ -18,7 +18,7 @@
 # integer values; one lets you select floating point values and the last
 # one lets you select a few names.
 
-import Tix
+import tkinter.tix
 
 TCL_ALL_EVENTS          = 0
 
@@ -34,14 +34,14 @@
 
         global demo_maker, demo_thrust, demo_num_engines
 
-        demo_maker = Tix.StringVar()
-        demo_thrust = Tix.DoubleVar()
-        demo_num_engines = Tix.IntVar()
+        demo_maker = tkinter.tix.StringVar()
+        demo_thrust = tkinter.tix.DoubleVar()
+        demo_num_engines = tkinter.tix.IntVar()
         demo_maker.set('P&W')
         demo_thrust.set(20000.0)
         demo_num_engines.set(2)
 
-        top = Tix.Frame(w, bd=1, relief=Tix.RAISED)
+        top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED)
 
         # $w.top.a allows only integer values
         #
@@ -49,16 +49,16 @@
         # [Hint] We set the label.width subwidget option of the Controls to
         #        be 16 so that their labels appear to be aligned.
         #
-        a = Tix.Control(top, label='Number of Engines: ', integer=1,
+        a = tkinter.tix.Control(top, label='Number of Engines: ', integer=1,
                         variable=demo_num_engines, min=1, max=4,
                         options='entry.width 10 label.width 20 label.anchor e')
 
-        b = Tix.Control(top, label='Thrust: ', integer=0,
+        b = tkinter.tix.Control(top, label='Thrust: ', integer=0,
                         min='10000.0', max='60000.0', step=500,
                         variable=demo_thrust,
                         options='entry.width 10 label.width 20 label.anchor e')
 
-        c = Tix.Control(top, label='Engine Maker: ', value='P&W',
+        c = tkinter.tix.Control(top, label='Engine Maker: ', value='P&W',
                         variable=demo_maker,
                         options='entry.width 10 label.width 20 label.anchor e')
 
@@ -68,17 +68,17 @@
         c['decrcmd'] = lambda w=c: adjust_maker(w, -1)
         c['validatecmd'] = lambda w=c: validate_maker(w)
 
-        a.pack(side=Tix.TOP, anchor=Tix.W)
-        b.pack(side=Tix.TOP, anchor=Tix.W)
-        c.pack(side=Tix.TOP, anchor=Tix.W)
+        a.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
+        b.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
+        c.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W)
 
-        box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
+        box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
         box.add('ok', text='Ok', underline=0, width=6,
                 command=self.okcmd)
         box.add('cancel', text='Cancel', underline=0, width=6,
                 command=self.quitcmd)
-        box.pack(side=Tix.BOTTOM, fill=Tix.X)
-        top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
+        box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
+        top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
 
     def okcmd (self):
         # tixDemo:Status "Selected %d of %s engines each of thrust %d", (demo_num_engines.get(), demo_maker.get(), demo_thrust.get())
@@ -118,5 +118,5 @@
     return maker_list[i]
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)

Modified: python/branches/py3k-issue1717/Demo/tix/samples/DirList.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/DirList.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/DirList.py	Sun Jan 25 21:08:20 2009
@@ -16,8 +16,8 @@
 # installation directory for an application.
 #
 
-import Tix, os, copy
-from Tkconstants import *
+import tkinter.tix, os, copy
+from tkinter.constants import *
 
 TCL_ALL_EVENTS          = 0
 
@@ -40,25 +40,25 @@
         # bg = root.tk.eval('tix option get bg')
         # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0
 
-        top = Tix.Frame( w, relief=RAISED, bd=1)
+        top = tkinter.tix.Frame( w, relief=RAISED, bd=1)
 
         # Create the DirList widget. By default it will show the current
         # directory
         #
         #
-        top.dir = Tix.DirList(top)
+        top.dir = tkinter.tix.DirList(top)
         top.dir.hlist['width'] = 40
 
         # When the user presses the ".." button, the selected directory
         # is "transferred" into the entry widget
         #
-        top.btn = Tix.Button(top, text = "  >>  ", pady = 0)
+        top.btn = tkinter.tix.Button(top, text = "  >>  ", pady = 0)
 
         # We use a LabelEntry to hold the installation directory. The user
         # can choose from the DirList widget, or he can type in the directory
         # manually
         #
-        top.ent = Tix.LabelEntry(top, label="Installation Directory:",
+        top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:",
                                   labelside = 'top',
                                   options = '''
                                   entry.width 40
@@ -85,7 +85,7 @@
 
         # Use a ButtonBox to hold the buttons.
         #
-        box = Tix.ButtonBox (w, orientation='horizontal')
+        box = tkinter.tix.ButtonBox (w, orientation='horizontal')
         box.add ('ok', text='Ok', underline=0, width=6,
                      command = lambda self=self: self.okcmd () )
         box.add ('cancel', text='Cancel', underline=0, width=6,
@@ -118,14 +118,14 @@
 # outside of the main demo program "tixwidgets.py".
 #
 if __name__== '__main__' :
-    import tkMessageBox, traceback
+    import tkinter.messagebox, traceback
 
     try:
-        root=Tix.Tk()
+        root=tkinter.tix.Tk()
         RunSample(root)
     except:
         t, v, tb = sys.exc_info()
         text = "Error running the demo script:\n"
         for line in traceback.format_exception(t,v,tb):
             text = text + line + '\n'
-            d = tkMessageBox.showerror ( 'Tix Demo Error', text)
+            d = tkinter.messagebox.showerror ( 'Tix Demo Error', text)

Modified: python/branches/py3k-issue1717/Demo/tix/samples/DirTree.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/DirTree.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/DirTree.py	Sun Jan 25 21:08:20 2009
@@ -16,8 +16,8 @@
 # installation directory for an application.
 #
 
-import Tix, os, copy
-from Tkconstants import *
+import tkinter.tix, os, copy
+from tkinter.constants import *
 
 TCL_ALL_EVENTS          = 0
 
@@ -40,25 +40,25 @@
         # bg = root.tk.eval('tix option get bg')
         # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0
 
-        top = Tix.Frame( w, relief=RAISED, bd=1)
+        top = tkinter.tix.Frame( w, relief=RAISED, bd=1)
 
         # Create the DirTree widget. By default it will show the current
         # directory
         #
         #
-        top.dir = Tix.DirTree(top)
+        top.dir = tkinter.tix.DirTree(top)
         top.dir.hlist['width'] = 40
 
         # When the user presses the ".." button, the selected directory
         # is "transferred" into the entry widget
         #
-        top.btn = Tix.Button(top, text = "  >>  ", pady = 0)
+        top.btn = tkinter.tix.Button(top, text = "  >>  ", pady = 0)
 
         # We use a LabelEntry to hold the installation directory. The user
         # can choose from the DirTree widget, or he can type in the directory
         # manually
         #
-        top.ent = Tix.LabelEntry(top, label="Installation Directory:",
+        top.ent = tkinter.tix.LabelEntry(top, label="Installation Directory:",
                                   labelside = 'top',
                                   options = '''
                                   entry.width 40
@@ -79,7 +79,7 @@
 
         # Use a ButtonBox to hold the buttons.
         #
-        box = Tix.ButtonBox (w, orientation='horizontal')
+        box = tkinter.tix.ButtonBox (w, orientation='horizontal')
         box.add ('ok', text='Ok', underline=0, width=6,
                      command = lambda self=self: self.okcmd () )
         box.add ('cancel', text='Cancel', underline=0, width=6,
@@ -113,5 +113,5 @@
 # outside of the main demo program "tixwidgets.py".
 #
 if __name__== '__main__' :
-    root=Tix.Tk()
+    root=tkinter.tix.Tk()
     RunSample(root)

Modified: python/branches/py3k-issue1717/Demo/tix/samples/NoteBook.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/NoteBook.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/NoteBook.py	Sun Jan 25 21:08:20 2009
@@ -13,7 +13,7 @@
 # This file demonstrates the use of the tixNoteBook widget, which allows
 # you to lay out your interface using a "notebook" metaphore
 #
-import Tix
+import tkinter.tix
 
 def RunSample(w):
     global root
@@ -21,20 +21,20 @@
 
     # We use these options to set the sizes of the subwidgets inside the
     # notebook, so that they are well-aligned on the screen.
-    prefix = Tix.OptionName(w)
+    prefix = tkinter.tix.OptionName(w)
     if prefix:
         prefix = '*'+prefix
     else:
         prefix = ''
     w.option_add(prefix+'*TixControl*entry.width', 10)
     w.option_add(prefix+'*TixControl*label.width', 18)
-    w.option_add(prefix+'*TixControl*label.anchor', Tix.E)
+    w.option_add(prefix+'*TixControl*label.anchor', tkinter.tix.E)
     w.option_add(prefix+'*TixNoteBook*tagPadX', 8)
 
     # Create the notebook widget and set its backpagecolor to gray.
     # Note that the -backpagecolor option belongs to the "nbframe"
     # subwidget.
-    nb = Tix.NoteBook(w, name='nb', ipadx=6, ipady=6)
+    nb = tkinter.tix.NoteBook(w, name='nb', ipadx=6, ipady=6)
     nb['bg'] = 'gray'
     nb.nbframe['backpagecolor'] = 'gray'
 
@@ -45,7 +45,7 @@
     nb.add('hard_disk', label="Hard Disk", underline=0)
     nb.add('network', label="Network", underline=0)
 
-    nb.pack(expand=1, fill=Tix.BOTH, padx=5, pady=5 ,side=Tix.TOP)
+    nb.pack(expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5 ,side=tkinter.tix.TOP)
 
     #----------------------------------------
     # Create the first page
@@ -54,21 +54,21 @@
     # other widgets
     #
     tab=nb.hard_disk
-    f = Tix.Frame(tab)
-    common = Tix.Frame(tab)
+    f = tkinter.tix.Frame(tab)
+    common = tkinter.tix.Frame(tab)
 
-    f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1)
-    common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y)
+    f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1)
+    common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y)
 
-    a = Tix.Control(f, value=12,   label='Access time: ')
-    w = Tix.Control(f, value=400,  label='Write Throughput: ')
-    r = Tix.Control(f, value=400,  label='Read Throughput: ')
-    c = Tix.Control(f, value=1021, label='Capacity: ')
-
-    a.pack(side=Tix.TOP, padx=20, pady=2)
-    w.pack(side=Tix.TOP, padx=20, pady=2)
-    r.pack(side=Tix.TOP, padx=20, pady=2)
-    c.pack(side=Tix.TOP, padx=20, pady=2)
+    a = tkinter.tix.Control(f, value=12,   label='Access time: ')
+    w = tkinter.tix.Control(f, value=400,  label='Write Throughput: ')
+    r = tkinter.tix.Control(f, value=400,  label='Read Throughput: ')
+    c = tkinter.tix.Control(f, value=1021, label='Capacity: ')
+
+    a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
 
     # Create the common buttons
     createCommonButtons(common)
@@ -79,23 +79,23 @@
 
     tab = nb.network
 
-    f = Tix.Frame(tab)
-    common = Tix.Frame(tab)
+    f = tkinter.tix.Frame(tab)
+    common = tkinter.tix.Frame(tab)
 
-    f.pack(side=Tix.LEFT, padx=2, pady=2, fill=Tix.BOTH, expand=1)
-    common.pack(side=Tix.RIGHT, padx=2, fill=Tix.Y)
+    f.pack(side=tkinter.tix.LEFT, padx=2, pady=2, fill=tkinter.tix.BOTH, expand=1)
+    common.pack(side=tkinter.tix.RIGHT, padx=2, fill=tkinter.tix.Y)
 
-    a = Tix.Control(f, value=12,   label='Access time: ')
-    w = Tix.Control(f, value=400,  label='Write Throughput: ')
-    r = Tix.Control(f, value=400,  label='Read Throughput: ')
-    c = Tix.Control(f, value=1021, label='Capacity: ')
-    u = Tix.Control(f, value=10,   label='Users: ')
-
-    a.pack(side=Tix.TOP, padx=20, pady=2)
-    w.pack(side=Tix.TOP, padx=20, pady=2)
-    r.pack(side=Tix.TOP, padx=20, pady=2)
-    c.pack(side=Tix.TOP, padx=20, pady=2)
-    u.pack(side=Tix.TOP, padx=20, pady=2)
+    a = tkinter.tix.Control(f, value=12,   label='Access time: ')
+    w = tkinter.tix.Control(f, value=400,  label='Write Throughput: ')
+    r = tkinter.tix.Control(f, value=400,  label='Read Throughput: ')
+    c = tkinter.tix.Control(f, value=1021, label='Capacity: ')
+    u = tkinter.tix.Control(f, value=10,   label='Users: ')
+
+    a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    u.pack(side=tkinter.tix.TOP, padx=20, pady=2)
 
     createCommonButtons(common)
 
@@ -104,16 +104,16 @@
     root.destroy()
 
 def createCommonButtons(master):
-    ok = Tix.Button(master, name='ok', text='OK', width=6,
+    ok = tkinter.tix.Button(master, name='ok', text='OK', width=6,
                 command=doDestroy)
-    cancel = Tix.Button(master, name='cancel',
+    cancel = tkinter.tix.Button(master, name='cancel',
                     text='Cancel', width=6,
                     command=doDestroy)
 
-    ok.pack(side=Tix.TOP, padx=2, pady=2)
-    cancel.pack(side=Tix.TOP, padx=2, pady=2)
+    ok.pack(side=tkinter.tix.TOP, padx=2, pady=2)
+    cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2)
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)
     root.mainloop()

Modified: python/branches/py3k-issue1717/Demo/tix/samples/OptMenu.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/OptMenu.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/OptMenu.py	Sun Jan 25 21:08:20 2009
@@ -13,7 +13,7 @@
 # This file demonstrates the use of the tixOptionMenu widget -- you can
 # use it for the user to choose from a fixed set of options
 #
-import Tix
+import tkinter.tix
 
 options = {'text':'Plain Text', 'post':'PostScript', 'html':'HTML',
            'tex':'LaTeX', 'rtf':'Rich Text Format'}
@@ -21,16 +21,16 @@
 def RunSample(w):
     global demo_opt_from, demo_opt_to
 
-    demo_opt_from = Tix.StringVar()
-    demo_opt_to = Tix.StringVar()
+    demo_opt_from = tkinter.tix.StringVar()
+    demo_opt_to = tkinter.tix.StringVar()
 
-    top = Tix.Frame(w, bd=1, relief=Tix.RAISED)
+    top = tkinter.tix.Frame(w, bd=1, relief=tkinter.tix.RAISED)
 
-    from_file = Tix.OptionMenu(top, label="From File Format : ",
+    from_file = tkinter.tix.OptionMenu(top, label="From File Format : ",
                                variable=demo_opt_from,
                                options = 'label.width  19 label.anchor e menubutton.width 15')
 
-    to_file = Tix.OptionMenu(top, label="To File Format : ",
+    to_file = tkinter.tix.OptionMenu(top, label="To File Format : ",
                              variable=demo_opt_to,
                              options='label.width  19 label.anchor e menubutton.width 15')
 
@@ -47,22 +47,22 @@
     demo_opt_from.set('html')
     demo_opt_to.set('post')
 
-    from_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6)
-    to_file.pack(side=Tix.TOP, anchor=Tix.W, pady=3, padx=6)
+    from_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6)
+    to_file.pack(side=tkinter.tix.TOP, anchor=tkinter.tix.W, pady=3, padx=6)
 
-    box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
+    box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
     box.add('ok', text='Ok', underline=0, width=6,
             command=lambda w=w: ok_command(w))
     box.add('cancel', text='Cancel', underline=0, width=6,
             command=lambda w=w: w.destroy())
-    box.pack(side=Tix.BOTTOM, fill=Tix.X)
-    top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
+    box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
+    top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
 
 def ok_command(w):
     # tixDemo:Status "Convert file from %s to %s" % ( demo_opt_from.get(), demo_opt_to.get())
     w.destroy()
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)
     root.mainloop()

Modified: python/branches/py3k-issue1717/Demo/tix/samples/PanedWin.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/PanedWin.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/PanedWin.py	Sun Jan 25 21:08:20 2009
@@ -15,7 +15,7 @@
 # of artical names and the size of the text widget that shows the body
 # of the article.
 
-import Tix
+import tkinter.tix
 
 TCL_ALL_EVENTS          = 0
 
@@ -32,30 +32,30 @@
         z = w.winfo_toplevel()
         z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
 
-        group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25')
+        group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25')
         group.entry.insert(0,'comp.lang.python')
-        pane = Tix.PanedWindow(w, orientation='vertical')
+        pane = tkinter.tix.PanedWindow(w, orientation='vertical')
 
         p1 = pane.add('list', min=70, size=100)
         p2 = pane.add('text', min=70)
-        list = Tix.ScrolledListBox(p1)
+        list = tkinter.tix.ScrolledListBox(p1)
         list.listbox['width'] = 80
         list.listbox['height'] = 5
-        text = Tix.ScrolledText(p2)
+        text = tkinter.tix.ScrolledText(p2)
         text.text['width'] = 80
         text.text['height'] = 20
 
-        list.listbox.insert(Tix.END, "  12324 Re: Tkinter is good for your health")
-        list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health")
-        list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)")
-        list.listbox.insert(Tix.END, "  12327 Re: Tix is even better for your health (Was: Tkinter is good...)")
-        list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)")
-        list.listbox.insert(Tix.END, "  12329 Re: Tix is even better for your health (Was: Tkinter is good...)")
-        list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)")
+        list.listbox.insert(tkinter.tix.END, "  12324 Re: Tkinter is good for your health")
+        list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health")
+        list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)")
+        list.listbox.insert(tkinter.tix.END, "  12327 Re: Tix is even better for your health (Was: Tkinter is good...)")
+        list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)")
+        list.listbox.insert(tkinter.tix.END, "  12329 Re: Tix is even better for your health (Was: Tkinter is good...)")
+        list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)")
 
         text.text['bg'] = list.listbox['bg']
         text.text['wrap'] = 'none'
-        text.text.insert(Tix.END, """
+        text.text.insert(tkinter.tix.END, """
     Mon, 19 Jun 1995 11:39:52        comp.lang.python              Thread   34 of  220
     Lines 353       A new way to put text and bitmaps together iNo responses
     ioi at blue.seas.upenn.edu                Ioi K. Lam at University of Pennsylvania
@@ -70,18 +70,18 @@
     """)
         text.text['state'] = 'disabled'
 
-        list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6)
-        text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6)
+        list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
+        text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
 
-        group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH)
-        pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1)
+        group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
+        pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1)
 
-        box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
+        box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
         box.add('ok', text='Ok', underline=0, width=6,
                 command=self.quitcmd)
         box.add('cancel', text='Cancel', underline=0, width=6,
                 command=self.quitcmd)
-        box.pack(side=Tix.BOTTOM, fill=Tix.X)
+        box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
 
     def quitcmd (self):
         self.exit = 0
@@ -94,5 +94,5 @@
         self.root.destroy()
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)

Modified: python/branches/py3k-issue1717/Demo/tix/samples/PopMenu.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/PopMenu.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/PopMenu.py	Sun Jan 25 21:08:20 2009
@@ -12,18 +12,18 @@
 
 # This file demonstrates the use of the tixPopupMenu widget.
 #
-import Tix
+import tkinter.tix
 
 def RunSample(w):
     # We create the frame and the button, then we'll bind the PopupMenu
     # to both widgets. The result is, when you press the right mouse
     # button over $w.top or $w.top.but, the PopupMenu will come up.
     #
-    top = Tix.Frame(w, relief=Tix.RAISED, bd=1)
-    but = Tix.Button(top, text='Press the right mouse button over this button or its surrounding area')
-    but.pack(expand=1, fill=Tix.BOTH, padx=50, pady=50)
+    top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1)
+    but = tkinter.tix.Button(top, text='Press the right mouse button over this button or its surrounding area')
+    but.pack(expand=1, fill=tkinter.tix.BOTH, padx=50, pady=50)
 
-    p = Tix.PopupMenu(top, title='Popup Test')
+    p = tkinter.tix.PopupMenu(top, title='Popup Test')
     p.bind_widget(top)
     p.bind_widget(but)
 
@@ -37,21 +37,21 @@
     p.menu.add_command(label='Find', underline=0)
     p.menu.add_command(label='System', underline=1)
     p.menu.add_command(label='Help', underline=0)
-    m1 = Tix.Menu(p.menu)
+    m1 = tkinter.tix.Menu(p.menu)
     m1.add_command(label='Hello')
     p.menu.add_cascade(label='More', menu=m1)
 
-    but.pack(side=Tix.TOP, padx=40, pady=50)
+    but.pack(side=tkinter.tix.TOP, padx=40, pady=50)
 
-    box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
+    box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
     box.add('ok', text='Ok', underline=0, width=6,
             command=lambda w=w: w.destroy())
     box.add('cancel', text='Cancel', underline=0, width=6,
             command=lambda w=w: w.destroy())
-    box.pack(side=Tix.BOTTOM, fill=Tix.X)
-    top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
+    box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
+    top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)
     root.mainloop()

Modified: python/branches/py3k-issue1717/Demo/tix/samples/SHList1.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/SHList1.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/SHList1.py	Sun Jan 25 21:08:20 2009
@@ -13,7 +13,7 @@
 # This file demonstrates the use of the tixScrolledHList widget.
 #
 
-import Tix
+import tkinter.tix
 
 TCL_ALL_EVENTS          = 0
 
@@ -33,13 +33,13 @@
         # We create the frame and the ScrolledHList widget
         # at the top of the dialog box
         #
-        top = Tix.Frame( w, relief=Tix.RAISED, bd=1)
+        top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1)
 
         # Put a simple hierachy into the HList (two levels). Use colors and
         # separator widgets (frames) to make the list look fancy
         #
-        top.a = Tix.ScrolledHList(top)
-        top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP)
+        top.a = tkinter.tix.ScrolledHList(top)
+        top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP)
 
         # This is our little relational database
         #
@@ -68,13 +68,13 @@
         count=0
         for boss,name in bosses :
             if count :
-                f=Tix.Frame(hlist, name='sep%d' % count, height=2, width=150,
-                    bd=2, relief=Tix.SUNKEN )
+                f=tkinter.tix.Frame(hlist, name='sep%d' % count, height=2, width=150,
+                    bd=2, relief=tkinter.tix.SUNKEN )
 
-                hlist.add_child( itemtype=Tix.WINDOW,
-                    window=f, state=Tix.DISABLED )
+                hlist.add_child( itemtype=tkinter.tix.WINDOW,
+                    window=f, state=tkinter.tix.DISABLED )
 
-            hlist.add(boss, itemtype=Tix.TEXT, text=name)
+            hlist.add(boss, itemtype=tkinter.tix.TEXT, text=name)
             count = count+1
 
 
@@ -99,15 +99,15 @@
 
         # Use a ButtonBox to hold the buttons.
         #
-        box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL )
+        box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL )
         box.add( 'ok',  text='Ok', underline=0,  width=6,
             command = self.okcmd)
 
         box.add( 'cancel', text='Cancel', underline=0, width=6,
             command = self.quitcmd)
 
-        box.pack( side=Tix.BOTTOM, fill=Tix.X)
-        top.pack( side=Tix.TOP,    fill=Tix.BOTH, expand=1 )
+        box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
+        top.pack( side=tkinter.tix.TOP,    fill=tkinter.tix.BOTH, expand=1 )
 
     def okcmd (self):
         self.quitcmd()
@@ -127,5 +127,5 @@
 # outside of the main demo program "tixwidgets.py".
 #
 if __name__== '__main__' :
-    root=Tix.Tk()
+    root=tkinter.tix.Tk()
     RunSample(root)

Modified: python/branches/py3k-issue1717/Demo/tix/samples/SHList2.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/SHList2.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/SHList2.py	Sun Jan 25 21:08:20 2009
@@ -16,7 +16,7 @@
 # In a tixHList widget, you can have one ore more columns.
 #
 
-import Tix
+import tkinter.tix
 
 TCL_ALL_EVENTS          = 0
 
@@ -36,13 +36,13 @@
         # We create the frame and the ScrolledHList widget
         # at the top of the dialog box
         #
-        top = Tix.Frame( w, relief=Tix.RAISED, bd=1)
+        top = tkinter.tix.Frame( w, relief=tkinter.tix.RAISED, bd=1)
 
         # Put a simple hierachy into the HList (two levels). Use colors and
         # separator widgets (frames) to make the list look fancy
         #
-        top.a = Tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' )
-        top.a.pack( expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.TOP)
+        top.a = tkinter.tix.ScrolledHList(top, options='hlist.columns 3 hlist.header 1' )
+        top.a.pack( expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.TOP)
 
         hlist=top.a.hlist
 
@@ -55,12 +55,12 @@
 
         # First some styles for the headers
         style={}
-        style['header'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist,
-            anchor=Tix.CENTER, padx=8, pady=2, font = boldfont )
+        style['header'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist,
+            anchor=tkinter.tix.CENTER, padx=8, pady=2, font = boldfont )
 
-        hlist.header_create(0, itemtype=Tix.TEXT, text='Name',
+        hlist.header_create(0, itemtype=tkinter.tix.TEXT, text='Name',
             style=style['header'])
-        hlist.header_create(1, itemtype=Tix.TEXT, text='Position',
+        hlist.header_create(1, itemtype=tkinter.tix.TEXT, text='Position',
             style=style['header'])
 
         # Notice that we use 3 columns in the hlist widget. This way when the user
@@ -90,13 +90,13 @@
             ('chuck', 'jeff',       'Chuck McLean',             'Cleaner')
         ]
 
-        style['mgr_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist)
+        style['mgr_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist)
 
-        style['mgr_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist)
+        style['mgr_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist)
 
-        style['empl_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=hlist)
+        style['empl_name'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, refwindow=hlist)
 
-        style['empl_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=hlist)
+        style['empl_posn'] = tkinter.tix.DisplayStyle(tkinter.tix.TEXT, padx=8, refwindow=hlist)
 
         # Let configure the appearance of the HList subwidget
         #
@@ -105,9 +105,9 @@
 
         # Create the boss
         #
-        hlist.add ('.',           itemtype=Tix.TEXT, text=boss[1],
+        hlist.add ('.',           itemtype=tkinter.tix.TEXT, text=boss[1],
             style=style['mgr_name'])
-        hlist.item_create('.', 1, itemtype=Tix.TEXT, text=boss[2],
+        hlist.item_create('.', 1, itemtype=tkinter.tix.TEXT, text=boss[2],
             style=style['mgr_posn'])
 
         # Create the managers
@@ -115,9 +115,9 @@
 
         for key,name,posn in managers :
             e= '.'+ key
-            hlist.add(e, itemtype=Tix.TEXT, text=name,
+            hlist.add(e, itemtype=tkinter.tix.TEXT, text=name,
                 style=style['mgr_name'])
-            hlist.item_create(e, 1, itemtype=Tix.TEXT, text=posn,
+            hlist.item_create(e, 1, itemtype=tkinter.tix.TEXT, text=posn,
                 style=style['mgr_posn'])
 
 
@@ -130,21 +130,21 @@
             #       parent entryPath / child's name
 
             hlist.add(entrypath, text=name, style=style['empl_name'])
-            hlist.item_create(entrypath, 1, itemtype=Tix.TEXT,
+            hlist.item_create(entrypath, 1, itemtype=tkinter.tix.TEXT,
                 text = posn, style = style['empl_posn'] )
 
 
         # Use a ButtonBox to hold the buttons.
         #
-        box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL )
+        box= tkinter.tix.ButtonBox(top, orientation=tkinter.tix.HORIZONTAL )
         box.add( 'ok',  text='Ok', underline=0,  width=6,
             command = self.okcmd )
 
         box.add( 'cancel', text='Cancel', underline=0, width=6,
             command = self.quitcmd )
 
-        box.pack( side=Tix.BOTTOM, fill=Tix.X)
-        top.pack( side=Tix.TOP,    fill=Tix.BOTH, expand=1 )
+        box.pack( side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
+        top.pack( side=tkinter.tix.TOP,    fill=tkinter.tix.BOTH, expand=1 )
 
     def okcmd (self):
         self.quitcmd()
@@ -164,5 +164,5 @@
 # outside of the main demo program "tixwidgets.py".
 #
 if __name__== '__main__' :
-    root=Tix.Tk()
+    root=tkinter.tix.Tk()
     RunSample(root)

Modified: python/branches/py3k-issue1717/Demo/tix/samples/Tree.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/samples/Tree.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/samples/Tree.py	Sun Jan 25 21:08:20 2009
@@ -14,30 +14,30 @@
 # dynamic hierachical data (the files in the Unix file system)
 #
 
-import Tix, os
+import tkinter.tix, os
 
 def RunSample(w):
-    top = Tix.Frame(w, relief=Tix.RAISED, bd=1)
-    tree = Tix.Tree(top, options='separator "/"')
-    tree.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.LEFT)
+    top = tkinter.tix.Frame(w, relief=tkinter.tix.RAISED, bd=1)
+    tree = tkinter.tix.Tree(top, options='separator "/"')
+    tree.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10, side=tkinter.tix.LEFT)
     tree['opencmd'] = lambda dir=None, w=tree: opendir(w, dir)
 
     # The / directory is added in the "open" mode. The user can open it
     # and then browse its subdirectories ...
     adddir(tree, "/")
 
-    box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL)
+    box = tkinter.tix.ButtonBox(w, orientation=tkinter.tix.HORIZONTAL)
     box.add('ok', text='Ok', underline=0, command=w.destroy, width=6)
     box.add('cancel', text='Cancel', underline=0, command=w.destroy, width=6)
-    box.pack(side=Tix.BOTTOM, fill=Tix.X)
-    top.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1)
+    box.pack(side=tkinter.tix.BOTTOM, fill=tkinter.tix.X)
+    top.pack(side=tkinter.tix.TOP, fill=tkinter.tix.BOTH, expand=1)
 
 def adddir(tree, dir):
     if dir == '/':
         text = '/'
     else:
         text = os.path.basename(dir)
-    tree.hlist.add(dir, itemtype=Tix.IMAGETEXT, text=text,
+    tree.hlist.add(dir, itemtype=tkinter.tix.IMAGETEXT, text=text,
                    image=tree.tk.call('tix', 'getimage', 'folder'))
     try:
         os.listdir(dir)
@@ -71,10 +71,10 @@
         if os.path.isdir(dir + '/' + file):
             adddir(tree, dir + '/' + file)
         else:
-            tree.hlist.add(dir + '/' + file, itemtype=Tix.IMAGETEXT, text=file,
+            tree.hlist.add(dir + '/' + file, itemtype=tkinter.tix.IMAGETEXT, text=file,
                            image=tree.tk.call('tix', 'getimage', 'file'))
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunSample(root)
     root.mainloop()

Modified: python/branches/py3k-issue1717/Demo/tix/tixwidgets.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tix/tixwidgets.py	(original)
+++ python/branches/py3k-issue1717/Demo/tix/tixwidgets.py	Sun Jan 25 21:08:20 2009
@@ -12,9 +12,9 @@
 #               % python tixwidgets.py
 #
 
-import os, os.path, sys, Tix
-from Tkconstants import *
-import traceback, tkMessageBox
+import os, os.path, sys, tkinter.tix
+from tkinter.constants import *
+import traceback, tkinter.messagebox
 
 TCL_DONT_WAIT           = 1<<1
 TCL_WINDOW_EVENTS       = 1<<2
@@ -30,7 +30,7 @@
 
         self.dir = None                         # script directory
         self.balloon = None                     # balloon widget
-        self.useBalloons = Tix.StringVar()
+        self.useBalloons = tkinter.tix.StringVar()
         self.useBalloons.set('0')
         self.statusbar = None                   # status bar widget
         self.welmsg = None                      # Msg widget
@@ -56,14 +56,14 @@
 
     def MkMainMenu(self):
         top = self.root
-        w = Tix.Frame(top, bd=2, relief=RAISED)
-        file = Tix.Menubutton(w, text='File', underline=0, takefocus=0)
-        help = Tix.Menubutton(w, text='Help', underline=0, takefocus=0)
+        w = tkinter.tix.Frame(top, bd=2, relief=RAISED)
+        file = tkinter.tix.Menubutton(w, text='File', underline=0, takefocus=0)
+        help = tkinter.tix.Menubutton(w, text='Help', underline=0, takefocus=0)
         file.pack(side=LEFT)
         help.pack(side=RIGHT)
-        fm = Tix.Menu(file, tearoff=0)
+        fm = tkinter.tix.Menu(file, tearoff=0)
         file['menu'] = fm
-        hm = Tix.Menu(help, tearoff=0)
+        hm = tkinter.tix.Menu(help, tearoff=0)
         help['menu'] = hm
 
         fm.add_command(label='Exit', underline=1,
@@ -77,7 +77,7 @@
 
     def MkMainNotebook(self):
         top = self.root
-        w = Tix.NoteBook(top, ipadx=5, ipady=5, options="""
+        w = tkinter.tix.NoteBook(top, ipadx=5, ipady=5, options="""
         tagPadX 6
         tagPadY 4
         borderWidth 2
@@ -103,8 +103,8 @@
         global demo
         top = self.root
 
-        w = Tix.Frame(top, relief=Tix.RAISED, bd=1)
-        demo.statusbar = Tix.Label(w, relief=Tix.SUNKEN, bd=1)
+        w = tkinter.tix.Frame(top, relief=tkinter.tix.RAISED, bd=1)
+        demo.statusbar = tkinter.tix.Label(w, relief=tkinter.tix.SUNKEN, bd=1)
         demo.statusbar.form(padx=3, pady=3, left=0, right='%70')
         return w
 
@@ -116,7 +116,7 @@
             z.geometry('790x590+10+10')
         else:
             z.geometry('890x640+10+10')
-        demo.balloon = Tix.Balloon(root)
+        demo.balloon = tkinter.tix.Balloon(root)
         frame1 = self.MkMainMenu()
         frame2 = self.MkMainNotebook()
         frame3 = self.MkMainStatus()
@@ -152,7 +152,7 @@
                 self.exit = 1
                 return
             except KeyboardInterrupt:
-                if tkMessageBox.askquestion ('Interrupt', 'Really Quit?') == 'yes':
+                if tkinter.messagebox.askquestion ('Interrupt', 'Really Quit?') == 'yes':
                     # self.tk.eval('exit')
                     self.exit = 1
                     return
@@ -163,7 +163,7 @@
                 text = ""
                 for line in traceback.format_exception(t,v,tb):
                     text += line + '\n'
-                try: tkMessageBox.showerror ('Error', text)
+                try: tkinter.messagebox.showerror ('Error', text)
                 except: pass
                 self.exit = 1
                 raise SystemExit(1)
@@ -191,9 +191,9 @@
 def MkWelcomeBar(top):
     global demo
 
-    w = Tix.Frame(top, bd=2, relief=Tix.GROOVE)
-    b1 = Tix.ComboBox(w, command=lambda w=top: MainTextFont(w))
-    b2 = Tix.ComboBox(w, command=lambda w=top: MainTextFont(w))
+    w = tkinter.tix.Frame(top, bd=2, relief=tkinter.tix.GROOVE)
+    b1 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w))
+    b2 = tkinter.tix.ComboBox(w, command=lambda w=top: MainTextFont(w))
     b1.entry['width'] = 15
     b1.slistbox.listbox['height'] = 3
     b2.entry['width'] = 4
@@ -202,22 +202,22 @@
     demo.welfont = b1
     demo.welsize = b2
 
-    b1.insert(Tix.END, 'Courier')
-    b1.insert(Tix.END, 'Helvetica')
-    b1.insert(Tix.END, 'Lucida')
-    b1.insert(Tix.END, 'Times Roman')
-
-    b2.insert(Tix.END, '8')
-    b2.insert(Tix.END, '10')
-    b2.insert(Tix.END, '12')
-    b2.insert(Tix.END, '14')
-    b2.insert(Tix.END, '18')
+    b1.insert(tkinter.tix.END, 'Courier')
+    b1.insert(tkinter.tix.END, 'Helvetica')
+    b1.insert(tkinter.tix.END, 'Lucida')
+    b1.insert(tkinter.tix.END, 'Times Roman')
+
+    b2.insert(tkinter.tix.END, '8')
+    b2.insert(tkinter.tix.END, '10')
+    b2.insert(tkinter.tix.END, '12')
+    b2.insert(tkinter.tix.END, '14')
+    b2.insert(tkinter.tix.END, '18')
 
     b1.pick(1)
     b2.pick(3)
 
-    b1.pack(side=Tix.LEFT, padx=4, pady=4)
-    b2.pack(side=Tix.LEFT, padx=4, pady=4)
+    b1.pack(side=tkinter.tix.LEFT, padx=4, pady=4)
+    b2.pack(side=tkinter.tix.LEFT, padx=4, pady=4)
 
     demo.balloon.bind_widget(b1, msg='Choose\na font',
                              statusmsg='Choose a font for this page')
@@ -228,20 +228,20 @@
 def MkWelcomeText(top):
     global demo
 
-    w = Tix.ScrolledWindow(top, scrollbar='auto')
+    w = tkinter.tix.ScrolledWindow(top, scrollbar='auto')
     win = w.window
     text = 'Welcome to TIX in Python'
-    title = Tix.Label(win,
-                      bd=0, width=30, anchor=Tix.N, text=text)
-    msg = Tix.Message(win,
-                      bd=0, width=400, anchor=Tix.N,
+    title = tkinter.tix.Label(win,
+                      bd=0, width=30, anchor=tkinter.tix.N, text=text)
+    msg = tkinter.tix.Message(win,
+                      bd=0, width=400, anchor=tkinter.tix.N,
                       text='Tix is a set of mega-widgets based on TK. This program \
 demonstrates the widgets in the Tix widget set. You can choose the pages \
 in this window to look at the corresponding widgets. \n\n\
 To quit this program, choose the "File | Exit" command.\n\n\
 For more information, see http://tix.sourceforge.net.')
-    title.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10)
-    msg.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10)
+    title.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10)
+    msg.pack(expand=1, fill=tkinter.tix.BOTH, padx=10, pady=10)
     demo.welmsg = msg
     return w
 
@@ -267,14 +267,14 @@
     w = nb.page(name)
     options = "label.padX 4"
 
-    til = Tix.LabelFrame(w, label='Chooser Widgets', options=options)
-    cbx = Tix.LabelFrame(w, label='tixComboBox', options=options)
-    ctl = Tix.LabelFrame(w, label='tixControl', options=options)
-    sel = Tix.LabelFrame(w, label='tixSelect', options=options)
-    opt = Tix.LabelFrame(w, label='tixOptionMenu', options=options)
-    fil = Tix.LabelFrame(w, label='tixFileEntry', options=options)
-    fbx = Tix.LabelFrame(w, label='tixFileSelectBox', options=options)
-    tbr = Tix.LabelFrame(w, label='Tool Bar', options=options)
+    til = tkinter.tix.LabelFrame(w, label='Chooser Widgets', options=options)
+    cbx = tkinter.tix.LabelFrame(w, label='tixComboBox', options=options)
+    ctl = tkinter.tix.LabelFrame(w, label='tixControl', options=options)
+    sel = tkinter.tix.LabelFrame(w, label='tixSelect', options=options)
+    opt = tkinter.tix.LabelFrame(w, label='tixOptionMenu', options=options)
+    fil = tkinter.tix.LabelFrame(w, label='tixFileEntry', options=options)
+    fbx = tkinter.tix.LabelFrame(w, label='tixFileSelectBox', options=options)
+    tbr = tkinter.tix.LabelFrame(w, label='Tool Bar', options=options)
 
     MkTitle(til.frame)
     MkCombo(cbx.frame)
@@ -301,38 +301,38 @@
     fbx.form(right=-1, top=0, left='%66')
 
 def MkCombo(w):
-    options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 14)
+    options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 14)
 
-    static = Tix.ComboBox(w, label='Static', editable=0, options=options)
-    editable = Tix.ComboBox(w, label='Editable', editable=1, options=options)
-    history = Tix.ComboBox(w, label='History', editable=1, history=1,
-                           anchor=Tix.E, options=options)
-    static.insert(Tix.END, 'January')
-    static.insert(Tix.END, 'February')
-    static.insert(Tix.END, 'March')
-    static.insert(Tix.END, 'April')
-    static.insert(Tix.END, 'May')
-    static.insert(Tix.END, 'June')
-    static.insert(Tix.END, 'July')
-    static.insert(Tix.END, 'August')
-    static.insert(Tix.END, 'September')
-    static.insert(Tix.END, 'October')
-    static.insert(Tix.END, 'November')
-    static.insert(Tix.END, 'December')
-
-    editable.insert(Tix.END, 'Angola')
-    editable.insert(Tix.END, 'Bangladesh')
-    editable.insert(Tix.END, 'China')
-    editable.insert(Tix.END, 'Denmark')
-    editable.insert(Tix.END, 'Ecuador')
-
-    history.insert(Tix.END, '/usr/bin/ksh')
-    history.insert(Tix.END, '/usr/local/lib/python')
-    history.insert(Tix.END, '/var/adm')
-
-    static.pack(side=Tix.TOP, padx=5, pady=3)
-    editable.pack(side=Tix.TOP, padx=5, pady=3)
-    history.pack(side=Tix.TOP, padx=5, pady=3)
+    static = tkinter.tix.ComboBox(w, label='Static', editable=0, options=options)
+    editable = tkinter.tix.ComboBox(w, label='Editable', editable=1, options=options)
+    history = tkinter.tix.ComboBox(w, label='History', editable=1, history=1,
+                           anchor=tkinter.tix.E, options=options)
+    static.insert(tkinter.tix.END, 'January')
+    static.insert(tkinter.tix.END, 'February')
+    static.insert(tkinter.tix.END, 'March')
+    static.insert(tkinter.tix.END, 'April')
+    static.insert(tkinter.tix.END, 'May')
+    static.insert(tkinter.tix.END, 'June')
+    static.insert(tkinter.tix.END, 'July')
+    static.insert(tkinter.tix.END, 'August')
+    static.insert(tkinter.tix.END, 'September')
+    static.insert(tkinter.tix.END, 'October')
+    static.insert(tkinter.tix.END, 'November')
+    static.insert(tkinter.tix.END, 'December')
+
+    editable.insert(tkinter.tix.END, 'Angola')
+    editable.insert(tkinter.tix.END, 'Bangladesh')
+    editable.insert(tkinter.tix.END, 'China')
+    editable.insert(tkinter.tix.END, 'Denmark')
+    editable.insert(tkinter.tix.END, 'Ecuador')
+
+    history.insert(tkinter.tix.END, '/usr/bin/ksh')
+    history.insert(tkinter.tix.END, '/usr/local/lib/python')
+    history.insert(tkinter.tix.END, '/var/adm')
+
+    static.pack(side=tkinter.tix.TOP, padx=5, pady=3)
+    editable.pack(side=tkinter.tix.TOP, padx=5, pady=3)
+    history.pack(side=tkinter.tix.TOP, padx=5, pady=3)
 
 states = ['Bengal', 'Delhi', 'Karnataka', 'Tamil Nadu']
 
@@ -359,30 +359,30 @@
 def MkControl(w):
     global demo_spintxt
 
-    options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 13)
+    options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 13)
 
-    demo_spintxt = Tix.StringVar()
+    demo_spintxt = tkinter.tix.StringVar()
     demo_spintxt.set(states[0])
-    simple = Tix.Control(w, label='Numbers', options=options)
-    spintxt = Tix.Control(w, label='States', variable=demo_spintxt,
+    simple = tkinter.tix.Control(w, label='Numbers', options=options)
+    spintxt = tkinter.tix.Control(w, label='States', variable=demo_spintxt,
                           options=options)
     spintxt['incrcmd'] = lambda w=spintxt: spin_cmd(w, 1)
     spintxt['decrcmd'] = lambda w=spintxt: spin_cmd(w, -1)
     spintxt['validatecmd'] = lambda w=spintxt: spin_validate(w)
 
-    simple.pack(side=Tix.TOP, padx=5, pady=3)
-    spintxt.pack(side=Tix.TOP, padx=5, pady=3)
+    simple.pack(side=tkinter.tix.TOP, padx=5, pady=3)
+    spintxt.pack(side=tkinter.tix.TOP, padx=5, pady=3)
 
 def MkSelect(w):
-    options = "label.anchor %s" % Tix.CENTER
+    options = "label.anchor %s" % tkinter.tix.CENTER
 
-    sel1 = Tix.Select(w, label='Mere Mortals', allowzero=1, radio=1,
-                      orientation=Tix.VERTICAL,
-                      labelside=Tix.TOP,
+    sel1 = tkinter.tix.Select(w, label='Mere Mortals', allowzero=1, radio=1,
+                      orientation=tkinter.tix.VERTICAL,
+                      labelside=tkinter.tix.TOP,
                       options=options)
-    sel2 = Tix.Select(w, label='Geeks', allowzero=1, radio=0,
-                      orientation=Tix.VERTICAL,
-                      labelside= Tix.TOP,
+    sel2 = tkinter.tix.Select(w, label='Geeks', allowzero=1, radio=0,
+                      orientation=tkinter.tix.VERTICAL,
+                      labelside= tkinter.tix.TOP,
                       options=options)
 
     sel1.add('eat', text='Eat')
@@ -397,13 +397,13 @@
     sel2.add('prog3', text='Program')
     sel2.add('sleep', text='Sleep')
 
-    sel1.pack(side=Tix.LEFT, padx=5, pady=3, fill=Tix.X)
-    sel2.pack(side=Tix.LEFT, padx=5, pady=3, fill=Tix.X)
+    sel1.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X)
+    sel2.pack(side=tkinter.tix.LEFT, padx=5, pady=3, fill=tkinter.tix.X)
 
 def MkOptMenu(w):
-    options='menubutton.width 15 label.anchor %s' % Tix.E
+    options='menubutton.width 15 label.anchor %s' % tkinter.tix.E
 
-    m = Tix.OptionMenu(w, label='File Format : ', options=options)
+    m = tkinter.tix.OptionMenu(w, label='File Format : ', options=options)
     m.add_command('text', label='Plain Text')
     m.add_command('post', label='PostScript')
     m.add_command('format', label='Formatted Text')
@@ -412,27 +412,27 @@
     m.add_command('tex', label='LaTeX')
     m.add_command('rtf', label='Rich Text Format')
 
-    m.pack(fill=Tix.X, padx=5, pady=3)
+    m.pack(fill=tkinter.tix.X, padx=5, pady=3)
 
 def MkFileEnt(w):
-    msg = Tix.Message(w,
-                      relief=Tix.FLAT, width=240, anchor=Tix.N,
+    msg = tkinter.tix.Message(w,
+                      relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
                       text='Press the "open file" icon button and a TixFileSelectDialog will popup.')
-    ent = Tix.FileEntry(w, label='Select a file : ')
-    msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
-    ent.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3)
+    ent = tkinter.tix.FileEntry(w, label='Select a file : ')
+    msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
+    ent.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3)
 
 def MkFileBox(w):
     """The FileSelectBox is a Motif-style box with various enhancements.
     For example, you can adjust the size of the two listboxes
     and your past selections are recorded.
     """
-    msg = Tix.Message(w,
-                      relief=Tix.FLAT, width=240, anchor=Tix.N,
+    msg = tkinter.tix.Message(w,
+                      relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
                       text='The Tix FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded.')
-    box = Tix.FileSelectBox(w)
-    msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
-    box.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3)
+    box = tkinter.tix.FileSelectBox(w)
+    msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
+    box.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3)
 
 def MkToolBar(w):
     """The Select widget is also good for arranging buttons in a tool bar.
@@ -441,12 +441,12 @@
 
     options='frame.borderWidth 1'
 
-    msg = Tix.Message(w,
-                      relief=Tix.FLAT, width=240, anchor=Tix.N,
+    msg = tkinter.tix.Message(w,
+                      relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
                       text='The Select widget is also good for arranging buttons in a tool bar.')
-    bar = Tix.Frame(w, bd=2, relief=Tix.RAISED)
-    font = Tix.Select(w, allowzero=1, radio=0, label='', options=options)
-    para = Tix.Select(w, allowzero=0, radio=1, label='', options=options)
+    bar = tkinter.tix.Frame(w, bd=2, relief=tkinter.tix.RAISED)
+    font = tkinter.tix.Select(w, allowzero=1, radio=0, label='', options=options)
+    para = tkinter.tix.Select(w, allowzero=0, radio=1, label='', options=options)
 
     font.add('bold', bitmap='@' + demo.dir + '/bitmaps/bold.xbm')
     font.add('italic', bitmap='@' + demo.dir + '/bitmaps/italic.xbm')
@@ -458,24 +458,24 @@
     para.add('center', bitmap='@' + demo.dir + '/bitmaps/centerj.xbm')
     para.add('justify', bitmap='@' + demo.dir + '/bitmaps/justify.xbm')
 
-    msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
-    bar.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3)
-    font.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3)
-    para.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3)
+    msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
+    bar.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3)
+    font.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3)
+    para.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3)
 
 def MkTitle(w):
-    msg = Tix.Message(w,
-                      relief=Tix.FLAT, width=240, anchor=Tix.N,
+    msg = tkinter.tix.Message(w,
+                      relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
                       text='There are many types of "chooser" widgets that allow the user to input different types of information')
-    msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
+    msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
 
 def MkScroll(nb, name):
     w = nb.page(name)
     options='label.padX 4'
 
-    sls = Tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options)
-    swn = Tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options)
-    stx = Tix.LabelFrame(w, label='Tix.ScrolledText', options=options)
+    sls = tkinter.tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options)
+    swn = tkinter.tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options)
+    stx = tkinter.tix.LabelFrame(w, label='Tix.ScrolledText', options=options)
 
     MkSList(sls.frame)
     MkSWindow(swn.frame)
@@ -490,31 +490,31 @@
     """This TixScrolledListBox is configured so that it uses scrollbars
     only when it is necessary. Use the handles to resize the listbox and
     watch the scrollbars automatically appear and disappear.  """
-    top = Tix.Frame(w, width=300, height=330)
-    bot = Tix.Frame(w)
-    msg = Tix.Message(top,
-                      relief=Tix.FLAT, width=200, anchor=Tix.N,
+    top = tkinter.tix.Frame(w, width=300, height=330)
+    bot = tkinter.tix.Frame(w)
+    msg = tkinter.tix.Message(top,
+                      relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N,
                       text='This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear.')
 
-    list = Tix.ScrolledListBox(top, scrollbar='auto')
+    list = tkinter.tix.ScrolledListBox(top, scrollbar='auto')
     list.place(x=50, y=150, width=120, height=80)
-    list.listbox.insert(Tix.END, 'Alabama')
-    list.listbox.insert(Tix.END, 'California')
-    list.listbox.insert(Tix.END, 'Montana')
-    list.listbox.insert(Tix.END, 'New Jersey')
-    list.listbox.insert(Tix.END, 'New York')
-    list.listbox.insert(Tix.END, 'Pennsylvania')
-    list.listbox.insert(Tix.END, 'Washington')
+    list.listbox.insert(tkinter.tix.END, 'Alabama')
+    list.listbox.insert(tkinter.tix.END, 'California')
+    list.listbox.insert(tkinter.tix.END, 'Montana')
+    list.listbox.insert(tkinter.tix.END, 'New Jersey')
+    list.listbox.insert(tkinter.tix.END, 'New York')
+    list.listbox.insert(tkinter.tix.END, 'Pennsylvania')
+    list.listbox.insert(tkinter.tix.END, 'Washington')
 
-    rh = Tix.ResizeHandle(top, bg='black',
-                          relief=Tix.RAISED,
+    rh = tkinter.tix.ResizeHandle(top, bg='black',
+                          relief=tkinter.tix.RAISED,
                           handlesize=8, gridded=1, minwidth=50, minheight=30)
-    btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x))
+    btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x))
     top.propagate(0)
-    msg.pack(fill=Tix.X)
-    btn.pack(anchor=Tix.CENTER)
-    top.pack(expand=1, fill=Tix.BOTH)
-    bot.pack(fill=Tix.BOTH)
+    msg.pack(fill=tkinter.tix.X)
+    btn.pack(anchor=tkinter.tix.CENTER)
+    top.pack(expand=1, fill=tkinter.tix.BOTH)
+    bot.pack(fill=tkinter.tix.BOTH)
     list.bind('<Map>', func=lambda arg=0, rh=rh, list=list:
               list.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(list)))
 
@@ -535,29 +535,29 @@
     if not os.path.isfile(file):
         text += ' (Image missing)'
 
-    top = Tix.Frame(w, width=330, height=330)
-    bot = Tix.Frame(w)
-    msg = Tix.Message(top,
-                      relief=Tix.FLAT, width=200, anchor=Tix.N,
+    top = tkinter.tix.Frame(w, width=330, height=330)
+    bot = tkinter.tix.Frame(w)
+    msg = tkinter.tix.Message(top,
+                      relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N,
                       text=text)
 
-    win = Tix.ScrolledWindow(top, scrollbar='auto')
+    win = tkinter.tix.ScrolledWindow(top, scrollbar='auto')
 
     image1 = win.window.image_create('photo', file=file)
-    lbl = Tix.Label(win.window, image=image1)
-    lbl.pack(expand=1, fill=Tix.BOTH)
+    lbl = tkinter.tix.Label(win.window, image=image1)
+    lbl.pack(expand=1, fill=tkinter.tix.BOTH)
 
     win.place(x=30, y=150, width=190, height=120)
 
-    rh = Tix.ResizeHandle(top, bg='black',
-                          relief=Tix.RAISED,
+    rh = tkinter.tix.ResizeHandle(top, bg='black',
+                          relief=tkinter.tix.RAISED,
                           handlesize=8, gridded=1, minwidth=50, minheight=30)
-    btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x))
+    btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x))
     top.propagate(0)
-    msg.pack(fill=Tix.X)
-    btn.pack(anchor=Tix.CENTER)
-    top.pack(expand=1, fill=Tix.BOTH)
-    bot.pack(fill=Tix.BOTH)
+    msg.pack(fill=tkinter.tix.X)
+    btn.pack(anchor=tkinter.tix.CENTER)
+    top.pack(expand=1, fill=tkinter.tix.BOTH)
+    bot.pack(fill=tkinter.tix.BOTH)
 
     win.bind('<Map>', func=lambda arg=0, rh=rh, win=win:
              win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win)))
@@ -570,15 +570,15 @@
 def MkSText(w):
     """The TixScrolledWindow widget allows you to scroll any kind of Tk
     widget. It is more versatile than a scrolled canvas widget."""
-    top = Tix.Frame(w, width=330, height=330)
-    bot = Tix.Frame(w)
-    msg = Tix.Message(top,
-                      relief=Tix.FLAT, width=200, anchor=Tix.N,
+    top = tkinter.tix.Frame(w, width=330, height=330)
+    bot = tkinter.tix.Frame(w)
+    msg = tkinter.tix.Message(top,
+                      relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N,
                       text='The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.')
 
-    win = Tix.ScrolledText(top, scrollbar='auto')
+    win = tkinter.tix.ScrolledText(top, scrollbar='auto')
     win.text['wrap'] = 'none'
-    win.text.insert(Tix.END, '''When -scrollbar is set to "auto", the
+    win.text.insert(tkinter.tix.END, '''When -scrollbar is set to "auto", the
 scrollbars are shown only when needed.
 Additional modifiers can be used to force a
 scrollbar to be shown or hidden. For example,
@@ -591,15 +591,15 @@
 )
     win.place(x=30, y=150, width=190, height=100)
 
-    rh = Tix.ResizeHandle(top, bg='black',
-                          relief=Tix.RAISED,
+    rh = tkinter.tix.ResizeHandle(top, bg='black',
+                          relief=tkinter.tix.RAISED,
                           handlesize=8, gridded=1, minwidth=50, minheight=30)
-    btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SText_reset(w,x))
+    btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SText_reset(w,x))
     top.propagate(0)
-    msg.pack(fill=Tix.X)
-    btn.pack(anchor=Tix.CENTER)
-    top.pack(expand=1, fill=Tix.BOTH)
-    bot.pack(fill=Tix.BOTH)
+    msg.pack(fill=tkinter.tix.X)
+    btn.pack(anchor=tkinter.tix.CENTER)
+    top.pack(expand=1, fill=tkinter.tix.BOTH)
+    bot.pack(fill=tkinter.tix.BOTH)
     win.bind('<Map>', func=lambda arg=0, rh=rh, win=win:
              win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win)))
 
@@ -612,8 +612,8 @@
     w = nb.page(name)
     options='label.padX 4'
 
-    pane = Tix.LabelFrame(w, label='Tix.PanedWindow', options=options)
-    note = Tix.LabelFrame(w, label='Tix.NoteBook', options=options)
+    pane = tkinter.tix.LabelFrame(w, label='Tix.PanedWindow', options=options)
+    note = tkinter.tix.LabelFrame(w, label='Tix.NoteBook', options=options)
 
     MkPanedWindow(pane.frame)
     MkNoteBook(note.frame)
@@ -626,29 +626,29 @@
     the sizes of several panes. The panes can be arranged either vertically
     or horizontally.
     """
-    msg = Tix.Message(w,
-                      relief=Tix.FLAT, width=240, anchor=Tix.N,
+    msg = tkinter.tix.Message(w,
+                      relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
                       text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.')
-    group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25')
+    group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25')
     group.entry.insert(0,'comp.lang.python')
-    pane = Tix.PanedWindow(w, orientation='vertical')
+    pane = tkinter.tix.PanedWindow(w, orientation='vertical')
 
     p1 = pane.add('list', min=70, size=100)
     p2 = pane.add('text', min=70)
-    list = Tix.ScrolledListBox(p1)
-    text = Tix.ScrolledText(p2)
+    list = tkinter.tix.ScrolledListBox(p1)
+    text = tkinter.tix.ScrolledText(p2)
 
-    list.listbox.insert(Tix.END, "  12324 Re: Tkinter is good for your health")
-    list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health")
-    list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)")
-    list.listbox.insert(Tix.END, "  12327 Re: Tix is even better for your health (Was: Tkinter is good...)")
-    list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)")
-    list.listbox.insert(Tix.END, "  12329 Re: Tix is even better for your health (Was: Tkinter is good...)")
-    list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)")
+    list.listbox.insert(tkinter.tix.END, "  12324 Re: Tkinter is good for your health")
+    list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health")
+    list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)")
+    list.listbox.insert(tkinter.tix.END, "  12327 Re: Tix is even better for your health (Was: Tkinter is good...)")
+    list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)")
+    list.listbox.insert(tkinter.tix.END, "  12329 Re: Tix is even better for your health (Was: Tkinter is good...)")
+    list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)")
 
     text.text['bg'] = list.listbox['bg']
     text.text['wrap'] = 'none'
-    text.text.insert(Tix.END, """
+    text.text.insert(tkinter.tix.END, """
 Mon, 19 Jun 1995 11:39:52        comp.lang.python              Thread   34 of  220
 Lines 353       A new way to put text and bitmaps together iNo responses
 ioi at blue.seas.upenn.edu                Ioi K. Lam at University of Pennsylvania
@@ -661,71 +661,71 @@
 support the -image option. For example, you can display a text string string
 together with a bitmap, at the same time, inside a TK button widget.
 """)
-    list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6)
-    text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6)
+    list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
+    text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
 
-    msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH)
-    group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH)
-    pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1)
+    msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
+    group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
+    pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1)
 
 def MkNoteBook(w):
-    msg = Tix.Message(w,
-                      relief=Tix.FLAT, width=240, anchor=Tix.N,
+    msg = tkinter.tix.Message(w,
+                      relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
                       text='The NoteBook widget allows you to layout a complex interface into individual pages.')
     # prefix = Tix.OptionName(w)
     # if not prefix: prefix = ''
     # w.option_add('*' + prefix + '*TixNoteBook*tagPadX', 8)
-    options = "entry.width %d label.width %d label.anchor %s" % (10, 18, Tix.E)
+    options = "entry.width %d label.width %d label.anchor %s" % (10, 18, tkinter.tix.E)
 
-    nb = Tix.NoteBook(w, ipadx=6, ipady=6, options=options)
+    nb = tkinter.tix.NoteBook(w, ipadx=6, ipady=6, options=options)
     nb.add('hard_disk', label="Hard Disk", underline=0)
     nb.add('network', label="Network", underline=0)
 
     # Frame for the buttons that are present on all pages
-    common = Tix.Frame(nb.hard_disk)
-    common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y)
+    common = tkinter.tix.Frame(nb.hard_disk)
+    common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y)
     CreateCommonButtons(common)
 
     # Widgets belonging only to this page
-    a = Tix.Control(nb.hard_disk, value=12, label='Access Time: ')
-    w = Tix.Control(nb.hard_disk, value=400, label='Write Throughput: ')
-    r = Tix.Control(nb.hard_disk, value=400, label='Read Throughput: ')
-    c = Tix.Control(nb.hard_disk, value=1021, label='Capacity: ')
-    a.pack(side=Tix.TOP, padx=20, pady=2)
-    w.pack(side=Tix.TOP, padx=20, pady=2)
-    r.pack(side=Tix.TOP, padx=20, pady=2)
-    c.pack(side=Tix.TOP, padx=20, pady=2)
+    a = tkinter.tix.Control(nb.hard_disk, value=12, label='Access Time: ')
+    w = tkinter.tix.Control(nb.hard_disk, value=400, label='Write Throughput: ')
+    r = tkinter.tix.Control(nb.hard_disk, value=400, label='Read Throughput: ')
+    c = tkinter.tix.Control(nb.hard_disk, value=1021, label='Capacity: ')
+    a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
 
-    common = Tix.Frame(nb.network)
-    common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y)
+    common = tkinter.tix.Frame(nb.network)
+    common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y)
     CreateCommonButtons(common)
 
-    a = Tix.Control(nb.network, value=12, label='Access Time: ')
-    w = Tix.Control(nb.network, value=400, label='Write Throughput: ')
-    r = Tix.Control(nb.network, value=400, label='Read Throughput: ')
-    c = Tix.Control(nb.network, value=1021, label='Capacity: ')
-    u = Tix.Control(nb.network, value=10, label='Users: ')
-    a.pack(side=Tix.TOP, padx=20, pady=2)
-    w.pack(side=Tix.TOP, padx=20, pady=2)
-    r.pack(side=Tix.TOP, padx=20, pady=2)
-    c.pack(side=Tix.TOP, padx=20, pady=2)
-    u.pack(side=Tix.TOP, padx=20, pady=2)
+    a = tkinter.tix.Control(nb.network, value=12, label='Access Time: ')
+    w = tkinter.tix.Control(nb.network, value=400, label='Write Throughput: ')
+    r = tkinter.tix.Control(nb.network, value=400, label='Read Throughput: ')
+    c = tkinter.tix.Control(nb.network, value=1021, label='Capacity: ')
+    u = tkinter.tix.Control(nb.network, value=10, label='Users: ')
+    a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
+    u.pack(side=tkinter.tix.TOP, padx=20, pady=2)
 
-    msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH)
-    nb.pack(side=Tix.TOP, padx=5, pady=5, fill=Tix.BOTH, expand=1)
+    msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
+    nb.pack(side=tkinter.tix.TOP, padx=5, pady=5, fill=tkinter.tix.BOTH, expand=1)
 
 def CreateCommonButtons(f):
-    ok = Tix.Button(f, text='OK', width = 6)
-    cancel = Tix.Button(f, text='Cancel', width = 6)
-    ok.pack(side=Tix.TOP, padx=2, pady=2)
-    cancel.pack(side=Tix.TOP, padx=2, pady=2)
+    ok = tkinter.tix.Button(f, text='OK', width = 6)
+    cancel = tkinter.tix.Button(f, text='Cancel', width = 6)
+    ok.pack(side=tkinter.tix.TOP, padx=2, pady=2)
+    cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2)
 
 def MkDirList(nb, name):
     w = nb.page(name)
     options = "label.padX 4"
 
-    dir = Tix.LabelFrame(w, label='Tix.DirList', options=options)
-    fsbox = Tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options)
+    dir = tkinter.tix.LabelFrame(w, label='Tix.DirList', options=options)
+    fsbox = tkinter.tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options)
     MkDirListWidget(dir.frame)
     MkExFileWidget(fsbox.frame)
     dir.form(top=0, left=0, right='%40', bottom=-1)
@@ -736,23 +736,23 @@
     system directory and makes it easy for the user to choose and access
     directories.
     """
-    msg = Tix.Message(w,
-                      relief=Tix.FLAT, width=240, anchor=Tix.N,
+    msg = tkinter.tix.Message(w,
+                      relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
                       text='The Tix DirList widget gives a graphical representation of the file system directory and makes it easy for the user to choose and access directories.')
-    dirlist = Tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16')
-    msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
-    dirlist.pack(side=Tix.TOP, padx=3, pady=3)
+    dirlist = tkinter.tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16')
+    msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
+    dirlist.pack(side=tkinter.tix.TOP, padx=3, pady=3)
 
 def MkExFileWidget(w):
     """The TixExFileSelectBox widget is more user friendly than the Motif
     style FileSelectBox.  """
-    msg = Tix.Message(w,
-                      relief=Tix.FLAT, width=240, anchor=Tix.N,
+    msg = tkinter.tix.Message(w,
+                      relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
                       text='The Tix ExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.')
     # There's a bug in the ComboBoxes - the scrolledlistbox is destroyed
-    box = Tix.ExFileSelectBox(w, bd=2, relief=Tix.RAISED)
-    msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
-    box.pack(side=Tix.TOP, padx=3, pady=3)
+    box = tkinter.tix.ExFileSelectBox(w, bd=2, relief=tkinter.tix.RAISED)
+    msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
+    box.pack(side=tkinter.tix.TOP, padx=3, pady=3)
 
 ###
 ### List of all the demos we want to show off
@@ -875,39 +875,39 @@
     w = nb.page(name)
     options = "label.padX 4"
 
-    pane = Tix.PanedWindow(w, orientation='horizontal')
-    pane.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH)
+    pane = tkinter.tix.PanedWindow(w, orientation='horizontal')
+    pane.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH)
     f1 = pane.add('list', expand='1')
     f2 = pane.add('text', expand='5')
     f1['relief'] = 'flat'
     f2['relief'] = 'flat'
 
-    lab = Tix.LabelFrame(f1, label='Select a sample program:')
-    lab.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5)
-    lab1 = Tix.LabelFrame(f2, label='Source:')
-    lab1.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5)
+    lab = tkinter.tix.LabelFrame(f1, label='Select a sample program:')
+    lab.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5)
+    lab1 = tkinter.tix.LabelFrame(f2, label='Source:')
+    lab1.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5)
 
-    slb = Tix.Tree(lab.frame, options='hlist.width 20')
-    slb.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5)
+    slb = tkinter.tix.Tree(lab.frame, options='hlist.width 20')
+    slb.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5)
 
-    stext = Tix.ScrolledText(lab1.frame, name='stext')
+    stext = tkinter.tix.ScrolledText(lab1.frame, name='stext')
     font = root.tk.eval('tix option get fixed_font')
     stext.text.config(font=font)
 
-    frame = Tix.Frame(lab1.frame, name='frame')
+    frame = tkinter.tix.Frame(lab1.frame, name='frame')
 
-    run = Tix.Button(frame, text='Run ...', name='run')
-    view = Tix.Button(frame, text='View Source ...', name='view')
-    run.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE)
-    view.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE)
+    run = tkinter.tix.Button(frame, text='Run ...', name='run')
+    view = tkinter.tix.Button(frame, text='View Source ...', name='view')
+    run.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE)
+    view.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE)
 
     stext.text['bg'] = slb.hlist['bg']
     stext.text['state'] = 'disabled'
     stext.text['wrap'] = 'none'
     stext.text['width'] = 80
 
-    frame.pack(side=Tix.BOTTOM, expand=0, fill=Tix.X, padx=7)
-    stext.pack(side=Tix.TOP, expand=0, fill=Tix.BOTH, padx=7)
+    frame.pack(side=tkinter.tix.BOTTOM, expand=0, fill=tkinter.tix.X, padx=7)
+    stext.pack(side=tkinter.tix.TOP, expand=0, fill=tkinter.tix.BOTH, padx=7)
 
     slb.hlist['separator'] = '.'
     slb.hlist['width'] = 25
@@ -922,13 +922,13 @@
 
     for type in ['widget', 'image']:
         if type != 'widget':
-            x = Tix.Frame(slb.hlist, bd=2, height=2, width=150,
-                          relief=Tix.SUNKEN, bg=slb.hlist['bg'])
-            slb.hlist.add_child(itemtype=Tix.WINDOW, window=x, state='disabled')
-        x = slb.hlist.add_child(itemtype=Tix.TEXT, state='disabled',
+            x = tkinter.tix.Frame(slb.hlist, bd=2, height=2, width=150,
+                          relief=tkinter.tix.SUNKEN, bg=slb.hlist['bg'])
+            slb.hlist.add_child(itemtype=tkinter.tix.WINDOW, window=x, state='disabled')
+        x = slb.hlist.add_child(itemtype=tkinter.tix.TEXT, state='disabled',
                                 text=comments[type])
         for key in stypes[type]:
-            slb.hlist.add_child(x, itemtype=Tix.TEXT, data=key,
+            slb.hlist.add_child(x, itemtype=tkinter.tix.TEXT, data=key,
                                 text=key)
     slb.hlist.selection_clear()
 
@@ -955,12 +955,12 @@
 
     if action == 'run':
         exec('import ' + prog)
-        w = Tix.Toplevel()
+        w = tkinter.tix.Toplevel()
         w.title(title)
         rtn = eval(prog + '.RunSample')
         rtn(w)
     elif action == 'view':
-        w = Tix.Toplevel()
+        w = tkinter.tix.Toplevel()
         w.title('Source view: ' + title)
         LoadFile(w, demo.dir + '/samples/' + prog + '.py')
     elif action == 'browse':
@@ -968,8 +968,8 @@
 
 def LoadFile(w, fname):
     global root
-    b = Tix.Button(w, text='Close', command=w.destroy)
-    t = Tix.ScrolledText(w)
+    b = tkinter.tix.Button(w, text='Close', command=w.destroy)
+    t = tkinter.tix.ScrolledText(w)
     #    b.form(left=0, bottom=0, padx=4, pady=4)
     #    t.form(left=0, bottom=b, right='-0', top=0)
     t.pack()
@@ -985,18 +985,18 @@
 def ReadFile(w, fname):
     old_state = w['state']
     w['state'] = 'normal'
-    w.delete('0.0', Tix.END)
+    w.delete('0.0', tkinter.tix.END)
 
     try:
         f = open(fname)
         lines = f.readlines()
         for s in lines:
-            w.insert(Tix.END, s)
+            w.insert(tkinter.tix.END, s)
         f.close()
     finally:
 #       w.see('1.0')
         w['state'] = old_state
 
 if __name__ == '__main__':
-    root = Tix.Tk()
+    root = tkinter.tix.Tk()
     RunMain(root)

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/AttrDialog.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/AttrDialog.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/AttrDialog.py	Sun Jan 25 21:08:20 2009
@@ -12,7 +12,7 @@
 # -- totally static, though different between PackDialog and WidgetDialog
 #    (but even that could be unified)
 
-from Tkinter import *
+from tkinter import *
 
 class Option:
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/ManPage.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/ManPage.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/ManPage.py	Sun Jan 25 21:08:20 2009
@@ -1,9 +1,9 @@
 # Widget to display a man page
 
 import re
-from Tkinter import *
-from Tkinter import _tkinter
-from ScrolledText import ScrolledText
+from tkinter import *
+from tkinter import _tkinter
+from tkinter.scrolledtext import ScrolledText
 
 # XXX These fonts may have to be changed to match your system
 BOLDFONT = '*-Courier-Bold-R-Normal-*-120-*'

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/MimeViewer.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/MimeViewer.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/MimeViewer.py	Sun Jan 25 21:08:20 2009
@@ -5,8 +5,8 @@
 
 import string
 from types import *
-from Tkinter import *
-from ScrolledText import ScrolledText
+from tkinter import *
+from tkinter.scrolledtext import ScrolledText
 
 class MimeViewer:
     def __init__(self, parent, title, msg):

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/ShellWindow.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/ShellWindow.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/ShellWindow.py	Sun Jan 25 21:08:20 2009
@@ -1,9 +1,9 @@
 import os
 import sys
 import string
-from Tkinter import *
-from ScrolledText import ScrolledText
-from Dialog import Dialog
+from tkinter import *
+from tkinter.scrolledtext import ScrolledText
+from tkinter.dialog import Dialog
 import signal
 
 BUFSIZE = 512

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/brownian.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/brownian.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/brownian.py	Sun Jan 25 21:08:20 2009
@@ -1,6 +1,6 @@
 # Brownian motion -- an example of a multi-threaded Tkinter program.
 
-from Tkinter import *
+from tkinter import *
 import random
 import threading
 import time

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/brownian2.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/brownian2.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/brownian2.py	Sun Jan 25 21:08:20 2009
@@ -1,7 +1,7 @@
 # Brownian motion -- an example of a NON multi-threaded Tkinter program ;)
 # By Michele Simoniato, inspired by brownian.py
 
-from Tkinter import *
+from tkinter import *
 import random
 import sys
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/canvasevents.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/canvasevents.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/canvasevents.py	Sun Jan 25 21:08:20 2009
@@ -1,6 +1,6 @@
 #! /usr/bin/env python
 
-from Tkinter import *
+from tkinter import *
 from Canvas import Oval, Group, CanvasText
 
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/dialog.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/dialog.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/dialog.py	Sun Jan 25 21:08:20 2009
@@ -4,7 +4,7 @@
 # optional bitmap, and any number of buttons.
 # Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.2-3, pp. 269-270.
 
-from Tkinter import *
+from tkinter import *
 import sys
 
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/electrons.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/electrons.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/electrons.py	Sun Jan 25 21:08:20 2009
@@ -11,7 +11,7 @@
 # /usr/include/X11/bitmaps for samples); it is displayed as the
 # background of the animation.  Default is no bitmap.
 
-from Tkinter import *
+from tkinter import *
 import random
 
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/hanoi.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/hanoi.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/hanoi.py	Sun Jan 25 21:08:20 2009
@@ -10,7 +10,7 @@
 # background of the animation.  Default is no bitmap.
 
 # This uses Steen Lumholt's Tk interface
-from Tkinter import *
+from tkinter import *
 
 
 # Basic Towers-of-Hanoi algorithm: move n pieces from a to b, using c

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/hello.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/hello.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/hello.py	Sun Jan 25 21:08:20 2009
@@ -1,7 +1,7 @@
 # Display hello, world in a button; clicking it quits the program
 
 import sys
-from Tkinter import *
+from tkinter import *
 
 def main():
     root = Tk()

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/imagedraw.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/imagedraw.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/imagedraw.py	Sun Jan 25 21:08:20 2009
@@ -1,6 +1,6 @@
 """Draw on top of an image"""
 
-from Tkinter import *
+from tkinter import *
 import sys
 
 def main():

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/imageview.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/imageview.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/imageview.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 import sys
 
 def main():

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/kill.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/kill.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/kill.py	Sun Jan 25 21:08:20 2009
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # Tkinter interface to Linux `kill' command.
 
-from Tkinter import *
+from tkinter import *
 from string import splitfields
 from string import split
 import subprocess

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/listtree.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/listtree.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/listtree.py	Sun Jan 25 21:08:20 2009
@@ -3,7 +3,7 @@
 import sys
 import string
 
-from Tkinter import *
+from tkinter import *
 
 def listtree(master, app):
     list = Listbox(master, name='list')

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/mbox.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/mbox.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/mbox.py	Sun Jan 25 21:08:20 2009
@@ -9,7 +9,7 @@
 import string
 import mhlib
 
-from Tkinter import *
+from tkinter import *
 
 from dialog import dialog
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/newmenubardemo.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/newmenubardemo.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/newmenubardemo.py	Sun Jan 25 21:08:20 2009
@@ -2,7 +2,7 @@
 
 """Play with the new Tk 8.0 toplevel menu option."""
 
-from Tkinter import *
+from tkinter import *
 
 class App:
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/optionmenu.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/optionmenu.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/optionmenu.py	Sun Jan 25 21:08:20 2009
@@ -1,6 +1,6 @@
 # option menu sample (Fredrik Lundh, September 1997)
 
-from Tkinter import *
+from tkinter import *
 
 root = Tk()
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/paint.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/paint.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/paint.py	Sun Jan 25 21:08:20 2009
@@ -20,7 +20,7 @@
                                                 davem at magnet.com
 """
 
-from Tkinter import *
+from tkinter import *
 
 """paint.py: not exactly a paint program.. just a smooth line drawing demo."""
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/rmt.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/rmt.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/rmt.py	Sun Jan 25 21:08:20 2009
@@ -11,7 +11,7 @@
 
 # XXX This should be written in a more Python-like style!!!
 
-from Tkinter import *
+from tkinter import *
 import sys
 
 # 1. Create basic application structure: menu bar on top of

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/solitaire.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/solitaire.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/solitaire.py	Sun Jan 25 21:08:20 2009
@@ -25,7 +25,7 @@
 import math
 import random
 
-from Tkinter import *
+from tkinter import *
 from Canvas import Rectangle, CanvasText, Group, Window
 
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/sortvisu.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/sortvisu.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/sortvisu.py	Sun Jan 25 21:08:20 2009
@@ -19,7 +19,7 @@
 """
 
 
-from Tkinter import *
+from tkinter import *
 from Canvas import Line, Rectangle
 import random
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/ss1.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/ss1.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/ss1.py	Sun Jan 25 21:08:20 2009
@@ -485,7 +485,7 @@
         s = chr(m+ord('A')) + s
     return s
 
-import Tkinter as Tk
+import tkinter as Tk
 
 class SheetGUI:
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/svkill.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/svkill.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/svkill.py	Sun Jan 25 21:08:20 2009
@@ -2,7 +2,7 @@
 
 # Tkinter interface to SYSV `ps' and `kill' commands.
 
-from Tkinter import *
+from tkinter import *
 
 if TkVersion < 4.0:
     raise ImportError("This version of svkill requires Tk 4.0 or later")

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/switch.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/switch.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/switch.py	Sun Jan 25 21:08:20 2009
@@ -1,6 +1,6 @@
 # Show how to do switchable panels.
 
-from Tkinter import *
+from tkinter import *
 
 class App:
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/guido/tkman.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/guido/tkman.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/guido/tkman.py	Sun Jan 25 21:08:20 2009
@@ -6,7 +6,7 @@
 import os
 import string
 import re
-from Tkinter import *
+from tkinter import *
 from ManPage import ManPage
 
 MANNDIRLIST = ['/depot/sundry/man/mann','/usr/local/man/mann']

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/00-HELLO-WORLD.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/00-HELLO-WORLD.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/00-HELLO-WORLD.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # note that there is no explicit call to start Tk.
 # Tkinter is smart enough to start the system if it's not already going.

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/animation-simple.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/animation-simple.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/animation-simple.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # This program shows how to use the "after" function to make animation.
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/animation-w-velocity-ctrl.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/animation-w-velocity-ctrl.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/animation-w-velocity-ctrl.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # this is the same as simple-demo-1.py, but uses
 # subclassing.

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/bind-w-mult-calls-p-type.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/bind-w-mult-calls-p-type.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/bind-w-mult-calls-p-type.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 import string
 
 # This program  shows how to use a simple type-in box

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-demo-simple.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-demo-simple.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-demo-simple.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # this program creates a canvas and puts a single polygon on the canvas
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-gridding.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-gridding.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-gridding.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # this is the same as simple-demo-1.py, but uses
 # subclassing.

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-or-creating.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-or-creating.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-or-creating.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # this file demonstrates a more sophisticated movement --
 # move dots or create new ones if you click outside the dots

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-w-mouse.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-w-mouse.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-moving-w-mouse.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # this file demonstrates the movement of a single canvas item under mouse control
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-mult-item-sel.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-mult-item-sel.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-mult-item-sel.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # allows moving dots with multiple selection.
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-reading-tag-info.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-reading-tag-info.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-reading-tag-info.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 
 class Test(Frame):

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-w-widget-draw-el.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-w-widget-draw-el.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-w-widget-draw-el.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # this file demonstrates the creation of widgets as part of a canvas object
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-with-scrollbars.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-with-scrollbars.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/canvas-with-scrollbars.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # This example program creates a scroling canvas, and demonstrates
 # how to tie scrollbars and canvses together. The mechanism

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/dialog-box.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/dialog-box.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/dialog-box.py	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
-from Tkinter import *
-from Dialog import Dialog
+from tkinter import *
+from tkinter.dialog import Dialog
 
 # this shows how to create a new window with a button in it
 # that can create new windows

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/entry-simple.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/entry-simple.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/entry-simple.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 import string
 
 # This program  shows how to use a simple type-in box

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/entry-with-shared-variable.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/entry-with-shared-variable.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/entry-with-shared-variable.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 import string
 
 # This program  shows how to make a typein box shadow a program variable.

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/killing-window-w-wm.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/killing-window-w-wm.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/killing-window-w-wm.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # This file shows how to trap the killing of a window
 # when the user uses window manager menus (typ. upper left hand corner

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/menu-all-types-of-entries.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/menu-all-types-of-entries.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/menu-all-types-of-entries.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # some vocabulary to keep from getting confused. This terminology
 # is something I cooked up for this file, but follows the man pages

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/menu-simple.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/menu-simple.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/menu-simple.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # some vocabulary to keep from getting confused. This terminology
 # is something I cooked up for this file, but follows the man pages

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-1.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-1.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-1.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 
 class Test(Frame):

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-2.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-2.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/not-what-you-might-think-2.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 
 class Test(Frame):

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/packer-and-placer-together.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/packer-and-placer-together.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/packer-and-placer-together.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # This is a program that tests the placer geom manager in conjunction with
 # the packer. The background (green) is packed, while the widget inside is placed

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/packer-simple.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/packer-simple.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/packer-simple.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 
 class Test(Frame):

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/placer-simple.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/placer-simple.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/placer-simple.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # This is a program that tests the placer geom manager
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/pong-demo-1.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/pong-demo-1.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/pong-demo-1.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 import string
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/printing-coords-of-items.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/printing-coords-of-items.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/printing-coords-of-items.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # this file demonstrates the creation of widgets as part of a canvas object
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/radiobutton-simple.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/radiobutton-simple.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/radiobutton-simple.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # This is a demo program that shows how to
 # create radio buttons and how to get other widgets to

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-band-box-demo-1.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-band-box-demo-1.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-band-box-demo-1.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 class Test(Frame):
     def printit(self):

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-line-demo-1.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-line-demo-1.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/rubber-line-demo-1.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 class Test(Frame):
     def printit(self):

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/slider-demo-1.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/slider-demo-1.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/slider-demo-1.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # shows how to make a slider, set and get its value under program control
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/subclass-existing-widgets.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/subclass-existing-widgets.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/subclass-existing-widgets.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # This is a program that makes a simple two button application
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/two-radio-groups.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/two-radio-groups.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/two-radio-groups.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 #       The way to think about this is that each radio button menu
 #       controls a different variable -- clicking on one of the

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-more.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-more.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-more.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # this shows how to create a new window with a button in it
 # that can create new windows

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-simple.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-simple.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-simple.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 # this shows how to spawn off new windows at a button press
 

Modified: python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-w-location.py
==============================================================================
--- python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-w-location.py	(original)
+++ python/branches/py3k-issue1717/Demo/tkinter/matt/window-creation-w-location.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 import sys
 ##sys.path.append("/users/mjc4y/projects/python/tkinter/utils")

Modified: python/branches/py3k-issue1717/Doc/ACKS.txt
==============================================================================
--- python/branches/py3k-issue1717/Doc/ACKS.txt	(original)
+++ python/branches/py3k-issue1717/Doc/ACKS.txt	Sun Jan 25 21:08:20 2009
@@ -60,6 +60,7 @@
    * Peter Funk
    * Lele Gaifax
    * Matthew Gallagher
+   * Gabriel Genellina
    * Ben Gertzfield
    * Nadim Ghaznavi
    * Jonathan Giddy

Modified: python/branches/py3k-issue1717/Doc/Makefile
==============================================================================
--- python/branches/py3k-issue1717/Doc/Makefile	(original)
+++ python/branches/py3k-issue1717/Doc/Makefile	Sun Jan 25 21:08:20 2009
@@ -14,7 +14,7 @@
 ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
                 $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)
 
-.PHONY: help checkout update build html htmlhelp clean coverage dist
+.PHONY: help checkout update build html htmlhelp clean coverage dist check
 
 help:
 	@echo "Please use \`make <target>' where <target> is one of"
@@ -24,6 +24,7 @@
 	@echo "  text      to make plain text files"
 	@echo "  changes   to make an overview over all changed/added/deprecated items"
 	@echo "  linkcheck to check all external links for integrity"
+	@echo "  suspicious to check for suspicious markup in output text"
 	@echo "  coverage  to check documentation coverage for library and C API"
 	@echo "  dist      to create a \"dist\" directory with archived docs for download"
 
@@ -36,9 +37,9 @@
 	  echo "Checking out Docutils..."; \
 	  svn checkout $(SVNROOT)/external/docutils-0.5/docutils tools/docutils; \
 	fi
-	@if [ ! -d tools/jinja ]; then \
+	@if [ ! -d tools/jinja2 ]; then \
 	  echo "Checking out Jinja..."; \
-	  svn checkout $(SVNROOT)/external/Jinja-1.2/jinja tools/jinja; \
+	  svn checkout $(SVNROOT)/external/Jinja-2.1.1/jinja2 tools/jinja2; \
 	fi
 	@if [ ! -d tools/pygments ]; then \
 	  echo "Checking out Pygments..."; \
@@ -48,7 +49,7 @@
 update: checkout
 	svn update tools/sphinx
 	svn update tools/docutils
-	svn update tools/jinja
+	svn update tools/jinja2
 	svn update tools/pygments
 
 build: checkout
@@ -84,6 +85,11 @@
 	@echo "Link check complete; look for any errors in the above output " \
 	      "or in build/$(BUILDER)/output.txt"
 
+suspicious: BUILDER = suspicious
+suspicious: build
+	@echo "Suspicious check complete; look for any errors in the above output " \
+	      "or in build/$(BUILDER)/suspicious.txt"
+
 coverage: BUILDER = coverage
 coverage: build
 	@echo "Coverage finished; see c.txt and python.txt in build/coverage"
@@ -141,3 +147,5 @@
 	cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip
 	cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2
 
+check:
+	$(PYTHON) tools/rstlint.py -i tools

Modified: python/branches/py3k-issue1717/Doc/c-api/allocation.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/allocation.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/allocation.rst	Sun Jan 25 21:08:20 2009
@@ -54,40 +54,15 @@
    accessed after this call as the memory is no longer a valid Python object.
 
 
-.. cfunction:: PyObject* Py_InitModule(char *name, PyMethodDef *methods)
-
-   Create a new module object based on a name and table of functions, returning
-   the new module object; the *methods* argument can be *NULL* if no methods are
-   to be defined for the module.
-
-
-.. cfunction:: PyObject* Py_InitModule3(char *name, PyMethodDef *methods, char *doc)
-
-   Create a new module object based on a name and table of functions, returning
-   the new module object.  The *methods* argument can be *NULL* if no methods
-   are to be defined for the module.  If *doc* is non-*NULL*, it will be used to
-   define the docstring for the module.
-
-
-.. cfunction:: PyObject* Py_InitModule4(char *name, PyMethodDef *methods, char *doc, PyObject *self, int apiver)
-
-   Create a new module object based on a name and table of functions, returning
-   the new module object.  The *methods* argument can be *NULL* if no methods
-   are to be defined for the module.  If *doc* is non-*NULL*, it will be used to
-   define the docstring for the module.  If *self* is non-*NULL*, it will passed
-   to the functions of the module as their (otherwise *NULL*) first parameter.
-   (This was added as an experimental feature, and there are no known uses in
-   the current version of Python.)  For *apiver*, the only value which should be
-   passed is defined by the constant :const:`PYTHON_API_VERSION`.
-
-   .. note::
-
-      Most uses of this function should probably be using the :cfunc:`Py_InitModule3`
-      instead; only use this if you are sure you need it.
-
-
 .. cvar:: PyObject _Py_NoneStruct
 
    Object which is visible in Python as ``None``.  This should only be accessed
    using the :cmacro:`Py_None` macro, which evaluates to a pointer to this
    object.
+
+
+.. seealso::
+
+   :cfunc:`PyModule_Create`
+      To allocate and create extension modules.
+

Modified: python/branches/py3k-issue1717/Doc/c-api/arg.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/arg.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/arg.rst	Sun Jan 25 21:08:20 2009
@@ -53,8 +53,9 @@
    string may contain embedded null bytes.  Unicode objects pass back a pointer
    to the default encoded string version of the object if such a conversion is
    possible.  All other read-buffer compatible objects pass back a reference to
-   the raw internal data representation.  Since this format doesn't allow writable buffer compatible objects like byte
-   arrays, ``s*`` is to be preferred.
+   the raw internal data representation.  Since this format doesn't allow
+   writable buffer compatible objects like byte arrays, ``s*`` is to be
+   preferred.
 
    The type of the length argument (int or :ctype:`Py_ssize_t`) is controlled by
    defining the macro :cmacro:`PY_SSIZE_T_CLEAN` before including
@@ -488,11 +489,11 @@
    ``H`` (integer) [unsigned short int]
       Convert a C :ctype:`unsigned short int` to a Python integer object.
 
-   ``I`` (integer/long) [unsigned int]
-      Convert a C :ctype:`unsigned int` to a Python long integer object.
+   ``I`` (integer) [unsigned int]
+      Convert a C :ctype:`unsigned int` to a Python integer object.
 
-   ``k`` (integer/long) [unsigned long]
-      Convert a C :ctype:`unsigned long` to a Python long integer object.
+   ``k`` (integer) [unsigned long]
+      Convert a C :ctype:`unsigned long` to a Python integer object.
 
    ``L`` (long) [PY_LONG_LONG]
       Convert a C :ctype:`long long` to a Python integer object. Only available

Modified: python/branches/py3k-issue1717/Doc/c-api/buffer.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/buffer.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/buffer.rst	Sun Jan 25 21:08:20 2009
@@ -31,7 +31,7 @@
 
 .. index:: single: PyBufferProcs
 
-More information on the buffer interface is provided in the section 
+More information on the buffer interface is provided in the section
 :ref:`buffer-structs`, under the description for :ctype:`PyBufferProcs`.
 
 Buffer objects are useful as a way to expose the data from another object's
@@ -104,7 +104,7 @@
                   pointer += strides[i] * indices[i];
                   if (suboffsets[i] >=0 ) {
                       pointer = *((char**)pointer) + suboffsets[i];
-                  }                     
+                  }
               }
               return (void*)pointer;
            }

Modified: python/branches/py3k-issue1717/Doc/c-api/bytes.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/bytes.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/bytes.rst	Sun Jan 25 21:08:20 2009
@@ -192,9 +192,3 @@
    reallocation fails, the original bytes object at *\*bytes* is deallocated,
    *\*bytes* is set to *NULL*, a memory exception is set, and ``-1`` is
    returned.
-
-
-.. cfunction:: PyObject* PyBytes_Format(PyObject *format, PyObject *args)
-
-   Return a new bytes object from *format* and *args*. Analogous to ``format %
-   args``.  The *args* argument must be a tuple.

Modified: python/branches/py3k-issue1717/Doc/c-api/conversion.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/conversion.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/conversion.rst	Sun Jan 25 21:08:20 2009
@@ -80,7 +80,7 @@
 
    See the Unix man page :manpage:`atof(2)` for details.
 
-   
+
 .. cfunction:: char * PyOS_stricmp(char *s1, char *s2)
 
    Case insensitive comparison of strings. The function works almost

Modified: python/branches/py3k-issue1717/Doc/c-api/file.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/file.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/file.rst	Sun Jan 25 21:08:20 2009
@@ -22,7 +22,7 @@
 
    .. warning::
 
-     Take care when you are mixing streams and descriptors! For more 
+     Take care when you are mixing streams and descriptors! For more
      information, see `the GNU C Library docs
      <http://www.gnu.org/software/libc/manual/html_node/Stream_002fDescriptor-Precautions.html#Stream_002fDescriptor-Precautions>`_.
 

Modified: python/branches/py3k-issue1717/Doc/c-api/init.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/init.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/init.rst	Sun Jan 25 21:08:20 2009
@@ -765,6 +765,50 @@
    :cfunc:`PyGILState_Release` on the same thread.
 
 
+
+Asynchronous Notifications
+==========================
+
+A mechanism is provided to make asynchronous notifications to the the main
+interpreter thread.  These notifications take the form of a function
+pointer and a void argument.
+
+.. index:: single: setcheckinterval() (in module sys)
+
+Every check interval, when the interpreter lock is released and reacquired,
+python will also call any such provided functions.  This can be used for
+example by asynchronous IO handlers.  The notification can be scheduled
+from a worker thread and the actual call than made at the earliest
+convenience by the main thread where it has possession of the global
+interpreter lock and can perform any Python API calls.
+
+.. cfunction:: void Py_AddPendingCall( int (*func)(void *, void *arg) )
+
+   .. index:: single: Py_AddPendingCall()
+
+   Post a notification to the Python main thread.  If successful,
+   *func* will be called with the argument *arg* at the earliest
+   convenience.  *func* will be called having the global interpreter
+   lock held and can thus use the full Python API and can take any
+   action such as setting object attributes to signal IO completion.
+   It must return 0 on success, or -1 signalling an exception.
+   The notification function won't be interrupted to perform another
+   asynchronous notification recursively,
+   but it can still be interrupted to switch threads if the interpreter
+   lock is released, for example, if it calls back into python code.
+
+   This function returns 0 on success in which case the notification has been
+   scheduled.  Otherwise, for example if the notification buffer is full,
+   it returns -1 without setting any exception.
+
+   This function can be called on any thread, be it a Python thread or
+   some other system thread.  If it is a Python thread, it doesen't matter if
+   it holds the global interpreter lock or not.
+
+   .. versionadded:: 2.7
+
+
+
 .. _profiling:
 
 Profiling and Tracing
@@ -885,7 +929,7 @@
 
    Return a tuple of function call counts.  There are constants defined for the
    positions within the tuple:
-   
+
    +-------------------------------+-------+
    | Name                          | Value |
    +===============================+=======+
@@ -911,7 +955,7 @@
    +-------------------------------+-------+
    | :const:`PCALL_POP`            | 10    |
    +-------------------------------+-------+
-   
+
    :const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created.
    :const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is used.
 

Modified: python/branches/py3k-issue1717/Doc/c-api/intro.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/intro.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/intro.rst	Sun Jan 25 21:08:20 2009
@@ -607,7 +607,7 @@
 
 * Sanity checks of the input arguments are added to frame creation.
 
-* The storage for long ints is initialized with a known invalid pattern to catch
+* The storage for ints is initialized with a known invalid pattern to catch
   reference to uninitialized digits.
 
 * Low-level tracing and extra exception checking are added to the runtime

Modified: python/branches/py3k-issue1717/Doc/c-api/long.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/long.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/long.rst	Sun Jan 25 21:08:20 2009
@@ -107,7 +107,7 @@
    retrieved from the resulting value using :cfunc:`PyLong_AsVoidPtr`.
 
 
-.. XXX alias PyLong_AS_LONG (for now) 
+.. XXX alias PyLong_AS_LONG (for now)
 .. cfunction:: long PyLong_AsLong(PyObject *pylong)
 
    .. index::
@@ -123,7 +123,7 @@
 
    Return a C :ctype:`long` representation of the contents of *pylong*.  If
    *pylong* is greater than :const:`LONG_MAX`, return -1 and
-   set `*overflow` to 1 (for overflow) or -1 (for underflow). 
+   set `*overflow` to 1 (for overflow) or -1 (for underflow).
    If an exception is set because of type errors, also return -1.
 
 

Modified: python/branches/py3k-issue1717/Doc/c-api/module.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/module.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/module.rst	Sun Jan 25 21:08:20 2009
@@ -73,6 +73,101 @@
    raise :exc:`SystemError` and return *NULL*.
 
 
+.. cfunction:: void* PyModule_GetState(PyObject *module)
+
+   Return the "state" of the module, that is, a pointer to the block of memory
+   allocated at module creation time, or *NULL*.  See
+   :cmember:`PyModuleDef.m_size`.
+
+
+.. cfunction:: PyModuleDef* PyModule_GetDef(PyObject *module)
+
+   Return a pointer to the :ctype:`PyModuleDef` struct from which the module was
+   created, or *NULL* if the module wasn't created with
+   :cfunc:`PyModule_Create`.
+
+
+Initializing C modules
+^^^^^^^^^^^^^^^^^^^^^^
+
+These functions are usually used in the module initialization function.
+
+.. cfunction:: PyObject* PyModule_Create(PyModuleDef *module)
+
+   Create a new module object, given the definition in *module*.  This behaves
+   like :cfunc:`PyModule_Create2` with *module_api_version* set to
+   :const:`PYTHON_API_VERSION`.
+
+
+.. cfunction:: PyObject* PyModule_Create2(PyModuleDef *module, int module_api_version)
+
+   Create a new module object, given the definition in *module*, assuming the
+   API version *module_api_version*.  If that version does not match the version
+   of the running interpreter, a :exc:`RuntimeWarning` is emitted.
+
+   .. note::
+
+      Most uses of this function should be using :cfunc:`PyModule_Create`
+      instead; only use this if you are sure you need it.
+
+
+.. ctype:: PyModuleDef
+
+   This struct holds all information that is needed to create a module object.
+   There is usually only one static variable of that type for each module, which
+   is statically initialized and then passed to :cfunc:`PyModule_Create` in the
+   module initialization function.
+
+   .. cmember:: PyModuleDef_Base m_base
+
+      Always initialize this member to :const:`PyModuleDef_HEAD_INIT`.
+
+   .. cmember:: char* m_name
+
+      Name for the new module.
+
+   .. cmember:: char* m_doc
+
+      Docstring for the module; usually a docstring variable created with
+      :cfunc:`PyDoc_STRVAR` is used.
+
+   .. cmember:: Py_ssize_t m_size
+
+      If the module object needs additional memory, this should be set to the
+      number of bytes to allocate; a pointer to the block of memory can be
+      retrieved with :cfunc:`PyModule_GetState`.  If no memory is needed, set
+      this to ``-1``.
+
+      This memory should be used, rather than static globals, to hold per-module
+      state, since it is then safe for use in multiple sub-interpreters.  It is
+      freed when the module object is deallocated, after the :cmember:`m_free`
+      function has been called, if present.
+
+   .. cmember:: PyMethodDef* m_methods
+
+      A pointer to a table of module-level functions, described by
+      :ctype:`PyMethodDef` values.  Can be *NULL* if no functions are present.
+
+   .. cmember:: inquiry m_reload
+
+      Currently unused, should be *NULL*.
+
+   .. cmember:: traverseproc m_traverse
+
+      A traversal function to call during GC traversal of the module object, or
+      *NULL* if not needed.
+
+   .. cmember:: inquiry m_clear
+
+      A clear function to call during GC clearing of the module object, or
+      *NULL* if not needed.
+
+   .. cmember:: freefunc m_free
+
+      A function to call during deallocation of the module object, or *NULL* if
+      not needed.
+
+
 .. cfunction:: int PyModule_AddObject(PyObject *module, const char *name, PyObject *value)
 
    Add an object to *module* as *name*.  This is a convenience function which can
@@ -96,7 +191,7 @@
 
 .. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro)
 
-   Add an int constant to *module*. The name and the value are taken from 
+   Add an int constant to *module*. The name and the value are taken from
    *macro*. For example ``PyModule_AddConstant(module, AF_INET)`` adds the int
    constant *AF_INET* with the value of *AF_INET* to *module*.
    Return ``-1`` on error, ``0`` on success.
@@ -105,4 +200,3 @@
 .. cfunction:: int PyModule_AddStringMacro(PyObject *module, macro)
 
    Add a string constant to *module*.
-

Modified: python/branches/py3k-issue1717/Doc/c-api/number.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/number.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/number.rst	Sun Jan 25 21:08:20 2009
@@ -230,19 +230,16 @@
 
 .. cfunction:: PyObject* PyNumber_Int(PyObject *o)
 
-   .. index:: builtin: int
-
-   Returns the *o* converted to an integer object on success, or *NULL* on failure.
-   If the argument is outside the integer range a long object will be returned
-   instead. This is the equivalent of the Python expression ``int(o)``.
+   Returns the *o* converted to an integer object on success, or *NULL* on
+   failure.  This is the equivalent of the Python expression ``int(o)``.
 
 
 .. cfunction:: PyObject* PyNumber_Long(PyObject *o)
 
-   .. index:: builtin: long
+   .. index:: builtin: int
 
    Returns the *o* converted to an integer object on success, or *NULL* on
-   failure.  This is the equivalent of the Python expression ``long(o)``.
+   failure.  This is the equivalent of the Python expression ``int(o)``.
 
 
 .. cfunction:: PyObject* PyNumber_Float(PyObject *o)
@@ -255,7 +252,7 @@
 
 .. cfunction:: PyObject* PyNumber_Index(PyObject *o)
 
-   Returns the *o* converted to a Python int or long on success or *NULL* with a
+   Returns the *o* converted to a Python int on success or *NULL* with a
    :exc:`TypeError` exception raised on failure.
 
 
@@ -271,7 +268,7 @@
 .. cfunction:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc)
 
    Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an
-   integer. If *o* can be converted to a Python int or long but the attempt to
+   integer. If *o* can be converted to a Python int but the attempt to
    convert to a Py_ssize_t value would raise an :exc:`OverflowError`, then the
    *exc* argument is the type of exception that will be raised (usually
    :exc:`IndexError` or :exc:`OverflowError`).  If *exc* is *NULL*, then the

Modified: python/branches/py3k-issue1717/Doc/c-api/object.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/object.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/object.rst	Sun Jan 25 21:08:20 2009
@@ -241,8 +241,6 @@
    allowing a type to explicitly indicate to the interpreter that it is not
    hashable.
 
-   .. versionadded:: 2.6
-
 
 .. cfunction:: int PyObject_IsTrue(PyObject *o)
 

Modified: python/branches/py3k-issue1717/Doc/c-api/reflection.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/reflection.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/reflection.rst	Sun Jan 25 21:08:20 2009
@@ -15,7 +15,7 @@
 
    Return a dictionary of the local variables in the current execution frame,
    or *NULL* if no frame is currently executing.
-   
+
 
 .. cfunction:: PyObject* PyEval_GetGlobals()
 

Modified: python/branches/py3k-issue1717/Doc/c-api/sequence.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/sequence.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/sequence.rst	Sun Jan 25 21:08:20 2009
@@ -143,9 +143,9 @@
 
    Return the underlying array of PyObject pointers.  Assumes that *o* was returned
    by :cfunc:`PySequence_Fast` and *o* is not *NULL*.
-   
+
    Note, if a list gets resized, the reallocation may relocate the items array.
-   So, only use the underlying array pointer in contexts where the sequence 
+   So, only use the underlying array pointer in contexts where the sequence
    cannot change.
 
 

Modified: python/branches/py3k-issue1717/Doc/c-api/structures.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/structures.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/structures.rst	Sun Jan 25 21:08:20 2009
@@ -198,3 +198,64 @@
    object and will co-exist with the slot.  This is helpful because calls to
    PyCFunctions are optimized more than wrapper object calls.
 
+
+.. ctype:: PyMemberDef
+
+   Structure which describes an attribute of a type which corresponds to a C
+   struct member.  Its fields are:
+
+   +------------------+-------------+-------------------------------+
+   | Field            | C Type      | Meaning                       |
+   +==================+=============+===============================+
+   | :attr:`name`     | char \*     | name of the member            |
+   +------------------+-------------+-------------------------------+
+   | :attr:`type`     | int         | the type of the member in the |
+   |                  |             | C struct                      |
+   +------------------+-------------+-------------------------------+
+   | :attr:`offset`   | Py_ssize_t  | the offset in bytes that the  |
+   |                  |             | member is located on the      |
+   |                  |             | type's object struct          |
+   +------------------+-------------+-------------------------------+
+   | :attr:`flags`    | int         | flag bits indicating if the   |
+   |                  |             | field should be read-only or  |
+   |                  |             | writable                      |
+   +------------------+-------------+-------------------------------+
+   | :attr:`doc`      | char \*     | points to the contents of the |
+   |                  |             | docstring                     |
+   +------------------+-------------+-------------------------------+
+
+   :attr:`type` can be one of many ``T_`` macros corresponding to various C
+   types.  When the member is accessed in Python, it will be converted to the
+   equivalent Python type.
+
+   =============== ==================
+   Macro name      C type
+   =============== ==================
+   T_SHORT         short
+   T_INT           int
+   T_LONG          long
+   T_FLOAT         float
+   T_DOUBLE        double
+   T_STRING        char \*
+   T_OBJECT        PyObject \*
+   T_OBJECT_EX     PyObject \*
+   T_CHAR          char
+   T_BYTE          char
+   T_UNBYTE        unsigned char
+   T_UINT          unsigned int
+   T_USHORT        unsigned short
+   T_ULONG         unsigned long
+   T_BOOL          char
+   T_LONGLONG      long long
+   T_ULONGLONG     unsigned long long
+   T_PYSSIZET      Py_ssize_t
+   =============== ==================
+
+   :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that
+   :cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and
+   :cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`.
+
+   :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for
+   read-only access.  Using :cmacro:`T_STRING` for :attr:`type` implies
+   :cmacro:`READONLY`.  Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX`
+   members can be deleted.  (They are set to *NULL*).

Modified: python/branches/py3k-issue1717/Doc/c-api/sys.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/sys.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/sys.rst	Sun Jan 25 21:08:20 2009
@@ -15,13 +15,6 @@
    one of the strings ``'<stdin>'`` or ``'???'``.
 
 
-.. cfunction:: long PyOS_GetLastModificationTime(char *filename)
-
-   Return the time of last modification of the file *filename*. The result is
-   encoded in the same way as the timestamp returned by the standard C library
-   function :cfunc:`time`.
-
-
 .. cfunction:: void PyOS_AfterFork()
 
    Function to update some internal state after a process fork; this should be

Modified: python/branches/py3k-issue1717/Doc/c-api/typeobj.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/typeobj.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/typeobj.rst	Sun Jan 25 21:08:20 2009
@@ -135,7 +135,7 @@
    :attr:`ob_size` field, and the instance size is :attr:`tp_basicsize` plus N
    times :attr:`tp_itemsize`, where N is the "length" of the object.  The value of
    N is typically stored in the instance's :attr:`ob_size` field.  There are
-   exceptions:  for example, long ints use a negative :attr:`ob_size` to indicate a
+   exceptions:  for example, ints use a negative :attr:`ob_size` to indicate a
    negative number, and N is ``abs(ob_size)`` there.  Also, the presence of an
    :attr:`ob_size` field in the instance layout doesn't mean that the instance
    structure is variable-length (for example, the structure for the list type has
@@ -642,7 +642,6 @@
    :attr:`__weakref__`, the type inherits its :attr:`tp_weaklistoffset` from its
    base type.
 
-
 .. cmember:: getiterfunc PyTypeObject.tp_iter
 
    An optional pointer to a function that returns an iterator for the object.  Its
@@ -803,7 +802,7 @@
 
    where :attr:`tp_basicsize`, :attr:`tp_itemsize` and :attr:`tp_dictoffset` are
    taken from the type object, and :attr:`ob_size` is taken from the instance.  The
-   absolute value is taken because long ints use the sign of :attr:`ob_size` to
+   absolute value is taken because ints use the sign of :attr:`ob_size` to
    store the sign of the number.  (There's never a need to do this calculation
    yourself; it is done for you by :cfunc:`_PyObject_GetDictPtr`.)
 
@@ -1048,7 +1047,7 @@
             binaryfunc nb_xor;
             binaryfunc nb_or;
             unaryfunc nb_int;
-            unaryfunc nb_long;
+            void *nb_reserved;
             unaryfunc nb_float;
 
             binaryfunc nb_inplace_add;
@@ -1079,6 +1078,12 @@
       ``Py_NotImplemented``, if another error occurred they must return ``NULL``
       and set an exception.
 
+   .. note::
+
+      The :cdata:`nb_reserved` field should always be ``NULL``.  It
+      was previously called :cdata:`nb_long`, and was renamed in
+      Python 3.0.1.
+
 
 .. _mapping-structs:
 

Modified: python/branches/py3k-issue1717/Doc/c-api/unicode.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/c-api/unicode.rst	(original)
+++ python/branches/py3k-issue1717/Doc/c-api/unicode.rst	Sun Jan 25 21:08:20 2009
@@ -409,19 +409,19 @@
 .. cfunction:: PyObject* PyUnicode_Encode(const Py_UNICODE *s, Py_ssize_t size, const char *encoding, const char *errors)
 
    Encode the :ctype:`Py_UNICODE` buffer of the given size and return a Python
-   string object.  *encoding* and *errors* have the same meaning as the parameters
-   of the same name in the Unicode :meth:`encode` method.  The codec to be used is
-   looked up using the Python codec registry.  Return *NULL* if an exception was
-   raised by the codec.
+   bytes object.  *encoding* and *errors* have the same meaning as the
+   parameters of the same name in the Unicode :meth:`encode` method.  The codec
+   to be used is looked up using the Python codec registry.  Return *NULL* if an
+   exception was raised by the codec.
 
 
 .. cfunction:: PyObject* PyUnicode_AsEncodedString(PyObject *unicode, const char *encoding, const char *errors)
 
-   Encode a Unicode object and return the result as Python string object.
-   *encoding* and *errors* have the same meaning as the parameters of the same name
-   in the Unicode :meth:`encode` method. The codec to be used is looked up using
-   the Python codec registry. Return *NULL* if an exception was raised by the
-   codec.
+   Encode a Unicode object and return the result as Python bytes object.
+   *encoding* and *errors* have the same meaning as the parameters of the same
+   name in the Unicode :meth:`encode` method. The codec to be used is looked up
+   using the Python codec registry. Return *NULL* if an exception was raised by
+   the codec.
 
 These are the UTF-8 codec APIs:
 
@@ -444,15 +444,16 @@
 
 .. cfunction:: PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
 
-   Encode the :ctype:`Py_UNICODE` buffer of the given size using UTF-8 and return a
-   Python string object.  Return *NULL* if an exception was raised by the codec.
+   Encode the :ctype:`Py_UNICODE` buffer of the given size using UTF-8 and
+   return a Python bytes object.  Return *NULL* if an exception was raised by
+   the codec.
 
 
 .. cfunction:: PyObject* PyUnicode_AsUTF8String(PyObject *unicode)
 
-   Encode a Unicode object using UTF-8 and return the result as Python string
-   object.  Error handling is "strict".  Return *NULL* if an exception was raised
-   by the codec.
+   Encode a Unicode object using UTF-8 and return the result as Python bytes
+   object.  Error handling is "strict".  Return *NULL* if an exception was
+   raised by the codec.
 
 These are the UTF-32 codec APIs:
 
@@ -514,9 +515,9 @@
 
 .. cfunction:: PyObject* PyUnicode_AsUTF32String(PyObject *unicode)
 
-   Return a Python string using the UTF-32 encoding in native byte order. The
-   string always starts with a BOM mark.  Error handling is "strict".  Return
-   *NULL* if an exception was raised by the codec.
+   Return a Python byte string using the UTF-32 encoding in native byte
+   order. The string always starts with a BOM mark.  Error handling is "strict".
+   Return *NULL* if an exception was raised by the codec.
 
 
 These are the UTF-16 codec APIs:
@@ -558,7 +559,7 @@
 
 .. cfunction:: PyObject* PyUnicode_EncodeUTF16(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder)
 
-   Return a Python string object holding the UTF-16 encoded value of the Unicode
+   Return a Python bytes object holding the UTF-16 encoded value of the Unicode
    data in *s*.  If *byteorder* is not ``0``, output is written according to the
    following byte order::
 
@@ -578,9 +579,9 @@
 
 .. cfunction:: PyObject* PyUnicode_AsUTF16String(PyObject *unicode)
 
-   Return a Python string using the UTF-16 encoding in native byte order. The
-   string always starts with a BOM mark.  Error handling is "strict".  Return
-   *NULL* if an exception was raised by the codec.
+   Return a Python byte string using the UTF-16 encoding in native byte
+   order. The string always starts with a BOM mark.  Error handling is "strict".
+   Return *NULL* if an exception was raised by the codec.
 
 These are the "Unicode Escape" codec APIs:
 
@@ -644,15 +645,16 @@
 
 .. cfunction:: PyObject* PyUnicode_EncodeLatin1(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
 
-   Encode the :ctype:`Py_UNICODE` buffer of the given size using Latin-1 and return
-   a Python string object.  Return *NULL* if an exception was raised by the codec.
+   Encode the :ctype:`Py_UNICODE` buffer of the given size using Latin-1 and
+   return a Python bytes object.  Return *NULL* if an exception was raised by
+   the codec.
 
 
 .. cfunction:: PyObject* PyUnicode_AsLatin1String(PyObject *unicode)
 
-   Encode a Unicode object using Latin-1 and return the result as Python string
-   object.  Error handling is "strict".  Return *NULL* if an exception was raised
-   by the codec.
+   Encode a Unicode object using Latin-1 and return the result as Python bytes
+   object.  Error handling is "strict".  Return *NULL* if an exception was
+   raised by the codec.
 
 These are the ASCII codec APIs.  Only 7-bit ASCII data is accepted. All other
 codes generate errors.
@@ -668,15 +670,16 @@
 
 .. cfunction:: PyObject* PyUnicode_EncodeASCII(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
 
-   Encode the :ctype:`Py_UNICODE` buffer of the given size using ASCII and return a
-   Python string object.  Return *NULL* if an exception was raised by the codec.
+   Encode the :ctype:`Py_UNICODE` buffer of the given size using ASCII and
+   return a Python bytes object.  Return *NULL* if an exception was raised by
+   the codec.
 
 
 .. cfunction:: PyObject* PyUnicode_AsASCIIString(PyObject *unicode)
 
-   Encode a Unicode object using ASCII and return the result as Python string
-   object.  Error handling is "strict".  Return *NULL* if an exception was raised
-   by the codec.
+   Encode a Unicode object using ASCII and return the result as Python bytes
+   object.  Error handling is "strict".  Return *NULL* if an exception was
+   raised by the codec.
 
 These are the mapping codec APIs:
 
@@ -767,15 +770,16 @@
 
 .. cfunction:: PyObject* PyUnicode_EncodeMBCS(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
 
-   Encode the :ctype:`Py_UNICODE` buffer of the given size using MBCS and return a
-   Python string object.  Return *NULL* if an exception was raised by the codec.
+   Encode the :ctype:`Py_UNICODE` buffer of the given size using MBCS and return
+   a Python bytes object.  Return *NULL* if an exception was raised by the
+   codec.
 
 
 .. cfunction:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode)
 
-   Encode a Unicode object using MBCS and return the result as Python string
-   object.  Error handling is "strict".  Return *NULL* if an exception was raised
-   by the codec.
+   Encode a Unicode object using MBCS and return the result as Python bytes
+   object.  Error handling is "strict".  Return *NULL* if an exception was
+   raised by the codec.
 
 .. % --- Methods & Slots ----------------------------------------------------
 

Modified: python/branches/py3k-issue1717/Doc/data/refcounts.dat
==============================================================================
--- python/branches/py3k-issue1717/Doc/data/refcounts.dat	(original)
+++ python/branches/py3k-issue1717/Doc/data/refcounts.dat	Sun Jan 25 21:08:20 2009
@@ -841,9 +841,6 @@
 PyNumber_Xor:PyObject*:o1:0:
 PyNumber_Xor:PyObject*:o2:0:
 
-PyOS_GetLastModificationTime:long:::
-PyOS_GetLastModificationTime:char*:filename::
-
 PyObject_AsFileDescriptor:int::: 
 PyObject_AsFileDescriptor:PyObject*:o:0:
 

Modified: python/branches/py3k-issue1717/Doc/distutils/apiref.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/distutils/apiref.rst	(original)
+++ python/branches/py3k-issue1717/Doc/distutils/apiref.rst	Sun Jan 25 21:08:20 2009
@@ -104,7 +104,7 @@
    | *package_dir*      | A mapping of package to        | a dictionary                                                |
    |                    | directory names                |                                                             |
    +--------------------+--------------------------------+-------------------------------------------------------------+
-   
+
 
 
 .. function:: run_setup(script_name[, script_args=None, stop_after='run'])
@@ -188,9 +188,10 @@
    |                        | for C/C++ header files (in     |                           |
    |                        | Unix form for portability)     |                           |
    +------------------------+--------------------------------+---------------------------+
-   | *define_macros*        | list of macros to define; each | (string,string)  tuple or |
-   |                        | macro is defined using a       | (name,``None``)           |
-   |                        | 2-tuple, where 'value' is      |                           |
+   | *define_macros*        | list of macros to define; each | (string, string) tuple or |
+   |                        | macro is defined using a       | (name, ``None``)          |
+   |                        | 2-tuple ``(name, value)``,     |                           |
+   |                        | where *value* is               |                           |
    |                        | either the string to define it |                           |
    |                        | to or ``None`` to define it    |                           |
    |                        | without a particular value     |                           |
@@ -754,7 +755,7 @@
       standard output, otherwise do nothing.
 
 .. % \subsection{Compiler-specific modules}
-.. % 
+.. %
 .. % The following modules implement concrete subclasses of the abstract
 .. % \class{CCompiler} class. They should not be instantiated directly, but should
 .. % be created using \function{distutils.ccompiler.new_compiler()} factory
@@ -858,7 +859,7 @@
 Macintosh. Needs work to support CW on Windows or Mac OS X.
 
 .. % \subsection{Utility modules}
-.. % 
+.. %
 .. % The following modules all provide general utility functions. They haven't
 .. % all been documented yet.
 
@@ -1109,13 +1110,13 @@
 
    For MacOS X systems the OS version reflects the minimal version on which
    binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET``
-   during the build of Python), not the OS version of the current system. 
+   during the build of Python), not the OS version of the current system.
 
    For universal binary builds on MacOS X the architecture value reflects
    the univeral binary status instead of the architecture of the current
-   processor. For 32-bit universal binaries the architecture is ``fat``, 
-   for 64-bit universal binaries the architecture is ``fat64``, and 
-   for 4-way universal binaries the architecture is ``universal``. 
+   processor. For 32-bit universal binaries the architecture is ``fat``,
+   for 64-bit universal binaries the architecture is ``fat64``, and
+   for 4-way universal binaries the architecture is ``universal``.
 
    Examples of returned values on MacOS X:
 
@@ -1692,7 +1693,7 @@
 
 .. % todo
 .. % \section{Distutils Commands}
-.. % 
+.. %
 .. % This part of Distutils implements the various Distutils commands, such
 .. % as \code{build}, \code{install} \&c. Each command is implemented as a
 .. % separate module, with the command name as the name of the module.

Modified: python/branches/py3k-issue1717/Doc/distutils/builtdist.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/distutils/builtdist.rst	(original)
+++ python/branches/py3k-issue1717/Doc/distutils/builtdist.rst	Sun Jan 25 21:08:20 2009
@@ -268,13 +268,13 @@
 .. % \longprogramopt{spec-file} option; used in conjunction with
 .. % \longprogramopt{spec-only}, this gives you an opportunity to customize
 .. % the \file{.spec} file manually:
-.. % 
+.. %
 .. % \ begin{verbatim}
 .. % > python setup.py bdist_rpm --spec-only
 .. % # ...edit dist/FooBar-1.0.spec
 .. % > python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec
 .. % \ end{verbatim}
-.. % 
+.. %
 .. % (Although a better way to do this is probably to override the standard
 .. % \command{bdist\_rpm} command with one that writes whatever else you want
 .. % to the \file{.spec} file.)
@@ -334,31 +334,31 @@
 Cross-compiling on Windows
 ==========================
 
-Starting with Python 2.6, distutils is capable of cross-compiling between 
-Windows platforms.  In practice, this means that with the correct tools 
+Starting with Python 2.6, distutils is capable of cross-compiling between
+Windows platforms.  In practice, this means that with the correct tools
 installed, you can use a 32bit version of Windows to create 64bit extensions
 and vice-versa.
 
-To build for an alternate platform, specify the :option:`--plat-name` option 
-to the build command.  Valid values are currently 'win32', 'win-amd64' and 
+To build for an alternate platform, specify the :option:`--plat-name` option
+to the build command.  Valid values are currently 'win32', 'win-amd64' and
 'win-ia64'.  For example, on a 32bit version of Windows, you could execute::
 
    python setup.py build --plat-name=win-amd64
 
-to build a 64bit version of your extension.  The Windows Installers also 
+to build a 64bit version of your extension.  The Windows Installers also
 support this option, so the command::
 
    python setup.py build --plat-name=win-amd64 bdist_wininst
 
 would create a 64bit installation executable on your 32bit version of Windows.
 
-To cross-compile, you must download the Python source code and cross-compile 
+To cross-compile, you must download the Python source code and cross-compile
 Python itself for the platform you are targetting - it is not possible from a
 binary installtion of Python (as the .lib etc file for other platforms are
-not included.)  In practice, this means the user of a 32 bit operating 
-system will need to use Visual Studio 2008 to open the 
-:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the 
-"x64" configuration of the 'pythoncore' project before cross-compiling 
+not included.)  In practice, this means the user of a 32 bit operating
+system will need to use Visual Studio 2008 to open the
+:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the
+"x64" configuration of the 'pythoncore' project before cross-compiling
 extensions is possible.
 
 Note that by default, Visual Studio 2008 does not install 64bit compilers or

Modified: python/branches/py3k-issue1717/Doc/distutils/configfile.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/distutils/configfile.rst	(original)
+++ python/branches/py3k-issue1717/Doc/distutils/configfile.rst	Sun Jan 25 21:08:20 2009
@@ -63,7 +63,7 @@
      --include-dirs (-I)  list of directories to search for header files
      --define (-D)        C preprocessor macros to define
      --undef (-U)         C preprocessor macros to undefine
-     --swig-opts          list of SWIG command line options        
+     --swig-opts          list of SWIG command line options
    [...]
 
 Note that an option spelled :option:`--foo-bar` on the command-line  is spelled

Modified: python/branches/py3k-issue1717/Doc/distutils/packageindex.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/distutils/packageindex.rst	(original)
+++ python/branches/py3k-issue1717/Doc/distutils/packageindex.rst	Sun Jan 25 21:08:20 2009
@@ -8,17 +8,17 @@
 packaged with distutils. The distutils command :command:`register` is used to
 submit your distribution's meta-data to the index. It is invoked as follows::
 
-   python setup.py register
+    python setup.py register
 
 Distutils will respond with the following prompt::
 
-   running register
-   We need to know who you are, so please choose either:
-    1. use your existing login,
-    2. register as a new user,
-    3. have the server generate a new password for you (and email it to you), or
-    4. quit
-   Your selection [default 1]:
+    running register
+    We need to know who you are, so please choose either:
+        1. use your existing login,
+        2. register as a new user,
+        3. have the server generate a new password for you (and email it to you), or
+        4. quit
+    Your selection [default 1]:
 
 Note: if your username and password are saved locally, you will not see this
 menu.
@@ -55,40 +55,50 @@
 
 The format of the :file:`.pypirc` file is as follows::
 
-   [distutils]
-   index-servers =
-     pypi
+    [distutils]
+    index-servers =
+        pypi
 
-   [pypi]
-   repository: <repository-url>
-   username: <username>
-   password: <password>
+    [pypi]
+    repository: <repository-url>
+    username: <username>
+    password: <password>
 
-*repository* can be omitted and defaults to ``http://www.python.org/pypi``.
+The *distutils* section defines a *index-servers* variable that lists the
+name of all sections describing a repository.
 
-If you want to define another server a new section can be created::
+Each section describing a repository defines three variables:
 
-   [distutils]
-   index-servers =
-     pypi
-     other
- 
-   [pypi]
-   repository: <repository-url>
-   username: <username>
-   password: <password>
+- *repository*, that defines the url of the PyPI server. Defaults to
+    ``http://www.python.org/pypi``.
+- *username*, which is the registered username on the PyPI server.
+- *password*, that will be used to authenticate. If omitted the user
+    will be prompt to type it when needed.
 
-   [other]
-   repository: http://example.com/pypi
-   username: <username>
-   password: <password>
+If you want to define another server a new section can be created and
+listed in the *index-servers* variable::
 
-The command can then be called with the -r option::
+    [distutils]
+    index-servers =
+        pypi
+        other
 
-   python setup.py register -r http://example.com/pypi
+    [pypi]
+    repository: <repository-url>
+    username: <username>
+    password: <password>
 
-Or even with the section name::
+    [other]
+    repository: http://example.com/pypi
+    username: <username>
+    password: <password>
 
-   python setup.py register -r other
+:command:`register` can then be called with the -r option to point the
+repository to work with::
 
- 
+    python setup.py register -r http://example.com/pypi
+
+The name of the section that describes the repository may also be used
+for conveniency::
+
+    python setup.py register -r other

Modified: python/branches/py3k-issue1717/Doc/distutils/setupscript.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/distutils/setupscript.rst	(original)
+++ python/branches/py3k-issue1717/Doc/distutils/setupscript.rst	Sun Jan 25 21:08:20 2009
@@ -213,7 +213,7 @@
 this::
 
    setup(...,
-         ext_modules=[Extension('_foo', ['foo.i'], 
+         ext_modules=[Extension('_foo', ['foo.i'],
                                 swig_opts=['-modern', '-I../include'])],
          py_modules=['foo'],
         )

Modified: python/branches/py3k-issue1717/Doc/distutils/uploading.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/distutils/uploading.rst	(original)
+++ python/branches/py3k-issue1717/Doc/distutils/uploading.rst	Sun Jan 25 21:08:20 2009
@@ -11,7 +11,7 @@
 The command is invoked immediately after building one or more distribution
 files.  For example, the command ::
 
-   python setup.py sdist bdist_wininst upload
+    python setup.py sdist bdist_wininst upload
 
 will cause the source distribution and the Windows installer to be uploaded to
 PyPI.  Note that these will be uploaded even if they are built using an earlier
@@ -20,11 +20,14 @@
 
 The :command:`upload` command uses the username, password, and repository URL
 from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this
-file).
+file). If a :command:`register` command was previously called in the same command,
+and if the password was entered in the prompt, :command:`upload` will reuse the
+entered password. This is useful if you do not want to store a clear text
+password in the :file:`$HOME/.pypirc` file.
 
 You can specify another PyPI server with the :option:`--repository=*url*` option::
 
-   python setup.py sdist bdist_wininst upload -r http://example.com/pypi
+    python setup.py sdist bdist_wininst upload -r http://example.com/pypi
 
 See section :ref:`pypirc` for more on defining several servers.
 
@@ -33,9 +36,8 @@
 be available for execution on the system :envvar:`PATH`.  You can also specify
 which key to use for signing using the :option:`--identity=*name*` option.
 
-Other :command:`upload` options include  :option:`--repository=*url*` 
-or :option:`--repository=*section*` where `url` is the url of the server
-and `section` the name of the section in :file:`$HOME/.pypirc`, and
+Other :command:`upload` options include :option:`--repository=<url>` or
+:option:`--repository=<section>` where *url* is the url of the server and
+*section* the name of the section in :file:`$HOME/.pypirc`, and
 :option:`--show-response` (which displays the full response text from the PyPI
 server for help in debugging upload problems).
-

Modified: python/branches/py3k-issue1717/Doc/documenting/markup.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/documenting/markup.rst	(original)
+++ python/branches/py3k-issue1717/Doc/documenting/markup.rst	Sun Jan 25 21:08:20 2009
@@ -53,9 +53,9 @@
 
 .. describe:: module
 
-   This directive marks the beginning of the description of a module (or package
-   submodule, in which case the name should be fully qualified, including the
-   package name).
+   This directive marks the beginning of the description of a module, package,
+   or submodule. The name should be fully qualified (i.e. including the
+   package name for submodules).
 
    The ``platform`` option, if present, is a comma-separated list of the
    platforms on which the module is available (if it is available on all
@@ -285,7 +285,8 @@
 As said before, Sphinx uses interpreted text roles to insert semantic markup in
 documents.
 
-Variable names are an exception, they should be marked simply with ``*var*``.
+Names of local variables, such as function/method arguments, are an exception,
+they should be marked simply with ``*var*``.
 
 For all other roles, you have to write ``:rolename:`content```.
 
@@ -310,7 +311,7 @@
 
 .. describe:: data
 
-   The name of a module-level variable.
+   The name of a module-level variable or constant.
 
 .. describe:: const
 
@@ -508,7 +509,7 @@
    curly braces to indicate a "variable" part, as in ``:file:``.
 
    If you don't need the "variable part" indication, use the standard
-   ````code```` instead.   
+   ````code```` instead.
 
 .. describe:: var
 
@@ -598,8 +599,8 @@
 
    Example::
 
-      .. versionadded:: 2.5
-         The `spam` parameter.
+      .. versionadded:: 3.1
+         The *spam* parameter.
 
    Note that there must be no blank line between the directive head and the
    explanation; this is to make these blocks visually continuous in the markup.
@@ -760,14 +761,14 @@
    Blank lines are not allowed within ``productionlist`` directive arguments.
 
    The definition can contain token names which are marked as interpreted text
-   (e.g. ``sum ::= `integer` "+" `integer```) -- this generates cross-references
+   (e.g. ``unaryneg ::= "-" `integer```) -- this generates cross-references
    to the productions of these tokens.
 
    Note that no further reST parsing is done in the production, so that you
    don't have to escape ``*`` or ``|`` characters.
 
 
-.. XXX describe optional first parameter 
+.. XXX describe optional first parameter
 
 The following is an example taken from the Python Reference Manual::
 

Modified: python/branches/py3k-issue1717/Doc/extending/building.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/extending/building.rst	(original)
+++ python/branches/py3k-issue1717/Doc/extending/building.rst	Sun Jan 25 21:08:20 2009
@@ -39,7 +39,7 @@
 
 With this :file:`setup.py`, and a file :file:`demo.c`, running ::
 
-   python setup.py build 
+   python setup.py build
 
 will compile :file:`demo.c`, and produce an extension module named ``demo`` in
 the :file:`build` directory. Depending on the system, the module file will end

Modified: python/branches/py3k-issue1717/Doc/extending/extending.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/extending/extending.rst	(original)
+++ python/branches/py3k-issue1717/Doc/extending/extending.rst	Sun Jan 25 21:08:20 2009
@@ -334,7 +334,7 @@
 :cfunc:`PyInit_spam` is called. (See below for comments about embedding Python.)
 It calls :cfunc:`PyModule_Create`, which returns a module object, and
 inserts built-in function objects into the newly created module based upon the
-table (an array of :ctype:`PyMethodDef` structures) found in the module definition. 
+table (an array of :ctype:`PyMethodDef` structures) found in the module definition.
 :cfunc:`PyModule_Create` returns a pointer to the module object
 that it creates.  It may abort with a fatal error for
 certain errors, or return *NULL* if the module could not be initialized
@@ -482,7 +482,7 @@
 :cfunc:`PyEval_CallObject`.  This function has two arguments, both pointers to
 arbitrary Python objects: the Python function, and the argument list.  The
 argument list must always be a tuple object, whose length is the number of
-arguments.  To call the Python function with no arguments, pass in NULL, or 
+arguments.  To call the Python function with no arguments, pass in NULL, or
 an empty tuple; to call it with one argument, pass a singleton tuple.
 :cfunc:`Py_BuildValue` returns a tuple when its format string consists of zero
 or more format codes between parentheses.  For example::
@@ -521,7 +521,7 @@
    if (result == NULL)
        return NULL; /* Pass error back */
    ...use result...
-   Py_DECREF(result); 
+   Py_DECREF(result);
 
 Depending on the desired interface to the Python callback function, you may also
 have to provide an argument list to :cfunc:`PyEval_CallObject`.  In some cases
@@ -546,7 +546,7 @@
 the error check!  Also note that strictly speaking this code is not complete:
 :cfunc:`Py_BuildValue` may run out of memory, and this should be checked.
 
-You may also call a function with keyword arguments by using 
+You may also call a function with keyword arguments by using
 :cfunc:`PyEval_CallObjectWithKeywords`.  As in the above example, we use
 :cfunc:`Py_BuildValue` to construct the dictionary. ::
 
@@ -687,7 +687,7 @@
 
    static PyObject *
    keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds)
-   {  
+   {
        int voltage;
        char *state = "a stiff";
        char *action = "voom";
@@ -695,11 +695,11 @@
 
        static char *kwlist[] = {"voltage", "state", "action", "type", NULL};
 
-       if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist, 
+       if (!PyArg_ParseTupleAndKeywords(args, keywds, "i|sss", kwlist,
                                         &voltage, &state, &action, &type))
-           return NULL; 
+           return NULL;
 
-       printf("-- This parrot wouldn't %s if you put %i Volts through it.\n", 
+       printf("-- This parrot wouldn't %s if you put %i Volts through it.\n",
               action, voltage);
        printf("-- Lovely plumage, the %s -- It's %s!\n", type, state);
 

Modified: python/branches/py3k-issue1717/Doc/extending/newtypes.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/extending/newtypes.rst	(original)
+++ python/branches/py3k-issue1717/Doc/extending/newtypes.rst	Sun Jan 25 21:08:20 2009
@@ -823,8 +823,8 @@
 previous sections. We will break down the main differences between them. ::
 
    typedef struct {
-   	PyListObject list;
-   	int state;
+       PyListObject list;
+       int state;
    } Shoddy;
 
 The primary difference for derived type objects is that the base type's object
@@ -837,10 +837,10 @@
    static int
    Shoddy_init(Shoddy *self, PyObject *args, PyObject *kwds)
    {
-   	if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0)
-   		return -1;
-   	self->state = 0;
-   	return 0;
+       if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0)
+          return -1;
+       self->state = 0;
+       return 0;
    }
 
 In the :attr:`__init__` method for our type, we can see how to call through to
@@ -859,18 +859,18 @@
    PyMODINIT_FUNC
    PyInit_shoddy(void)
    {
-        PyObject *m;
+       PyObject *m;
 
-        ShoddyType.tp_base = &PyList_Type;
-        if (PyType_Ready(&ShoddyType) < 0)
-            return NULL;
-
-        m = PyModule_Create(&shoddymodule);
-        if (m == NULL)
-            return NULL;
+       ShoddyType.tp_base = &PyList_Type;
+       if (PyType_Ready(&ShoddyType) < 0)
+           return NULL;
+
+       m = PyModule_Create(&shoddymodule);
+       if (m == NULL)
+           return NULL;
 
-        Py_INCREF(&ShoddyType);
-        PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType);
+       Py_INCREF(&ShoddyType);
+       PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType);
    }
 
 Before calling :cfunc:`PyType_Ready`, the type structure must have the
@@ -1113,7 +1113,7 @@
    typedef struct PyMethodDef {
        char        *ml_name;       /* method name */
        PyCFunction  ml_meth;       /* implementation function */
-       int	         ml_flags;      /* flags */
+       int          ml_flags;      /* flags */
        char        *ml_doc;        /* docstring */
    } PyMethodDef;
 
@@ -1180,7 +1180,7 @@
 of *NULL* is required.
 
 .. XXX Descriptors need to be explained in more detail somewhere, but not here.
-   
+
    Descriptor objects have two handler functions which correspond to the
    \member{tp_getattro} and \member{tp_setattro} handlers.  The
    \method{__get__()} handler is a function which is passed the descriptor,
@@ -1216,7 +1216,7 @@
 
        PyErr_Format(PyExc_AttributeError,
                     "'%.50s' object has no attribute '%.400s'",
-		    tp->tp_name, name);
+                    tp->tp_name, name);
        return NULL;
    }
 
@@ -1233,15 +1233,15 @@
        return -1;
    }
 
-.. XXX tp_compare is dead; need to rewrite for tp_richcompare!  
+.. XXX tp_compare is dead; need to rewrite for tp_richcompare!
 
    Object Comparison
    -----------------
-    
+
    ::
-    
+
       cmpfunc tp_compare;
-    
+
    The :attr:`tp_compare` handler is called when comparisons are needed and the
    object does not implement the specific rich comparison method which matches the
    requested comparison.  (It is always used if defined and the
@@ -1252,18 +1252,18 @@
    allowed to return arbitrary negative or positive integers for less than and
    greater than, respectively; as of Python 2.2, this is no longer allowed.  In the
    future, other return values may be assigned a different meaning.)
-    
+
    A :attr:`tp_reserved` handler may raise an exception.  In this case it should
    return a negative value.  The caller has to test for the exception using
    :cfunc:`PyErr_Occurred`.
-    
+
    Here is a sample implementation::
-    
+
       static int
       newdatatype_compare(newdatatypeobject * obj1, newdatatypeobject * obj2)
       {
           long result;
-    
+
           if (obj1->obj_UnderlyingDatatypePtr->size <
               obj2->obj_UnderlyingDatatypePtr->size) {
               result = -1;

Modified: python/branches/py3k-issue1717/Doc/extending/windows.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/extending/windows.rst	(original)
+++ python/branches/py3k-issue1717/Doc/extending/windows.rst	Sun Jan 25 21:08:20 2009
@@ -102,15 +102,11 @@
    and it should call :cfunc:`Py_InitModule` with the string ``"spam"`` as its
    first argument (use the minimal :file:`example.c` in this directory as a guide).
    By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`.
-   The output file should be called :file:`spam.pyd` (in Release mode) or  
+   The output file should be called :file:`spam.pyd` (in Release mode) or
    :file:`spam_d.pyd` (in Debug mode). The extension :file:`.pyd` was chosen
    to avoid confusion with a system library :file:`spam.dll` to which your module
    could be a Python interface.
 
-   .. versionchanged:: 2.5
-      Previously, file names like :file:`spam.dll` (in release mode) or
-      :file:`spam_d.dll` (in debug mode) were also recognized.
-
    Now your options are:
 
 #. Copy :file:`example.sln` and :file:`example.vcproj`, rename them to

Modified: python/branches/py3k-issue1717/Doc/glossary.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/glossary.rst	(original)
+++ python/branches/py3k-issue1717/Doc/glossary.rst	Sun Jan 25 21:08:20 2009
@@ -11,7 +11,7 @@
    ``>>>``
       The default Python prompt of the interactive shell.  Often seen for code
       examples which can be executed interactively in the interpreter.
-    
+
    ``...``
       The default Python prompt of the interactive shell when entering code for
       an indented code block or within a pair of matching left and right
@@ -50,11 +50,11 @@
       A value associated with an object which is referenced by name using
       dotted expressions.  For example, if an object *o* has an attribute
       *a* it would be referenced as *o.a*.
-    
+
    BDFL
       Benevolent Dictator For Life, a.k.a. `Guido van Rossum
       <http://www.python.org/~guido/>`_, Python's creator.
-    
+
    bytecode
       Python source code is compiled into bytecode, the internal representation
       of a Python program in the interpreter.  The bytecode is also cached in
@@ -67,7 +67,7 @@
       A template for creating user-defined objects. Class definitions
       normally contain method definitions which operate on instances of the
       class.
-    
+
    coercion
       The implicit conversion of an instance of one type to another during an
       operation which involves two arguments of the same type.  For example,
@@ -77,7 +77,7 @@
       will raise a ``TypeError``.  Without coercion, all arguments of even
       compatible types would have to be normalized to the same value by the
       programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``.
-    
+
    complex number
       An extension of the familiar real number system in which all numbers are
       expressed as a sum of a real part and an imaginary part.  Imaginary
@@ -89,7 +89,7 @@
       :mod:`math` module, use :mod:`cmath`.  Use of complex numbers is a fairly
       advanced mathematical feature.  If you're not aware of a need for them,
       it's almost certain you can safely ignore them.
-    
+
    context manager
       An object which controls the environment seen in a :keyword:`with`
       statement by defining :meth:`__enter__` and :meth:`__exit__` methods.
@@ -132,7 +132,7 @@
       and reference to super classes.
 
       For more information about descriptors' methods, see :ref:`descriptors`.
-    
+
    dictionary
       An associative array, where arbitrary keys are mapped to values.  The use
       of :class:`dict` closely resembles that for :class:`list`, but the keys can
@@ -146,8 +146,8 @@
       of the enclosing class, function or module.  Since it is available via
       introspection, it is the canonical place for documentation of the
       object.
-    
-   duck-typing 
+
+   duck-typing
       A pythonic programming style which determines an object's type by inspection
       of its method or attribute signature rather than by explicit relationship
       to some type object ("If it looks like a duck and quacks like a duck, it
@@ -157,13 +157,13 @@
       :func:`isinstance`. (Note, however, that duck-typing can be complemented
       with abstract base classes.) Instead, it typically employs :func:`hasattr`
       tests or :term:`EAFP` programming.
-    
+
    EAFP
       Easier to ask for forgiveness than permission.  This common Python coding
       style assumes the existence of valid keys or attributes and catches
       exceptions if the assumption proves false.  This clean and fast style is
       characterized by the presence of many :keyword:`try` and :keyword:`except`
-      statements.  The technique contrasts with the :term:`LBYL` style 
+      statements.  The technique contrasts with the :term:`LBYL` style
       common to many other languages such as C.
 
    expression
@@ -179,6 +179,11 @@
       A module written in C or C++, using Python's C API to interact with the core and
       with user code.
 
+   finder
+      An object that tries to find the :term:`loader` for a module. It must
+      implement a method named :meth:`find_module`. See :pep:`302` for
+      details.
+
    floor division
       Mathematical division discarding any remainder.  The floor division
       operator is ``//``.  For example, the expression ``11//4`` evaluates to
@@ -196,7 +201,7 @@
       By importing the :mod:`__future__` module and evaluating its variables,
       you can see when a new feature was first added to the language and when it
       becomes the default::
-    
+
          >>> import __future__
          >>> __future__.division
          _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)
@@ -205,7 +210,7 @@
       The process of freeing memory when it is not used anymore.  Python
       performs garbage collection via reference counting and a cyclic garbage
       collector that is able to detect and break reference cycles.
-    
+
    generator
       A function which returns an iterator.  It looks like a normal function
       except that values are returned to the caller using a :keyword:`yield`
@@ -215,21 +220,21 @@
       stopped at the :keyword:`yield` keyword (returning the result) and is
       resumed there when the next element is requested by calling the
       :meth:`__next__` method of the returned iterator.
-    
+
       .. index:: single: generator expression
-    
+
    generator expression
       An expression that returns a generator.  It looks like a normal expression
       followed by a :keyword:`for` expression defining a loop variable, range,
       and an optional :keyword:`if` expression.  The combined expression
       generates values for an enclosing function::
-    
+
          >>> sum(i*i for i in range(10))         # sum of squares 0, 1, 4, ... 81
          285
-    
+
    GIL
       See :term:`global interpreter lock`.
-    
+
    global interpreter lock
       The lock used by Python threads to assure that only one thread
       executes in the :term:`CPython` :term:`virtual machine` at a time.
@@ -255,14 +260,14 @@
       containers (such as lists or dictionaries) are.  Objects which are
       instances of user-defined classes are hashable by default; they all
       compare unequal, and their hash value is their :func:`id`.
-    
+
    IDLE
       An Integrated Development Environment for Python.  IDLE is a basic editor
       and interpreter environment which ships with the standard distribution of
       Python.  Good for beginners, it also serves as clear example code for
       those wanting to implement a moderately sophisticated, multi-platform GUI
       application.
-    
+
    immutable
       An object with a fixed value.  Immutable objects include numbers, strings and
       tuples.  Such an object cannot be altered.  A new object has to
@@ -270,6 +275,10 @@
       role in places where a constant hash value is needed, for example as a key
       in a dictionary.
 
+   importer
+      An object that both finds and loads a module; both a
+      :term:`finder` and :term:`loader` object.
+
    interactive
       Python has an interactive interpreter which means you can enter
       statements and expressions at the interpreter prompt, immediately
@@ -277,7 +286,7 @@
       arguments (possibly by selecting it from your computer's main
       menu). It is a very powerful way to test out new ideas or inspect
       modules and packages (remember ``help(x)``).
-    
+
    interpreted
       Python is an interpreted language, as opposed to a compiled one,
       though the distinction can be blurry because of the presence of the
@@ -286,7 +295,7 @@
       Interpreted languages typically have a shorter development/debug cycle
       than compiled ones, though their programs generally also run more
       slowly.  See also :term:`interactive`.
-    
+
    iterable
       A container object capable of returning its members one at a
       time. Examples of iterables include all sequence types (such as
@@ -302,7 +311,7 @@
       statement does that automatically for you, creating a temporary unnamed
       variable to hold the iterator for the duration of the loop.  See also
       :term:`iterator`, :term:`sequence`, and :term:`generator`.
-    
+
    iterator
       An object representing a stream of data.  Repeated calls to the iterator's
       :meth:`__next__` (or passing it to the builtin function)  :func:`next`
@@ -318,7 +327,7 @@
       :func:`iter` function or use it in a :keyword:`for` loop.  Attempting this
       with an iterator will just return the same exhausted iterator object used
       in the previous iteration pass, making it appear like an empty container.
-    
+
       More information can be found in :ref:`typeiter`.
 
    keyword argument
@@ -342,7 +351,7 @@
       A built-in Python :term:`sequence`.  Despite its name it is more akin
       to an array in other languages than to a linked list since access to
       elements are O(1).
-    
+
    list comprehension
       A compact way to process all or part of the elements in a sequence and
       return a list with the results.  ``result = ["0x%02x" % x for x in
@@ -350,11 +359,16 @@
       even hex numbers (0x..) in the range from 0 to 255. The :keyword:`if`
       clause is optional.  If omitted, all elements in ``range(256)`` are
       processed.
-    
+
+   loader
+      An object that loads a module. It must define a method named
+      :meth:`load_module`. A loader is typically returned by a
+      :term:`finder`. See :pep:`302` for details.
+
    mapping
       A container object (such as :class:`dict`) which supports arbitrary key
       lookups using the special method :meth:`__getitem__`.
-    
+
    metaclass
       The class of a class.  Class definitions create a class name, a class
       dictionary, and a list of base classes.  The metaclass is responsible for
@@ -373,7 +387,7 @@
       of an instance of that class, the method will get the instance object as
       its first :term:`argument` (which is usually called ``self``).
       See :term:`function` and :term:`nested scope`.
-    
+
    mutable
       Mutable objects can change their value but keep their :func:`id`.  See
       also :term:`immutable`.
@@ -390,7 +404,7 @@
       :func:`collections.namedtuple`.  The latter approach automatically
       provides extra features such as a self-documenting representation like
       ``Employee(name='jones', title='programmer')``.
-    
+
    namespace
       The place where a variable is stored.  Namespaces are implemented as
       dictionaries.  There are the local, global and builtin namespaces as well
@@ -402,7 +416,7 @@
       :func:`random.seed` or :func:`itertools.izip` makes it clear that those
       functions are implemented by the :mod:`random` and :mod:`itertools`
       modules, respectively.
-    
+
    nested scope
       The ability to refer to a variable in an enclosing definition.  For
       instance, a function defined inside another function can refer to
@@ -410,7 +424,7 @@
       reference and not for assignment which will always write to the innermost
       scope.  In contrast, local variables both read and write in the innermost
       scope.  Likewise, global variables read and write to the global namespace.
-    
+
    new-style class
       Old name for the flavor of classes now used for all class objects.  In
       earlier Python versions, only new-style classes could use Python's newer,
@@ -421,7 +435,7 @@
       Any data with state (attributes or value) and defined behavior
       (methods).  Also the ultimate base class of any :term:`new-style
       class`.
-    
+
    positional argument
       The arguments assigned to local names inside a function or method,
       determined by the order in which they were given in the call.  ``*`` is
@@ -441,7 +455,7 @@
       to loop over all elements of an iterable using a :keyword:`for`
       statement.  Many other languages don't have this type of construct, so
       people unfamiliar with Python sometimes use a numerical counter instead::
-     
+
           for i in range(len(food)):
               print(food[i])
 
@@ -464,7 +478,7 @@
       popular, the technique is somewhat tricky to get right and is best
       reserved for rare cases where there are large numbers of instances in a
       memory-critical application.
-    
+
    sequence
       An :term:`iterable` which supports efficient element access using integer
       indices via the :meth:`__getitem__` special method and defines a
@@ -516,7 +530,7 @@
    virtual machine
       A computer defined entirely in software.  Python's virtual machine
       executes the :term:`bytecode` emitted by the bytecode compiler.
-    
+
    Zen of Python
       Listing of Python design principles and philosophies that are helpful in
       understanding and using the language.  The listing can be found by typing

Modified: python/branches/py3k-issue1717/Doc/howto/curses.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/howto/curses.rst	(original)
+++ python/branches/py3k-issue1717/Doc/howto/curses.rst	Sun Jan 25 21:08:20 2009
@@ -297,7 +297,7 @@
 could code::
 
    stdscr.addstr(0, 0, "Current mode: Typing mode",
-   	      curses.A_REVERSE)
+                 curses.A_REVERSE)
    stdscr.refresh()
 
 The curses library also supports color on those terminals that provide it, The
@@ -399,8 +399,8 @@
 
    curses.echo()            # Enable echoing of characters
 
-   # Get a 15-character string, with the cursor on the top line 
-   s = stdscr.getstr(0,0, 15)  
+   # Get a 15-character string, with the cursor on the top line
+   s = stdscr.getstr(0,0, 15)
 
 The Python :mod:`curses.textpad` module supplies something better. With it, you
 can turn a window into a text box that supports an Emacs-like set of

Modified: python/branches/py3k-issue1717/Doc/howto/doanddont.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/howto/doanddont.rst	(original)
+++ python/branches/py3k-issue1717/Doc/howto/doanddont.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ************************************
-  Idioms and Anti-Idioms in Python  
+  Idioms and Anti-Idioms in Python
 ************************************
 
 :Author: Moshe Zadka
@@ -94,7 +94,7 @@
    # bar.py
    from foo import a
    if something():
-       a = 2 # danger: foo.a != a 
+       a = 2 # danger: foo.a != a
 
 Good example::
 
@@ -271,6 +271,6 @@
 
 This version is bulletproof::
 
-   value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] 
+   value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9]
            + calculate_number(10, 20)*forbulate(500, 360))
 

Modified: python/branches/py3k-issue1717/Doc/howto/functional.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/howto/functional.rst	(original)
+++ python/branches/py3k-issue1717/Doc/howto/functional.rst	Sun Jan 25 21:08:20 2009
@@ -145,7 +145,7 @@
 functions are also easier to read and to check for errors.
 
 
-Ease of debugging and testing 
+Ease of debugging and testing
 -----------------------------
 
 Testing and debugging a functional-style program is easier.
@@ -213,7 +213,7 @@
     Traceback (most recent call last):
       File "<stdin>", line 1, in ?
     StopIteration
-    >>>      
+    >>>
 
 Python expects iterable objects in several different contexts, the most
 important being the ``for`` statement.  In the statement ``for X in Y``, Y must
@@ -363,7 +363,7 @@
 comprehensions are surrounded by square brackets ("[]").  Generator expressions
 have the form::
 
-    ( expression for expr in sequence1 
+    ( expression for expr in sequence1
                  if condition1
                  for expr2 in sequence2
                  if condition2
@@ -405,7 +405,7 @@
                  if not (conditionN):
                      continue   # Skip this element
 
-                 # Output the value of 
+                 # Output the value of
                  # the expression.
 
 This means that when there are multiple ``for...in`` clauses but no ``if``
@@ -419,8 +419,8 @@
     >>> seq1 = 'abc'
     >>> seq2 = (1,2,3)
     >>> [(x,y) for x in seq1 for y in seq2]
-    [('a', 1), ('a', 2), ('a', 3), 
-     ('b', 1), ('b', 2), ('b', 3), 
+    [('a', 1), ('a', 2), ('a', 3),
+     ('b', 1), ('b', 2), ('b', 3),
      ('c', 1), ('c', 2), ('c', 3)]
 
 To avoid introducing an ambiguity into Python's grammar, if ``expression`` is
@@ -586,7 +586,7 @@
     9
     >>> next(it)
     Traceback (most recent call last):
-      File ``t.py'', line 15, in ?
+      File "t.py", line 15, in ?
         it.next()
     StopIteration
 
@@ -627,7 +627,7 @@
 Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate the
 features of generator expressions:
 
-``map(f, iterA, iterB, ...)`` returns an iterator over the sequence 
+``map(f, iterA, iterB, ...)`` returns an iterator over the sequence
  ``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``.
 
     >>> def upper(s):
@@ -639,7 +639,7 @@
     >>> [upper(s) for s in ['sentence', 'fragment']]
     ['SENTENCE', 'FRAGMENT']
 
-You can of course achieve the same effect with a list comprehension. 
+You can of course achieve the same effect with a list comprehension.
 
 ``filter(predicate, iter)`` returns an iterator over all the sequence elements
 that meet a certain condition, and is similarly duplicated by list
@@ -709,7 +709,7 @@
     True
     >>> all([0,1,0])
     False
-    >>> all([0,0,0]) 
+    >>> all([0,0,0])
     False
     >>> all([1,1,1])
     True
@@ -827,7 +827,7 @@
 ``itertools.starmap(func, iter)`` assumes that the iterable will return a stream
 of tuples, and calls ``f()`` using these tuples as the arguments::
 
-    itertools.starmap(os.path.join, 
+    itertools.starmap(os.path.join,
                       [('/usr', 'bin', 'java'), ('/bin', 'python'),
                        ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')])
     =>
@@ -887,9 +887,9 @@
 
 ::
 
-    city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), 
+    city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'),
                  ('Anchorage', 'AK'), ('Nome', 'AK'),
-                 ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), 
+                 ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'),
                  ...
                 ]
 
@@ -904,7 +904,7 @@
     where
     iterator-1 =>
       ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL')
-    iterator-2 => 
+    iterator-2 =>
       ('Anchorage', 'AK'), ('Nome', 'AK')
     iterator-3 =>
       ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')
@@ -1045,7 +1045,7 @@
 
     >>> double(add(5, 6))
     22
-                    
+
 The ``unpack`` keyword is provided to work around the fact that Python functions
 are not always `fully curried <http://en.wikipedia.org/wiki/Currying>`__.  By
 default, it is expected that the ``inner`` function will return a single object
@@ -1054,15 +1054,15 @@
 will be expanded before being passed to ``outer``. Put simply, ::
 
     compose(f, g)(5, 6)
-                    
+
 is equivalent to::
 
     f(g(5, 6))
-                    
+
 while ::
 
     compose(f, g, unpack=True)(5, 6)
-                    
+
 is equivalent to::
 
     f(*g(5, 6))
@@ -1074,21 +1074,21 @@
 
     from functional import compose, partial
     import functools
-        
+
 
     multi_compose = partial(functools.reduce, compose)
-        
-    
+
+
 We can also use ``map()``, ``compose()`` and ``partial()`` to craft a version of
 ``"".join(...)`` that converts its arguments to string::
 
     from functional import compose, partial
-        
+
     join = compose("".join, partial(map, str))
 
 
 ``flip(func)``
-                    
+
 ``flip()`` wraps the callable in ``func`` and causes it to receive its
 non-keyword arguments in reverse order. ::
 
@@ -1103,7 +1103,7 @@
     (7, 6, 5)
 
 ``foldl(func, start, iterable)``
-                    
+
 ``foldl()`` takes a binary function, a starting value (usually some kind of
 'zero'), and an iterable.  The function is applied to the starting value and the
 first element of the list, then the result of that and the second element of the
@@ -1117,7 +1117,7 @@
 
     f(f(f(0, 1), 2), 3)
 
-    
+
 ``foldl()`` is roughly equivalent to the following recursive function::
 
     def foldl(func, start, seq):
@@ -1224,7 +1224,7 @@
 4) Convert the lambda to a def statement, using that name.
 5) Remove the comment.
 
-I really like these rules, but you're free to disagree 
+I really like these rules, but you're free to disagree
 about whether this lambda-free style is better.
 
 
@@ -1282,7 +1282,7 @@
 Text Processing".
 
 Mertz also wrote a 3-part series of articles on functional programming
-for IBM's DeveloperWorks site; see 
+for IBM's DeveloperWorks site; see
 `part 1 <http://www-128.ibm.com/developerworks/library/l-prog.html>`__,
 `part 2 <http://www-128.ibm.com/developerworks/library/l-prog2.html>`__, and
 `part 3 <http://www-128.ibm.com/developerworks/linux/library/l-prog3.html>`__,

Modified: python/branches/py3k-issue1717/Doc/howto/regex.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/howto/regex.rst	(original)
+++ python/branches/py3k-issue1717/Doc/howto/regex.rst	Sun Jan 25 21:08:20 2009
@@ -611,7 +611,7 @@
    is to read? ::
 
       charref = re.compile(r"""
-       &[#]		     # Start of a numeric entity reference
+       &[#]                # Start of a numeric entity reference
        (
            0[0-7]+         # Octal form
          | [0-9]+          # Decimal form
@@ -917,7 +917,7 @@
 
    InternalDate = re.compile(r'INTERNALDATE "'
            r'(?P<day>[ 123][0-9])-(?P<mon>[A-Z][a-z][a-z])-'
-   	r'(?P<year>[0-9][0-9][0-9][0-9])'
+           r'(?P<year>[0-9][0-9][0-9][0-9])'
            r' (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9])'
            r' (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])'
            r'"')

Modified: python/branches/py3k-issue1717/Doc/howto/sockets.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/howto/sockets.rst	(original)
+++ python/branches/py3k-issue1717/Doc/howto/sockets.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ****************************
-  Socket Programming HOWTO  
+  Socket Programming HOWTO
 ****************************
 
 :Author: Gordon McMillan
@@ -62,7 +62,7 @@
 
    #create an INET, STREAMing socket
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-   #now connect to the web server on port 80 
+   #now connect to the web server on port 80
    # - the normal http port
    s.connect(("www.mcmillan-inc.com", 80))
 
@@ -77,7 +77,7 @@
    #create an INET, STREAMing socket
    serversocket = socket.socket(
        socket.AF_INET, socket.SOCK_STREAM)
-   #bind the socket to a public host, 
+   #bind the socket to a public host,
    # and a well-known port
    serversocket.bind((socket.gethostname(), 80))
    #become a server socket
@@ -184,35 +184,35 @@
 length message::
 
    class mysocket:
-       """demonstration class only 
+       """demonstration class only
          - coded for clarity, not efficiency
        """
 
        def __init__(self, sock=None):
-      	   if sock is None:
-   	           self.sock = socket.socket(
-   		                       socket.AF_INET, socket.SOCK_STREAM)
-   	       else:
-   	           self.sock = sock
+           if sock is None:
+               self.sock = socket.socket(
+                               socket.AF_INET, socket.SOCK_STREAM)
+               else:
+                   self.sock = sock
 
        def connect(self, host, port):
            self.sock.connect((host, port))
 
        def mysend(self, msg):
-   	       totalsent = 0
-   	       while totalsent < MSGLEN:
-   	           sent = self.sock.send(msg[totalsent:])
-   	           if sent == 0:
-   		           raise RuntimeError("socket connection broken")
-   	           totalsent = totalsent + sent
+           totalsent = 0
+           while totalsent < MSGLEN:
+               sent = self.sock.send(msg[totalsent:])
+               if sent == 0:
+                   raise RuntimeError("socket connection broken")
+               totalsent = totalsent + sent
 
        def myreceive(self):
            msg = ''
            while len(msg) < MSGLEN:
-   	           chunk = self.sock.recv(MSGLEN-len(msg))
-   	           if chunk == '':
-   		           raise RuntimeError("socket connection broken")
-   	           msg = msg + chunk
+               chunk = self.sock.recv(MSGLEN-len(msg))
+               if chunk == '':
+                   raise RuntimeError("socket connection broken")
+               msg = msg + chunk
            return msg
 
 The sending code here is usable for almost any messaging scheme - in Python you
@@ -340,9 +340,9 @@
 
    ready_to_read, ready_to_write, in_error = \
                   select.select(
-                     potential_readers, 
-                     potential_writers, 
-                     potential_errs, 
+                     potential_readers,
+                     potential_writers,
+                     potential_errs,
                      timeout)
 
 You pass ``select`` three lists: the first contains all sockets that you might

Modified: python/branches/py3k-issue1717/Doc/howto/unicode.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/howto/unicode.rst	(original)
+++ python/branches/py3k-issue1717/Doc/howto/unicode.rst	Sun Jan 25 21:08:20 2009
@@ -32,8 +32,8 @@
 looking at Apple ][ BASIC programs, published in French-language publications in
 the mid-1980s, that had lines like these::
 
-	PRINT "FICHIER EST COMPLETE."
-	PRINT "CARACTERE NON ACCEPTE."
+   PRINT "FICHIER EST COMPLETE."
+   PRINT "CARACTERE NON ACCEPTE."
 
 Those messages should contain accents, and they just look wrong to someone who
 can read French.
@@ -91,11 +91,11 @@
 character with value 0x12ca (4810 decimal).  The Unicode standard contains a lot
 of tables listing characters and their corresponding code points::
 
-	0061    'a'; LATIN SMALL LETTER A
-	0062    'b'; LATIN SMALL LETTER B
-	0063    'c'; LATIN SMALL LETTER C
-        ...
-	007B	'{'; LEFT CURLY BRACKET
+   0061    'a'; LATIN SMALL LETTER A
+   0062    'b'; LATIN SMALL LETTER B
+   0063    'c'; LATIN SMALL LETTER C
+   ...
+   007B    '{'; LEFT CURLY BRACKET
 
 Strictly, these definitions imply that it's meaningless to say 'this is
 character U+12ca'.  U+12ca is a code point, which represents some particular
@@ -527,19 +527,19 @@
 assuming the default filesystem encoding is UTF-8, running the following
 program::
 
-	fn = 'filename\u4500abc'
-	f = open(fn, 'w')
-	f.close()
-
-	import os
-	print(os.listdir(b'.'))
-	print(os.listdir('.'))
+   fn = 'filename\u4500abc'
+   f = open(fn, 'w')
+   f.close()
+
+   import os
+   print(os.listdir(b'.'))
+   print(os.listdir('.'))
 
 will produce the following output::
 
-	amk:~$ python t.py
-	[b'.svn', b'filename\xe4\x94\x80abc', ...]
-	['.svn', 'filename\u4500abc', ...]
+   amk:~$ python t.py
+   [b'.svn', b'filename\xe4\x94\x80abc', ...]
+   ['.svn', 'filename\u4500abc', ...]
 
 The first list contains UTF-8-encoded filenames, and the second list contains
 the Unicode versions.
@@ -636,26 +636,26 @@
    - [ ] Unicode introduction
        - [ ] ASCII
        - [ ] Terms
-	   - [ ] Character
-	   - [ ] Code point
-	 - [ ] Encodings
-	    - [ ] Common encodings: ASCII, Latin-1, UTF-8
+           - [ ] Character
+           - [ ] Code point
+         - [ ] Encodings
+            - [ ] Common encodings: ASCII, Latin-1, UTF-8
        - [ ] Unicode Python type
-	   - [ ] Writing unicode literals
-	       - [ ] Obscurity: -U switch
-	   - [ ] Built-ins
-	       - [ ] unichr()
-	       - [ ] ord()
-	       - [ ] unicode() constructor
-	   - [ ] Unicode type
-	       - [ ] encode(), decode() methods
+           - [ ] Writing unicode literals
+               - [ ] Obscurity: -U switch
+           - [ ] Built-ins
+               - [ ] unichr()
+               - [ ] ord()
+               - [ ] unicode() constructor
+           - [ ] Unicode type
+               - [ ] encode(), decode() methods
        - [ ] Unicodedata module for character properties
        - [ ] I/O
-	   - [ ] Reading/writing Unicode data into files
-	       - [ ] Byte-order marks
-	   - [ ] Unicode filenames
+           - [ ] Reading/writing Unicode data into files
+               - [ ] Byte-order marks
+           - [ ] Unicode filenames
        - [ ] Writing Unicode programs
-	   - [ ] Do everything in Unicode
-	   - [ ] Declaring source code encodings (PEP 263)
+           - [ ] Do everything in Unicode
+           - [ ] Declaring source code encodings (PEP 263)
        - [ ] Other issues
-	   - [ ] Building Python (UCS2, UCS4)
+           - [ ] Building Python (UCS2, UCS4)

Modified: python/branches/py3k-issue1717/Doc/howto/urllib2.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/howto/urllib2.rst	(original)
+++ python/branches/py3k-issue1717/Doc/howto/urllib2.rst	Sun Jan 25 21:08:20 2009
@@ -10,7 +10,7 @@
     HOWTO, available at `urllib2 - Le Manuel manquant
     <http://www.voidspace.org.uk/python/articles/urllib2_francais.shtml>`_.
 
- 
+
 
 Introduction
 ============
@@ -19,9 +19,9 @@
 
     You may also find useful the following article on fetching web resources
     with Python:
-    
+
     * `Basic Authentication <http://www.voidspace.org.uk/python/articles/authentication.shtml>`_
-    
+
         A tutorial on *Basic Authentication*, with examples in Python.
 
 **urllib.request** is a `Python <http://www.python.org>`_ module for fetching URLs
@@ -98,7 +98,7 @@
 library. ::
 
     import urllib.parse
-    import urllib.request 
+    import urllib.request
 
     url = 'http://www.someserver.com/cgi-bin/register.cgi'
     values = {'name' : 'Michael Foord',
@@ -161,15 +161,15 @@
 Explorer [#]_. ::
 
     import urllib.parse
-    import urllib.request 
-    
+    import urllib.request
+
     url = 'http://www.someserver.com/cgi-bin/register.cgi'
-    user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' 
+    user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
     values = {'name' : 'Michael Foord',
               'location' : 'Northampton',
               'language' : 'Python' }
     headers = { 'User-Agent' : user_agent }
-    
+
     data = urllib.parse.urlencode(values)
     req = urllib.request.Request(url, data, headers)
     response = urllib.request.urlopen(req)
@@ -183,7 +183,7 @@
 ===================
 
 *urlopen* raises :exc:`URLError` when it cannot handle a response (though as usual
-with Python APIs, builtin exceptions such as 
+with Python APIs, builtin exceptions such as
 :exc:`ValueError`, :exc:`TypeError` etc. may also
 be raised).
 
@@ -311,18 +311,18 @@
 geturl, and info, methods as returned by the ``urllib.response`` module::
 
     >>> req = urllib.request.Request('http://www.python.org/fish.html')
-    >>> try: 
+    >>> try:
     >>>     urllib.request.urlopen(req)
     >>> except urllib.error.URLError, e:
     >>>     print(e.code)
     >>>     print(e.read())
-    >>> 
+    >>>
     404
-    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
+    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
         "http://www.w3.org/TR/html4/loose.dtd">
-    <?xml-stylesheet href="./css/ht2html.css" 
+    <?xml-stylesheet href="./css/ht2html.css"
         type="text/css"?>
-    <html><head><title>Error 404: File Not Found</title> 
+    <html><head><title>Error 404: File Not Found</title>
     ...... etc...
 
 Wrapping it Up
@@ -376,7 +376,7 @@
             print('Error code: ', e.code)
     else:
         # everything is fine
-        
+
 
 info and geturl
 ===============
@@ -448,7 +448,7 @@
 and a 'realm'. The header looks like : ``Www-authenticate: SCHEME
 realm="REALM"``.
 
-e.g. :: 
+e.g. ::
 
     Www-authenticate: Basic realm="cPanel Users"
 
@@ -472,24 +472,24 @@
 than the URL you pass to .add_password() will also match. ::
 
     # create a password manager
-    password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()                        
+    password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
 
     # Add the username and password.
-    # If we knew the realm, we could use it instead of ``None``.
+    # If we knew the realm, we could use it instead of None.
     top_level_url = "http://example.com/foo/"
     password_mgr.add_password(None, top_level_url, username, password)
 
-    handler = urllib.request.HTTPBasicAuthHandler(password_mgr)                            
+    handler = urllib.request.HTTPBasicAuthHandler(password_mgr)
 
     # create "opener" (OpenerDirector instance)
-    opener = urllib.request.build_opener(handler)                       
+    opener = urllib.request.build_opener(handler)
 
     # use the opener to fetch a URL
-    opener.open(a_url)      
+    opener.open(a_url)
 
     # Install the opener.
     # Now all calls to urllib.request.urlopen use our opener.
-    urllib.request.install_opener(opener)                               
+    urllib.request.install_opener(opener)
 
 .. note::
 
@@ -545,7 +545,7 @@
 
     # timeout in seconds
     timeout = 10
-    socket.setdefaulttimeout(timeout) 
+    socket.setdefaulttimeout(timeout)
 
     # this call to urllib.request.urlopen now uses the default timeout
     # we have set in the socket module
@@ -562,7 +562,7 @@
 This document was reviewed and revised by John Lee.
 
 .. [#] For an introduction to the CGI protocol see
-       `Writing Web Applications in Python <http://www.pyzine.com/Issue008/Section_Articles/article_CGIOne.html>`_. 
+       `Writing Web Applications in Python <http://www.pyzine.com/Issue008/Section_Articles/article_CGIOne.html>`_.
 .. [#] Like Google for example. The *proper* way to use google from a program
        is to use `PyGoogle <http://pygoogle.sourceforge.net>`_ of course. See
        `Voidspace Google <http://www.voidspace.org.uk/python/recipebook.shtml#google>`_
@@ -579,6 +579,6 @@
        is set to use the proxy, which urllib picks up on. In order to test
        scripts with a localhost server, I have to prevent urllib from using
        the proxy.
-.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe 
+.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe
        <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/456195>`_.
- 
+

Modified: python/branches/py3k-issue1717/Doc/howto/webservers.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/howto/webservers.rst	(original)
+++ python/branches/py3k-issue1717/Doc/howto/webservers.rst	Sun Jan 25 21:08:20 2009
@@ -88,7 +88,7 @@
    <http://wiki.python.org/moin/CgiScripts>`_ with some additional information
    about CGI in Python.
 
-   
+
 Simple script for testing CGI
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -387,7 +387,7 @@
 
    You might be interested in some WSGI-supporting modules already contained in
    the standard library, namely:
-    
+
    * :mod:`wsgiref` -- some tiny utilities and servers for WSGI
 
 
@@ -500,7 +500,7 @@
    time in looking through the most popular ones.  Some frameworks have their
    own template engine or have a recommentation for one.  It's wise to use
    these.
-  
+
    Popular template engines include:
 
    * Mako
@@ -688,7 +688,7 @@
 found in the Python wiki.
 
 .. seealso::
-    
+
    The Python wiki contains an extensive list of `web frameworks
    <http://wiki.python.org/moin/WebFrameworks>`_.
 

Modified: python/branches/py3k-issue1717/Doc/install/index.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/install/index.rst	(original)
+++ python/branches/py3k-issue1717/Doc/install/index.rst	Sun Jan 25 21:08:20 2009
@@ -3,7 +3,7 @@
 .. _install-index:
 
 *****************************
-  Installing Python Modules  
+  Installing Python Modules
 *****************************
 
 :Author: Greg Ward
@@ -18,7 +18,7 @@
    Thus, I have to be sure to explain the basics at some point:
    sys.path and PYTHONPATH at least.  Should probably give pointers to
    other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc.
-   
+
    Finally, it might be useful to include all the material from my "Care
    and Feeding of a Python Installation" talk in here somewhere.  Yow!
 
@@ -268,7 +268,7 @@
 statements shown below, and get the output as shown, to find out my
 :file:`{prefix}` and :file:`{exec-prefix}`::
 
-   Python 2.4 (#26, Aug  7 2004, 17:19:02) 
+   Python 2.4 (#26, Aug  7 2004, 17:19:02)
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> sys.prefix
@@ -584,11 +584,11 @@
    $ python
    Python 2.2 (#11, Oct  3 2002, 13:31:27)
    [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
-   Type ``help'', ``copyright'', ``credits'' or ``license'' for more information.
+   Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> sys.path
-   ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', 
-    '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload', 
+   ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2',
+    '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload',
     '/usr/local/lib/python2.3/site-packages']
    >>>
 

Modified: python/branches/py3k-issue1717/Doc/library/2to3.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/2to3.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/2to3.rst	Sun Jan 25 21:08:20 2009
@@ -3,7 +3,7 @@
 2to3 - Automated Python 2 to 3 code translation
 ===============================================
 
-.. sectionauthor:: Benjamin Peterson
+.. sectionauthor:: Benjamin Peterson <benjamin at python.org>
 
 2to3 is a Python program that reads Python 2.x source code and applies a series
 of *fixers* to transform it into valid Python 3.x code.  The standard library

Modified: python/branches/py3k-issue1717/Doc/library/abc.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/abc.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/abc.rst	Sun Jan 25 21:08:20 2009
@@ -42,15 +42,15 @@
       Register *subclass* as a "virtual subclass" of this ABC. For
       example::
 
-	from abc import ABCMeta
+        from abc import ABCMeta
 
-	class MyABC(metaclass=ABCMeta):
-	    pass
+        class MyABC(metaclass=ABCMeta):
+            pass
 
-	MyABC.register(tuple)
+        MyABC.register(tuple)
 
-	assert issubclass(tuple, MyABC)
-	assert isinstance((), MyABC)
+        assert issubclass(tuple, MyABC)
+        assert isinstance((), MyABC)
 
    You can also override this method in an abstract base class:
 
@@ -128,7 +128,7 @@
    A decorator indicating abstract methods.
 
    Using this decorator requires that the class's metaclass is :class:`ABCMeta` or
-   is derived from it. 
+   is derived from it.
    A class that has a metaclass derived from :class:`ABCMeta`
    cannot be instantiated unless all of its abstract methods and
    properties are overridden.
@@ -163,7 +163,7 @@
    A subclass of the built-in :func:`property`, indicating an abstract property.
 
    Using this function requires that the class's metaclass is :class:`ABCMeta` or
-   is derived from it. 
+   is derived from it.
    A class that has a metaclass derived from :class:`ABCMeta` cannot be
    instantiated unless all of its abstract methods and properties are overridden.
    The abstract properties can be called using any of the normal

Modified: python/branches/py3k-issue1717/Doc/library/aifc.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/aifc.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/aifc.rst	Sun Jan 25 21:08:20 2009
@@ -17,7 +17,7 @@
 ability to compress the audio data.
 
 .. warning::
-   
+
    Some operations may only work under IRIX; these will raise :exc:`ImportError`
    when attempting to import the :mod:`cl` module, which is only available on IRIX.
 

Modified: python/branches/py3k-issue1717/Doc/library/array.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/array.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/array.rst	Sun Jan 25 21:08:20 2009
@@ -52,7 +52,7 @@
 
    Return a new array whose items are restricted by *typecode*, and initialized
    from the optional *initializer* value, which must be a list, object
-   supporting the buffer interface, or iterable over elements of the 
+   supporting the buffer interface, or iterable over elements of the
    appropriate type.
 
    If given a list or string, the initializer is passed to the new array's

Modified: python/branches/py3k-issue1717/Doc/library/ast.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/ast.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/ast.rst	Sun Jan 25 21:08:20 2009
@@ -114,7 +114,7 @@
    Parse an expression into an AST node.  Equivalent to ``compile(expr,
    filename, mode, ast.PyCF_ONLY_AST)``.
 
-   
+
 .. function:: literal_eval(node_or_string)
 
    Safely evaluate an expression node or a string containing a Python
@@ -178,7 +178,7 @@
 
    A node visitor base class that walks the abstract syntax tree and calls a
    visitor function for every node found.  This function may return a value
-   which is forwarded by the `visit` method.
+   which is forwarded by the :meth:`visit` method.
 
    This class is meant to be subclassed, with the subclass adding visitor
    methods.
@@ -192,7 +192,7 @@
    .. method:: generic_visit(node)
 
       This visitor calls :meth:`visit` on all children of the node.
-      
+
       Note that child nodes of nodes that have a custom visitor method won't be
       visited unless the visitor calls :meth:`generic_visit` or visits them
       itself.
@@ -207,11 +207,11 @@
    A :class:`NodeVisitor` subclass that walks the abstract syntax tree and
    allows modification of nodes.
 
-   The `NodeTransformer` will walk the AST and use the return value of the
-   visitor methods to replace or remove the old node.  If the return value of
-   the visitor method is ``None``, the node will be removed from its location,
-   otherwise it is replaced with the return value.  The return value may be the
-   original node in which case no replacement takes place.
+   The :class:`NodeTransformer` will walk the AST and use the return value of
+   the visitor methods to replace or remove the old node.  If the return value
+   of the visitor method is ``None``, the node will be removed from its
+   location, otherwise it is replaced with the return value.  The return value
+   may be the original node in which case no replacement takes place.
 
    Here is an example transformer that rewrites all occurrences of name lookups
    (``foo``) to ``data['foo']``::

Modified: python/branches/py3k-issue1717/Doc/library/audioop.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/audioop.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/audioop.rst	Sun Jan 25 21:08:20 2009
@@ -260,7 +260,7 @@
        in_test = inputdata[pos*2:]
        ipos, factor = audioop.findfit(in_test, out_test)
        # Optional (for better cancellation):
-       # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)], 
+       # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)],
        #              out_test)
        prefill = '\0'*(pos+ipos)*2
        postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata))

Modified: python/branches/py3k-issue1717/Doc/library/base64.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/base64.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/base64.rst	Sun Jan 25 21:08:20 2009
@@ -154,7 +154,7 @@
    >>> import base64
    >>> encoded = base64.b64encode('data to be encoded')
    >>> encoded
-   'ZGF0YSB0byBiZSBlbmNvZGVk'
+   b'ZGF0YSB0byBiZSBlbmNvZGVk'
    >>> data = base64.b64decode(encoded)
    >>> data
    'data to be encoded'

Modified: python/branches/py3k-issue1717/Doc/library/bdb.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/bdb.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/bdb.rst	Sun Jan 25 21:08:20 2009
@@ -325,7 +325,7 @@
 
    Check whether we should break here, depending on the way the breakpoint *b*
    was set.
-   
+
    If it was set via line number, it checks if ``b.line`` is the same as the one
    in the frame also passed as argument.  If the breakpoint was set via function
    name, we have to check we are in the right frame (the right function) and if
@@ -335,7 +335,7 @@
 
    Determine if there is an effective (active) breakpoint at this line of code.
    Return breakpoint number or 0 if none.
-	
+
    Called only if we know there is a breakpoint at this location.  Returns the
    breakpoint that was triggered and a flag that indicates if it is ok to delete
    a temporary breakpoint.

Modified: python/branches/py3k-issue1717/Doc/library/binascii.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/binascii.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/binascii.rst	Sun Jan 25 21:08:20 2009
@@ -113,8 +113,19 @@
       print(binascii.crc32("hello world"))
       # Or, in two pieces:
       crc = binascii.crc32("hello")
-      crc = binascii.crc32(" world", crc)
-      print(crc)
+      crc = binascii.crc32(" world", crc) & 0xffffffff
+      print('crc32 = 0x%08x' % crc)
+
+.. note::
+   To generate the same numeric value across all Python versions and
+   platforms use crc32(data) & 0xffffffff.  If you are only using
+   the checksum in packed binary format this is not necessary as the
+   return value will have the correct 32bit binary representation
+   regardless of sign.
+
+.. versionchanged:: 3.0
+   The return value will always be unsigned and in the range [0, 2**32-1]
+   regardless of platform.
 
 
 .. function:: b2a_hex(data)

Modified: python/branches/py3k-issue1717/Doc/library/cmath.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/cmath.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/cmath.rst	Sun Jan 25 21:08:20 2009
@@ -68,9 +68,9 @@
 
 .. function:: polar(x)
 
-   Convert a :class:`complex` from rectangular coordinates to polar 
+   Convert a :class:`complex` from rectangular coordinates to polar
    coordinates. The function returns a tuple with the two elements
-   *r* and *phi*. *r* is the distance from 0 and *phi* the phase 
+   *r* and *phi*. *r* is the distance from 0 and *phi* the phase
    angle.
 
 

Modified: python/branches/py3k-issue1717/Doc/library/codeop.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/codeop.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/codeop.rst	Sun Jan 25 21:08:20 2009
@@ -43,7 +43,7 @@
    other value will cause :exc:`ValueError` to  be raised.
 
    .. warning::
-      
+
       It is possible (but not likely) that the parser stops parsing with a
       successful outcome before reaching the end of the source; in this case,
       trailing symbols may be ignored instead of causing an error.  For example,

Modified: python/branches/py3k-issue1717/Doc/library/collections.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/collections.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/collections.rst	Sun Jan 25 21:08:20 2009
@@ -41,36 +41,36 @@
 :class:`Hashable`                                 ``__hash__``
 :class:`Iterable`                                 ``__iter__``
 :class:`Iterator`          :class:`Iterable`      ``__next__``            ``__iter__``
-:class:`Sized`          			  ``__len__``
+:class:`Sized`                                    ``__len__``
 :class:`Callable`                                 ``__call__``
-                                                  
+
 :class:`Sequence`          :class:`Sized`,        ``__getitem__``         ``__contains__``. ``__iter__``, ``__reversed__``.
                            :class:`Iterable`,     and ``__len__``         ``index``, and ``count``
-                           :class:`Container`     
-                                                  
+                           :class:`Container`
+
 :class:`MutableSequence`   :class:`Sequence`      ``__getitem__``         Inherited Sequence methods and
                                                   ``__delitem__``,        ``append``, ``reverse``, ``extend``, ``pop``,
                                                   ``insert``,             ``remove``, and ``__iadd__``
                                                   and ``__len__``
-                                                  
+
 :class:`Set`               :class:`Sized`,        ``__len__``,            ``__le__``, ``__lt__``, ``__eq__``, ``__ne__``,
                            :class:`Iterable`,     ``__iter__``, and       ``__gt__``, ``__ge__``, ``__and__``, ``__or__``
                            :class:`Container`     ``__contains__``        ``__sub__``, ``__xor__``, and ``isdisjoint``
-                                                  
+
 :class:`MutableSet`        :class:`Set`           ``add`` and             Inherited Set methods and
                                                   ``discard``             ``clear``, ``pop``, ``remove``, ``__ior__``,
                                                                           ``__iand__``, ``__ixor__``, and ``__isub__``
-                                                  
+
 :class:`Mapping`           :class:`Sized`,        ``__getitem__``,        ``__contains__``, ``keys``, ``items``, ``values``,
                            :class:`Iterable`,     ``__len__``. and        ``get``, ``__eq__``, and ``__ne__``
                            :class:`Container`     ``__iter__``
-                                                  
+
 :class:`MutableMapping`    :class:`Mapping`       ``__getitem__``         Inherited Mapping methods and
                                                   ``__setitem__``,        ``pop``, ``popitem``, ``clear``, ``update``,
                                                   ``__delitem__``,        and ``setdefault``
-						  ``__iter__``, and
+                                                  ``__iter__``, and
                                                   ``__len__``
-                                                  
+
 :class:`MappingView`       :class:`Sized`                                 ``__len__``
 :class:`KeysView`          :class:`MappingView`,                          ``__contains__``,
                            :class:`Set`                                   ``__iter__``
@@ -84,7 +84,7 @@
 
     size = None
     if isinstance(myvar, collections.Sized):
-	size = len(myvar)
+        size = len(myvar)
 
 Several of the ABCs are also useful as mixins that make it easier to develop
 classes supporting container APIs.  For example, to write a class supporting
@@ -140,12 +140,161 @@
 (For more about ABCs, see the :mod:`abc` module and :pep:`3119`.)
 
 
-.. _deque-objects:
+:class:`Counter` objects
+------------------------
+
+A counter tool is provided to support convenient and rapid tallies.
+For example::
+
+    # Tally occurrences of words in a list
+    >>> cnt = Counter()
+    >>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:
+    ...     cnt[word] += 1
+    >>> cnt
+    Counter({'blue': 3, 'red': 2, 'green': 1})
+
+    # Find the ten most common words in Hamlet
+    >>> import re
+    >>> words = re.findall('\w+', open('hamlet.txt').read().lower())
+    >>> Counter(words).most_common(10)
+    [('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),
+     ('you', 554),  ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]
+
+.. class:: Counter([iterable-or-mapping])
+
+   A :class:`Counter` is a :class:`dict` subclass for counting hashable objects.
+   It is an unordered collection where elements are stored as dictionary keys
+   and their counts are stored as dictionary values.  Counts are allowed to be
+   any integer value including zero or negative counts.  The :class:`Counter`
+   class is similar to bags or multisets in other languages.
+
+   Elements are counted from an *iterable* or initialized from another
+   *mapping* (or counter)::
+
+       >>> c = Counter()                            # a new, empty counter
+       >>> c = Counter('gallahad')                  # a new counter from an iterable
+       >>> c = Counter({'red': 4, 'blue': 2})       # a new counter from a mapping
+       >>> c = Counter(spam=8, eggs=1)              # a new counter from keyword args
+
+   Counter objects have a dictionary interface except that they return a zero
+   count for missing items instead of raising a :exc:`KeyError`::
+
+        >>> c = Counter(['eggs', 'ham'])
+        >>> c['bacon']                              # count of a missing element is zero
+        0
+
+   Setting a count to zero does not remove an element from a counter.
+   Use ``del`` to remove it entirely:
+
+        >>> c['sausage'] = 0                        # counter entry with a zero count
+        >>> del c['sausage']                        # del actually removes the entry
+
+   .. versionadded:: 2.7
+
+
+   Counter objects support two methods beyond those available for all
+   dictionaries:
+
+   .. method:: elements()
+
+      Return an iterator over elements repeating each as many times as its
+      count.  Elements are returned in arbitrary order.  If an element's count
+      is less than one, :meth:`elements` will ignore it.
+
+            >>> c = Counter(a=4, b=2, c=0, d=-2)
+            >>> list(c.elements())
+            ['a', 'a', 'a', 'a', 'b', 'b']
+
+   .. method:: most_common([n])
+
+      Return a list of the *n* most common elements and their counts from
+      the most common to the least.  If *n* is not specified or is ``None``,
+      return a list of all element counts in decreasing order of frequency.
+      Elements with equal counts are ordered arbitrarily::
+
+            >>> Counter('abracadabra').most_common(3)
+            [('a', 5), ('r', 2), ('b', 2)]
+
+   The usual dictionary methods are available for :class:`Counter` objects
+   except for two which work differently for counters.
+
+   .. method:: fromkeys(iterable)
+
+       This class method is not implemented for :class:`Counter` objects.
+
+   .. method:: update([iterable-or-mapping])
+
+       Elements are counted from an *iterable* or added-in from another
+       *mapping* (or counter).  Like :meth:`dict.update` but adds-in counts
+       instead of replacing them.  Also, the *iterable* is expected to be a
+       sequence of elements, not a sequence of ``(key, value)`` pairs::
+
+            >>> c = Counter('which')
+            >>> c.update('witch')           # add elements from another iterable
+            >>> d = Counter('watch')
+            >>> c.update(d)                 # add elements from another counter
+            >>> c['h']                      # four 'h' in which, witch, and watch
+            4
+
+Common patterns for working with :class:`Counter` objects::
+
+    sum(c.values())               # total of all counts
+    c.clear()                     # reset all counts
+    list(c)                       # list unique elements
+    set(c)                        # convert to a set
+    dict(c)                       # convert to a regular dictionary
+    c.items()                     # convert to a list of (elem, cnt) pairs
+    Counter(dict(list_of_pairs))  # convert from a list of (elem, cnt) pairs
+    c.most_common()[:-n:-1]       # n least common elements
+    c += Counter()                # remove zero and negative counts
+
+Several multiset mathematical operations are provided for combining
+:class:`Counter` objects.  Multisets are like regular sets but are allowed to
+contain repeated elements (with counts of one or more).  Addition and
+subtraction combine counters by adding or subtracting the counts of
+corresponding elements.  Intersection and union return the minimum and maximum
+of corresponding counts.  All four multiset operations exclude results with
+counts less than one::
+
+    >>> c = Counter(a=3, b=1)
+    >>> d = Counter(a=1, b=2)
+    >>> c + d                           # add two counters together:  c[x] + d[x]
+    Counter({'a': 4, 'b': 3})
+    >>> c - d                           # subtract (keeping only positive counts)
+    Counter({'a': 2})
+    >>> c & d                           # intersection:  min(c[x], d[x])
+    Counter({'a': 1, 'b': 1})
+    >>> c | d                           # union:  max(c[x], d[x])
+    Counter({'a': 3, 'b': 2})
+
+.. seealso::
+
+    * `Counter class <http://code.activestate.com/recipes/576611/>`_
+      adapted for Python 2.5 and an early `Bag recipe
+      <http://code.activestate.com/recipes/259174/>`_ for Python 2.4.
+
+    * `Bag class <http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html>`_
+      in Smalltalk.
+
+    * Wikipedia entry for `Multisets <http://en.wikipedia.org/wiki/Multiset>`_\.
+
+    * `C++ multisets <http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm>`_
+      tutorial with examples.
+
+    * For mathematical operations on multisets and their use cases, see
+      *Knuth, Donald. The Art of Computer Programming Volume II,
+      Section 4.6.3, Exercise 19*\.
+
+    * To enumerate all distinct multisets of a given size over a given set of
+      elements, see the :func:`combinations_with_replacement` function in the
+      :ref:`itertools-recipes` for itertools::
+
+          map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC
+
 
 :class:`deque` objects
 ----------------------
 
-
 .. class:: deque([iterable[, maxlen]])
 
    Returns a new deque object initialized left-to-right (using :meth:`append`) with
@@ -288,8 +437,6 @@
    deque(['c', 'b', 'a'])
 
 
-.. _deque-recipes:
-
 :class:`deque` Recipes
 ^^^^^^^^^^^^^^^^^^^^^^
 
@@ -337,12 +484,10 @@
        'Return the last n lines of a file'
        return deque(open(filename), n)
 
-.. _defaultdict-objects:
 
 :class:`defaultdict` objects
 ----------------------------
 
-
 .. class:: defaultdict([default_factory[, ...]])
 
    Returns a new dictionary-like object.  :class:`defaultdict` is a subclass of the
@@ -386,8 +531,6 @@
       ``None``, if absent.
 
 
-.. _defaultdict-examples:
-
 :class:`defaultdict` Examples
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -457,8 +600,6 @@
    [('blue', set([2, 4])), ('red', set([1, 3]))]
 
 
-.. _named-tuple-factory:
-
 :func:`namedtuple` Factory Function for Tuples with Named Fields
 ----------------------------------------------------------------
 
@@ -526,8 +667,8 @@
                if kwds:
                    raise ValueError('Got unexpected field names: %r' % kwds.keys())
                return result
-   <BLANKLINE>            
-           def __getnewargs__(self): 
+   <BLANKLINE>
+           def __getnewargs__(self):
                return tuple(self)
    <BLANKLINE>
            x = property(itemgetter(0))
@@ -674,8 +815,8 @@
 :class:`UserDict` objects
 -------------------------
 
-The class, :class:`UserDict` acts as a wrapper around dictionary objects.  
-The need for this class has been partially supplanted by the ability to 
+The class, :class:`UserDict` acts as a wrapper around dictionary objects.
+The need for this class has been partially supplanted by the ability to
 subclass directly from :class:`dict`; however, this class can be easier
 to work with because the underlying dictionary is accessible as an
 attribute.
@@ -688,7 +829,7 @@
    initialized with its contents; note that a reference to *initialdata* will not
    be kept, allowing it be used for other purposes.
 
-In addition to supporting the methods and operations of mappings, 
+In addition to supporting the methods and operations of mappings,
 :class:`UserDict` instances provide the following attribute:
 
 .. attribute:: UserDict.data
@@ -701,11 +842,11 @@
 -------------------------
 
 This class acts as a wrapper around list objects.  It is a useful base class
-for your own list-like classes which can inherit from them and override 
+for your own list-like classes which can inherit from them and override
 existing methods or add new ones.  In this way, one can add new behaviors to
 lists.
 
-The need for this class has been partially supplanted by the ability to 
+The need for this class has been partially supplanted by the ability to
 subclass directly from :class:`list`; however, this class can be easier
 to work with because the underlying list is accessible as an attribute.
 
@@ -717,12 +858,12 @@
    defaulting to the empty list ``[]``.  *list* can be any iterable, for
    example a real Python list or a :class:`UserList` object.
 
-In addition to supporting the methods and operations of mutable sequences, 
+In addition to supporting the methods and operations of mutable sequences,
 :class:`UserList` instances provide the following attribute:
 
 .. attribute:: UserList.data
 
-   A real :class:`list` object used to store the contents of the 
+   A real :class:`list` object used to store the contents of the
    :class:`UserList` class.
 
 **Subclassing requirements:** Subclasses of :class:`UserList` are expect to
@@ -740,8 +881,8 @@
 :class:`UserString` objects
 ---------------------------
 
-The class, :class:`UserString` acts as a wrapper around string objects.  
-The need for this class has been partially supplanted by the ability to 
+The class, :class:`UserString` acts as a wrapper around string objects.
+The need for this class has been partially supplanted by the ability to
 subclass directly from :class:`str`; however, this class can be easier
 to work with because the underlying string is accessible as an
 attribute.
@@ -749,8 +890,8 @@
 .. class:: UserString([sequence])
 
    Class that simulates a string or a Unicode string object.  The instance's
-   content is kept in a regular string object, which is accessible via the 
-   :attr:`data` attribute of :class:`UserString` instances.  The instance's 
+   content is kept in a regular string object, which is accessible via the
+   :attr:`data` attribute of :class:`UserString` instances.  The instance's
    contents are initially set to a copy of *sequence*.  The *sequence* can
    be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a
    subclass) or an arbitrary sequence which can be converted into a string using

Modified: python/branches/py3k-issue1717/Doc/library/configparser.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/configparser.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/configparser.rst	Sun Jan 25 21:08:20 2009
@@ -344,7 +344,7 @@
    import configparser
 
    config = configparser.RawConfigParser()
-   
+
    # When adding sections or items, add them in the reverse order of
    # how you want them to be displayed in the actual file.
    # In addition, please note that using RawConfigParser's and the raw
@@ -359,7 +359,7 @@
    config.set('Section1', 'baz', 'fun')
    config.set('Section1', 'bar', 'Python')
    config.set('Section1', 'foo', '%(bar)s is %(baz)s!')
-   
+
    # Writing our configuration file to 'example.cfg'
    with open('example.cfg', 'wb') as configfile:
        config.write(configfile)
@@ -399,7 +399,7 @@
    print(config.get('Section1', 'foo', 0, {'bar': 'Documentation',
                                            'baz': 'evil'}))
 
-Defaults are available in all three types of ConfigParsers. They are used in 
+Defaults are available in all three types of ConfigParsers. They are used in
 interpolation if an option used is not defined elsewhere. ::
 
    import configparser
@@ -407,7 +407,7 @@
    # New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each
    config = configparser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'})
    config.read('example.cfg')
-   
+
    print(config.get('Section1', 'foo')) # -> "Python is fun!"
    config.remove_option('Section1', 'bar')
    config.remove_option('Section1', 'baz')

Modified: python/branches/py3k-issue1717/Doc/library/constants.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/constants.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/constants.rst	Sun Jan 25 21:08:20 2009
@@ -14,13 +14,13 @@
 
 .. data:: False
 
-   The false value of the :class:`bool` type. Assignments to ``False`` 
+   The false value of the :class:`bool` type. Assignments to ``False``
    are illegal and raise a :exc:`SyntaxError`.
 
 
 .. data:: True
 
-   The true value of the :class:`bool` type. Assignments to ``True`` 
+   The true value of the :class:`bool` type. Assignments to ``True``
    are illegal and raise a :exc:`SyntaxError`.
 
 

Modified: python/branches/py3k-issue1717/Doc/library/crypt.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/crypt.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/crypt.rst	Sun Jan 25 21:08:20 2009
@@ -51,7 +51,7 @@
        username = input('Python login:')
        cryptedpasswd = pwd.getpwnam(username)[1]
        if cryptedpasswd:
-           if cryptedpasswd == 'x' or cryptedpasswd == '*': 
+           if cryptedpasswd == 'x' or cryptedpasswd == '*':
                raise "Sorry, currently no support for shadow passwords"
            cleartext = getpass.getpass()
            return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd

Modified: python/branches/py3k-issue1717/Doc/library/csv.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/csv.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/csv.rst	Sun Jan 25 21:08:20 2009
@@ -82,7 +82,7 @@
    be split into lines in a manner which preserves the newline characters.
 
    A short usage example::
- 
+
       >>> import csv
       >>> spamReader = csv.reader(open('eggs.csv'), delimiter=' ', quotechar='|')
       >>> for row in spamReader:

Modified: python/branches/py3k-issue1717/Doc/library/ctypes.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/ctypes.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/ctypes.rst	Sun Jan 25 21:08:20 2009
@@ -1376,24 +1376,22 @@
 The *mode* parameter can be used to specify how the library is loaded.  For
 details, consult the ``dlopen(3)`` manpage, on Windows, *mode* is ignored.
 
-The *use_errno* parameter, when set to True, enables a ctypes
-mechanism that allows to access the system `errno` error number in a
-safe way.  `ctypes` maintains a thread-local copy of the systems
-`errno` variable; if you call foreign functions created with
-`use_errno=True` then the `errno` value before the function call is
-swapped with the ctypes private copy, the same happens immediately
-after the function call.
-
-The function `ctypes.get_errno()` returns the value of the ctypes
-private copy, and the function `ctypes.set_errno(value)` changes the
-ctypes private copy to `value` and returns the former value.
-
-The *use_last_error* parameter, when set to True, enables the same
-mechanism for the Windows error code which is managed by the
-:func:`GetLastError` and :func:`SetLastError` Windows API functions;
-`ctypes.get_last_error()` and `ctypes.set_last_error(value)` are used
-to request and change the ctypes private copy of the windows error
-code.
+The *use_errno* parameter, when set to True, enables a ctypes mechanism that
+allows to access the system :data:`errno` error number in a safe way.
+:mod:`ctypes` maintains a thread-local copy of the systems :data:`errno`
+variable; if you call foreign functions created with ``use_errno=True`` then the
+:data:`errno` value before the function call is swapped with the ctypes private
+copy, the same happens immediately after the function call.
+
+The function :func:`ctypes.get_errno` returns the value of the ctypes private
+copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy
+to a new value and returns the former value.
+
+The *use_last_error* parameter, when set to True, enables the same mechanism for
+the Windows error code which is managed by the :func:`GetLastError` and
+:func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` and
+:func:`ctypes.set_last_error` are used to request and change the ctypes private
+copy of the windows error code.
 
 .. data:: RTLD_GLOBAL
    :noindex:
@@ -1596,18 +1594,20 @@
 .. function:: CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)
 
    The returned function prototype creates functions that use the standard C
-   calling convention.  The function will release the GIL during the call.
-   If `use_errno` is set to True, the ctypes private copy of the system `errno`
-   variable is exchanged with the real `errno` value bafore and after the call;
-   `use_last_error` does the same for the Windows error code.
+   calling convention.  The function will release the GIL during the call.  If
+   *use_errno* is set to True, the ctypes private copy of the system
+   :data:`errno` variable is exchanged with the real :data:`errno` value bafore
+   and after the call; *use_last_error* does the same for the Windows error
+   code.
 
 
 .. function:: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False)
 
    Windows only: The returned function prototype creates functions that use the
-   ``stdcall`` calling convention, except on Windows CE where :func:`WINFUNCTYPE`
-   is the same as :func:`CFUNCTYPE`.  The function will release the GIL during the
-   call. `use_errno` and `use_last_error` have the same meaning as above.
+   ``stdcall`` calling convention, except on Windows CE where
+   :func:`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`.  The function will
+   release the GIL during the call.  *use_errno* and *use_last_error* have the
+   same meaning as above.
 
 
 .. function:: PYFUNCTYPE(restype, *argtypes)
@@ -1852,10 +1852,10 @@
 .. function:: find_library(name)
    :module: ctypes.util
 
-   Try to find a library and return a pathname.  `name` is the library name without
-   any prefix like `lib`, suffix like ``.so``, ``.dylib`` or version number (this
-   is the form used for the posix linker option :option:`-l`).  If no library can
-   be found, returns ``None``.
+   Try to find a library and return a pathname.  *name* is the library name
+   without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version
+   number (this is the form used for the posix linker option :option:`-l`).  If
+   no library can be found, returns ``None``.
 
    The exact functionality is system dependent.
 
@@ -1887,12 +1887,12 @@
 .. function:: get_errno()
 
    Returns the current value of the ctypes-private copy of the system
-   `errno` variable in the calling thread.
+   :data:`errno` variable in the calling thread.
 
 .. function:: get_last_error()
 
    Windows only: returns the current value of the ctypes-private copy of the system
-   `LastError` variable in the calling thread.
+   :data:`LastError` variable in the calling thread.
 
 .. function:: memmove(dst, src, count)
 
@@ -1947,15 +1947,14 @@
 
 .. function:: set_errno(value)
 
-   Set the  current value of the ctypes-private copy of the system
-   `errno` variable in the calling thread to `value` and return the
-   previous value.
+   Set the current value of the ctypes-private copy of the system :data:`errno`
+   variable in the calling thread to *value* and return the previous value.
 
 .. function:: set_last_error(value)
 
-   Windows only: set the current value of the ctypes-private copy of
-   the system `LastError` variable in the calling thread to `value`
-   and return the previous value.
+   Windows only: set the current value of the ctypes-private copy of the system
+   :data:`LastError` variable in the calling thread to *value* and return the
+   previous value.
 
 .. function:: sizeof(obj_or_type)
 
@@ -2407,10 +2406,10 @@
                          ("hreftype", HREFTYPE)]
 
          class TYPEDESC(Structure):
+             _anonymous_ = ("u",)
              _fields_ = [("u", _U),
                          ("vt", VARTYPE)]
 
-             _anonymous_ = ("u",)
 
       The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field
       specifies which one of the union fields is valid.  Since the ``u`` field

Modified: python/branches/py3k-issue1717/Doc/library/datetime.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/datetime.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/datetime.rst	Sun Jan 25 21:08:20 2009
@@ -264,10 +264,10 @@
 considered to be true if and only if it isn't equal to ``timedelta(0)``.
 
 Example usage:
-    
+
     >>> from datetime import timedelta
     >>> year = timedelta(days=365)
-    >>> another_year = timedelta(weeks=40, days=84, hours=23, 
+    >>> another_year = timedelta(weeks=40, days=84, hours=23,
     ...                          minutes=50, seconds=600)  # adds up to 365 days
     >>> year == another_year
     True
@@ -515,10 +515,10 @@
     True
     >>> my_birthday = date(today.year, 6, 24)
     >>> if my_birthday < today:
-    ...     my_birthday = my_birthday.replace(year=today.year + 1) 
+    ...     my_birthday = my_birthday.replace(year=today.year + 1)
     >>> my_birthday
     datetime.date(2008, 6, 24)
-    >>> time_to_birthday = abs(my_birthday - today) 
+    >>> time_to_birthday = abs(my_birthday - today)
     >>> time_to_birthday.days
     202
 
@@ -1012,7 +1012,7 @@
     >>> tt = dt.timetuple()
     >>> for it in tt:   # doctest: +SKIP
     ...     print(it)
-    ... 
+    ...
     2006    # year
     11      # month
     21      # day
@@ -1041,23 +1041,23 @@
     ...     def __init__(self):         # DST starts last Sunday in March
     ...         d = datetime(dt.year, 4, 1)   # ends last Sunday in October
     ...         self.dston = d - timedelta(days=d.weekday() + 1)
-    ...         d = datetime(dt.year, 11, 1)    
+    ...         d = datetime(dt.year, 11, 1)
     ...         self.dstoff = d - timedelta(days=d.weekday() + 1)
     ...     def utcoffset(self, dt):
     ...         return timedelta(hours=1) + self.dst(dt)
-    ...     def dst(self, dt):              
+    ...     def dst(self, dt):
     ...         if self.dston <=  dt.replace(tzinfo=None) < self.dstoff:
     ...             return timedelta(hours=1)
     ...         else:
     ...             return timedelta(0)
     ...     def tzname(self,dt):
     ...          return "GMT +1"
-    ... 
+    ...
     >>> class GMT2(tzinfo):
     ...     def __init__(self):
-    ...         d = datetime(dt.year, 4, 1)  
+    ...         d = datetime(dt.year, 4, 1)
     ...         self.dston = d - timedelta(days=d.weekday() + 1)
-    ...         d = datetime(dt.year, 11, 1)    
+    ...         d = datetime(dt.year, 11, 1)
     ...         self.dstoff = d - timedelta(days=d.weekday() + 1)
     ...     def utcoffset(self, dt):
     ...         return timedelta(hours=1) + self.dst(dt)
@@ -1068,7 +1068,7 @@
     ...             return timedelta(0)
     ...     def tzname(self,dt):
     ...         return "GMT +2"
-    ... 
+    ...
     >>> gmt1 = GMT1()
     >>> # Daylight Saving Time
     >>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=gmt1)
@@ -1089,7 +1089,7 @@
     datetime.datetime(2006, 6, 14, 13, 0, tzinfo=<GMT1 object at 0x...>)
     >>> dt2.utctimetuple() == dt3.utctimetuple()
     True
- 
+
 
 
 .. _datetime-time:
@@ -1237,12 +1237,12 @@
    return ``None`` or a string object.
 
 Example:
-    
+
     >>> from datetime import time, tzinfo
     >>> class GMT1(tzinfo):
     ...     def utcoffset(self, dt):
-    ...         return timedelta(hours=1) 
-    ...     def dst(self, dt):              
+    ...         return timedelta(hours=1)
+    ...     def dst(self, dt):
     ...         return timedelta(0)
     ...     def tzname(self,dt):
     ...         return "Europe/Prague"
@@ -1473,7 +1473,7 @@
 :class:`tzinfo` subclasses; there are no ambiguities when using UTC, or any
 other fixed-offset :class:`tzinfo` subclass (such as a class representing only
 EST (fixed offset -5 hours), or only EDT (fixed offset -4 hours)).
-    
+
 
 .. _strftime-behavior:
 
@@ -1494,10 +1494,6 @@
 microseconds should not be used, as :class:`date` objects have no such
 values.  If they're used anyway, ``0`` is substituted for them.
 
-:class:`time` and :class:`datetime` objects support a ``%f`` format code
-which expands to the number of microseconds in the object, zero-padded on
-the left to six places.
-
 For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty
 strings.
 
@@ -1516,7 +1512,7 @@
 
 The full set of format codes supported varies across platforms, because Python
 calls the platform C library's :func:`strftime` function, and platform
-variations are common.  
+variations are common.
 
 The following is a list of all the format codes that the C standard (1989
 version) requires, and these work on all platforms with a standard C
@@ -1616,7 +1612,9 @@
 (1)
    When used with the :func:`strptime` function, the ``%f`` directive
    accepts from one to six digits and zero pads on the right.  ``%f`` is
-   an extension to the set of format characters in the C standard.
+   an extension to the set of format characters in the C standard (but
+   implemented separately in datetime objects, and therefore always
+   available).
 
 (2)
    When used with the :func:`strptime` function, the ``%p`` directive only affects

Modified: python/branches/py3k-issue1717/Doc/library/decimal.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/decimal.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/decimal.rst	Sun Jan 25 21:08:20 2009
@@ -323,7 +323,7 @@
       infinity       ::=  'Infinity' | 'Inf'
       nan            ::=  'NaN' [digits] | 'sNaN' [digits]
       numeric-value  ::=  decimal-part [exponent-part] | infinity
-      numeric-string ::=  [sign] numeric-value | [sign] nan  
+      numeric-string ::=  [sign] numeric-value | [sign] nan
 
    If *value* is a :class:`tuple`, it should have three components, a sign
    (:const:`0` for positive or :const:`1` for negative), a :class:`tuple` of
@@ -453,6 +453,29 @@
       >>> Decimal(321).exp()
       Decimal('2.561702493119680037517373933E+139')
 
+   .. method:: from_float(f)
+
+      Classmethod that converts a float to a decimal number, exactly.
+
+      Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`.
+      Since 0.1 is not exactly representable in binary floating point, the
+      value is stored as the nearest representable value which is
+      `0x1.999999999999ap-4`.  That equivalent value in decimal is
+      `0.1000000000000000055511151231257827021181583404541015625`.
+
+      .. doctest::
+
+          >>> Decimal.from_float(0.1)
+          Decimal('0.1000000000000000055511151231257827021181583404541015625')
+          >>> Decimal.from_float(float('nan'))
+          Decimal('NaN')
+          >>> Decimal.from_float(float('inf'))
+          Decimal('Infinity')
+          >>> Decimal.from_float(float('-inf'))
+          Decimal('-Infinity')
+
+      .. versionadded:: 3.1
+
    .. method:: fma(other, third[, context])
 
       Fused multiply-add.  Return self*other+third with no rounding of the
@@ -852,7 +875,7 @@
    * :const:`ROUND_HALF_EVEN` (to nearest with ties going to nearest even integer),
    * :const:`ROUND_HALF_UP` (to nearest with ties going away from zero), or
    * :const:`ROUND_UP` (away from zero).
-   * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero 
+   * :const:`ROUND_05UP` (away from zero if last digit after rounding towards zero
      would have been 0 or 5; otherwise towards zero)
 
    The *traps* and *flags* fields list any signals to be set. Generally, new
@@ -910,6 +933,26 @@
       If the argument is a string, no leading or trailing whitespace is
       permitted.
 
+   .. method:: create_decimal_from_float(f)
+
+      Creates a new Decimal instance from a float *f* but rounding using *self*
+      as the context.  Unlike the :meth:`Decimal.from_float` class method,
+      the context precision, rounding method, flags, and traps are applied to
+      the conversion.
+
+      .. doctest::
+
+         >>> context = Context(prec=5, rounding=ROUND_DOWN)
+         >>> context.create_decimal_from_float(math.pi)
+         Decimal('3.1415')
+         >>> context = Context(prec=5, traps=[Inexact])
+         >>> context.create_decimal_from_float(math.pi)
+         Traceback (most recent call last):
+             ...
+         decimal.Inexact: None
+
+      .. versionadded:: 3.1
+
    .. method:: Etiny()
 
       Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent
@@ -1071,7 +1114,7 @@
 
    .. method:: logical_and(x, y)
 
-      Applies the logical operation `and` between each operand's digits.
+      Applies the logical operation *and* between each operand's digits.
 
 
    .. method:: logical_invert(x)
@@ -1081,12 +1124,12 @@
 
    .. method:: logical_or(x, y)
 
-      Applies the logical operation `or` between each operand's digits.
+      Applies the logical operation *or* between each operand's digits.
 
 
    .. method:: logical_xor(x, y)
 
-      Applies the logical operation `xor` between each operand's digits.
+      Applies the logical operation *xor* between each operand's digits.
 
 
    .. method:: max(x, y)
@@ -1194,8 +1237,8 @@
 
    .. method:: remainder_near(x, y)
 
-      Returns `x - y * n`, where *n* is the integer nearest the exact value
-      of `x / y` (if the result is `0` then its sign will be the sign of *x*).
+      Returns ``x - y * n``, where *n* is the integer nearest the exact value
+      of ``x / y`` (if the result is 0 then its sign will be the sign of *x*).
 
 
    .. method:: rotate(x, y)
@@ -1312,7 +1355,7 @@
       sqrt(-x) and x > 0
       0 ** 0
       x ** (non-integer)
-      x ** Infinity      
+      x ** Infinity
 
 
 .. class:: Overflow
@@ -1415,7 +1458,7 @@
    Decimal('9.51111111')
    >>> u + (v + w)
    Decimal('9.51111111')
-   >>> 
+   >>>
    >>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')
    >>> (u*v) + (u*w)
    Decimal('0.0060000')
@@ -1554,7 +1597,7 @@
 
        """
        q = Decimal(10) ** -places      # 2 places --> '0.01'
-       sign, digits, exp = value.quantize(q).as_tuple()  
+       sign, digits, exp = value.quantize(q).as_tuple()
        result = []
        digits = list(map(str, digits))
        build, next = result.append, digits.pop
@@ -1611,12 +1654,12 @@
        getcontext().prec += 2
        i, lasts, s, fact, num = 0, 0, 1, 1, 1
        while s != lasts:
-           lasts = s    
+           lasts = s
            i += 1
            fact *= i
-           num *= x     
-           s += num / fact   
-       getcontext().prec -= 2        
+           num *= x
+           s += num / fact
+       getcontext().prec -= 2
        return +s
 
    def cos(x):
@@ -1633,13 +1676,13 @@
        getcontext().prec += 2
        i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1
        while s != lasts:
-           lasts = s    
+           lasts = s
            i += 2
            fact *= i * (i-1)
            num *= x * x
            sign *= -1
-           s += num / fact * sign 
-       getcontext().prec -= 2        
+           s += num / fact * sign
+       getcontext().prec -= 2
        return +s
 
    def sin(x):
@@ -1656,13 +1699,13 @@
        getcontext().prec += 2
        i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1
        while s != lasts:
-           lasts = s    
+           lasts = s
            i += 2
            fact *= i * (i-1)
            num *= x * x
            sign *= -1
-           s += num / fact * sign 
-       getcontext().prec -= 2        
+           s += num / fact * sign
+       getcontext().prec -= 2
        return +s
 
 
@@ -1696,7 +1739,7 @@
    >>> Decimal('3.214').quantize(TWOPLACES)
    Decimal('3.21')
 
-   >>> # Validate that a number does not exceed two places 
+   >>> # Validate that a number does not exceed two places
    >>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact]))
    Decimal('3.21')
 

Modified: python/branches/py3k-issue1717/Doc/library/dis.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/dis.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/dis.rst	Sun Jan 25 21:08:20 2009
@@ -79,8 +79,8 @@
 
    Detect all offsets in the code object *code* which are jump targets, and
    return a list of these offsets.
-   
-   
+
+
 .. data:: opname
 
    Sequence of operation names, indexable using the bytecode.
@@ -502,7 +502,7 @@
    The low byte of *counts* is the number of values before the list value, the
    high byte of *counts* the number of values after it.  The resulting values
    are put onto the stack right-to-left.
-   
+
 
 .. opcode:: DUP_TOPX (count)
 
@@ -701,7 +701,7 @@
    opcode finds the keyword parameters first.  For each keyword argument, the value
    is on top of the key.  Below the keyword parameters, the positional parameters
    are on the stack, with the right-most parameter on top.  Below the parameters,
-   the function object to call is on the stack.  Pops all function arguments, and 
+   the function object to call is on the stack.  Pops all function arguments, and
    the function itself off the stack, and pushes the return value.
 
 

Modified: python/branches/py3k-issue1717/Doc/library/email.mime.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/email.mime.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/email.mime.rst	Sun Jan 25 21:08:20 2009
@@ -2,7 +2,7 @@
 ----------------------------------------------------------
 
 .. module:: email.mime
-   :synopsis: Build MIME messages. 
+   :synopsis: Build MIME messages.
 
 
 Ordinarily, you get a message object structure by passing a file or some text to
@@ -55,14 +55,14 @@
 
 .. currentmodule:: email.mime.multipart
 
-.. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]])
+.. class:: MIMEMultipart([_subtype[, boundary[, _subparts[, _params]]]])
 
    Module: :mod:`email.mime.multipart`
 
    A subclass of :class:`MIMEBase`, this is an intermediate base class for MIME
    messages that are :mimetype:`multipart`.  Optional *_subtype* defaults to
    :mimetype:`mixed`, but can be used to specify the subtype of the message.  A
-   :mailheader:`Content-Type` header of :mimetype:`multipart/`*_subtype* will be
+   :mailheader:`Content-Type` header of :mimetype:`multipart/_subtype` will be
    added to the message object.  A :mailheader:`MIME-Version` header will also be
    added.
 

Modified: python/branches/py3k-issue1717/Doc/library/fileinput.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/fileinput.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/fileinput.rst	Sun Jan 25 21:08:20 2009
@@ -145,7 +145,7 @@
 when standard input is read.
 
 .. warning::
-   
+
    The current implementation does not work for MS-DOS 8+3 filesystems.
 
 

Modified: python/branches/py3k-issue1717/Doc/library/fractions.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/fractions.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/fractions.rst	Sun Jan 25 21:08:20 2009
@@ -126,11 +126,11 @@
 
 .. function:: gcd(a, b)
 
-   Return the greatest common divisor of the integers `a` and `b`.  If
-   either `a` or `b` is nonzero, then the absolute value of `gcd(a,
-   b)` is the largest integer that divides both `a` and `b`.  `gcd(a,b)`
-   has the same sign as `b` if `b` is nonzero; otherwise it takes the sign
-   of `a`.  `gcd(0, 0)` returns `0`.
+   Return the greatest common divisor of the integers *a* and *b*.  If either
+   *a* or *b* is nonzero, then the absolute value of ``gcd(a, b)`` is the
+   largest integer that divides both *a* and *b*.  ``gcd(a,b)`` has the same
+   sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*.  ``gcd(0,
+   0)`` returns ``0``.
 
 
 .. seealso::

Modified: python/branches/py3k-issue1717/Doc/library/ftplib.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/ftplib.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/ftplib.rst	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,3 @@
-
 :mod:`ftplib` --- FTP protocol client
 =====================================
 

Modified: python/branches/py3k-issue1717/Doc/library/functions.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/functions.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/functions.rst	Sun Jan 25 21:08:20 2009
@@ -95,7 +95,7 @@
    the range ``0 <= x < 256``.  :class:`bytes` is an immutable version of
    :class:`bytearray` -- it has the same non-mutating methods and the same
    indexing and slicing behavior.
-   
+
    Accordingly, constructor arguments are interpreted as for :func:`buffer`.
 
    Bytes objects can also be created with literals, see :ref:`strings`.
@@ -271,7 +271,7 @@
 
    Take two (non complex) numbers as arguments and return a pair of numbers
    consisting of their quotient and remainder when using integer division.  With mixed
-   operand types, the rules for binary arithmetic operators apply.  For integers, 
+   operand types, the rules for binary arithmetic operators apply.  For integers,
    the result is the same as ``(a // b, a % b)``. For floating point
    numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)``
    but may be 1 less than that.  In any case ``q * b + a % b`` is very close to
@@ -411,12 +411,12 @@
    .. index::
       pair: str; format
       single: __format__
-   
+
    Convert a string or a number to a "formatted" representation, as controlled
    by *format_spec*.  The interpretation of *format_spec* will depend on the
    type of the *value* argument, however there is a standard formatting syntax
    that is used by most built-in types: :ref:`formatspec`.
-   
+
    .. note::
 
       ``format(value, format_spec)`` merely calls ``value.__format__(format_spec)``.
@@ -573,7 +573,7 @@
    returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``.  If
    no argument is given, returns a new empty list, ``[]``.
 
-   :class:`list` is a mutable sequence type, as documented in :ref:`typesseq`. 
+   :class:`list` is a mutable sequence type, as documented in :ref:`typesseq`.
 
 .. function:: locals()
 
@@ -654,7 +654,7 @@
 .. function:: open(file[, mode='r'[, buffering=None[, encoding=None[, errors=None[, newline=None[, closefd=True]]]]]])
 
    Open a file.  If the file cannot be opened, :exc:`IOError` is raised.
-   
+
    *file* is either a string or bytes object giving the name (and the path if
    the file isn't in the current working directory) of the file to be opened or
    an integer file descriptor of the file to be wrapped.  (If a file descriptor
@@ -699,7 +699,7 @@
    *buffering* is an optional integer used to set the buffering policy.  By
    default full buffering is on. Pass 0 to switch buffering off (only allowed in
    binary mode), 1 to set line buffering, and an integer > 1 for full buffering.
-    
+
    *encoding* is the name of the encoding used to decode or encode the file.
    This should only be used in text mode.  The default encoding is platform
    dependent, but any encoding supported by Python can be passed.  See the
@@ -991,7 +991,7 @@
 .. function:: str([object[, encoding[, errors]]])
 
    Return a string version of an object, using one of the following modes:
-   
+
    If *encoding* and/or *errors* are given, :func:`str` will decode the
    *object* which can either be a byte string or a character buffer using
    the codec for *encoding*. The *encoding* parameter is a string giving
@@ -1002,7 +1002,7 @@
    errors, while a value of ``'ignore'`` causes errors to be silently ignored,
    and a value of ``'replace'`` causes the official Unicode replacement character,
    U+FFFD, to be used to replace input characters which cannot be decoded.
-   See also the :mod:`codecs` module. 
+   See also the :mod:`codecs` module.
 
    When only *object* is given, this returns its nicely printable representation.
    For strings, this is the string itself.  The difference with ``repr(object)``
@@ -1042,10 +1042,10 @@
    single inheritance, :func:`super` can be used to refer to parent classes without
    naming them explicitly, thus making the code more maintainable.  This use
    closely parallels the use of "super" in other programming languages.
-   
+
    The second use case is to support cooperative multiple inheritence in a
-   dynamic execution environment.  This use case is unique to Python and is 
-   not found in statically compiled languages or languages that only support 
+   dynamic execution environment.  This use case is unique to Python and is
+   not found in statically compiled languages or languages that only support
    single inheritance.  This makes in possible to implement "diamond diagrams"
    where multiple base classes implement the same method.  Good design dictates
    that this method have the same calling signature in every case (because the
@@ -1080,7 +1080,7 @@
    3])`` returns ``(1, 2, 3)``.  If no argument is given, returns a new empty
    tuple, ``()``.
 
-   :class:`tuple` is an immutable sequence type, as documented in :ref:`typesseq`. 
+   :class:`tuple` is an immutable sequence type, as documented in :ref:`typesseq`.
 
 
 .. function:: type(object)
@@ -1110,7 +1110,7 @@
 
       >>> class X(object):
       ...     a = 1
-      ...     
+      ...
       >>> X = type('X', (object,), dict(a=1))
 
 
@@ -1125,12 +1125,12 @@
 
 .. function:: zip(*iterables)
 
-   Make an iterator that aggregates elements from each of the iterables. 
+   Make an iterator that aggregates elements from each of the iterables.
 
    Returns an iterator of tuples, where the *i*-th tuple contains
    the *i*-th element from each of the argument sequences or iterables.  The
    iterator stops when the shortest input iterable is exhausted. With a single
-   iterable argument, it returns an iterator of 1-tuples.  With no arguments, 
+   iterable argument, it returns an iterator of 1-tuples.  With no arguments,
    it returns an empty iterator.  Equivalent to::
 
       def zip(*iterables):
@@ -1199,7 +1199,7 @@
 
    For example, the statement ``import spam`` results in bytecode resembling the
    following code::
-   
+
       spam = __import__('spam', globals(), locals(), [], -1)
 
    The statement ``import spam.ham`` results in this call::

Modified: python/branches/py3k-issue1717/Doc/library/gettext.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/gettext.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/gettext.rst	Sun Jan 25 21:08:20 2009
@@ -369,7 +369,7 @@
    If the message id is not found in the catalog, and a fallback is specified, the
    request is forwarded to the fallback's :meth:`ngettext` method.  Otherwise, when
    *n* is 1 *singular* is returned, and *plural* is returned in all other cases.
-   
+
    Here is an example::
 
       n = len(os.listdir('.'))
@@ -551,10 +551,9 @@
 
    animals = ['mollusk',
               'albatross',
-   	   'rat',
-   	   'penguin',
-   	   'python',
-   	   ]
+              'rat',
+              'penguin',
+              'python', ]
    # ...
    for a in animals:
        print(a)
@@ -569,10 +568,9 @@
 
    animals = [_('mollusk'),
               _('albatross'),
-   	   _('rat'),
-   	   _('penguin'),
-   	   _('python'),
-   	   ]
+              _('rat'),
+              _('penguin'),
+              _('python'), ]
 
    del _
 
@@ -595,10 +593,9 @@
 
    animals = [N_('mollusk'),
               N_('albatross'),
-   	   N_('rat'),
-   	   N_('penguin'),
-   	   N_('python'),
-   	   ]
+              N_('rat'),
+              N_('penguin'),
+              N_('python'), ]
 
    # ...
    for a in animals:

Modified: python/branches/py3k-issue1717/Doc/library/gzip.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/gzip.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/gzip.rst	Sun Jan 25 21:08:20 2009
@@ -7,7 +7,7 @@
 This module provides a simple interface to compress and decompress files just
 like the GNU programs :program:`gzip` and :program:`gunzip` would.
 
-The data compression is provided by the :mod:``zlib`` module.
+The data compression is provided by the :mod:`zlib` module.
 
 The :mod:`gzip` module provides the :class:`GzipFile` class which is modeled
 after Python's File Object. The :class:`GzipFile` class reads and writes
@@ -24,7 +24,7 @@
 The module defines the following items:
 
 
-.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj]]]])
+.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj[, mtime]]]]])
 
    Constructor for the :class:`GzipFile` class, which simulates most of the methods
    of a file object, with the exception of the :meth:`readinto` and
@@ -52,6 +52,15 @@
    level of compression; ``1`` is fastest and produces the least compression, and
    ``9`` is slowest and produces the most compression.  The default is ``9``.
 
+   The *mtime* argument is an optional numeric timestamp to be written to
+   the stream when compressing.  All :program:`gzip`compressed streams are
+   required to contain a timestamp.  If omitted or ``None``, the current
+   time is used.  This module ignores the timestamp when decompressing;
+   however, some programs, such as :program:`gunzip`\ , make use of it.
+   The format of the timestamp is the same as that of the return value of
+   ``time.time()`` and of the ``st_mtime`` member of the object returned
+   by ``os.stat()``.
+
    Calling a :class:`GzipFile` object's :meth:`close` method does not close
    *fileobj*, since you might wish to append more material after the compressed
    data.  This also allows you to pass a :class:`StringIO` object opened for

Modified: python/branches/py3k-issue1717/Doc/library/hashlib.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/hashlib.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/hashlib.rst	Sun Jan 25 21:08:20 2009
@@ -4,8 +4,8 @@
 
 .. module:: hashlib
    :synopsis: Secure hash and message digest algorithms.
-.. moduleauthor:: Gregory P. Smith <greg at users.sourceforge.net>
-.. sectionauthor:: Gregory P. Smith <greg at users.sourceforge.net>
+.. moduleauthor:: Gregory P. Smith <greg at krypto.org>
+.. sectionauthor:: Gregory P. Smith <greg at krypto.org>
 
 
 .. index::
@@ -37,6 +37,11 @@
 
 .. note::
 
+   For better multithreading performance, the Python GIL is released for
+   strings of more than 2047 bytes at object creation or on update.
+
+.. note::
+
    Feeding string objects is to :meth:`update` is not supported, as hashes work
    on bytes, not on characters.
 

Modified: python/branches/py3k-issue1717/Doc/library/heapq.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/heapq.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/heapq.rst	Sun Jan 25 21:08:20 2009
@@ -100,7 +100,7 @@
    H
    N
 
-   
+
 The module also offers three general purpose functions based on heaps.
 
 

Modified: python/branches/py3k-issue1717/Doc/library/http.cookiejar.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/http.cookiejar.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/http.cookiejar.rst	Sun Jan 25 21:08:20 2009
@@ -704,7 +704,7 @@
 The :class:`Cookie` class also defines the following method:
 
 
-.. method:: Cookie.is_expired([now=:const:`None`])
+.. method:: Cookie.is_expired([now=None])
 
    True if cookie has passed the time at which the server requested it should
    expire.  If *now* is given (in seconds since the epoch), return whether the

Modified: python/branches/py3k-issue1717/Doc/library/http.cookies.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/http.cookies.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/http.cookies.rst	Sun Jan 25 21:08:20 2009
@@ -131,9 +131,6 @@
 
    The keys are case-insensitive.
 
-   .. versionadded:: 2.6
-      The :attr:`httponly` attribute was added.
-
 
 .. attribute:: Morsel.value
 

Modified: python/branches/py3k-issue1717/Doc/library/idle.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/idle.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/idle.rst	Sun Jan 25 21:08:20 2009
@@ -230,7 +230,7 @@
    Keywords
       orange
 
-   Strings 
+   Strings
       green
 
    Comments

Modified: python/branches/py3k-issue1717/Doc/library/inspect.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/inspect.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/inspect.rst	Sun Jan 25 21:08:20 2009
@@ -384,7 +384,7 @@
 
 .. function:: getargspec(func)
 
-   Get the names and default values of a function's arguments. A 
+   Get the names and default values of a function's arguments. A
    :term:`named tuple` ``ArgSpec(args, varargs, keywords,
    defaults)`` is returned. *args* is a list of
    the argument names. *varargs* and *varkw* are the names of the ``*`` and
@@ -416,7 +416,7 @@
 
 .. function:: getargvalues(frame)
 
-   Get information about arguments passed into a particular frame. A :term:`named tuple` 
+   Get information about arguments passed into a particular frame. A :term:`named tuple`
    ``ArgInfo(args, varargs, keywords, locals)`` is returned. *args* is a list of the
    argument names (it may contain nested lists). *varargs* and *varkw* are the
    names of the ``*`` and ``**`` arguments or ``None``. *locals* is the locals
@@ -484,7 +484,7 @@
 
 .. function:: getframeinfo(frame[, context])
 
-   Get information about a frame or traceback object.  A :term:`named tuple` 
+   Get information about a frame or traceback object.  A :term:`named tuple`
    ``Traceback(filename, lineno, function, code_context, index)`` is returned.
 
 

Modified: python/branches/py3k-issue1717/Doc/library/io.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/io.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/io.rst	Sun Jan 25 21:08:20 2009
@@ -6,7 +6,7 @@
 .. moduleauthor:: Guido van Rossum <guido at python.org>
 .. moduleauthor:: Mike Verdone <mike.verdone at gmail.com>
 .. moduleauthor:: Mark Russell <mark.russell at zen.co.uk>
-.. sectionauthor:: Benjamin Peterson
+.. sectionauthor:: Benjamin Peterson <benjamin at python.org>
 
 The :mod:`io` module provides the Python interfaces to stream handling.  The
 builtin :func:`open` function is defined in this module.
@@ -214,7 +214,7 @@
    .. method:: close()
 
       Flush and close this stream. This method has no effect if the file is
-      already closed. Once the file is closed, any operation on the file 
+      already closed. Once the file is closed, any operation on the file
       (e.g. reading or writing) will raise an :exc:`IOError`. The internal
       file descriptor isn't closed if *closefd* was False.
 
@@ -328,59 +328,6 @@
       ``len(b)``, since if the write fails, an :exc:`IOError` will be raised).
 
 
-Raw File I/O
-------------
-
-.. class:: FileIO(name[, mode])
-
-   :class:`FileIO` represents a file containing bytes data.  It implements
-   the :class:`RawIOBase` interface (and therefore the :class:`IOBase`
-   interface, too).
-
-   The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing,
-   or appending.  The file will be created if it doesn't exist when opened for
-   writing or appending; it will be truncated when opened for writing.  Add a
-   ``'+'`` to the mode to allow simultaneous reading and writing.
-
-   In addition to the attributes and methods from :class:`IOBase` and
-   :class:`RawIOBase`, :class:`FileIO` provides the following data
-   attributes and methods:
-
-   .. attribute:: mode
-
-      The mode as given in the constructor.
-
-   .. attribute:: name
-
-      The file name.  This is the file descriptor of the file when no name is
-      given in the constructor.
-
-   .. method:: read([n])
-
-      Read and return at most *n* bytes.  Only one system call is made, so it is
-      possible that less data than was requested is returned.  Use :func:`len`
-      on the returned bytes object to see how many bytes were actually returned.
-      (In non-blocking mode, ``None`` is returned when no data is available.)
-
-   .. method:: readall()
-
-      Read and return the entire file's contents in a single bytes object.  As
-      much as immediately available is returned in non-blocking mode.  If the
-      EOF has been reached, ``b''`` is returned.
-
-   .. method:: write(b)
-
-      Write the bytes or bytearray object, *b*, to the file, and return
-      the number actually written. Only one system call is made, so it
-      is possible that only some of the data is written.
-
-   Note that the inherited ``readinto()`` method should not be used on
-   :class:`FileIO` objects.
-
-
-Buffered Streams
-----------------
-
 .. class:: BufferedIOBase
 
    Base class for streams that support buffering.  It inherits :class:`IOBase`.
@@ -438,6 +385,59 @@
       underlying raw stream cannot accept more data at the moment.
 
 
+Raw File I/O
+------------
+
+.. class:: FileIO(name[, mode])
+
+   :class:`FileIO` represents a file containing bytes data.  It implements
+   the :class:`RawIOBase` interface (and therefore the :class:`IOBase`
+   interface, too).
+
+   The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing,
+   or appending.  The file will be created if it doesn't exist when opened for
+   writing or appending; it will be truncated when opened for writing.  Add a
+   ``'+'`` to the mode to allow simultaneous reading and writing.
+
+   In addition to the attributes and methods from :class:`IOBase` and
+   :class:`RawIOBase`, :class:`FileIO` provides the following data
+   attributes and methods:
+
+   .. attribute:: mode
+
+      The mode as given in the constructor.
+
+   .. attribute:: name
+
+      The file name.  This is the file descriptor of the file when no name is
+      given in the constructor.
+
+   .. method:: read([n])
+
+      Read and return at most *n* bytes.  Only one system call is made, so it is
+      possible that less data than was requested is returned.  Use :func:`len`
+      on the returned bytes object to see how many bytes were actually returned.
+      (In non-blocking mode, ``None`` is returned when no data is available.)
+
+   .. method:: readall()
+
+      Read and return the entire file's contents in a single bytes object.  As
+      much as immediately available is returned in non-blocking mode.  If the
+      EOF has been reached, ``b''`` is returned.
+
+   .. method:: write(b)
+
+      Write the bytes or bytearray object, *b*, to the file, and return
+      the number actually written. Only one system call is made, so it
+      is possible that only some of the data is written.
+
+   Note that the inherited ``readinto()`` method should not be used on
+   :class:`FileIO` objects.
+
+
+Buffered Streams
+----------------
+
 .. class:: BytesIO([initial_bytes])
 
    A stream implementation using an in-memory bytes buffer.  It inherits
@@ -628,7 +628,7 @@
    .. attribute:: line_buffering
 
       Whether line buffering is enabled.
-   
+
 
 .. class:: StringIO([initial_value[, encoding[, errors[, newline]]]])
 
@@ -659,7 +659,7 @@
       # 'First line.\nSecond line.\n'
       contents = output.getvalue()
 
-      # Close object and discard memory buffer -- 
+      # Close object and discard memory buffer --
       # .getvalue() will now raise an exception.
       output.close()
 

Modified: python/branches/py3k-issue1717/Doc/library/itertools.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/itertools.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/itertools.rst	Sun Jan 25 21:08:20 2009
@@ -74,7 +74,7 @@
 
 .. function:: itertools.chain.from_iterable(iterable)
 
-   Alternate constructor for :func:`chain`.  Gets chained inputs from a 
+   Alternate constructor for :func:`chain`.  Gets chained inputs from a
    single iterable argument that is evaluated lazily.  Equivalent to::
 
       @classmethod
@@ -89,9 +89,9 @@
 
    Return *r* length subsequences of elements from the input *iterable*.
 
-   Combinations are emitted in lexicographic sort order.  So, if the 
+   Combinations are emitted in lexicographic sort order.  So, if the
    input *iterable* is sorted, the combination tuples will be produced
-   in sorted order.  
+   in sorted order.
 
    Elements are treated as unique based on their position, not on their
    value.  So if the input elements are unique, there will be no repeat
@@ -104,7 +104,9 @@
             # combinations(range(4), 3) --> 012 013 023 123
             pool = tuple(iterable)
             n = len(pool)
-            indices = range(r)
+            if r > n:
+                return
+            indices = list(range(r))
             yield tuple(pool[i] for i in indices)
             while 1:
                 for i in reversed(range(r)):
@@ -128,6 +130,8 @@
                 if sorted(indices) == list(indices):
                     yield tuple(pool[i] for i in indices)
 
+   The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n``
+   or zero when ``r > n``.
 
 .. function:: count([n])
 
@@ -306,12 +310,12 @@
    Return successive *r* length permutations of elements in the *iterable*.
 
    If *r* is not specified or is ``None``, then *r* defaults to the length
-   of the *iterable* and all possible full-length permutations 
+   of the *iterable* and all possible full-length permutations
    are generated.
 
-   Permutations are emitted in lexicographic sort order.  So, if the 
+   Permutations are emitted in lexicographic sort order.  So, if the
    input *iterable* is sorted, the permutation tuples will be produced
-   in sorted order.  
+   in sorted order.
 
    Elements are treated as unique based on their position, not on their
    value.  So if the input elements are unique, there will be no repeat
@@ -325,7 +329,9 @@
             pool = tuple(iterable)
             n = len(pool)
             r = n if r is None else r
-            indices = range(n)
+            if r > n:
+                return
+            indices = list(range(n))
             cycles = range(n, n-r, -1)
             yield tuple(pool[i] for i in indices[:r])
             while n:
@@ -342,7 +348,7 @@
                 else:
                     return
 
-   The code for :func:`permutations` can be also expressed as a subsequence of 
+   The code for :func:`permutations` can be also expressed as a subsequence of
    :func:`product`, filtered to exclude entries with repeated elements (those
    from the same position in the input pool)::
 
@@ -354,6 +360,8 @@
                 if len(set(indices)) == r:
                     yield tuple(pool[i] for i in indices)
 
+   The number of items returned is ``n! / (n-r)!`` when ``0 <= r <= n``
+   or zero when ``r > n``.
 
 .. function:: product(*iterables[, repeat])
 
@@ -466,7 +474,7 @@
 
 .. doctest::
 
-   # Show a dictionary sorted and grouped by value
+   >>> # Show a dictionary sorted and grouped by value
    >>> from operator import itemgetter
    >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3)
    >>> di = sorted(d.items(), key=itemgetter(1))
@@ -477,13 +485,13 @@
    2 ['b', 'd', 'f']
    3 ['g']
 
-   # Find runs of consecutive numbers using groupby.  The key to the solution
-   # is differencing with a range so that consecutive numbers all appear in
-   # same group.
+   >>> # Find runs of consecutive numbers using groupby.  The key to the solution
+   >>> # is differencing with a range so that consecutive numbers all appear in
+   >>> # same group.
    >>> data = [ 1,  4,5,6, 10, 15,16,17,18, 22, 25,26,27,28]
    >>> for k, g in groupby(enumerate(data), lambda t:t[0]-t[1]):
    ...     print(map(operator.itemgetter(1), g))
-   ... 
+   ...
    [1]
    [4, 5, 6]
    [10]
@@ -593,7 +601,8 @@
        return (d for d, s in zip(data, selectors) if s)
 
    def combinations_with_replacement(iterable, r):
-       "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC"
+       "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC"
+       # number items returned:  (n+r-1)! / r! / (n-1)!
        pool = tuple(iterable)
        n = len(pool)
        indices = [0] * r
@@ -606,3 +615,27 @@
                return
            indices[i:] = [indices[i] + 1] * (r - i)
            yield tuple(pool[i] for i in indices)
+
+    def unique_everseen(iterable, key=None):
+        "List unique elements, preserving order. Remember all elements ever seen."
+        # unique_everseen('AAAABBBCCDAABBB') --> A B C D
+        # unique_everseen('ABBCcAD', str.lower) --> A B C D
+        seen = set()
+        seen_add = seen.add
+        if key is None:
+            for element in iterable:
+                if element not in seen:
+                    seen_add(element)
+                    yield element
+        else:
+            for element in iterable:
+                k = key(element)
+                if k not in seen:
+                    seen_add(k)
+                    yield element
+
+    def unique_justseen(iterable, key=None):
+        "List unique elements, preserving order. Remember only the element just seen."
+        # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B
+        # unique_justseen('ABBCcAD', str.lower) --> A B C A D
+        return map(next, map(itemgetter(1), groupby(iterable, key)))

Modified: python/branches/py3k-issue1717/Doc/library/json.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/json.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/json.rst	Sun Jan 25 21:08:20 2009
@@ -13,7 +13,7 @@
 :mod:`marshal` and :mod:`pickle` modules.
 
 Encoding basic Python object hierarchies::
-    
+
     >>> import json
     >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
     '["foo", {"bar": ["baz", null, 1.0, 2]}]'
@@ -42,12 +42,12 @@
     >>> import json
     >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))
     {
-        "4": 5, 
+        "4": 5,
         "6": 7
     }
 
 Decoding JSON::
-    
+
     >>> import json
     >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
     ['foo', {'bar': ['baz', None, 1.0, 2]}]
@@ -74,7 +74,7 @@
     Decimal('1.1')
 
 Extending :class:`JSONEncoder`::
-    
+
     >>> import json
     >>> class ComplexEncoder(json.JSONEncoder):
     ...     def default(self, obj):
@@ -88,12 +88,12 @@
     '[2.0, 1.0]'
     >>> list(ComplexEncoder().iterencode(2 + 1j))
     ['[', '2.0', ', ', '1.0', ']']
-    
+
 
 .. highlight:: none
 
 Using json.tool from the shell to validate and pretty-print::
-    
+
     $ echo '{"json":"obj"}' | python -mjson.tool
     {
         "json": "obj"
@@ -103,7 +103,7 @@
 
 .. highlight:: python
 
-.. note:: 
+.. note::
 
    The JSON produced by this module's default settings is a subset of
    YAML, so it may be used as a serializer for that as well.
@@ -151,7 +151,7 @@
    *default(obj)* is a function that should return a serializable version of
    *obj* or raise :exc:`TypeError`.  The default simply raises :exc:`TypeError`.
 
-   To use a custom :class:`JSONEncoder`` subclass (e.g. one that overrides the
+   To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the
    :meth:`default` method to serialize additional types), specify it with the
    *cls* kwarg.
 
@@ -367,7 +367,7 @@
 
       For example, to support arbitrary iterators, you could implement default
       like this::
-            
+
          def default(self, o):
             try:
                 iterable = iter(o)
@@ -391,6 +391,6 @@
 
       Encode the given object, *o*, and yield each string representation as
       available.  For example::
-            
+
             for chunk in JSONEncoder().iterencode(bigobject):
                 mysocket.write(chunk)

Modified: python/branches/py3k-issue1717/Doc/library/locale.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/locale.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/locale.rst	Sun Jan 25 21:08:20 2009
@@ -473,7 +473,7 @@
    >>> import locale
    >>> loc = locale.getlocale() # get current locale
    >>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform
-   >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut 
+   >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut
    >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
    >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale
    >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale

Modified: python/branches/py3k-issue1717/Doc/library/logging.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/logging.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/logging.rst	Sun Jan 25 21:08:20 2009
@@ -119,7 +119,7 @@
 messages at different log levels.  This allows you to instrument your code with
 debug messages, for example, but turning the log level down so that those debug
 messages are not written for your production system.  The default levels are
-``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``UNSET``.
+``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG`` and ``NOTSET``.
 
 The logger, handler, and log message call each specify a level.  The log message
 is only emitted if the handler and logger are configured to emit messages of
@@ -420,6 +420,8 @@
 code approach, mainly separation of configuration and code and the ability of
 noncoders to easily modify the logging properties.
 
+.. _library-config:
+
 Configuring Logging for a Library
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -520,6 +522,9 @@
 the message to its destination. Most user-defined subclasses of :class:`Handler`
 will need to override this :meth:`emit`.
 
+Useful Handlers
+---------------
+
 In addition to the base :class:`Handler` class, many useful subclasses are
 provided:
 
@@ -528,39 +533,52 @@
 
 #. :class:`FileHandler` instances send error messages to disk files.
 
-#. :class:`BaseRotatingHandler` is the base class for handlers that rotate log
-   files at a certain point. It is not meant to be  instantiated directly. Instead,
-   use :class:`RotatingFileHandler` or :class:`TimedRotatingFileHandler`.
+.. module:: logging.handlers
 
-#. :class:`RotatingFileHandler` instances send error messages to disk files,
-   with support for maximum log file sizes and log file rotation.
+#. :class:`BaseRotatingHandler` is the base class for handlers that
+   rotate log files at a certain point. It is not meant to be  instantiated
+   directly. Instead, use :class:`RotatingFileHandler` or
+   :class:`TimedRotatingFileHandler`.
 
-#. :class:`TimedRotatingFileHandler` instances send error messages to disk files
-   rotating the log file at certain timed intervals.
+#. :class:`RotatingFileHandler` instances send error messages to disk
+   files, with support for maximum log file sizes and log file rotation.
 
-#. :class:`SocketHandler` instances send error messages to TCP/IP sockets.
+#. :class:`TimedRotatingFileHandler` instances send error messages to
+   disk files, rotating the log file at certain timed intervals.
 
-#. :class:`DatagramHandler` instances send error messages to UDP sockets.
+#. :class:`SocketHandler` instances send error messages to TCP/IP
+   sockets.
 
-#. :class:`SMTPHandler` instances send error messages to a designated email
-   address.
+#. :class:`DatagramHandler` instances send error messages to UDP
+   sockets.
 
-#. :class:`SysLogHandler` instances send error messages to a Unix syslog daemon,
-   possibly on a remote machine.
+#. :class:`SMTPHandler` instances send error messages to a designated
+   email address.
 
-#. :class:`NTEventLogHandler` instances send error messages to a Windows
-   NT/2000/XP event log.
+#. :class:`SysLogHandler` instances send error messages to a Unix
+   syslog daemon, possibly on a remote machine.
 
-#. :class:`MemoryHandler` instances send error messages to a buffer in memory,
-   which is flushed whenever specific criteria are met.
+#. :class:`NTEventLogHandler` instances send error messages to a
+   Windows NT/2000/XP event log.
 
-#. :class:`HTTPHandler` instances send error messages to an HTTP server using
-   either ``GET`` or ``POST`` semantics.
+#. :class:`MemoryHandler` instances send error messages to a buffer
+   in memory, which is flushed whenever specific criteria are met.
+
+#. :class:`HTTPHandler` instances send error messages to an HTTP
+   server using either ``GET`` or ``POST`` semantics.
+
+#. :class:`WatchedFileHandler` instances watch the file they are
+   logging to. If the file changes, it is closed and reopened using the file
+   name. This handler is only useful on Unix-like systems; Windows does not
+   support the underlying mechanism used.
+
+.. currentmodule:: logging
 
 #. :class:`NullHandler` instances do nothing with error messages. They are used
    by library developers who want to use logging, but want to avoid the "No
    handlers could be found for logger XXX" message which can be displayed if
-   the library user has not configured logging.
+   the library user has not configured logging. See :ref:`library-config` for
+   more information.
 
 .. versionadded:: 3.1
 
@@ -591,6 +609,9 @@
 name. If this feature is used, messages sent to the named logger and its
 children are allowed through the filter, and all others dropped.
 
+Module-Level Functions
+----------------------
+
 In addition to the classes described above, there are a number of module- level
 functions.
 
@@ -1534,8 +1555,6 @@
 StreamHandler
 ^^^^^^^^^^^^^
 
-.. module:: logging.handlers
-
 The :class:`StreamHandler` class, located in the core :mod:`logging` package,
 sends logging output to streams such as *sys.stdout*, *sys.stderr* or any
 file-like object (or, more precisely, any object which supports :meth:`write`
@@ -1591,9 +1610,33 @@
       Outputs the record to the file.
 
 
+NullHandler
+^^^^^^^^^^^
+
+.. versionadded:: 3.1
+
+The :class:`NullHandler` class, located in the core :mod:`logging` package,
+does not do any formatting or output. It is essentially a "no-op" handler
+for use by library developers.
+
+
+.. class:: NullHandler()
+
+   Returns a new instance of the :class:`NullHandler` class.
+
+
+   .. method:: emit(record)
+
+      This method does nothing.
+
+See :ref:`library-config` for more information on how to use
+:class:`NullHandler`.
+
 WatchedFileHandler
 ^^^^^^^^^^^^^^^^^^
 
+.. currentmodule:: logging.handlers
+
 The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
 module, is a :class:`FileHandler` which watches the file it is logging to. If
 the file changes, it is closed and reopened using the file name.
@@ -2267,7 +2310,7 @@
 .. function:: fileConfig(fname[, defaults])
 
    Reads the logging configuration from a :mod:`configparser`\-format file named
-   *fname*.  This function can be called several times from an application,
+   *fname*. This function can be called several times from an application,
    allowing an end user the ability to select from various pre-canned
    configurations (if the developer provides a mechanism to present the choices
    and load the chosen configuration). Defaults to be passed to the ConfigParser
@@ -2301,20 +2344,18 @@
 Configuration file format
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-The configuration file format understood by :func:`fileConfig` is
-based on :mod:`configparser` functionality. The file must contain
-sections called ``[loggers]``, ``[handlers]`` and ``[formatters]``
-which identify by name the entities of each type which are defined in
-the file. For each such entity, there is a separate section which
-identified how that entity is configured. Thus, for a logger named
-``log01`` in the ``[loggers]`` section, the relevant configuration
-details are held in a section ``[logger_log01]``. Similarly, a handler
-called ``hand01`` in the ``[handlers]`` section will have its
-configuration held in a section called ``[handler_hand01]``, while a
-formatter called ``form01`` in the ``[formatters]`` section will have
-its configuration specified in a section called
-``[formatter_form01]``. The root logger configuration must be
-specified in a section called ``[logger_root]``.
+The configuration file format understood by :func:`fileConfig` is based on
+:mod:`configparser` functionality. The file must contain sections called
+``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the
+entities of each type which are defined in the file. For each such entity, there
+is a separate section which identifies how that entity is configured.  Thus, for
+a logger named ``log01`` in the ``[loggers]`` section, the relevant
+configuration details are held in a section ``[logger_log01]``. Similarly, a
+handler called ``hand01`` in the ``[handlers]`` section will have its
+configuration held in a section called ``[handler_hand01]``, while a formatter
+called ``form01`` in the ``[formatters]`` section will have its configuration
+specified in a section called ``[formatter_form01]``. The root logger
+configuration must be specified in a section called ``[logger_root]``.
 
 Examples of these sections in the file are given below. ::
 

Modified: python/branches/py3k-issue1717/Doc/library/mailbox.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/mailbox.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/mailbox.rst	Sun Jan 25 21:08:20 2009
@@ -1553,7 +1553,7 @@
                # that's better than losing a message completely.
                box.lock()
                box.add(message)
-               box.flush()         
+               box.flush()
                box.unlock()
 
                # Remove original message

Modified: python/branches/py3k-issue1717/Doc/library/math.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/math.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/math.rst	Sun Jan 25 21:08:20 2009
@@ -98,7 +98,7 @@
 .. function:: isnan(x)
 
    Checks if the float *x* is a NaN (not a number). NaNs are part of the
-   IEEE 754 standards. Operation like but not limited to ``inf * 0``, 
+   IEEE 754 standards. Operation like but not limited to ``inf * 0``,
    ``inf / inf`` or any operation involving a NaN, e.g. ``nan * 1``, return
    a NaN.
 
@@ -118,7 +118,7 @@
 .. function:: trunc(x)
 
    Return the :class:`Real` value *x* truncated to an :class:`Integral` (usually
-   a long integer). Delegates to ``x.__trunc__()``.
+   an integer). Delegates to ``x.__trunc__()``.
 
 
 Note that :func:`frexp` and :func:`modf` have a different call/return pattern

Modified: python/branches/py3k-issue1717/Doc/library/mmap.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/mmap.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/mmap.rst	Sun Jan 25 21:08:20 2009
@@ -87,7 +87,7 @@
    will be relative to the offset from the beginning of the file. *offset*
    defaults to 0.  *offset* must be a multiple of the PAGESIZE or
    ALLOCATIONGRANULARITY.
-   
+
    This example shows a simple way of using :class:`mmap`::
 
       import mmap

Modified: python/branches/py3k-issue1717/Doc/library/modules.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/modules.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/modules.rst	Sun Jan 25 21:08:20 2009
@@ -18,3 +18,4 @@
    pkgutil.rst
    modulefinder.rst
    runpy.rst
+   importlib.rst

Modified: python/branches/py3k-issue1717/Doc/library/msvcrt.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/msvcrt.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/msvcrt.rst	Sun Jan 25 21:08:20 2009
@@ -18,7 +18,7 @@
 
 The module implements both the normal and wide char variants of the console I/O
 api. The normal API deals only with ASCII characters and is of limited use
-for internationalized applications. The wide char API should be used where 
+for internationalized applications. The wide char API should be used where
 ever possible
 
 .. _msvcrt-files:
@@ -98,11 +98,11 @@
    return the keycode.  The :kbd:`Control-C` keypress cannot be read with this
    function.
 
-   
+
 .. function:: getwch()
 
    Wide char variant of :func:`getch`, returning a Unicode value.
-   
+
 
 .. function:: getche()
 
@@ -113,28 +113,28 @@
 .. function:: getwche()
 
    Wide char variant of :func:`getche`, returning a Unicode value.
-   
+
 
 .. function:: putch(char)
 
    Print the character *char* to the console without buffering.
 
-   
+
 .. function:: putwch(unicode_char)
 
    Wide char variant of :func:`putch`, accepting a Unicode value.
-   
+
 
 .. function:: ungetch(char)
 
    Cause the character *char* to be "pushed back" into the console buffer; it will
    be the next character read by :func:`getch` or :func:`getche`.
 
-   
+
 .. function:: ungetwch(unicode_char)
 
    Wide char variant of :func:`ungetch`, accepting a Unicode value.
-   
+
 
 .. _msvcrt-other:
 

Modified: python/branches/py3k-issue1717/Doc/library/multiprocessing.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/multiprocessing.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/multiprocessing.rst	Sun Jan 25 21:08:20 2009
@@ -19,9 +19,9 @@
 .. warning::
 
     Some of this package's functionality requires a functioning shared semaphore
-    implementation on the host operating system. Without one, the 
-    :mod:`multiprocessing.synchronize` module will be disabled, and attempts to 
-    import it will result in an :exc:`ImportError`. See 
+    implementation on the host operating system. Without one, the
+    :mod:`multiprocessing.synchronize` module will be disabled, and attempts to
+    import it will result in an :exc:`ImportError`. See
     :issue:`3770` for additional information.
 
 .. note::
@@ -35,8 +35,8 @@
         >>> from multiprocessing import Pool
         >>> p = Pool(5)
         >>> def f(x):
-        ... 	return x*x
-        ... 
+        ...     return x*x
+        ...
         >>> p.map(f, [1,2,3])
         Process PoolWorker-1:
         Process PoolWorker-2:
@@ -75,11 +75,11 @@
         print 'module name:', __name__
         print 'parent process:', os.getppid()
         print 'process id:', os.getpid()
-    
+
     def f(name):
         info('function f')
         print 'hello', name
-    
+
     if __name__ == '__main__':
         info('main line')
         p = Process(target=f, args=('bob',))
@@ -107,12 +107,12 @@
       def f(q):
           q.put([42, None, 'hello'])
 
-       if __name__ == '__main__':
-           q = Queue()
-           p = Process(target=f, args=(q,))
-           p.start()
-           print(q.get())    # prints "[42, None, 'hello']"
-           p.join()
+      if __name__ == '__main__':
+          q = Queue()
+          p = Process(target=f, args=(q,))
+          p.start()
+          print(q.get())    # prints "[42, None, 'hello']"
+          p.join()
 
    Queues are thread and process safe.
 
@@ -541,7 +541,7 @@
 
    .. method:: put(item[, block[, timeout]])
 
-      Put item into the queue.  If the optional argument *block* is ``True`` 
+      Put item into the queue.  If the optional argument *block* is ``True``
       (the default) and *timeout* is ``None`` (the default), block if necessary until
       a free slot is available.  If *timeout* is a positive number, it blocks at
       most *timeout* seconds and raises the :exc:`queue.Full` exception if no
@@ -856,7 +856,7 @@
    acceptable.  If *block* is ``True`` and *timeout* is not ``None`` then it
    specifies a timeout in seconds.  If *block* is ``False`` then *timeout* is
    ignored.
-   
+
    Note that on OS/X ``sem_timedwait`` is unsupported, so timeout arguments
    for these will be ignored.
 
@@ -878,7 +878,7 @@
 It is possible to create shared objects using shared memory which can be
 inherited by child processes.
 
-.. function:: Value(typecode_or_type[, *args, lock]])
+.. function:: Value(typecode_or_type, *args[, lock])
 
    Return a :mod:`ctypes` object allocated from shared memory.  By default the
    return value is actually a synchronized wrapper for the object.
@@ -960,7 +960,7 @@
 
    *typecode_or_type* determines the type of the returned object: it is either a
    ctypes type or a one character typecode of the kind used by the :mod:`array`
-   module.  */*args* is passed on to the constructor for the type.
+   module.  *\*args* is passed on to the constructor for the type.
 
    Note that setting and getting the value is potentially non-atomic -- use
    :func:`Value` instead to make sure that access is automatically synchronized
@@ -970,7 +970,7 @@
    attributes which allow one to use it to store and retrieve strings -- see
    documentation for :mod:`ctypes`.
 
-.. function:: Array(typecode_or_type, size_or_initializer[, *args[, lock]])
+.. function:: Array(typecode_or_type, size_or_initializer, *args[, lock])
 
    The same as :func:`RawArray` except that depending on the value of *lock* a
    process-safe synchronization wrapper may be returned instead of a raw ctypes
@@ -1133,22 +1133,22 @@
       server process which is using the given address and authentication key.
 
    .. method:: get_server()
-      
+
       Returns a :class:`Server` object which represents the actual server under
-      the control of the Manager. The :class:`Server` object supports the 
-      :meth:`serve_forever` method::
-      
-       >>> from multiprocessing.managers import BaseManager
-       >>> m = BaseManager(address=('', 50000), authkey='abc'))
-       >>> server = m.get_server()
-       >>> s.serve_forever()
-       
-       :class:`Server` additionally have an :attr:`address` attribute.
+      the control of the Manager. The :class:`Server` object supports the
+      :meth:`serve_forever` method:
+
+      >>> from multiprocessing.managers import BaseManager
+      >>> m = BaseManager(address=('', 50000), authkey='abc'))
+      >>> server = m.get_server()
+      >>> s.serve_forever()
+
+      :class:`Server` additionally have an :attr:`address` attribute.
 
    .. method:: connect()
-   
-      Connect a local manager object to a remote manager process::
-      
+
+      Connect a local manager object to a remote manager process:
+
       >>> from multiprocessing.managers import BaseManager
       >>> m = BaseManager(address='127.0.0.1', authkey='abc))
       >>> m.connect()
@@ -1293,7 +1293,7 @@
 >>>>>>>>>>>>>>>>>>>
 
 To create one's own manager, one creates a subclass of :class:`BaseManager` and
-use the :meth:`~BaseManager.resgister` classmethod to register new types or
+use the :meth:`~BaseManager.register` classmethod to register new types or
 callables with the manager class.  For example::
 
    from multiprocessing.managers import BaseManager
@@ -1358,7 +1358,7 @@
    >>> queue.get()
    'hello'
 
-Local processes can also access that queue, using the code from above on the 
+Local processes can also access that queue, using the code from above on the
 client to access it remotely::
 
     >>> from multiprocessing import Process, Queue
@@ -1369,12 +1369,12 @@
     ...         super(Worker, self).__init__()
     ...     def run(self):
     ...         self.q.put('local hello')
-    ... 
+    ...
     >>> queue = Queue()
     >>> w = Worker(queue)
     >>> w.start()
     >>> class QueueManager(BaseManager): pass
-    ... 
+    ...
     >>> QueueManager.register('get_queue', callable=lambda: queue)
     >>> m = QueueManager(address=('', 50000), authkey='abracadabra')
     >>> s = m.get_server()
@@ -1522,7 +1522,9 @@
    .. method:: apply(func[, args[, kwds]])
 
       Call *func* with arguments *args* and keyword arguments *kwds*.  It blocks
-      till the result is ready.
+      till the result is ready. Given this blocks - :meth:`apply_async` is better suited
+      for performing work in parallel. Additionally, the passed
+      in function is only executed in one of the workers of the pool.
 
    .. method:: apply_async(func[, args[, kwds[, callback]]])
 
@@ -1809,8 +1811,8 @@
 
 * An ``'AF_PIPE'`` address is a string of the form
    :samp:`r'\\\\.\\pipe\\{PipeName}'`.  To use :func:`Client` to connect to a named
-   pipe on a remote computer called ServerName* one should use an address of the
-   form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead.
+   pipe on a remote computer called *ServerName* one should use an address of the
+   form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead.
 
 Note that any string beginning with two backslashes is assumed by default to be
 an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address.
@@ -1855,30 +1857,74 @@
    Returns the logger used by :mod:`multiprocessing`.  If necessary, a new one
    will be created.
 
-   When first created the logger has level :data:`logging.NOTSET` and has a
-   handler which sends output to :data:`sys.stderr` using format
-   ``'[%(levelname)s/%(processName)s] %(message)s'``.  (The logger allows use of
-   the non-standard ``'%(processName)s'`` format.)  Message sent to this logger
-   will not by default propagate to the root logger.
+   When first created the logger has level :data:`logging.NOTSET` and no
+   default handler. Messages sent to this logger will not by default propagate
+   to the root logger.
 
    Note that on Windows child processes will only inherit the level of the
    parent process's logger -- any other customization of the logger will not be
    inherited.
 
+.. currentmodule:: multiprocessing
+.. function:: log_to_stderr()
+
+   This function performs a call to :func:`get_logger` but in addition to
+   returning the logger created by get_logger, it adds a handler which sends
+   output to :data:`sys.stderr` using format
+   ``'[%(levelname)s/%(processName)s] %(message)s'``.
+
 Below is an example session with logging turned on::
 
     >>> import multiprocessing, logging
-    >>> logger = multiprocessing.get_logger()
+    >>> logger = multiprocessing.log_to_stderr()
     >>> logger.setLevel(logging.INFO)
     >>> logger.warning('doomed')
     [WARNING/MainProcess] doomed
     >>> m = multiprocessing.Manager()
     [INFO/SyncManager-1] child process calling self.run()
-    [INFO/SyncManager-1] manager bound to '\\\\.\\pipe\\pyc-2776-0-lj0tfa'
+    [INFO/SyncManager-1] created temp directory /.../pymp-Wh47O_
+    [INFO/SyncManager-1] manager serving at '/.../listener-lWsERs'
     >>> del m
     [INFO/MainProcess] sending shutdown message to manager
     [INFO/SyncManager-1] manager exiting with exitcode 0
 
+In addition to having these two logging functions, the multiprocessing also
+exposes two additional logging level attributes. These are  :const:`SUBWARNING`
+and :const:`SUBDEBUG`. The table below illustrates where theses fit in the
+normal level hierarchy.
+
++----------------+----------------+
+| Level          | Numeric value  |
++================+================+
+| ``SUBWARNING`` | 25             |
++----------------+----------------+
+| ``SUBDEBUG``   | 5              |
++----------------+----------------+
+
+For a full table of logging levels, see the :mod:`logging` module.
+
+These additional logging levels are used primarily for certain debug messages
+within the multiprocessing module. Below is the same example as above, except
+with :const:`SUBDEBUG` enabled::
+
+    >>> import multiprocessing, logging
+    >>> logger = multiprocessing.log_to_stderr()
+    >>> logger.setLevel(multiprocessing.SUBDEBUG)
+    >>> logger.warning('doomed')
+    [WARNING/MainProcess] doomed
+    >>> m = multiprocessing.Manager()
+    [INFO/SyncManager-1] child process calling self.run()
+    [INFO/SyncManager-1] created temp directory /.../pymp-djGBXN
+    [INFO/SyncManager-1] manager serving at '/.../pymp-djGBXN/listener-knBYGe'
+    >>> del m
+    [SUBDEBUG/MainProcess] finalizer calling ...
+    [INFO/MainProcess] sending shutdown message to manager
+    [DEBUG/SyncManager-1] manager received shutdown message
+    [SUBDEBUG/SyncManager-1] calling <Finalize object, callback=unlink, ...
+    [SUBDEBUG/SyncManager-1] finalizer calling <built-in function unlink> ...
+    [SUBDEBUG/SyncManager-1] calling <Finalize object, dead>
+    [SUBDEBUG/SyncManager-1] finalizer calling <function rmtree at 0x5aa730> ...
+    [INFO/SyncManager-1] manager exiting with exitcode 0
 
 The :mod:`multiprocessing.dummy` module
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2118,7 +2164,7 @@
 .. literalinclude:: ../includes/mp_benchmarks.py
 
 An example/demo of how to use the :class:`managers.SyncManager`, :class:`Process`
-and others to build a system which can distribute processes and work via a 
+and others to build a system which can distribute processes and work via a
 distributed queue to a "cluster" of machines on a network, accessible via SSH.
 You will need to have private key authentication for all hosts configured for
 this to work.

Modified: python/branches/py3k-issue1717/Doc/library/nntplib.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/nntplib.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/nntplib.rst	Sun Jan 25 21:08:20 2009
@@ -24,16 +24,16 @@
    Group comp.lang.python has 59 articles, range 3742 to 3803
    >>> resp, subs = s.xhdr('subject', first + '-' + last)
    >>> for id, sub in subs[-10:]: print(id, sub)
-   ... 
+   ...
    3792 Re: Removing elements from a list while iterating...
    3793 Re: Who likes Info files?
    3794 Emacs and doc strings
    3795 a few questions about the Mac implementation
    3796 Re: executable python scripts
    3797 Re: executable python scripts
-   3798 Re: a few questions about the Mac implementation 
+   3798 Re: a few questions about the Mac implementation
    3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules
-   3802 Re: executable python scripts 
+   3802 Re: executable python scripts
    3803 Re: \POSIX{} wait and SIGCHLD
    >>> s.quit()
    '205 news.cwi.nl closing connection.  Goodbye.'

Modified: python/branches/py3k-issue1717/Doc/library/numbers.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/numbers.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/numbers.rst	Sun Jan 25 21:08:20 2009
@@ -49,14 +49,14 @@
    :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``,
    ``%``, ``<``, ``<=``, ``>``, and ``>=``.
 
-   Real also provides defaults for :func:`complex`, :attr:`Complex.real`,
-   :attr:`Complex.imag`, and :meth:`Complex.conjugate`.
+   Real also provides defaults for :func:`complex`, :attr:`~Complex.real`,
+   :attr:`~Complex.imag`, and :meth:`~Complex.conjugate`.
 
 
 .. class:: Rational
 
    Subtypes :class:`Real` and adds
-   :attr:`Rational.numerator` and :attr:`Rational.denominator` properties, which
+   :attr:`~Rational.numerator` and :attr:`~Rational.denominator` properties, which
    should be in lowest terms. With these, it provides a default for
    :func:`float`.
 
@@ -72,8 +72,8 @@
 .. class:: Integral
 
    Subtypes :class:`Rational` and adds a conversion to :class:`int`.
-   Provides defaults for :func:`float`, :attr:`Rational.numerator`, and
-   :attr:`Rational.denominator`, and bit-string operations: ``<<``,
+   Provides defaults for :func:`float`, :attr:`~Rational.numerator`, and
+   :attr:`~Rational.denominator`, and bit-string operations: ``<<``,
    ``>>``, ``&``, ``^``, ``|``, ``~``.
 
 
@@ -169,7 +169,7 @@
        knowledge of ``A``, so it can handle those instances before
        delegating to :class:`Complex`.
 
-If ``A<:Complex`` and ``B<:Real`` without sharing any other knowledge,
+If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge,
 then the appropriate shared operation is the one involving the built
 in :class:`complex`, and both :meth:`__radd__` s land there, so ``a+b
 == b+a``.

Modified: python/branches/py3k-issue1717/Doc/library/operator.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/operator.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/operator.rst	Sun Jan 25 21:08:20 2009
@@ -7,7 +7,7 @@
 
 
 .. testsetup::
-   
+
    import operator
    from operator import itemgetter
 
@@ -209,7 +209,7 @@
 
    Remove the value of *a* at index *b*.
 
- 
+
 .. function:: getitem(a, b)
               __getitem__(a, b)
 
@@ -337,7 +337,7 @@
 
       >>> class C:
       ...     pass
-      ... 
+      ...
       >>> import operator
       >>> obj = C()
       >>> operator.isMappingType(obj)
@@ -427,9 +427,9 @@
                 def g(obj):
                     return tuple(obj[item] for item in items)
             return g
-   
-   The items can be any type accepted by the operand's :meth:`__getitem__` 
-   method.  Dictionaries accept any hashable value.  Lists, tuples, and 
+
+   The items can be any type accepted by the operand's :meth:`__getitem__`
+   method.  Dictionaries accept any hashable value.  Lists, tuples, and
    strings accept an index or a slice:
 
       >>> itemgetter(1)('ABCDEFG')

Modified: python/branches/py3k-issue1717/Doc/library/optparse.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/optparse.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/optparse.rst	Sun Jan 25 21:08:20 2009
@@ -543,8 +543,8 @@
 :class:`OptionGroup` to a parser is easy::
 
     group = OptionGroup(parser, "Dangerous Options",
-			"Caution: use these options at your own risk.  "
-			"It is believed that some of them bite.")
+                        "Caution: use these options at your own risk.  "
+                        "It is believed that some of them bite.")
     group.add_option("-g", action="store_true", help="Group option.")
     parser.add_option_group(group)
 
@@ -558,12 +558,12 @@
       -q, --quiet          be vewwy quiet (I'm hunting wabbits)
       -fFILE, --file=FILE  write output to FILE
       -mMODE, --mode=MODE  interaction mode: one of 'novice', 'intermediate'
-			   [default], 'expert'
+                           [default], 'expert'
 
       Dangerous Options:
-	Caution: use of these options is at your own risk.  It is believed that
-	some of them bite.
-	-g                 Group option.
+      Caution: use of these options is at your own risk.  It is believed that
+      some of them bite.
+      -g                 Group option.
 
 .. _optparse-printing-version-string:
 
@@ -794,7 +794,7 @@
 The keyword arguments define attributes of the new Option object.  The most
 important option attribute is :attr:`action`, and it largely determines which
 other attributes are relevant or required.  If you pass irrelevant option
-attributes, or fail to pass required ones, :mod:`optparse` raises an 
+attributes, or fail to pass required ones, :mod:`optparse` raises an
 :exc:`OptionError` exception explaining your mistake.
 
 An option's *action* determines what :mod:`optparse` does when it encounters

Modified: python/branches/py3k-issue1717/Doc/library/os.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/os.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/os.rst	Sun Jan 25 21:08:20 2009
@@ -1226,7 +1226,7 @@
    These functions all execute a new program, replacing the current process; they
    do not return.  On Unix, the new executable is loaded into the current process,
    and will have the same process id as the caller.  Errors will be reported as
-   :exc:`OSError` exceptions.  
+   :exc:`OSError` exceptions.
 
    The current process is replaced immediately. Open file objects and
    descriptors are not flushed, so if there may be data buffered
@@ -1258,7 +1258,7 @@
    used to define the environment variables for the new process (these are used
    instead of the current process' environment); the functions :func:`execl`,
    :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new process to
-   inherit the environment of the current process. 
+   inherit the environment of the current process.
 
    Availability: Unix, Windows.
 
@@ -1456,7 +1456,7 @@
 
    (Note that the :mod:`subprocess` module provides more powerful facilities for
    spawning new processes and retrieving their results; using that module is
-   preferable to using these functions.  Check specially the *Replacing Older 
+   preferable to using these functions.  Check specially the *Replacing Older
    Functions with the subprocess Module* section in that documentation page.)
 
    If *mode* is :const:`P_NOWAIT`, this function returns the process id of the new

Modified: python/branches/py3k-issue1717/Doc/library/ossaudiodev.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/ossaudiodev.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/ossaudiodev.rst	Sun Jan 25 21:08:20 2009
@@ -16,26 +16,26 @@
    use ALSA, you'll have to make sure its OSS compatibility layer
    is active to use ossaudiodev, but you're gonna need it for the vast
    majority of Linux audio apps anyways.
-   
+
    Sounds like things are also complicated for other BSDs.  In response
    to my python-dev query, Thomas Wouters said:
-   
+
    > Likewise, googling shows OpenBSD also uses OSS/Free -- the commercial
    > OSS installation manual tells you to remove references to OSS/Free from the
    > kernel :)
-   
+
    but Aleksander Piotrowsk actually has an OpenBSD box, and he quotes
    from its <soundcard.h>:
    >  * WARNING!  WARNING!
    >  * This is an OSS (Linux) audio emulator.
    >  * Use the Native NetBSD API for developing new code, and this
    >  * only for compiling Linux programs.
-   
+
    There's also an ossaudio manpage on OpenBSD that explains things
    further.  Presumably NetBSD and OpenBSD have a different standard
    audio interface.  That's the great thing about standards, there are so
    many to choose from ... ;-)
-   
+
    This probably all warrants a footnote or two, but I don't understand
    things well enough right now to write it!   --GPW
 

Modified: python/branches/py3k-issue1717/Doc/library/othergui.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/othergui.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/othergui.rst	Sun Jan 25 21:08:20 2009
@@ -70,7 +70,7 @@
       Robin Dunn.
 
 PyGTK, PyQt, and wxPython, all have a modern look and feel and more
-widgets than Tkinter. In addition, there are many other GUI toolkits for 
+widgets than Tkinter. In addition, there are many other GUI toolkits for
 Python, both cross-platform, and platform-specific. See the `GUI Programming
 <http://wiki.python.org/moin/GuiProgramming>`_ page in the Python Wiki for a
 much more complete list, and also for links to documents where the

Modified: python/branches/py3k-issue1717/Doc/library/parser.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/parser.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/parser.rst	Sun Jan 25 21:08:20 2009
@@ -635,7 +635,7 @@
 while the long form uses an indented block and allows nested definitions::
 
    def make_power(exp):
-       "Make a function that raises an argument to the exponent `exp'."
+       "Make a function that raises an argument to the exponent `exp`."
        def raiser(x, y=exp):
            return x ** y
        return raiser

Modified: python/branches/py3k-issue1717/Doc/library/pdb.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/pdb.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/pdb.rst	Sun Jan 25 21:08:20 2009
@@ -37,7 +37,7 @@
    (Pdb) continue
    NameError: 'spam'
    > <string>(1)?()
-   (Pdb) 
+   (Pdb)
 
 :file:`pdb.py` can also be invoked as a script to debug other scripts.  For
 example::
@@ -65,7 +65,7 @@
    >>> pdb.pm()
    > ./mymodule.py(3)test2()
    -> print(spam)
-   (Pdb) 
+   (Pdb)
 
 The module defines the following functions; each enters the debugger in a
 slightly different way:
@@ -105,7 +105,7 @@
 
 .. function:: post_mortem([traceback])
 
-   Enter post-mortem debugging of the given *traceback* object.  If no 
+   Enter post-mortem debugging of the given *traceback* object.  If no
    *traceback* is given, it uses the one of the exception that is currently
    being handled (an exception must be being handled if the default is to be
    used).

Modified: python/branches/py3k-issue1717/Doc/library/pickle.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/pickle.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/pickle.rst	Sun Jan 25 21:08:20 2009
@@ -98,8 +98,8 @@
 
 There are currently 4 different protocols which can be used for pickling.
 
-* Protocol version 0 is the original ASCII protocol and is backwards compatible
-  with earlier versions of Python.
+* Protocol version 0 is the original human-readable protocol and is
+  backwards compatible with earlier versions of Python.
 
 * Protocol version 1 is the old binary format which is also compatible with
   earlier versions of Python.
@@ -130,16 +130,6 @@
    The highest protocol version available.  This value can be passed as a
    *protocol* value.
 
-.. note::
-
-   Be sure to always open pickle files created with protocols >= 1 in binary mode.
-   For the old ASCII-based pickle protocol 0 you can use either text mode or binary
-   mode as long as you stay consistent.
-
-   A pickle file written with protocol 0 in binary mode will contain lone linefeeds
-   as line terminators and therefore will look "funny" when viewed in Notepad or
-   other editors which do not support this format.
-
 .. data:: DEFAULT_PROTOCOL
 
    The default protocol used for pickling.  May be less than HIGHEST_PROTOCOL.
@@ -478,7 +468,7 @@
 fact, these methods are part of the copy protocol which implements the
 :meth:`__reduce__` special method.  The copy protocol provides a unified
 interface for retrieving the data necessary for pickling and copying
-objects. [#]_ 
+objects. [#]_
 
 Although powerful, implementing :meth:`__reduce__` directly in your classes is
 error prone.  For this reason, class designers should use the high-level
@@ -570,10 +560,8 @@
 Here is a comprehensive example presenting how persistent ID can be used to
 pickle external objects by reference.
 
-.. XXX Work around for some bug in sphinx/pygments.
-.. highlightlang:: python
 .. literalinclude:: ../includes/dbpickle.py
-.. highlightlang:: python3
+
 
 .. _pickle-state:
 
@@ -715,7 +703,7 @@
 
 
 .. XXX Add note about how extension codes could evade our protection
-   mechanism (e.g. cached classes do not invokes find_class()). 
+   mechanism (e.g. cached classes do not invokes find_class()).
 
 As our examples shows, you have to be careful with what you allow to be
 unpickled.  Therefore if security is a concern, you may want to consider
@@ -725,46 +713,35 @@
 
 .. _pickle-example:
 
-Example
--------
+Usage Examples
+--------------
 
 For the simplest code, use the :func:`dump` and :func:`load` functions.  Note
 that a self-referencing list is pickled and restored correctly. ::
 
    import pickle
 
-   data1 = {'a': [1, 2.0, 3, 4+6j],
-            'b': ("string", "string using Unicode features \u0394"),
-            'c': None}
-
-   selfref_list = [1, 2, 3]
-   selfref_list.append(selfref_list)
-
-   output = open('data.pkl', 'wb')
-
-   # Pickle dictionary using protocol 2.
-   pickle.dump(data1, output, 2)
-
-   # Pickle the list using the highest protocol available.
-   pickle.dump(selfref_list, output, -1)
-
-   output.close()
+   # An arbitrary collection of objects supported by pickle.
+   data = {
+     'a': [1, 2.0, 3, 4+6j],
+     'b': ("character string", b"byte string"),
+     'c': set([None, True, False])
+   }
 
-The following example reads the resulting pickled data.  When reading a
-pickle-containing file, you should open the file in binary mode because you
-can't be sure if the ASCII or binary format was used. ::
+   with open('data.pickle', 'wb') as f:
+       # Pickle the 'data' dictionary using the highest protocol available.
+       pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)
 
-   import pprint, pickle
 
-   pkl_file = open('data.pkl', 'rb')
+The following example reads the resulting pickled data. ::
 
-   data1 = pickle.load(pkl_file)
-   pprint.pprint(data1)
+   import pickle
 
-   data2 = pickle.load(pkl_file)
-   pprint.pprint(data2)
+   with open('data.pickle', 'rb') as f:
+       # The protocol version used is detected automatically, so we do not
+       # have to specify it.
+       data = pickle.load(f)
 
-   pkl_file.close()
 
 .. seealso::
 

Modified: python/branches/py3k-issue1717/Doc/library/profile.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/profile.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/profile.rst	Sun Jan 25 21:08:20 2009
@@ -51,15 +51,15 @@
 
 The Python standard library provides two different profilers:
 
-#. :mod:`cProfile` is recommended for most users; it's a C extension 
+#. :mod:`cProfile` is recommended for most users; it's a C extension
    with reasonable overhead
-   that makes it suitable for profiling long-running programs. 
+   that makes it suitable for profiling long-running programs.
    Based on :mod:`lsprof`,
-   contributed by Brett Rosen and Ted Czotter.  
+   contributed by Brett Rosen and Ted Czotter.
 
 #. :mod:`profile`, a pure Python module whose interface is imitated by
-   :mod:`cProfile`.  Adds significant overhead to profiled programs. 
-   If you're trying to extend 
+   :mod:`cProfile`.  Adds significant overhead to profiled programs.
+   If you're trying to extend
    the profiler in some way, the task might be easier with this module.
    Copyright © 1994, by InfoSeek Corporation.
 
@@ -260,24 +260,24 @@
    that the text string in the far right column was used to sort the output. The
    column headings include:
 
-   ncalls 
+   ncalls
       for the number of calls,
 
-   tottime 
+   tottime
       for the total time spent in the given function (and excluding time made in calls
       to sub-functions),
 
-   percall 
+   percall
       is the quotient of ``tottime`` divided by ``ncalls``
 
-   cumtime 
+   cumtime
       is the total time spent in this and all subfunctions (from invocation till
       exit). This figure is accurate *even* for recursive functions.
 
-   percall 
+   percall
       is the quotient of ``cumtime`` divided by primitive calls
 
-   filename:lineno(function) 
+   filename:lineno(function)
       provides the respective data of each function
 
    When there are two numbers in the first column (for example, ``43/3``), then the

Modified: python/branches/py3k-issue1717/Doc/library/pyexpat.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/pyexpat.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/pyexpat.rst	Sun Jan 25 21:08:20 2009
@@ -177,9 +177,9 @@
 
 .. attribute:: xmlparser.buffer_size
 
-   The size of the buffer used when :attr:`buffer_text` is true.  
-   A new buffer size can be set by assigning a new integer value 
-   to this attribute.  
+   The size of the buffer used when :attr:`buffer_text` is true.
+   A new buffer size can be set by assigning a new integer value
+   to this attribute.
    When the size is changed, the buffer will be flushed.
 
 

Modified: python/branches/py3k-issue1717/Doc/library/queue.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/queue.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/queue.rst	Sun Jan 25 21:08:20 2009
@@ -68,7 +68,7 @@
 -------------
 
 Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`)
-provide the public methods described below.  
+provide the public methods described below.
 
 
 .. method:: Queue.qsize()
@@ -138,20 +138,20 @@
 
 Example of how to wait for enqueued tasks to be completed::
 
-   def worker(): 
-       while True: 
-           item = q.get() 
-           do_work(item) 
-           q.task_done() 
+   def worker():
+       while True:
+           item = q.get()
+           do_work(item)
+           q.task_done()
 
-   q = Queue() 
-   for i in range(num_worker_threads): 
+   q = Queue()
+   for i in range(num_worker_threads):
         t = Thread(target=worker)
         t.set_daemon(True)
-        t.start() 
+        t.start()
 
    for item in source():
-       q.put(item) 
+       q.put(item)
 
    q.join()       # block until all tasks are done
 

Modified: python/branches/py3k-issue1717/Doc/library/random.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/random.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/random.rst	Sun Jan 25 21:08:20 2009
@@ -149,13 +149,13 @@
 
 .. function:: uniform(a, b)
 
-   Return a random floating point number *N* such that ``a <= N < b`` for
-   ``a <= b`` and ``b <= N < a`` for ``b < a``.
+   Return a random floating point number *N* such that ``a <= N <= b`` for
+   ``a <= b`` and ``b <= N <= a`` for ``b < a``.
 
 
 .. function:: triangular(low, high, mode)
 
-   Return a random floating point number *N* such that ``low <= N < high`` and
+   Return a random floating point number *N* such that ``low <= N <= high`` and
    with the specified *mode* between those bounds.  The *low* and *high* bounds
    default to zero and one.  The *mode* argument defaults to the midpoint
    between the bounds, giving a symmetric distribution.
@@ -163,27 +163,30 @@
 
 .. function:: betavariate(alpha, beta)
 
-   Beta distribution.  Conditions on the parameters are ``alpha > 0`` and ``beta >
-   0``. Returned values range between 0 and 1.
+   Beta distribution.  Conditions on the parameters are ``alpha > 0`` and
+   ``beta > 0``. Returned values range between 0 and 1.
 
 
 .. function:: expovariate(lambd)
 
-   Exponential distribution.  *lambd* is 1.0 divided by the desired mean.  (The
-   parameter would be called "lambda", but that is a reserved word in Python.)
-   Returned values range from 0 to positive infinity.
+   Exponential distribution.  *lambd* is 1.0 divided by the desired
+   mean.  It should be nonzero.  (The parameter would be called
+   "lambda", but that is a reserved word in Python.)  Returned values
+   range from 0 to positive infinity if *lambd* is positive, and from
+   negative infinity to 0 if *lambd* is negative.
 
 
 .. function:: gammavariate(alpha, beta)
 
-   Gamma distribution.  (*Not* the gamma function!)  Conditions on the parameters
-   are ``alpha > 0`` and ``beta > 0``.
+   Gamma distribution.  (*Not* the gamma function!)  Conditions on the
+   parameters are ``alpha > 0`` and ``beta > 0``.
 
 
 .. function:: gauss(mu, sigma)
 
-   Gaussian distribution.  *mu* is the mean, and *sigma* is the standard deviation.
-   This is slightly faster than the :func:`normalvariate` function defined below.
+   Gaussian distribution.  *mu* is the mean, and *sigma* is the standard
+   deviation.  This is slightly faster than the :func:`normalvariate` function
+   defined below.
 
 
 .. function:: lognormvariate(mu, sigma)

Modified: python/branches/py3k-issue1717/Doc/library/re.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/re.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/re.rst	Sun Jan 25 21:08:20 2009
@@ -221,7 +221,7 @@
    ``'s'``, ``'u'``, ``'x'``.)  The group matches the empty string; the
    letters set the corresponding flags: :const:`re.a` (ASCII-only matching),
    :const:`re.I` (ignore case), :const:`re.L` (locale dependent),
-   :const:`re.M` (multi-line), :const:`re.S` (dot matches all), 
+   :const:`re.M` (multi-line), :const:`re.S` (dot matches all),
    and :const:`re.X` (verbose), for the entire regular expression. (The
    flags are described in :ref:`contents-of-module-re`.) This
    is useful if you wish to include the flags as part of the regular
@@ -487,7 +487,7 @@
    counterpart ``(?u)``), but these are redundant in Python 3.0 since
    matches are Unicode by default for strings (and Unicode matching
    isn't allowed for bytes).
-   
+
 
 .. data:: I
           IGNORECASE
@@ -1011,14 +1011,14 @@
 
    >>> pair.match("717ak").group(1)
    '7'
-   
+
    # Error because re.match() returns None, which doesn't have a group() method:
    >>> pair.match("718ak").group(1)
    Traceback (most recent call last):
      File "<pyshell#23>", line 1, in <module>
        re.match(r".*(.).*\1", "718ak").group(1)
    AttributeError: 'NoneType' object has no attribute 'group'
-   
+
    >>> pair.match("354aa").group(1)
    'a'
 
@@ -1127,7 +1127,7 @@
 Making a Phonebook
 ^^^^^^^^^^^^^^^^^^
 
-:func:`split` splits a string into a list delimited by the passed pattern.  The 
+:func:`split` splits a string into a list delimited by the passed pattern.  The
 method is invaluable for converting textual data into data structures that can be
 easily read and modified by Python as demonstrated in the following example that
 creates a phonebook.
@@ -1136,7 +1136,7 @@
 triple-quoted string syntax:
 
    >>> input = """Ross McFluff: 834.345.1254 155 Elm Street
-   ... 
+   ...
    ... Ronald Heathmore: 892.345.3428 436 Finley Avenue
    ... Frank Burger: 925.541.7625 662 South Dogwood Way
    ...

Modified: python/branches/py3k-issue1717/Doc/library/reprlib.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/reprlib.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/reprlib.rst	Sun Jan 25 21:08:20 2009
@@ -65,7 +65,7 @@
 
 .. attribute:: Repr.maxlong
 
-   Maximum number of characters in the representation for a long integer.  Digits
+   Maximum number of characters in the representation for an integer.  Digits
    are dropped from the middle.  The default is ``40``.
 
 

Modified: python/branches/py3k-issue1717/Doc/library/rlcompleter.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/rlcompleter.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/rlcompleter.rst	Sun Jan 25 21:08:20 2009
@@ -61,6 +61,6 @@
    If called for a dotted name, it will try to evaluate anything without obvious
    side-effects (functions will not be evaluated, but it can generate calls to
    :meth:`__getattr__`) up to the last part, and find matches for the rest via the
-   :func:`dir` function.  Any exception raised during the evaluation of the 
+   :func:`dir` function.  Any exception raised during the evaluation of the
    expression is caught, silenced and :const:`None` is returned.
 

Modified: python/branches/py3k-issue1717/Doc/library/sched.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/sched.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/sched.rst	Sun Jan 25 21:08:20 2009
@@ -42,7 +42,7 @@
    930343700.276
 
 In multi-threaded environments, the :class:`scheduler` class has limitations
-with respect to thread-safety, inability to insert a new task before 
+with respect to thread-safety, inability to insert a new task before
 the one currently pending in a running scheduler, and holding up the main
 thread until the event queue is empty.  Instead, the preferred approach
 is to use the :class:`threading.Timer` class instead.
@@ -58,7 +58,7 @@
     ...     print(time.time())
     ...     Timer(5, print_time, ()).start()
     ...     Timer(10, print_time, ()).start()
-    ...     time.sleep(11)	# sleep while time-delay events execute
+    ...     time.sleep(11)  # sleep while time-delay events execute
     ...     print(time.time())
     ...
     >>> print_some_times()

Modified: python/branches/py3k-issue1717/Doc/library/shutil.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/shutil.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/shutil.rst	Sun Jan 25 21:08:20 2009
@@ -20,7 +20,7 @@
 
    Even the higher-level file copying functions (:func:`copy`, :func:`copy2`)
    can't copy all file metadata.
-   
+
    On POSIX platforms, this means that file owner and group are lost as well
    as ACLs.  On Mac OS, the resource fork and other metadata are not used.
    This means that resources will be lost and file type and creator codes will

Modified: python/branches/py3k-issue1717/Doc/library/signal.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/signal.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/signal.rst	Sun Jan 25 21:08:20 2009
@@ -39,12 +39,12 @@
 * Some care must be taken if both signals and threads are used in the same
   program.  The fundamental thing to remember in using signals and threads
   simultaneously is: always perform :func:`signal` operations in the main thread
-  of execution.  Any thread can perform an :func:`alarm`, :func:`getsignal`, 
-  :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread 
-  can set a new signal handler, and the main thread will be the only one to 
-  receive signals (this is enforced by the Python :mod:`signal` module, even 
-  if the underlying thread implementation supports sending signals to 
-  individual threads).  This means that signals can't be used as a means of 
+  of execution.  Any thread can perform an :func:`alarm`, :func:`getsignal`,
+  :func:`pause`, :func:`setitimer` or :func:`getitimer`; only the main thread
+  can set a new signal handler, and the main thread will be the only one to
+  receive signals (this is enforced by the Python :mod:`signal` module, even
+  if the underlying thread implementation supports sending signals to
+  individual threads).  This means that signals can't be used as a means of
   inter-thread communication.  Use locks instead.
 
 The variables defined in the :mod:`signal` module are:
@@ -80,22 +80,22 @@
    One more than the number of the highest signal number.
 
 
-.. data:: ITIMER_REAL    
+.. data:: ITIMER_REAL
 
    Decrements interval timer in real time, and delivers :const:`SIGALRM` upon expiration.
 
 
-.. data:: ITIMER_VIRTUAL 
+.. data:: ITIMER_VIRTUAL
 
-   Decrements interval timer only when the process is executing, and delivers 
+   Decrements interval timer only when the process is executing, and delivers
    SIGVTALRM upon expiration.
 
 
 .. data:: ITIMER_PROF
-   
-   Decrements interval timer both when the process executes and when the 
-   system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, 
-   this timer is usually used to profile the time spent by the application 
+
+   Decrements interval timer both when the process executes and when the
+   system is executing on behalf of the process. Coupled with ITIMER_VIRTUAL,
+   this timer is usually used to profile the time spent by the application
    in user and kernel space. SIGPROF is delivered upon expiration.
 
 
@@ -105,7 +105,7 @@
 
    Raised to signal an error from the underlying :func:`setitimer` or
    :func:`getitimer` implementation. Expect this error if an invalid
-   interval timer or a negative time is passed to :func:`setitimer`. 
+   interval timer or a negative time is passed to :func:`setitimer`.
    This error is a subtype of :exc:`IOError`.
 
 
@@ -143,21 +143,21 @@
 
 .. function:: setitimer(which, seconds[, interval])
 
-   Sets given interval timer (one of :const:`signal.ITIMER_REAL`, 
+   Sets given interval timer (one of :const:`signal.ITIMER_REAL`,
    :const:`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified
-   by *which* to fire after *seconds* (float is accepted, different from 
+   by *which* to fire after *seconds* (float is accepted, different from
    :func:`alarm`) and after that every *interval* seconds. The interval
    timer specified by *which* can be cleared by setting seconds to zero.
 
    When an interval timer fires, a signal is sent to the process.
-   The signal sent is dependent on the timer being used; 
-   :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`, 
+   The signal sent is dependent on the timer being used;
+   :const:`signal.ITIMER_REAL` will deliver :const:`SIGALRM`,
    :const:`signal.ITIMER_VIRTUAL` sends :const:`SIGVTALRM`,
    and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`.
 
    The old values are returned as a tuple: (delay, interval).
 
-   Attempting to pass an invalid interval timer will cause a 
+   Attempting to pass an invalid interval timer will cause a
    :exc:`ItimerError`.
 
 
@@ -186,7 +186,7 @@
    will be restarted when interrupted by signal *signalnum*, otherwise system calls will
    be interrupted. Returns nothing. Availability: Unix (see the man page
    :manpage:`siginterrupt(3)` for further information).
-   
+
    Note that installing a signal handler with :func:`signal` will reset the restart
    behaviour to interruptible by implicitly calling :cfunc:`siginterrupt` with a true *flag*
    value for the given signal.
@@ -233,7 +233,7 @@
    signal.alarm(5)
 
    # This open() may hang indefinitely
-   fd = os.open('/dev/ttyS0', os.O_RDWR)  
+   fd = os.open('/dev/ttyS0', os.O_RDWR)
 
    signal.alarm(0)          # Disable the alarm
 

Modified: python/branches/py3k-issue1717/Doc/library/smtplib.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/smtplib.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/smtplib.rst	Sun Jan 25 21:08:20 2009
@@ -182,9 +182,9 @@
 
    Identify yourself to an ESMTP server using ``EHLO``.  The hostname argument
    defaults to the fully qualified domain name of the local host.  Examine the
-   response for ESMTP option and store them for use by :meth:`has_extn`. 
-   Also sets several informational attributes: the message returned by 
-   the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp` 
+   response for ESMTP option and store them for use by :meth:`has_extn`.
+   Also sets several informational attributes: the message returned by
+   the server is stored as the :attr:`ehlo_resp` attribute, :attr:`does_esmtp`
    is set to true or false depending on whether the server supports ESMTP, and
    :attr:`esmtp_features` will be a dictionary containing the names of the
    SMTP service extensions this server supports, and their
@@ -200,7 +200,7 @@
    previous ``EHLO`` or ``HELO`` command this session.  It tries ESMTP ``EHLO``
    first.
 
-   :exc:SMTPHeloError
+   :exc:`SMTPHeloError`
      The server didn't reply properly to the ``HELO`` greeting.
 
 .. method:: SMTP.has_extn(name)

Modified: python/branches/py3k-issue1717/Doc/library/socket.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/socket.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/socket.rst	Sun Jan 25 21:08:20 2009
@@ -178,10 +178,10 @@
 
 .. data:: SIO_*
           RCVALL_*
-          
+
    Constants for Windows' WSAIoctl(). The constants are used as arguments to the
    :meth:`ioctl` method of socket objects.
-   
+
 
 .. data:: TIPC_*
 
@@ -210,7 +210,7 @@
    all the necessary arguments for creating the corresponding socket. *host* is a domain
    name, a string representation of an IPv4/v6 address or ``None``. *port* is a string
    service name such as ``'http'``, a numeric port number or ``None``.
-   The rest of the arguments are optional and must be numeric if specified.  
+   The rest of the arguments are optional and must be numeric if specified.
    By passing ``None`` as the value of *host* and *port*, , you can pass ``NULL`` to the C API.
 
    The :func:`getaddrinfo` function returns a list of 5-tuples with the following
@@ -544,14 +544,14 @@
    contents of the buffer (see the optional built-in module :mod:`struct` for a way
    to decode C structures encoded as byte strings).
 
-   
+
 .. method:: socket.ioctl(control, option)
 
-   :platform: Windows 
-   
+   :platform: Windows
+
    The :meth:`ioctl` method is a limited interface to the WSAIoctl system
    interface. Please refer to the MSDN documentation for more information.
-   
+
 
 .. method:: socket.listen(backlog)
 
@@ -797,17 +797,17 @@
                                  socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
        af, socktype, proto, canonname, sa = res
        try:
-   	s = socket.socket(af, socktype, proto)
+           s = socket.socket(af, socktype, proto)
        except socket.error as msg:
-   	s = None
-   	continue
+           s = None
+           continue
        try:
-   	s.bind(sa)
-   	s.listen(1)
+           s.bind(sa)
+           s.listen(1)
        except socket.error as msg:
-   	s.close()
-   	s = None
-   	continue
+           s.close()
+           s = None
+           continue
        break
    if s is None:
        print('could not open socket')
@@ -832,16 +832,16 @@
    for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM):
        af, socktype, proto, canonname, sa = res
        try:
-   	s = socket.socket(af, socktype, proto)
+           s = socket.socket(af, socktype, proto)
        except socket.error as msg:
-   	s = None
-   	continue
+           s = None
+           continue
        try:
-   	s.connect(sa)
+           s.connect(sa)
        except socket.error as msg:
-   	s.close()
-   	s = None
-   	continue
+           s.close()
+           s = None
+           continue
        break
    if s is None:
        print('could not open socket')
@@ -851,7 +851,7 @@
    s.close()
    print('Received', repr(data))
 
-   
+
 The last example shows how to write a very simple network sniffer with raw
 sockets on Windows. The example requires administrator privileges to modify
 the interface::
@@ -860,19 +860,19 @@
 
    # the public network interface
    HOST = socket.gethostbyname(socket.gethostname())
-   
+
    # create a raw socket and bind it to the public interface
    s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
    s.bind((HOST, 0))
-   
+
    # Include IP headers
    s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1)
-   
+
    # receive all packages
    s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)
-   
+
    # receive a package
    print(s.recvfrom(65565))
-   
+
    # disabled promiscuous mode
    s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)

Modified: python/branches/py3k-issue1717/Doc/library/sqlite3.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/sqlite3.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/sqlite3.rst	Sun Jan 25 21:08:20 2009
@@ -541,8 +541,8 @@
 
    This read-only attribute provides the column names of the last query. To
    remain compatible with the Python DB API, it returns a 7-tuple for each
-   column where the last six items of each tuple are :const:`None`. 
-   
+   column where the last six items of each tuple are :const:`None`.
+
    It is set for ``SELECT`` statements without any matching rows as well.
 
 .. _sqlite3-row-objects:
@@ -553,7 +553,7 @@
 .. class:: Row
 
    A :class:`Row` instance serves as a highly optimized
-   :attr:`~Connection.row_factory` for :class:`Connection` objects. 
+   :attr:`~Connection.row_factory` for :class:`Connection` objects.
    It tries to mimic a tuple in most of its features.
 
    It supports mapping access by column name and index, iteration,
@@ -561,17 +561,12 @@
 
    If two :class:`Row` objects have exactly the same columns and their
    members are equal, they compare equal.
-   
-   .. versionchanged:: 2.6
-      Added iteration and equality (hashability).
 
    .. method:: keys
 
       This method returns a tuple of column names. Immediately after a query,
       it is the first member of each tuple in :attr:`Cursor.description`.
 
-      .. versionadded:: 2.6
-
 Let's assume we initialize a table as in the example given above::
 
     conn = sqlite3.connect(":memory:")
@@ -780,7 +775,7 @@
 ------------------------
 
 By default, the :mod:`sqlite3` module opens transactions implicitly before a
-Data Modification Language (DML)  statement (i.e. 
+Data Modification Language (DML)  statement (i.e.
 ``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions
 implicitly before a non-DML, non-query statement (i. e.
 anything other than ``SELECT`` or the aforementioned).

Modified: python/branches/py3k-issue1717/Doc/library/ssl.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/ssl.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/ssl.rst	Sun Jan 25 21:08:20 2009
@@ -45,7 +45,7 @@
 
 .. exception:: SSLError
 
-   Raised to signal an error from the underlying SSL implementation.  This 
+   Raised to signal an error from the underlying SSL implementation.  This
    signifies some problem in the higher-level
    encryption and authentication layer that's superimposed on the underlying
    network connection.  This error is a subtype of :exc:`socket.error`, which
@@ -170,7 +170,7 @@
      >>> import time
      >>> time.ctime(ssl.cert_time_to_seconds("May  9 00:00:00 2007 GMT"))
      'Wed May  9 00:00:00 2007'
-     >>> 
+     >>>
 
 .. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None)
 
@@ -397,7 +397,7 @@
 the client or server, and then the certificate for the issuer of that
 certificate, and then the certificate for the issuer of *that* certificate,
 and so on up the chain till you get to a certificate which is *self-signed*,
-that is, a certificate which has the same subject and issuer, 
+that is, a certificate which has the same subject and issuer,
 sometimes called a *root certificate*.  The certificates should just
 be concatenated together in the certificate file.  For example, suppose
 we had a three certificate chain, from our server certificate to the
@@ -433,13 +433,13 @@
 you only need the root certificates, and the remote peer is supposed to
 furnish the other certificates necessary to chain from its certificate to
 a root certificate.
-See :rfc:`4158` for more discussion of the way in which 
+See :rfc:`4158` for more discussion of the way in which
 certification chains can be built.
 
 If you are going to create a server that provides SSL-encrypted
 connection services, you will need to acquire a certificate for that
 service.  There are many ways of acquiring appropriate certificates,
-such as buying one from a certification authority.  Another common 
+such as buying one from a certification authority.  Another common
 practice is to generate a self-signed certificate.  The simplest
 way to do this is with the OpenSSL package, using something like
 the following::
@@ -581,7 +581,7 @@
 
 And go back to listening for new client connections.
 
-           
+
 .. seealso::
 
    Class :class:`socket.socket`

Modified: python/branches/py3k-issue1717/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/stdtypes.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/stdtypes.rst	Sun Jan 25 21:08:20 2009
@@ -172,7 +172,7 @@
 any operand is a complex number, the objects are of different types that cannot
 be compared, or other cases where there is no defined ordering.
 
-.. index:: 
+.. index::
    single: __eq__() (instance method)
    single: __ne__() (instance method)
    single: __lt__() (instance method)
@@ -322,6 +322,7 @@
       module: math
       single: floor() (in module math)
       single: ceil() (in module math)
+      single: trunc() (in module math)
       pair: numeric; conversions
       pair: C; language
 
@@ -330,31 +331,31 @@
    for well-defined conversions.
 
 (4)
-   float also accepts the strings "nan" and "inf" with an optional prefix "+" 
+   float also accepts the strings "nan" and "inf" with an optional prefix "+"
    or "-" for Not a Number (NaN) and positive or negative infinity.
 
 (5)
    Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for
    programming languages.
 
-   
+
 
 All :class:`numbers.Real` types (:class:`int` and
 :class:`float`) also include the following operations:
 
-+--------------------+--------------------------------+--------+
-| Operation          | Result                         | Notes  |
-+====================+================================+========+
-| ``trunc(x)``       | *x* truncated to Integral      |        |
-+--------------------+--------------------------------+--------+
-| ``round(x[, n])``  | *x* rounded to n digits,       |        |
-|                    | rounding half to even. If n is |        |
-|                    | omitted, it defaults to 0.     |        |
-+--------------------+--------------------------------+--------+
-| ``math.floor(x)``  | the greatest Integral <= *x*   |        |
-+--------------------+--------------------------------+--------+
-| ``math.ceil(x)``   | the least Integral >= *x*      |        |
-+--------------------+--------------------------------+--------+
++--------------------+------------------------------------+--------+
+| Operation          | Result                             | Notes  |
++====================+====================================+========+
+| ``math.trunc(x)``  | *x* truncated to Integral          |        |
++--------------------+------------------------------------+--------+
+| ``round(x[, n])``  | *x* rounded to n digits,           |        |
+|                    | rounding half to even. If n is     |        |
+|                    | omitted, it defaults to 0.         |        |
++--------------------+------------------------------------+--------+
+| ``math.floor(x)``  | the greatest integral float <= *x* |        |
++--------------------+------------------------------------+--------+
+| ``math.ceil(x)``   | the least integral float >= *x*    |        |
++--------------------+------------------------------------+--------+
 
 For additional numeric operations see the :mod:`math` and :mod:`cmath`
 modules.
@@ -460,8 +461,6 @@
     original float and with a positive denominator.  Raises
     :exc:`OverflowError` on infinities and a :exc:`ValueError` on
     NaNs.
-    
-    .. versionadded:: 2.6
 
 Two methods support conversion to
 and from hexadecimal strings.  Since Python's floats are stored
@@ -595,16 +594,17 @@
 Sequence Types --- :class:`str`, :class:`bytes`, :class:`bytearray`, :class:`list`, :class:`tuple`, :class:`range`
 ==================================================================================================================
 
-There are five sequence types: strings, byte sequences, byte arrays, lists,
-tuples, and range objects.  (For other containers see the built-in
-:class:`dict`, :class:`list`, :class:`set`, and :class:`tuple` classes, and the
-:mod:`collections` module.)
+There are six sequence types: strings, byte sequences (:class:`bytes` objects),
+byte arrays (:class:`bytearray` objects), lists, tuples, and range objects.  For
+other containers see the built in :class:`dict` and :class:`set` classes, and
+the :mod:`collections` module.
+
 
 .. index::
    object: sequence
    object: string
    object: bytes
-   object: buffer
+   object: bytearray
    object: tuple
    object: list
    object: range
@@ -875,7 +875,7 @@
    otherwise. Decimal characters include digit characters, and all characters
    that that can be used to form decimal-radix numbers, e.g. U+0660,
    ARABIC-INDIC DIGIT ZERO.
-   
+
 
 .. method:: str.isdigit()
 
@@ -903,7 +903,7 @@
    that have the Unicode numeric value property, e.g. U+2155,
    VULGAR FRACTION ONE FIFTH.
 
-   
+
 .. method:: str.isprintable()
 
    Return true if all characters in the string are printable or the string is
@@ -1474,7 +1474,7 @@
    example, sort by department, then by salary grade).
 
    While a list is being sorted, the effect of attempting to mutate, or even
-   inspect, the list is undefined.  The C implementation 
+   inspect, the list is undefined.  The C implementation
    makes the list appear empty for the duration, and raises :exc:`ValueError` if it
    can detect that the list has been mutated during a sort.
 
@@ -1525,7 +1525,7 @@
    b'\xf0\xf1\xf2'
 
 The translate method differs in semantics from the version available on strings:
-   
+
 .. method:: bytes.translate(table[, delete])
 
    Return a copy of the bytes or bytearray object where all bytes occurring in
@@ -1623,12 +1623,12 @@
    .. method:: union(other, ...)
                set | other | ...
 
-      Return a new set with elements from both sets.
+      Return a new set with elements from the set and all others.
 
    .. method:: intersection(other, ...)
                set & other & ...
 
-      Return a new set with elements common to both sets.
+      Return a new set with elements common to the set and all others.
 
    .. method:: difference(other, ...)
                set - other - ...
@@ -1807,7 +1807,7 @@
 
       Return the item of *d* with key *key*.  Raises a :exc:`KeyError` if *key* is
       not in the map.
-      
+
       If a subclass of dict defines a method :meth:`__missing__`, if the key *key*
       is not present, the ``d[key]`` operation calls that method with the key *key*
       as argument.  The ``d[key]`` operation then returns or raises whatever is
@@ -2149,7 +2149,7 @@
    positioning); other values are ``os.SEEK_CUR`` or ``1`` (seek relative to the
    current position) and ``os.SEEK_END`` or ``2``  (seek relative to the file's
    end).  There is no return value.
-   
+
    For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by two and
    ``f.seek(-3, os.SEEK_END)`` sets the position to the third to last.
 

Modified: python/branches/py3k-issue1717/Doc/library/string.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/string.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/string.rst	Sun Jan 25 21:08:20 2009
@@ -98,7 +98,7 @@
       :meth:`format` is just a wrapper that calls :meth:`vformat`.
 
    .. method:: vformat(format_string, args, kwargs)
-   
+
       This function does the actual work of formatting.  It is exposed as a
       separate function for cases where you want to pass in a predefined
       dictionary of arguments, rather than unpacking and repacking the
@@ -111,12 +111,12 @@
    intended to be replaced by subclasses:
 
    .. method:: parse(format_string)
-   
+
       Loop over the format_string and return an iterable of tuples
       (*literal_text*, *field_name*, *format_spec*, *conversion*).  This is used
       by :meth:`vformat` to break the string in to either literal text, or
       replacement fields.
-      
+
       The values in the tuple conceptually represent a span of literal text
       followed by a single replacement field.  If there is no literal text
       (which can happen if two replacement fields occur consecutively), then
@@ -134,7 +134,7 @@
       *key* parameter to :meth:`get_value`.
 
    .. method:: get_value(key, args, kwargs)
-   
+
       Retrieve a given field value.  The *key* argument will be either an
       integer or a string.  If it is an integer, it represents the index of the
       positional argument in *args*; if it is a string, then it represents a
@@ -172,7 +172,7 @@
       method is provided so that subclasses can override it.
 
    .. method:: convert_field(value, conversion)
-   
+
       Converts the value (returned by :meth:`get_field`) given a conversion type
       (as in the tuple returned by the :meth:`parse` method.)  The default
       version understands 'r' (repr) and 's' (str) conversion types.
@@ -201,7 +201,7 @@
       element_index: `integer`
       conversion: "r" | "s" | "a"
       format_spec: <described in the next section>
-      
+
 In less formal terms, the replacement field starts with a *field_name*, which
 can either be a number (for a positional argument), or an identifier (for
 keyword arguments).  Following this is an optional *conversion* field, which is
@@ -221,7 +221,7 @@
    "My quest is {name}"             # References keyword argument 'name'
    "Weight in tons {0.weight}"      # 'weight' attribute of first positional arg
    "Units destroyed: {players[0]}"  # First element of keyword argument 'players'.
-   
+
 The *conversion* field causes a type coercion before formatting.  Normally, the
 job of formatting a value is done by the :meth:`__format__` method of the value
 itself.  However, in some cases it is desirable to force a type to be formatted
@@ -265,11 +265,11 @@
 Then the outer replacement field would be evaluated, producing::
 
    "noses     "
-   
+
 Which is substituted into the string, yielding::
-   
+
    "A man with two noses     "
-   
+
 (The extra space is because we specified a field width of 10, and because left
 alignment is the default for strings.)
 
@@ -301,7 +301,7 @@
    width: `integer`
    precision: `integer`
    type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"
-   
+
 The *fill* character can be any character other than '}' (which signifies the
 end of the field).  The presence of a fill character is signaled by the *next*
 character, which must be one of the alignment options. If the second character
@@ -394,9 +394,9 @@
    +---------+----------------------------------------------------------+
    | None    | The same as ``'d'``.                                     |
    +---------+----------------------------------------------------------+
-                                                                         
+
 The available presentation types for floating point and decimal values are:
-                                                                         
+
    +---------+----------------------------------------------------------+
    | Type    | Meaning                                                  |
    +=========+==========================================================+

Modified: python/branches/py3k-issue1717/Doc/library/subprocess.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/subprocess.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/subprocess.rst	Sun Jan 25 21:08:20 2009
@@ -126,7 +126,7 @@
    Special value that can be used as the *stderr* argument to :class:`Popen` and
    indicates that standard error should go into the same handle as standard
    output.
-   
+
 
 Convenience Functions
 ^^^^^^^^^^^^^^^^^^^^^
@@ -160,11 +160,12 @@
 
    Run command with arguments and return its output as a byte string.
 
-   If the exit code was non-zero it raises a CalledProcessError.  The
-   CalledProcessError object will have the return code in the returncode
-   attribute and output in the output attribute.
+   If the exit code was non-zero it raises a :exc:`CalledProcessError`.  The
+   :exc:`CalledProcessError` object will have the return code in the
+   :attr:`returncode`
+   attribute and output in the :attr:`output` attribute.
 
-   The arguments are the same as for the Popen constructor.  Example:
+   The arguments are the same as for the :class:`Popen` constructor.  Example:
 
       >>> subprocess.check_output(["ls", "-l", "/dev/null"])
       'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'
@@ -346,7 +347,7 @@
    The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly
    by :meth:`communicate`).  A ``None`` value indicates that the process
    hasn't terminated yet.
-   
+
    A negative value ``-N`` indicates that the child was terminated by signal
    ``N`` (Unix only).
 

Modified: python/branches/py3k-issue1717/Doc/library/symtable.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/symtable.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/symtable.rst	Sun Jan 25 21:08:20 2009
@@ -5,7 +5,7 @@
    :synopsis: Interface to the compiler's internal symbol tables.
 
 .. moduleauthor:: Jeremy Hylton <jeremy at alum.mit.edu>
-.. sectionauthor:: Benjamin Peterson
+.. sectionauthor:: Benjamin Peterson <benjamin at python.org>
 
 
 Symbol tables are generated by the compiler from AST just before bytecode is

Modified: python/branches/py3k-issue1717/Doc/library/sys.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/sys.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/sys.rst	Sun Jan 25 21:08:20 2009
@@ -327,7 +327,7 @@
 
    The *default* argument allows to define a value which will be returned
    if the object type does not provide means to retrieve the size and would
-   cause a `TypeError`. 
+   cause a `TypeError`.
 
    func:`getsizeof` calls the object's __sizeof__ method and adds an additional
    garbage collector overhead if the object is managed by the garbage collector.
@@ -484,6 +484,11 @@
    A program is free to modify this list for its own purposes.
 
 
+   .. seealso::
+      Module :mod:`site` This describes how to use .pth files to extend
+      :data:`sys.path`.
+
+
 .. data:: platform
 
    This string contains a platform identifier that can be used to append
@@ -500,10 +505,8 @@
    Windows          ``'win32'``
    Windows/Cygwin   ``'cygwin'``
    Mac OS X         ``'darwin'``
-   Mac OS 9         ``'mac'``
    OS/2             ``'os2'``
    OS/2 EMX         ``'os2emx'``
-   RiscOS           ``'riscos'``
    AtheOS           ``'atheos'``
    ================ ===========================
 
@@ -642,7 +645,7 @@
 
    The events have the following meaning:
 
-   ``'call'`` 
+   ``'call'``
       A function is called (or some other code block entered).  The
       global trace function is called; *arg* is ``None``; the return value
       specifies the local trace function.
@@ -704,7 +707,7 @@
    prompts of :func:`input`. The interpreter's own prompts
    and (almost all of) its error messages go to ``stderr``.  ``stdout`` and
    ``stderr`` needn't be built-in file objects: any object is acceptable as long
-   as it has a :meth:`write` method that takes a string argument.  (Changing these 
+   as it has a :meth:`write` method that takes a string argument.  (Changing these
    objects doesn't affect the standard I/O streams of processes executed by
    :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in
    the :mod:`os` module.)
@@ -783,11 +786,3 @@
    first three characters of :const:`version`.  It is provided in the :mod:`sys`
    module for informational purposes; modifying this value has no effect on the
    registry keys used by Python. Availability: Windows.
-
-
-.. seealso::
-
-   Module :mod:`site`
-      This describes how to use .pth files to extend ``sys.path``.
-
-

Modified: python/branches/py3k-issue1717/Doc/library/tempfile.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/tempfile.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/tempfile.rst	Sun Jan 25 21:08:20 2009
@@ -149,11 +149,11 @@
 
    .. warning::
 
-      Use of this function may introduce a security hole in your program.
-      By the time you get around to doing anything with the file name it
-      returns, someone else may have beaten you to the punch.
-      :func:`mktemp` usage can be replaced easily with
-      :func:`NamedTemporaryFile`, passing it the  `delete=False` parameter::
+      Use of this function may introduce a security hole in your program.  By
+      the time you get around to doing anything with the file name it returns,
+      someone else may have beaten you to the punch.  :func:`mktemp` usage can
+      be replaced easily with :func:`NamedTemporaryFile`, passing it the
+      ``delete=False`` parameter::
 
          >>> f = NamedTemporaryFile(delete=False)
          >>> f

Modified: python/branches/py3k-issue1717/Doc/library/test.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/test.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/test.rst	Sun Jan 25 21:08:20 2009
@@ -353,5 +353,3 @@
    Class used to record warnings for unit tests. See documentation of
    :func:`check_warnings` above for more details.
 
-   .. versionadded:: 2.6
-

Modified: python/branches/py3k-issue1717/Doc/library/threading.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/threading.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/threading.rst	Sun Jan 25 21:08:20 2009
@@ -278,12 +278,6 @@
    raises the same exception.
 
 
-.. method:: Thread.getName()
-            Thread.setName()
-
-   Old API for :attr:`~Thread.name`.
-
-
 .. attribute:: Thread.name
 
    A string used for identification purposes only. It has no semantics.
@@ -291,6 +285,13 @@
    constructor.
 
 
+.. method:: Thread.getName()
+            Thread.setName()
+
+   Old getter/setter API for :attr:`~Thread.name`; use it directly as a property
+   instead.
+
+
 .. attribute:: Thread.ident
 
    The 'thread identifier' of this thread or ``None`` if the thread has not been
@@ -309,12 +310,6 @@
    returns a list of all alive threads.
 
 
-.. method:: Thread.isDaemon()
-            Thread.setDaemon()
-
-   Old API for :attr:`~Thread.daemon`.
-
-
 .. attribute:: Thread.daemon
 
    The thread's daemon flag. This must be set before :meth:`start` is called,
@@ -325,6 +320,13 @@
    The entire Python program exits when no alive non-daemon threads are left.
 
 
+.. method:: Thread.isDaemon()
+            Thread.setDaemon()
+
+   Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a
+   property instead.
+
+
 .. _lock-objects:
 
 Lock Objects

Modified: python/branches/py3k-issue1717/Doc/library/tk.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/tk.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/tk.rst	Sun Jan 25 21:08:20 2009
@@ -12,7 +12,7 @@
 
 Tk/Tcl has long been an integral part of Python.  It provides a robust and
 platform independent windowing toolkit, that is available to Python programmers
-using the :mod:`tkinter` package, and its extension, the :mod:`tkinter.tix` 
+using the :mod:`tkinter` package, and its extension, the :mod:`tkinter.tix`
 module.
 
 The :mod:`tkinter` package is a thin object-oriented layer on top of Tcl/Tk. To
@@ -23,15 +23,15 @@
 mechanism which allows Python and Tcl to interact.
 
 :mod:`tkinter`'s chief virtues are that it is fast, and that it usually comes
-bundled with Python. Although its standard documentation is weak, good 
-material is available, which includes: references, tutorials, a book and 
-others. :mod:`tkinter` is also famous for having an outdated look and feel, 
-which has been vastly improved in Tk 8.5. Nevertheless, there are many other 
-GUI libraries that you could be interested in. For more information about 
+bundled with Python. Although its standard documentation is weak, good
+material is available, which includes: references, tutorials, a book and
+others. :mod:`tkinter` is also famous for having an outdated look and feel,
+which has been vastly improved in Tk 8.5. Nevertheless, there are many other
+GUI libraries that you could be interested in. For more information about
 alternatives, see the :ref:`other-gui-packages` section.
 
 .. toctree::
-   
+
    tkinter.rst
    tkinter.tix.rst
    tkinter.scrolledtext.rst

Modified: python/branches/py3k-issue1717/Doc/library/tkinter.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/tkinter.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/tkinter.rst	Sun Jan 25 21:08:20 2009
@@ -41,7 +41,7 @@
 linked with the Python interpreter.
 
 In addition to the Tk interface module, :mod:`tkinter` includes a number of
-Python modules, :mod:`tkinter.constants` being one of the most important. 
+Python modules, :mod:`tkinter.constants` being one of the most important.
 Importing :mod:`tkinter` will automatically import :mod:`tkinter.constants`,
 so, usually, to use Tkinter all you need is a simple import statement::
 
@@ -96,7 +96,7 @@
    Basic dialogs and convenience functions.
 
 :mod:`tkinter.dnd`
-   Drag-and-drop support for :mod:`tkinter`. This is experimental and should 
+   Drag-and-drop support for :mod:`tkinter`. This is experimental and should
    become deprecated when it is replaced  with the Tk DND.
 
 :mod:`turtle`
@@ -156,7 +156,7 @@
   the novice.  The book is not exhaustive, and for many details it defers to the
   man pages.
 
-* :file:`tkinter/__init__.py` is a last resort for most, but can be a good 
+* :file:`tkinter/__init__.py` is a last resort for most, but can be a good
   place to go when nothing else makes sense.
 
 
@@ -271,7 +271,7 @@
 someOptions), in C++, you would express this as fred.someAction(someOptions),
 and in Tk, you say::
 
-   .fred someAction someOptions 
+   .fred someAction someOptions
 
 Note that the object name, ``.fred``, starts with a dot.
 
@@ -320,7 +320,7 @@
 arguments.  In Tkinter, the Pack class holds all this functionality, and the
 various forms of the pack command are implemented as methods.  All widgets in
 :mod:`tkinter` are subclassed from the Packer, and so inherit all the packing
-methods. See the :mod:`tkinter.tix` module documentation for additional 
+methods. See the :mod:`tkinter.tix` module documentation for additional
 information on the Form geometry manager. ::
 
    pack .fred -side left       =====>  fred.pack(side = "left")
@@ -477,7 +477,7 @@
 For more extensive information on the packer and the options that it can take,
 see the man pages and page 183 of John Ousterhout's book.
 
-anchor 
+anchor
    Anchor type.  Denotes where the packer is to place each slave in its parcel.
 
 expand
@@ -707,7 +707,7 @@
 they are denoted in Tk, which can be useful when referring to the Tk man pages.
 ::
 
-   Tk      Tkinter Event Field             Tk      Tkinter Event Field 
+   Tk      Tkinter Event Field             Tk      Tkinter Event Field
    --      -------------------             --      -------------------
    %f      focus                           %A      char
    %h      height                          %E      send_event

Modified: python/branches/py3k-issue1717/Doc/library/tkinter.tix.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/tkinter.tix.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/tkinter.tix.rst	Sun Jan 25 21:08:20 2009
@@ -8,12 +8,12 @@
 
 .. index:: single: Tix
 
-The :mod:`tkinter.tix` (Tk Interface Extension) module provides an additional 
-rich set of widgets. Although the standard Tk library has many useful widgets, 
+The :mod:`tkinter.tix` (Tk Interface Extension) module provides an additional
+rich set of widgets. Although the standard Tk library has many useful widgets,
 they are far from complete. The :mod:`tkinter.tix` library provides most of the
-commonly needed widgets that are missing from standard Tk: :class:`HList`, 
-:class:`ComboBox`, :class:`Control` (a.k.a. SpinBox) and an assortment of 
-scrollable widgets. 
+commonly needed widgets that are missing from standard Tk: :class:`HList`,
+:class:`ComboBox`, :class:`Control` (a.k.a. SpinBox) and an assortment of
+scrollable widgets.
 :mod:`tkinter.tix` also includes many more widgets that are generally useful in
 a wide range of applications: :class:`NoteBook`, :class:`FileEntry`,
 :class:`PanedWindow`, etc; there are more than 40 of them.
@@ -50,10 +50,10 @@
    Toplevel widget of Tix which represents mostly the main window of an
    application. It has an associated Tcl interpreter.
 
-   Classes in the :mod:`tkinter.tix` module subclasses the classes in the 
-   :mod:`tkinter`. The former imports the latter, so to use :mod:`tkinter.tix` 
-   with Tkinter, all you need to do is to import one module. In general, you 
-   can just import :mod:`tkinter.tix`, and replace the toplevel call to 
+   Classes in the :mod:`tkinter.tix` module subclasses the classes in the
+   :mod:`tkinter`. The former imports the latter, so to use :mod:`tkinter.tix`
+   with Tkinter, all you need to do is to import one module. In general, you
+   can just import :mod:`tkinter.tix`, and replace the toplevel call to
    :class:`tkinter.Tk` with :class:`tix.Tk`::
 
       from tkinter import tix
@@ -437,7 +437,7 @@
 The :mod:`tkinter.tix` module adds:
 
 * `pixmap <http://tix.sourceforge.net/dist/current/man/html/TixCmd/pixmap.htm>`_
-  capabilities to all :mod:`tkinter.tix` and :mod:`tkinter` widgets to create 
+  capabilities to all :mod:`tkinter.tix` and :mod:`tkinter` widgets to create
   color images from XPM files.
 
   .. Python Demo of:

Modified: python/branches/py3k-issue1717/Doc/library/tokenize.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/tokenize.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/tokenize.rst	Sun Jan 25 21:08:20 2009
@@ -19,16 +19,16 @@
    The :func:`tokenize` generator requires one argument, *readline*, which
    must be a callable object which provides the same interface as the
    :meth:`readline` method of built-in file objects (see section
-   :ref:`bltin-file-objects`).  Each call to the function should return one 
+   :ref:`bltin-file-objects`).  Each call to the function should return one
    line of input as bytes.
 
-   The generator produces 5-tuples with these members: the token type; the 
-   token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and 
-   column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of 
-   ints specifying the row and column where the token ends in the source; and 
+   The generator produces 5-tuples with these members: the token type; the
+   token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and
+   column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of
+   ints specifying the row and column where the token ends in the source; and
    the line on which the token was found. The line passed (the last tuple item)
    is the *logical* line; continuation lines are included.
-   
+
    :func:`tokenize` determines the source encoding of the file by looking for a
    UTF-8 BOM or encoding cookie, according to :pep:`263`.
 
@@ -44,35 +44,35 @@
 .. data:: NL
 
    Token value used to indicate a non-terminating newline.  The NEWLINE token
-   indicates the end of a logical line of Python code; NL tokens are generated 
+   indicates the end of a logical line of Python code; NL tokens are generated
    when a logical line of code is continued over multiple physical lines.
 
 
 .. data:: ENCODING
 
-    Token value that indicates the encoding used to decode the source bytes 
-    into text. The first token returned by :func:`tokenize` will always be an 
+    Token value that indicates the encoding used to decode the source bytes
+    into text. The first token returned by :func:`tokenize` will always be an
     ENCODING token.
 
 
-Another function is provided to reverse the tokenization process. This is 
-useful for creating tools that tokenize a script, modify the token stream, and 
+Another function is provided to reverse the tokenization process. This is
+useful for creating tools that tokenize a script, modify the token stream, and
 write back the modified script.
 
 
 .. function:: untokenize(iterable)
 
     Converts tokens back into Python source code.  The *iterable* must return
-    sequences with at least two elements, the token type and the token string. 
+    sequences with at least two elements, the token type and the token string.
     Any additional sequence elements are ignored.
-    
+
     The reconstructed script is returned as a single string.  The result is
     guaranteed to tokenize back to match the input so that the conversion is
-    lossless and round-trips are assured.  The guarantee applies only to the 
-    token type and token string as the spacing between tokens (column 
+    lossless and round-trips are assured.  The guarantee applies only to the
+    token type and token string as the spacing between tokens (column
     positions) may change.
-    
-    It returns bytes, encoded using the ENCODING token, which is the first 
+
+    It returns bytes, encoded using the ENCODING token, which is the first
     token sequence output by :func:`tokenize`.
 
 
@@ -81,43 +81,43 @@
 
 .. function:: detect_encoding(readline)
 
-    The :func:`detect_encoding` function is used to detect the encoding that 
-    should be used to decode a Python source file. It requires one argment, 
+    The :func:`detect_encoding` function is used to detect the encoding that
+    should be used to decode a Python source file. It requires one argment,
     readline, in the same way as the :func:`tokenize` generator.
-    
+
     It will call readline a maximum of twice, and return the encoding used
     (as a string) and a list of any lines (not decoded from bytes) it has read
     in.
-    
+
     It detects the encoding from the presence of a utf-8 bom or an encoding
     cookie as specified in pep-0263. If both a bom and a cookie are present,
     but disagree, a SyntaxError will be raised.
-    
-    If no encoding is specified, then the default of 'utf-8' will be returned. 
 
-    
+    If no encoding is specified, then the default of 'utf-8' will be returned.
+
+
 Example of a script re-writer that transforms float literals into Decimal
 objects::
 
     def decistmt(s):
         """Substitute Decimals for floats in a string of statements.
-    
+
         >>> from decimal import Decimal
         >>> s = 'print(+21.3e-5*-.1234/81.7)'
         >>> decistmt(s)
         "print (+Decimal ('21.3e-5')*-Decimal ('.1234')/Decimal ('81.7'))"
-    
+
         The format of the exponent is inherited from the platform C library.
         Known cases are "e-007" (Windows) and "e-07" (not Windows).  Since
         we're only showing 12 digits, and the 13th isn't close to 5, the
         rest of the output should be platform-independent.
-    
+
         >>> exec(s) #doctest: +ELLIPSIS
         -3.21716034272e-0...7
-    
+
         Output from calculations with Decimal should be identical across all
         platforms.
-    
+
         >>> exec(decistmt(s))
         -3.217160342717258261933904529E-7
         """

Modified: python/branches/py3k-issue1717/Doc/library/trace.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/trace.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/trace.rst	Sun Jan 25 21:08:20 2009
@@ -65,13 +65,13 @@
 
 :option:`--ignore-module`
    Accepts comma separated list of module names. Ignore each of the named
-   module and its submodules (if it is a package).  May be given 
+   module and its submodules (if it is a package).  May be given
    multiple times.
 
 :option:`--ignore-dir`
    Ignore all modules and packages in the named directory and subdirectories
    (multiple directories can be joined by os.pathsep).  May be given multiple
-   times. 
+   times.
 
 
 .. _trace-api:

Modified: python/branches/py3k-issue1717/Doc/library/traceback.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/traceback.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/traceback.rst	Sun Jan 25 21:08:20 2009
@@ -163,10 +163,10 @@
 
    def lumberjack():
        bright_side_of_death()
-   
+
    def bright_side_of_death():
        return tuple()[0]
-   
+
    try:
        lumberjack()
    except:
@@ -245,12 +245,12 @@
    >>> import traceback
    >>> def another_function():
    ...     lumberstack()
-   ... 
+   ...
    >>> def lumberstack():
    ...     traceback.print_stack()
    ...     print(repr(traceback.extract_stack()))
    ...     print(repr(traceback.format_stack()))
-   ... 
+   ...
    >>> another_function()
      File "<doctest>", line 10, in <module>
        another_function()

Modified: python/branches/py3k-issue1717/Doc/library/turtle.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/turtle.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/turtle.rst	Sun Jan 25 21:08:20 2009
@@ -322,8 +322,7 @@
 
    :param y: a number (integer or float)
 
-   Set the turtle's first coordinate to *y*, leave second coordinate
-   unchanged.
+   Set the turtle's second coordinate to *y*, leave first coordinate unchanged.
 
    >>> turtle.position()
    (0.00, 40.00)
@@ -1563,7 +1562,7 @@
 
    Subclass of TurtleScreen, with :ref:`four methods added <screenspecific>`.
 
-   
+
 .. class:: ScrolledCavas(master)
 
    :param master: some Tkinter widget to contain the ScrolledCanvas, i.e.
@@ -1588,13 +1587,13 @@
    "compound"  ``None`` (a compund shape has to be constructed using the
                :meth:`addcomponent` method)
    =========== ===========
-                
+
    .. method:: addcomponent(poly, fill, outline=None)
 
       :param poly: a polygon, i.e. a tuple of pairs of numbers
       :param fill: a color the *poly* will be filled with
       :param outline: a color for the poly's outline (if given)
-     
+
       Example:
 
       >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
@@ -1638,31 +1637,31 @@
 
      >>> help(Screen.bgcolor)
      Help on method bgcolor in module turtle:
-    
+
      bgcolor(self, *args) unbound turtle.Screen method
          Set or return backgroundcolor of the TurtleScreen.
-    
+
          Arguments (if given): a color string or three numbers
          in the range 0..colormode or a 3-tuple of such numbers.
-    
-    
+
+
            >>> screen.bgcolor("orange")
            >>> screen.bgcolor()
            "orange"
            >>> screen.bgcolor(0.5,0,0.5)
            >>> screen.bgcolor()
            "#800080"
-    
+
      >>> help(Turtle.penup)
      Help on method penup in module turtle:
-    
+
      penup(self) unbound turtle.Turtle method
          Pull the pen up -- no drawing when moving.
-    
+
          Aliases: penup | pu | up
-    
+
          No argument
-    
+
          >>> turtle.penup()
 
 - The docstrings of the functions which are derived from methods have a modified
@@ -1670,32 +1669,32 @@
 
      >>> help(bgcolor)
      Help on function bgcolor in module turtle:
-    
+
      bgcolor(*args)
          Set or return backgroundcolor of the TurtleScreen.
-    
+
          Arguments (if given): a color string or three numbers
          in the range 0..colormode or a 3-tuple of such numbers.
-    
+
          Example::
-    
+
            >>> bgcolor("orange")
            >>> bgcolor()
            "orange"
            >>> bgcolor(0.5,0,0.5)
            >>> bgcolor()
            "#800080"
-    
+
      >>> help(penup)
      Help on function penup in module turtle:
-    
+
      penup()
          Pull the pen up -- no drawing when moving.
-    
+
          Aliases: penup | pu | up
-    
+
          No argument
-    
+
          Example:
          >>> penup()
 
@@ -1871,19 +1870,19 @@
 Changes since Python 2.6
 ========================
 
-- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and 
-  :meth:`Turtle.window_height` have been eliminated. 
-  Methods with these names and functionality are now available only 
+- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and
+  :meth:`Turtle.window_height` have been eliminated.
+  Methods with these names and functionality are now available only
   as methods of :class:`Screen`. The functions derived from these remain
-  available. (In fact already in Python 2.6 these methods were merely 
-  duplications of the corresponding 
+  available. (In fact already in Python 2.6 these methods were merely
+  duplications of the corresponding
   :class:`TurtleScreen`/:class:`Screen`-methods.)
 
-- The method :meth:`Turtle.fill` has been eliminated. 
-  The behaviour of :meth:`begin_fill` and :meth:`end_fill` 
-  have changed slightly: now  every filling-process must be completed with an 
+- The method :meth:`Turtle.fill` has been eliminated.
+  The behaviour of :meth:`begin_fill` and :meth:`end_fill`
+  have changed slightly: now  every filling-process must be completed with an
   ``end_fill()`` call.
-  
+
 - A method :meth:`Turtle.filling` has been added. It returns a boolean
   value: ``True`` if a filling process is under way, ``False`` otherwise.
   This behaviour corresponds to a ``fill()`` call without arguments in

Modified: python/branches/py3k-issue1717/Doc/library/unicodedata.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/unicodedata.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/unicodedata.rst	Sun Jan 25 21:08:20 2009
@@ -156,7 +156,7 @@
      File "<stdin>", line 1, in ?
    ValueError: not a decimal
    >>> unicodedata.category('A')  # 'L'etter, 'u'ppercase
-   'Lu'   
+   'Lu'
    >>> unicodedata.bidirectional('\u0660') # 'A'rabic, 'N'umber
    'AN'
 

Modified: python/branches/py3k-issue1717/Doc/library/unittest.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/unittest.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/unittest.rst	Sun Jan 25 21:08:20 2009
@@ -592,7 +592,7 @@
             TestCase.failUnlessAlmostEqual(first, second[, places[, msg]])
 
    Test that *first* and *second* are approximately equal by computing the
-   difference, rounding to the given number of decimal *places* (default 7), 
+   difference, rounding to the given number of decimal *places* (default 7),
    and comparing to zero.
    Note that comparing a given number of decimal places is not the same as
    comparing a given number of significant digits. If the values do not compare
@@ -603,7 +603,7 @@
             TestCase.failIfAlmostEqual(first, second[, places[, msg]])
 
    Test that *first* and *second* are not approximately equal by computing the
-   difference, rounding to the given number of decimal *places* (default 7), 
+   difference, rounding to the given number of decimal *places* (default 7),
    and comparing to zero.
    Note that comparing a given number of decimal places is not the same as
    comparing a given number of significant digits. If the values do not compare

Modified: python/branches/py3k-issue1717/Doc/library/urllib.parse.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/urllib.parse.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/urllib.parse.rst	Sun Jan 25 21:08:20 2009
@@ -365,7 +365,7 @@
       'http://www.Python.org/doc/'
 
 
-The following classes provide the implementations of the parse results::
+The following classes provide the implementations of the parse results:
 
 .. class:: BaseResult
 

Modified: python/branches/py3k-issue1717/Doc/library/urllib.request.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/urllib.request.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/urllib.request.rst	Sun Jan 25 21:08:20 2009
@@ -49,8 +49,8 @@
    The urlopen function from the previous version, Python 2.6 and earlier,  of
    the module  urllib has been discontinued as urlopen can return the
    file-object as the previous. The proxy handling, which in earlier was passed
-   as a dict parameter to urlopen can be availed by the use of `ProxyHandler`
-   objects.
+   as a dict parameter to urlopen can be availed by the use of
+   :class:`ProxyHandler` objects.
 
 
 .. function:: install_opener(opener)

Modified: python/branches/py3k-issue1717/Doc/library/warnings.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/warnings.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/warnings.rst	Sun Jan 25 21:08:20 2009
@@ -279,15 +279,15 @@
    this function with an alternative implementation by assigning to
    ``warnings.showwarning``.
    *line* is a line of source code to be included in the warning
-   message; if *line* is not supplied, :func:`showwarning` will 
+   message; if *line* is not supplied, :func:`showwarning` will
    try to read the line specified by *filename* and *lineno*.
 
 
 .. function:: formatwarning(message, category, filename, lineno[, line])
 
    Format a warning the standard way.  This returns a string  which may contain
-   embedded newlines and ends in a newline.  *line* is 
-   a line of source code to be included in the warning message; if *line* is not supplied, 
+   embedded newlines and ends in a newline.  *line* is
+   a line of source code to be included in the warning message; if *line* is not supplied,
    :func:`formatwarning` will try to read the line specified by *filename* and *lineno*.
 
 
@@ -335,8 +335,3 @@
     module returned when you import :mod:`warnings` whose filter will be
     protected. This argument exists primarily for testing the :mod:`warnings`
     module itself.
-
-    .. versionchanged:: 3.0
-
-       Constructor arguments turned into keyword-only arguments.
-

Modified: python/branches/py3k-issue1717/Doc/library/webbrowser.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/webbrowser.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/webbrowser.rst	Sun Jan 25 21:08:20 2009
@@ -155,7 +155,7 @@
 
    url = 'http://www.python.org'
 
-   # Open URL in a new tab, if a browser window is already open. 
+   # Open URL in a new tab, if a browser window is already open.
    webbrowser.open_new_tab(url + '/doc')
 
    # Open URL in new window, raising the window if possible.

Modified: python/branches/py3k-issue1717/Doc/library/wsgiref.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/wsgiref.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/wsgiref.rst	Sun Jan 25 21:08:20 2009
@@ -122,13 +122,13 @@
       def simple_app(environ, start_response):
           setup_testing_defaults(environ)
 
-          status = '200 OK'
-          headers = [('Content-type', 'text/plain')]
+          status = b'200 OK'
+          headers = [(b'Content-type', b'text/plain; charset=utf-8')]
 
           start_response(status, headers)
 
-          ret = ["%s: %s\n" % (key, value)
-                 for key, value in environ.iteritems()]
+          ret = [("%s: %s\n" % (key, value)).encode("utf-8")
+                 for key, value in environ.items()]
           return ret
 
       httpd = make_server('', 8000, simple_app)
@@ -161,14 +161,14 @@
 
    Example usage::
 
-      from StringIO import StringIO
+      from io import StringIO
       from wsgiref.util import FileWrapper
 
       # We're using a StringIO-buffer for as the file-like object
       filelike = StringIO("This is an example file-like object"*10)
       wrapper = FileWrapper(filelike, blksize=5)
 
-      for chunk in wrapper: 
+      for chunk in wrapper:
           print(chunk)
 
 
@@ -413,16 +413,16 @@
       from wsgiref.validate import validator
       from wsgiref.simple_server import make_server
 
-      # Our callable object which is intentionally not compliant to the 
+      # Our callable object which is intentionally not compliant to the
       # standard, so the validator is going to break
       def simple_app(environ, start_response):
-          status = '200 OK' # HTTP Status
-          headers = [('Content-type', 'text/plain')] # HTTP Headers
+          status = b'200 OK' # HTTP Status
+          headers = [(b'Content-type', b'text/plain')] # HTTP Headers
           start_response(status, headers)
 
           # This is going to break because we need to return a list, and
           # the validator is going to inform us
-          return "Hello World"
+          return b"Hello World"
 
       # This is the application wrapped in a validator
       validator_app = validator(simple_app)
@@ -509,7 +509,7 @@
 
    .. method:: BaseHandler._write(data)
 
-      Buffer the string *data* for transmission to the client.  It's okay if this
+      Buffer the bytes *data* for transmission to the client.  It's okay if this
       method actually transmits the data; :class:`BaseHandler` just separates write
       and flush operations for greater efficiency when the underlying system actually
       has such a distinction.
@@ -712,12 +712,12 @@
    # is a dictionary containing CGI-style envrironment variables and the
    # second variable is the callable object (see PEP333)
    def hello_world_app(environ, start_response):
-       status = '200 OK' # HTTP Status
-       headers = [('Content-type', 'text/plain')] # HTTP Headers
+       status = b'200 OK' # HTTP Status
+       headers = [(b'Content-type', b'text/plain; charset=utf-8')] # HTTP Headers
        start_response(status, headers)
 
        # The returned object is going to be printed
-       return ["Hello World"]
+       return [b"Hello World"]
 
    httpd = make_server('', 8000, hello_world_app)
    print("Serving on port 8000...")

Modified: python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/xml.etree.elementtree.rst	Sun Jan 25 21:08:20 2009
@@ -32,7 +32,7 @@
 A C implementation of this API is available as :mod:`xml.etree.cElementTree`.
 
 See http://effbot.org/zone/element-index.htm for tutorials and links to other
-docs. Fredrik Lundh's page is also the location of the development version of the 
+docs. Fredrik Lundh's page is also the location of the development version of the
 xml.etree.ElementTree.
 
 .. _elementtree-functions:
@@ -379,7 +379,7 @@
             <title>Example page</title>
         </head>
         <body>
-            <p>Moved to <a href="http://example.org/">example.org</a> 
+            <p>Moved to <a href="http://example.org/">example.org</a>
             or <a href="http://example.com/">example.com</a>.</p>
         </body>
     </html>
@@ -486,9 +486,9 @@
 
 :meth:`XMLTreeBuilder.feed` calls *target*\'s :meth:`start` method
 for each opening tag, its :meth:`end` method for each closing tag,
-and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close` 
-calls *target*\'s method :meth:`close`. 
-:class:`XMLTreeBuilder` can be used not only for building a tree structure. 
+and data is processed by method :meth:`data`. :meth:`XMLTreeBuilder.close`
+calls *target*\'s method :meth:`close`.
+:class:`XMLTreeBuilder` can be used not only for building a tree structure.
 This is an example of counting the maximum depth of an XML file::
 
     >>> from xml.etree.ElementTree import XMLTreeBuilder
@@ -496,16 +496,16 @@
     ...     maxDepth = 0
     ...     depth = 0
     ...     def start(self, tag, attrib):   # Called for each opening tag.
-    ...         self.depth += 1 
+    ...         self.depth += 1
     ...         if self.depth > self.maxDepth:
     ...             self.maxDepth = self.depth
     ...     def end(self, tag):             # Called for each closing tag.
     ...         self.depth -= 1
-    ...     def data(self, data):   
+    ...     def data(self, data):
     ...         pass            # We do not need to do anything with data.
     ...     def close(self):    # Called when all data has been parsed.
     ...         return self.maxDepth
-    ... 
+    ...
     >>> target = MaxDepth()
     >>> parser = XMLTreeBuilder(target=target)
     >>> exampleXml = """

Modified: python/branches/py3k-issue1717/Doc/library/xmlrpc.client.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/xmlrpc.client.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/xmlrpc.client.rst	Sun Jan 25 21:08:20 2009
@@ -513,8 +513,8 @@
            self.proxy = proxy
        def make_connection(self, host):
            self.realhost = host
-   	h = http.client.HTTP(self.proxy)
-   	return h
+           h = http.client.HTTP(self.proxy)
+           return h
        def send_request(self, connection, handler, request_body):
            connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler))
        def send_host(self, connection, host):

Modified: python/branches/py3k-issue1717/Doc/library/xmlrpc.server.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/xmlrpc.server.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/xmlrpc.server.rst	Sun Jan 25 21:08:20 2009
@@ -126,7 +126,7 @@
                                requestHandler=RequestHandler)
    server.register_introspection_functions()
 
-   # Register pow() function; this will use the value of 
+   # Register pow() function; this will use the value of
    # pow.__name__ as the name, which is just 'pow'.
    server.register_function(pow)
 
@@ -135,10 +135,10 @@
        return x + y
    server.register_function(adder_function, 'add')
 
-   # Register an instance; all the methods of the instance are 
+   # Register an instance; all the methods of the instance are
    # published as XML-RPC methods (in this case, just 'div').
    class MyFuncs:
-       def div(self, x, y): 
+       def div(self, x, y):
            return x // y
 
    server.register_instance(MyFuncs())

Modified: python/branches/py3k-issue1717/Doc/library/zipfile.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/zipfile.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/zipfile.rst	Sun Jan 25 21:08:20 2009
@@ -67,8 +67,8 @@
    otherwise returns ``False``.  *filename* may be a file or file-like object too.
    This module does not currently handle ZIP files which have appended comments.
 
-   .. versionchanged:: 2.7
-   Support for file and file-like objects.
+   .. versionchanged:: 3.1
+      Support for file and file-like objects.
 
 .. data:: ZIP_STORED
 
@@ -193,7 +193,7 @@
 
 .. method:: ZipFile.extractall([path[, members[, pwd]]])
 
-   Extract all members from the archive to the current working directory.  *path* 
+   Extract all members from the archive to the current working directory.  *path*
    specifies a different directory to extract to.  *members* is optional and must
    be a subset of the list returned by :meth:`namelist`.  *pwd* is the password
    used for encrypted files.
@@ -266,9 +266,9 @@
 
    .. note::
 
-      When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter, 
-      the compression method used will be that specified in the *compress_type* 
-      member of the given :class:`ZipInfo` instance.  By default, the 
+      When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter,
+      the compression method used will be that specified in the *compress_type*
+      member of the given :class:`ZipInfo` instance.  By default, the
       :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`.
 
 The following data attributes are also available:
@@ -282,9 +282,9 @@
 
 .. attribute:: ZipFile.comment
 
-   The comment text associated with the ZIP file.  If assigning a comment to a 
-   :class:`ZipFile` instance created with mode 'a' or 'w', this should be a 
-   string no longer than 65535 bytes.  Comments longer than this will be 
+   The comment text associated with the ZIP file.  If assigning a comment to a
+   :class:`ZipFile` instance created with mode 'a' or 'w', this should be a
+   string no longer than 65535 bytes.  Comments longer than this will be
    truncated in the written archive when :meth:`ZipFile.close` is called.
 
 .. _pyzipfile-objects:
@@ -313,10 +313,10 @@
    internal use only.  The :meth:`writepy` method makes archives with file names
    like this::
 
-      string.pyc                                # Top level name 
-      test/__init__.pyc                         # Package directory 
+      string.pyc                                # Top level name
+      test/__init__.pyc                         # Package directory
       test/testall.pyc                          # Module test.testall
-      test/bogus/__init__.pyc                   # Subpackage directory 
+      test/bogus/__init__.pyc                   # Subpackage directory
       test/bogus/myfile.pyc                     # Submodule test.bogus.myfile
 
 

Modified: python/branches/py3k-issue1717/Doc/library/zipimport.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/zipimport.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/zipimport.rst	Sun Jan 25 21:08:20 2009
@@ -142,7 +142,7 @@
     --------                   -------
         8467                   1 file
    $ ./python
-   Python 2.3 (#1, Aug 1 2003, 19:54:32) 
+   Python 2.3 (#1, Aug 1 2003, 19:54:32)
    >>> import sys
    >>> sys.path.insert(0, '/tmp/example.zip')  # Add .zip file to front of path
    >>> import jwzthreading

Modified: python/branches/py3k-issue1717/Doc/library/zlib.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/zlib.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/zlib.rst	Sun Jan 25 21:08:20 2009
@@ -31,19 +31,30 @@
    Exception raised on compression and decompression errors.
 
 
-.. function:: adler32(string[, value])
+.. function:: adler32(data[, value])
 
-   Computes a Adler-32 checksum of *string*.  (An Adler-32 checksum is almost as
+   Computes a Adler-32 checksum of *data*.  (An Adler-32 checksum is almost as
    reliable as a CRC32 but can be computed much more quickly.)  If *value* is
    present, it is used as the starting value of the checksum; otherwise, a fixed
    default value is used.  This allows computing a running checksum over the
-   concatenation of several input strings.  The algorithm is not cryptographically
+   concatenation of several inputs.  The algorithm is not cryptographically
    strong, and should not be used for authentication or digital signatures.  Since
    the algorithm is designed for use as a checksum algorithm, it is not suitable
    for use as a general hash algorithm.
 
    Always returns an unsigned 32-bit integer.
 
+.. note::
+   To generate the same numeric value across all Python versions and
+   platforms use adler32(data) & 0xffffffff.  If you are only using
+   the checksum in packed binary format this is not necessary as the
+   return value will have the correct 32bit binary representation
+   regardless of sign.
+
+.. versionchanged:: 3.0
+   The return value will always be unsigned and in the range [0, 2**32-1]
+   regardless of platform.
+
 
 .. function:: compress(string[, level])
 
@@ -62,22 +73,33 @@
    ``9`` is slowest and produces the most.  The default value is ``6``.
 
 
-.. function:: crc32(string[, value])
+.. function:: crc32(data[, value])
 
    .. index::
       single: Cyclic Redundancy Check
       single: checksum; Cyclic Redundancy Check
 
-   Computes a CRC (Cyclic Redundancy Check)  checksum of *string*. If *value* is
+   Computes a CRC (Cyclic Redundancy Check)  checksum of *data*. If *value* is
    present, it is used as the starting value of the checksum; otherwise, a fixed
    default value is used.  This allows computing a running checksum over the
-   concatenation of several input strings.  The algorithm is not cryptographically
+   concatenation of several inputs.  The algorithm is not cryptographically
    strong, and should not be used for authentication or digital signatures.  Since
    the algorithm is designed for use as a checksum algorithm, it is not suitable
    for use as a general hash algorithm.
 
    Always returns an unsigned 32-bit integer.
 
+.. note::
+   To generate the same numeric value across all Python versions and
+   platforms use crc32(data) & 0xffffffff.  If you are only using
+   the checksum in packed binary format this is not necessary as the
+   return value will have the correct 32bit binary representation
+   regardless of sign.
+
+.. versionchanged:: 3.0
+   The return value will always be unsigned and in the range [0, 2**32-1]
+   regardless of platform.
+
 
 .. function:: decompress(string[, wbits[, bufsize]])
 

Modified: python/branches/py3k-issue1717/Doc/license.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/license.rst	(original)
+++ python/branches/py3k-issue1717/Doc/license.rst	Sun Jan 25 21:08:20 2009
@@ -124,7 +124,7 @@
    analyze, test, perform and/or display publicly, prepare derivative works,
    distribute, and otherwise use Python |release| alone or in any derivative
    version, provided, however, that PSF's License Agreement and PSF's notice of
-   copyright, i.e., "Copyright © 2001-2008 Python Software Foundation; All Rights
+   copyright, i.e., "Copyright © 2001-2009 Python Software Foundation; All Rights
    Reserved" are retained in Python |release| alone or in any derivative version
    prepared by Licensee.
 
@@ -386,8 +386,8 @@
 
 The source for the :mod:`fpectl` module includes the following notice::
 
-     ---------------------------------------------------------------------  
-    /                       Copyright (c) 1996.                           \ 
+     ---------------------------------------------------------------------
+    /                       Copyright (c) 1996.                           \
    |          The Regents of the University of California.                 |
    |                        All rights reserved.                           |
    |                                                                       |
@@ -419,7 +419,7 @@
    |   opinions  of authors expressed herein do not necessarily state or   |
    |   reflect those of the United States Government or  the  University   |
    |   of  California,  and shall not be used for advertising or product   |
-    \  endorsement purposes.                                              / 
+    \  endorsement purposes.                                              /
      ---------------------------------------------------------------------
 
 

Modified: python/branches/py3k-issue1717/Doc/make.bat
==============================================================================
--- python/branches/py3k-issue1717/Doc/make.bat	(original)
+++ python/branches/py3k-issue1717/Doc/make.bat	Sun Jan 25 21:08:20 2009
@@ -8,34 +8,41 @@
 if "%1" EQU "" goto help
 if "%1" EQU "html" goto build
 if "%1" EQU "htmlhelp" goto build
-if "%1" EQU "web" goto build
-if "%1" EQU "webrun" goto webrun
+if "%1" EQU "latex" goto build
+if "%1" EQU "text" goto build
+if "%1" EQU "suspicious" goto build
+if "%1" EQU "linkcheck" goto build
+if "%1" EQU "changes" goto build
 if "%1" EQU "checkout" goto checkout
 if "%1" EQU "update" goto update
 
 :help
+set this=%~n0
 echo HELP
 echo.
-echo builddoc checkout
-echo builddoc update
-echo builddoc html
-echo builddoc htmlhelp
-echo builddoc web
-echo builddoc webrun
+echo %this% checkout
+echo %this% update
+echo %this% html
+echo %this% htmlhelp
+echo %this% latex
+echo %this% text
+echo %this% suspicious
+echo %this% linkcheck
+echo %this% changes
 echo.
 goto end
 
 :checkout
 svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx
-svn co %SVNROOT%/external/docutils-0.4/docutils tools/docutils
-svn co %SVNROOT%/external/Jinja-1.1/jinja tools/jinja
-svn co %SVNROOT%/external/Pygments-0.9/pygments tools/pygments
+svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils
+svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2
+svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments
 goto end
 
 :update
 svn update tools/sphinx
 svn update tools/docutils
-svn update tools/jinja
+svn update tools/jinja2
 svn update tools/pygments
 goto end
 
@@ -43,13 +50,8 @@
 if not exist build mkdir build
 if not exist build\%1 mkdir build\%1
 if not exist build\doctrees mkdir build\doctrees
-cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%1
+cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%*
 if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp
 goto end
 
-:webrun
-set PYTHONPATH=tools
-%PYTHON% -m sphinx.web build\web
-goto end
-
 :end

Modified: python/branches/py3k-issue1717/Doc/reference/datamodel.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/reference/datamodel.rst	(original)
+++ python/branches/py3k-issue1717/Doc/reference/datamodel.rst	Sun Jan 25 21:08:20 2009
@@ -317,7 +317,7 @@
       slicing notations can be used as the target of assignment and :keyword:`del`
       (delete) statements.
 
-      There is currently a single intrinsic mutable sequence type:
+      There are currently two intrinsic mutable sequence types:
 
       Lists
          .. index:: object: list
@@ -1152,7 +1152,7 @@
    implementing :meth:`__format__`, however most classes will either
    delegate formatting to one of the built-in types, or use a similar
    formatting option syntax.
-   
+
    See :ref:`formatspec` for a description of the standard formatting syntax.
 
    The return value must be a string object.
@@ -1777,13 +1777,13 @@
             object.__ixor__(self, other)
             object.__ior__(self, other)
 
-   These methods are called to implement the augmented arithmetic operations
+   These methods are called to implement the augmented arithmetic assignments
    (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, ``>>=``,
    ``&=``, ``^=``, ``|=``).  These methods should attempt to do the operation
    in-place (modifying *self*) and return the result (which could be, but does
    not have to be, *self*).  If a specific method is not defined, the augmented
-   operation falls back to the normal methods.  For instance, to evaluate the
-   expression ``x += y``, where *x* is an instance of a class that has an
+   assignment falls back to the normal methods.  For instance, to execute the
+   statement ``x += y``, where *x* is an instance of a class that has an
    :meth:`__iadd__` method, ``x.__iadd__(y)`` is called.  If *x* is an instance
    of a class that does not define a :meth:`__iadd__` method, ``x.__add__(y)``
    and ``y.__radd__(x)`` are considered, as with the evaluation of ``x + y``.

Modified: python/branches/py3k-issue1717/Doc/reference/expressions.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/reference/expressions.rst	(original)
+++ python/branches/py3k-issue1717/Doc/reference/expressions.rst	Sun Jan 25 21:08:20 2009
@@ -552,7 +552,7 @@
 :keyword:`del` statements.  The syntax for a slicing:
 
 .. productionlist::
-   slicing: `primary` "[" `slice_list` "]" 
+   slicing: `primary` "[" `slice_list` "]"
    slice_list: `slice_item` ("," `slice_item`)* [","]
    slice_item: `expression` | `proper_slice`
    proper_slice: [`lower_bound`] ":" [`upper_bound`] [ ":" [`stride`] ]
@@ -640,7 +640,7 @@
 the call.
 
 .. note::
-   
+
    An implementation may provide builtin functions whose positional parameters do
    not have names, even if they are 'named' for the purpose of documentation, and
    which therefore cannot be supplied by keyword.  In CPython, this is the case for
@@ -1045,7 +1045,7 @@
 Comparison of objects of the differing types depends on whether either
 of the types provide explicit support for the comparison.  Most numeric types
 can be compared with one another, but comparisons of :class:`float` and
-:class:`Decimal` are not supported to avoid the inevitable confusion arising            
+:class:`Decimal` are not supported to avoid the inevitable confusion arising
 from representation issues such as ``float('1.1')`` being inexactly represented
 and therefore not exactly equal to ``Decimal('1.1')`` which is.  When
 cross-type comparison is not supported, the comparison method returns
@@ -1323,7 +1323,7 @@
    identity only, but this caused surprises because people expected to be able
    to test a dictionary for emptiness by comparing it to ``{}``.
 
-.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of 
+.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of
    descriptors, you may notice seemingly unusual behaviour in certain uses of
    the :keyword:`is` operator, like those involving comparisons between instance
    methods, or constants.  Check their documentation for more info.

Modified: python/branches/py3k-issue1717/Doc/reference/lexical_analysis.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/reference/lexical_analysis.rst	(original)
+++ python/branches/py3k-issue1717/Doc/reference/lexical_analysis.rst	Sun Jan 25 21:08:20 2009
@@ -608,7 +608,7 @@
 
    7     2147483647                        0o177    0b100110111
    3     79228162514264337593543950336     0o377    0x100000000
-         79228162514264337593543950336              0xdeadbeef						    
+         79228162514264337593543950336              0xdeadbeef
 
 
 .. _floating:
@@ -654,7 +654,7 @@
 part, add a floating point number to it, e.g., ``(3+4j)``.  Some examples of
 imaginary literals::
 
-   3.14j   10.j    10j     .001j   1e100j  3.14e-10j 
+   3.14j   10.j    10j     .001j   1e100j  3.14e-10j
 
 
 .. _operators:

Modified: python/branches/py3k-issue1717/Doc/reference/simple_stmts.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/reference/simple_stmts.rst	(original)
+++ python/branches/py3k-issue1717/Doc/reference/simple_stmts.rst	Sun Jan 25 21:08:20 2009
@@ -246,7 +246,8 @@
 operation and an assignment statement:
 
 .. productionlist::
-   augmented_assignment_stmt: `target` `augop` (`expression_list` | `yield_expression`)
+   augmented_assignment_stmt: `augtarget` `augop` (`expression_list` | `yield_expression`)
+   augtarget: `identifier` | `attributeref` | `subscription` | `slicing`
    augop: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="
         : | ">>=" | "<<=" | "&=" | "^=" | "|="
 
@@ -507,7 +508,7 @@
 .. index:: pair: exception; chaining
            __cause__ (exception attribute)
            __context__ (exception attribute)
-   
+
 The ``from`` clause is used for exception chaining: if given, the second
 *expression* must be another exception class or instance, which will then be
 attached to the raised exception as the :attr:`__cause__` attribute (which is
@@ -729,7 +730,7 @@
 searched inside the package.  A package is generally a subdirectory of a
 directory on ``sys.path`` that has a file :file:`__init__.py`.
 
-.. 
+..
    [XXX Can't be
    bothered to spell this out right now; see the URL
    http://www.python.org/doc/essays/packages.html for more details, also about how
@@ -871,12 +872,12 @@
    nonlocal_stmt: "nonlocal" `identifier` ("," `identifier`)*
 
 .. XXX add when implemented
-                : ["=" (`target_list` "=")+ `expression_list`]
-                : | "nonlocal" `identifier` `augop` `expression_list`
+                : ["=" (`target_list` "=")+ expression_list]
+                : | "nonlocal" identifier augop expression_list
 
-The :keyword:`nonlocal` statement causes the listed identifiers to refer to 
-previously bound variables in the nearest enclosing scope.  This is important 
-because the default behavior for binding is to search the local namespace 
+The :keyword:`nonlocal` statement causes the listed identifiers to refer to
+previously bound variables in the nearest enclosing scope.  This is important
+because the default behavior for binding is to search the local namespace
 first.  The statement allows encapsulated code to rebind variables outside of
 the local scope besides the global (module) scope.
 
@@ -889,7 +890,7 @@
 enclosing scope (the scope in which a new binding should be created cannot
 be determined unambiguously).
 
-Names listed in a :keyword:`nonlocal` statement must not collide with 
+Names listed in a :keyword:`nonlocal` statement must not collide with
 pre-existing bindings in the local scope.
 
 .. seealso::

Modified: python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py
==============================================================================
--- python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py	(original)
+++ python/branches/py3k-issue1717/Doc/tools/sphinxext/pyspecific.py	Sun Jan 25 21:08:20 2009
@@ -46,15 +46,9 @@
 from docutils.io import StringOutput
 from docutils.utils import new_document
 
-try:
-    from sphinx.builders import Builder
-except ImportError:
-    from sphinx.builder import Builder
-
-try:
-    from sphinx.writers.text import TextWriter
-except ImportError:
-    from sphinx.textwriter import TextWriter
+from sphinx.builders import Builder
+from sphinx.writers.text import TextWriter
+
 
 class PydocTopicsBuilder(Builder):
     name = 'pydoc-topics'
@@ -90,6 +84,9 @@
         finally:
             f.close()
 
+# Support for checking for suspicious markup
+
+import suspicious
 
 # Support for documenting Opcodes
 
@@ -114,5 +111,6 @@
 def setup(app):
     app.add_role('issue', issue_role)
     app.add_builder(PydocTopicsBuilder)
+    app.add_builder(suspicious.CheckSuspiciousMarkupBuilder)
     app.add_description_unit('opcode', 'opcode', '%s (opcode)',
                              parse_opcode_signature)

Modified: python/branches/py3k-issue1717/Doc/tutorial/classes.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/classes.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/classes.rst	Sun Jan 25 21:08:20 2009
@@ -14,7 +14,7 @@
 class or classes, and a method can call the method of a base class with the same
 name.  Objects can contain an arbitrary amount of private data.
 
-In C++ terminology, normally class members (including the data members) are 
+In C++ terminology, normally class members (including the data members) are
 *public* (except see below :ref:`tut-private`),
 and all member functions are *virtual*.  There are no special constructors or
 destructors.  As in Modula-3, there are no shorthands for referencing the
@@ -171,7 +171,7 @@
        def do_global():
            global spam
            spam = "global spam"
-   
+
        spam = "test spam"
        do_local()
        print("After local assignment:", spam)
@@ -302,7 +302,7 @@
    ...     def __init__(self, realpart, imagpart):
    ...         self.r = realpart
    ...         self.i = imagpart
-   ... 
+   ...
    >>> x = Complex(3.0, -4.5)
    >>> x.r, x.i
    (3.0, -4.5)
@@ -532,7 +532,7 @@
   is ``True`` since :class:`bool` is a subclass of :class:`int`.  However,
   ``issubclass(float, int)`` is ``False`` since :class:`float` is not a
   subclass of :class:`int`.
-  
+
 
 
 .. _tut-multiple:
@@ -789,7 +789,7 @@
    f
    l
    o
-   g	
+   g
 
 Anything that can be done with generators can also be done with class based
 iterators as described in the previous section.  What makes generators so

Modified: python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/controlflow.rst	Sun Jan 25 21:08:20 2009
@@ -61,7 +61,7 @@
    ... a = ['cat', 'window', 'defenestrate']
    >>> for x in a:
    ...     print(x, len(x))
-   ... 
+   ...
    cat 3
    window 6
    defenestrate 12
@@ -74,7 +74,7 @@
 
    >>> for x in a[:]: # make a slice copy of the entire list
    ...    if len(x) > 6: a.insert(0, x)
-   ... 
+   ...
    >>> a
    ['defenestrate', 'cat', 'window', 'defenestrate']
 
@@ -96,7 +96,7 @@
     2
     3
     4
-    
+
 
 
 The given end point is never part of the generated list; ``range(10)`` generates
@@ -104,13 +104,13 @@
 is possible to let the range start at another number, or to specify a different
 increment (even negative; sometimes this is called the 'step')::
 
-    range(5, 10)          
+    range(5, 10)
        5 through 9
 
-    range(0, 10, 3)       
+    range(0, 10, 3)
        0, 3, 6, 9
 
-    range(-10, -100, -30) 
+    range(-10, -100, -30)
       -10, -40, -70
 
 To iterate over the indices of a sequence, you can combine :func:`range` and
@@ -119,7 +119,7 @@
    >>> a = ['Mary', 'had', 'a', 'little', 'lamb']
    >>> for i in range(len(a)):
    ...     print(i, a[i])
-   ... 
+   ...
    0 Mary
    1 had
    2 a
@@ -135,12 +135,12 @@
    range(0, 10)
 
 In many ways the object returned by :func:`range` behaves as if it is a list,
-but in fact it isn't. It is an object which returns the successive items of 
-the desired sequence when you iterate over it, but it doesn't really make 
-the list, thus saving space. 
+but in fact it isn't. It is an object which returns the successive items of
+the desired sequence when you iterate over it, but it doesn't really make
+the list, thus saving space.
 
-We say such an object is *iterable*, that is, suitable as a target for 
-functions and constructs that expect something from which they can 
+We say such an object is *iterable*, that is, suitable as a target for
+functions and constructs that expect something from which they can
 obtain successive items until the supply is exhausted. We have seen that
 the :keyword:`for` statement is such an *iterator*. The function :func:`list`
 is another; it creates lists from iterables::
@@ -177,7 +177,7 @@
    ...     else:
    ...         # loop fell through without finding a factor
    ...         print(n, 'is a prime number')
-   ... 
+   ...
    2 is a prime number
    3 is a prime number
    4 equals 2 * 2
@@ -198,7 +198,7 @@
 
    >>> while True:
    ...     pass  # Busy-wait for keyboard interrupt (Ctrl+C)
-   ... 
+   ...
 
 This is commonly used for creating minimal classes::
 
@@ -212,7 +212,7 @@
 
    >>> def initlog(*args):
    ...     pass   # Remember to implement this!
-   ... 
+   ...
 
 .. _tut-functions:
 
@@ -229,7 +229,7 @@
    ...         print(b, end=' ')
    ...         a, b = b, a+b
    ...     print()
-   ... 
+   ...
    >>> # Now call the function we just defined:
    ... fib(2000)
    1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597
@@ -300,7 +300,7 @@
    ...         result.append(b)    # see below
    ...         a, b = b, a+b
    ...     return result
-   ... 
+   ...
    >>> f100 = fib2(100)    # call it
    >>> f100                # write the result
    [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
@@ -436,7 +436,7 @@
 
    >>> def function(a):
    ...     pass
-   ... 
+   ...
    >>> function(0, a=0)
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
@@ -487,7 +487,7 @@
 ------------------------
 
 .. index::
-  statement: *  
+  statement: *
 
 Finally, the least frequently used option is to specify that a function can be
 called with an arbitrary number of arguments.  These arguments will be wrapped
@@ -497,13 +497,13 @@
    def write_multiple_items(file, separator, *args):
        file.write(separator.join(args))
 
- 
+
 Normally, these ``variadic`` arguments will be last in the list of formal
-parameters, because they scoop up all remaining input arguments that are 
+parameters, because they scoop up all remaining input arguments that are
 passed to the function. Any formal parameters which occur after the ``*args``
-parameter are 'keyword-only' arguments, meaning that they can only be used as 
+parameter are 'keyword-only' arguments, meaning that they can only be used as
 keywords rather than positional arguments. ::
- 
+
    >>> def concat(*args, sep="/"):
    ...    return sep.join(args)
    ...
@@ -581,7 +581,7 @@
    single: strings, documentation
 
 Here are some conventions about the content and formatting of documentation
-strings. 
+strings.
 
 The first line should always be a short, concise summary of the object's
 purpose.  For brevity, it should not explicitly state the object's name or type,
@@ -610,11 +610,11 @@
 
    >>> def my_function():
    ...     """Do nothing, but document it.
-   ... 
+   ...
    ...     No, really, it doesn't do anything.
    ...     """
    ...     pass
-   ... 
+   ...
    >>> print(my_function.__doc__)
    Do nothing, but document it.
 

Modified: python/branches/py3k-issue1717/Doc/tutorial/datastructures.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/datastructures.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/datastructures.rst	Sun Jan 25 21:08:20 2009
@@ -159,7 +159,7 @@
 
 List comprehensions provide a concise way to create lists from sequences.
 Common applications are to make lists where each element is the result of
-some operations applied to each member of the sequence, or to create a 
+some operations applied to each member of the sequence, or to create a
 subsequence of those elements that satisfy a certain condition.
 
 
@@ -167,7 +167,7 @@
 clause, then zero or more :keyword:`for` or :keyword:`if` clauses.  The result
 will be a list resulting from evaluating the expression in the context of the
 :keyword:`for` and :keyword:`if` clauses which follow it.  If the expression
-would evaluate to a tuple, it must be parenthesized. 
+would evaluate to a tuple, it must be parenthesized.
 
 Here we take a list of numbers and return a list of three times each number::
 
@@ -195,7 +195,7 @@
 
 Tuples can often be created without their parentheses, but not here::
 
-   >>> [x, x**2 for x in vec]	# error - parens required for tuples
+   >>> [x, x**2 for x in vec]  # error - parens required for tuples
      File "<stdin>", line 1, in ?
        [x, x**2 for x in vec]
                   ^
@@ -227,7 +227,7 @@
 powerful tool but -- like all powerful tools -- they need to be used carefully,
 if at all.
 
-Consider the following example of a 3x3 matrix held as a list containing three 
+Consider the following example of a 3x3 matrix held as a list containing three
 lists, one list per row::
 
     >>> mat = [
@@ -236,7 +236,7 @@
     ...        [7, 8, 9],
     ...       ]
 
-Now, if you wanted to swap rows and columns, you could use a list 
+Now, if you wanted to swap rows and columns, you could use a list
 comprehension::
 
     >>> print([[row[i] for row in mat] for i in [0, 1, 2]])
@@ -254,7 +254,7 @@
             print(row[i], end="")
         print()
 
-In real world, you should prefer builtin functions to complex flow statements. 
+In real world, you should prefer builtin functions to complex flow statements.
 The :func:`zip` function would do a great job for this use case::
 
     >>> list(zip(*mat))
@@ -519,7 +519,7 @@
    >>> answers = ['lancelot', 'the holy grail', 'blue']
    >>> for q, a in zip(questions, answers):
    ...     print('What is your {0}?  It is {1}.'.format(q, a))
-   ...	
+   ...
    What is your name?  It is lancelot.
    What is your quest?  It is the holy grail.
    What is your favorite color?  It is blue.
@@ -542,7 +542,7 @@
    >>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']
    >>> for f in sorted(set(basket)):
    ...     print(f)
-   ... 	
+   ...
    apple
    banana
    orange

Modified: python/branches/py3k-issue1717/Doc/tutorial/errors.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/errors.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/errors.rst	Sun Jan 25 21:08:20 2009
@@ -91,7 +91,7 @@
    ...         break
    ...     except ValueError:
    ...         print("Oops!  That was no valid number.  Try again...")
-   ...     
+   ...
 
 The :keyword:`try` statement works as follows.
 
@@ -195,12 +195,12 @@
 
    >>> def this_fails():
    ...     x = 1/0
-   ... 
+   ...
    >>> try:
    ...     this_fails()
    ... except ZeroDivisionError as err:
    ...     print('Handling run-time error:', err)
-   ... 
+   ...
    Handling run-time error: int division or modulo by zero
 
 
@@ -251,12 +251,12 @@
    ...         self.value = value
    ...     def __str__(self):
    ...         return repr(self.value)
-   ... 
+   ...
    >>> try:
    ...     raise MyError(2*2)
    ... except MyError as e:
    ...     print('My exception occurred, value:', e.value)
-   ... 
+   ...
    My exception occurred, value: 4
    >>> raise MyError('oops!')
    Traceback (most recent call last):
@@ -326,7 +326,7 @@
    ...     raise KeyboardInterrupt
    ... finally:
    ...     print('Goodbye, world!')
-   ... 
+   ...
    Goodbye, world!
    Traceback (most recent call last):
      File "<stdin>", line 2, in ?
@@ -389,9 +389,9 @@
        print(line)
 
 The problem with this code is that it leaves the file open for an indeterminate
-amount of time after this part of the code has finished executing. 
-This is not an issue in simple scripts, but can be a problem for larger 
-applications. The :keyword:`with` statement allows objects like files to be 
+amount of time after this part of the code has finished executing.
+This is not an issue in simple scripts, but can be a problem for larger
+applications. The :keyword:`with` statement allows objects like files to be
 used in a way that ensures they are always cleaned up promptly and correctly. ::
 
    with open("myfile.txt") as f:

Modified: python/branches/py3k-issue1717/Doc/tutorial/index.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/index.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/index.rst	Sun Jan 25 21:08:20 2009
@@ -1,7 +1,7 @@
 .. _tutorial-index:
 
 ######################
-  The Python Tutorial 
+  The Python Tutorial
 ######################
 
 :Release: |version|

Modified: python/branches/py3k-issue1717/Doc/tutorial/inputoutput.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/inputoutput.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/inputoutput.rst	Sun Jan 25 21:08:20 2009
@@ -90,7 +90,7 @@
 
    >>> for x in range(1, 11):
    ...     print('{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x))
-   ... 
+   ...
     1   1    1
     2   4    8
     3   9   27
@@ -151,7 +151,7 @@
                                                           other='Georg'))
    The story of Bill, Manfred, and Georg.
 
-An optional ``':``` and format specifier can follow the field name. This also
+An optional ``':'`` and format specifier can follow the field name. This also
 greater control over how the value is formatted.  The following example
 truncates the Pi to three places after the decimal.
 
@@ -165,7 +165,7 @@
    >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678}
    >>> for name, phone in table.items():
    ...     print('{0:10} ==> {1:10d}'.format(name, phone))
-   ... 
+   ...
    Jack       ==>       4098
    Dcab       ==>       7678
    Sjoerd     ==>       4127
@@ -343,7 +343,7 @@
    16
    >>> f.seek(5)     # Go to the 6th byte in the file
    5
-   >>> f.read(1)        
+   >>> f.read(1)
    b'5'
    >>> f.seek(-3, 2) # Go to the 3rd byte before the end
    13
@@ -353,7 +353,7 @@
 In text files (those opened without a ``b`` in the mode string), only seeks
 relative to the beginning of the file are allowed (the exception being seeking
 to the very file end with ``seek(0, 2)``).
-   
+
 When you're done with a file, call ``f.close()`` to close it and free up any
 system resources taken up by the open file.  After calling ``f.close()``,
 attempts to use the file object will automatically fail. ::

Modified: python/branches/py3k-issue1717/Doc/tutorial/interpreter.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/interpreter.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/interpreter.rst	Sun Jan 25 21:08:20 2009
@@ -115,7 +115,7 @@
    >>> the_world_is_flat = 1
    >>> if the_world_is_flat:
    ...     print("Be careful not to fall off!")
-   ... 
+   ...
    Be careful not to fall off!
 
 
@@ -191,7 +191,7 @@
 to do this, put one more special comment line right after the ``#!`` line to
 define the source file encoding::
 
-   # -*- coding: encoding -*- 
+   # -*- coding: encoding -*-
 
 With that declaration, everything in the source file will be treated as having
 the encoding *encoding* instead of UTF-8.  The list of possible encodings can be

Modified: python/branches/py3k-issue1717/Doc/tutorial/introduction.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/introduction.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/introduction.rst	Sun Jan 25 21:08:20 2009
@@ -58,7 +58,7 @@
    >>> 8/5 # Fractions aren't lost when dividing integers
    1.6000000000000001
 
-Note: You might not see exactly the same result; floating point results can 
+Note: You might not see exactly the same result; floating point results can
 differ from one machine to another.  We will say more later about controlling
 the appearance of floating point output; what we see here is the most
 informative display but not as easy to read as we would get with::
@@ -71,9 +71,9 @@
 why these two ways of displaying floating point data come to be different.
 See :ref:`tut-fp-issues` for a full discussion.
 
-To do integer division and get an integer result, 
+To do integer division and get an integer result,
 discarding any fractional result, there is another operator, ``//``::
-   
+
    >>> # Integer division returns the floor:
    ... 7//3
    2
@@ -103,7 +103,7 @@
 
    >>> # try to access an undefined variable
    ... n
-   Traceback (most recent call last):   
+   Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'n' is not defined
 
@@ -245,14 +245,14 @@
 they will be included in the string. ::
 
    print("""
-   Usage: thingy [OPTIONS] 
+   Usage: thingy [OPTIONS]
         -h                        Display this usage message
         -H hostname               Hostname to connect to
    """)
 
 produces the following output::
 
-   Usage: thingy [OPTIONS] 
+   Usage: thingy [OPTIONS]
         -h                        Display this usage message
         -H hostname               Hostname to connect to
 
@@ -371,10 +371,10 @@
 Then the right edge of the last character of a string of *n* characters has
 index *n*, for example::
 
-    +---+---+---+---+---+ 
+    +---+---+---+---+---+
     | H | e | l | p | A |
-    +---+---+---+---+---+ 
-    0   1   2   3   4   5 
+    +---+---+---+---+---+
+    0   1   2   3   4   5
    -5  -4  -3  -2  -1
 
 The first row of numbers gives the position of the indices 0...5 in the string;
@@ -396,7 +396,7 @@
 .. seealso::
 
    :ref:`typesseq`
-      Strings are examples of *sequence types*, and support the common 
+      Strings are examples of *sequence types*, and support the common
       operations supported by such types.
 
    :ref:`string-methods`
@@ -565,7 +565,7 @@
    >>> while b < 10:
    ...     print(b)
    ...     a, b = b, a+b
-   ... 
+   ...
    1
    1
    2
@@ -601,8 +601,8 @@
 
 * The :func:`print` function writes the value of the expression(s) it is
   given.  It differs from just writing the expression you want to write (as we did
-  earlier in the calculator examples) in the way it handles multiple 
-  expressions, floating point quantities, 
+  earlier in the calculator examples) in the way it handles multiple
+  expressions, floating point quantities,
   and strings.  Strings are printed without quotes, and a space is inserted
   between items, so you can format things nicely, like this::
 
@@ -617,5 +617,5 @@
      >>> while b < 1000:
      ...     print(b, end=' ')
      ...     a, b = b, a+b
-     ... 
+     ...
      1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987

Modified: python/branches/py3k-issue1717/Doc/tutorial/modules.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/modules.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/modules.rst	Sun Jan 25 21:08:20 2009
@@ -103,8 +103,8 @@
    1 1 2 3 5 8 13 21 34 55 89 144 233 377
 
 This imports all names except those beginning with an underscore (``_``).
-In most cases Python programmers do not use this facility since it introduces 
-an unknown set of names into the interpreter, possibly hiding some things 
+In most cases Python programmers do not use this facility since it introduces
+an unknown set of names into the interpreter, possibly hiding some things
 you have already defined.
 
 .. note::
@@ -287,7 +287,7 @@
    ['__name__', 'fib', 'fib2']
    >>> dir(sys)
    ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__',
-    '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', 
+    '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv',
     'builtin_module_names', 'byteorder', 'callstats', 'copyright',
     'displayhook', 'exc_info', 'excepthook',
     'exec_prefix', 'executable', 'exit', 'getdefaultencoding', 'getdlopenflags',
@@ -327,10 +327,10 @@
    bError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'Unicod
    eEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserW
    arning', 'ValueError', 'Warning', 'ZeroDivisionError', '__build_class__', '__deb
-   ug__', '__doc__', '__import__', '__name__', '__package__', 'abs', 'all', 'any', 
+   ug__', '__doc__', '__import__', '__name__', '__package__', 'abs', 'all', 'any',
    'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'chr', 'classmethod', 'compile', '
    complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate
-   ', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 
+   ', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr',
    'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance',
     'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memory
    view', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property'

Modified: python/branches/py3k-issue1717/Doc/tutorial/stdlib.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/stdlib.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/stdlib.rst	Sun Jan 25 21:08:20 2009
@@ -136,7 +136,7 @@
    >>> random.random()    # random float
    0.17970987693706186
    >>> random.randrange(6)    # random integer chosen from range(6)
-   4   
+   4
 
 The SciPy project <http://scipy.org> has many other modules for numerical
 computations.

Modified: python/branches/py3k-issue1717/Doc/tutorial/stdlib2.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/stdlib2.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/stdlib2.rst	Sun Jan 25 21:08:20 2009
@@ -62,7 +62,7 @@
    >>> locale.format("%d", x, grouping=True)
    '1,234,567'
    >>> locale.format("%s%.*f", (conv['currency_symbol'],
-   ...	      conv['frac_digits'], x), grouping=True)
+   ...               conv['frac_digits'], x), grouping=True)
    '$1,234,567.80'
 
 
@@ -174,7 +174,7 @@
 
    class AsyncZip(threading.Thread):
        def __init__(self, infile, outfile):
-           threading.Thread.__init__(self)        
+           threading.Thread.__init__(self)
            self.infile = infile
            self.outfile = outfile
        def run(self):
@@ -358,11 +358,11 @@
 results in decimal floating point and binary floating point. The difference
 becomes significant if the results are rounded to the nearest cent::
 
-   >>> from decimal import *       
+   >>> from decimal import *
    >>> Decimal('0.70') * Decimal('1.05')
    Decimal("0.7350")
    >>> .70 * 1.05
-   0.73499999999999999       
+   0.73499999999999999
 
 The :class:`Decimal` result keeps a trailing zero, automatically inferring four
 place significance from multiplicands with two place significance.  Decimal
@@ -380,7 +380,7 @@
    >>> sum([Decimal('0.1')]*10) == Decimal('1.0')
    True
    >>> sum([0.1]*10) == 1.0
-   False      
+   False
 
 The :mod:`decimal` module provides arithmetic with as much precision as needed::
 

Modified: python/branches/py3k-issue1717/Doc/tutorial/whatnow.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/tutorial/whatnow.rst	(original)
+++ python/branches/py3k-issue1717/Doc/tutorial/whatnow.rst	Sun Jan 25 21:08:20 2009
@@ -49,8 +49,8 @@
   Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.)
 
 * http://scipy.org: The Scientific Python project includes modules for fast
-  array computations and manipulations plus a host of packages for such 
-  things as linear algebra, Fourier transforms, non-linear solvers, 
+  array computations and manipulations plus a host of packages for such
+  things as linear algebra, Fourier transforms, non-linear solvers,
   random number distributions, statistical analysis and the like.
 
 For Python-related questions and problem reports, you can post to the newsgroup
@@ -68,6 +68,6 @@
 
 .. Postings figure based on average of last six months activity as
    reported by www.egroups.com; Jan. 2000 - June 2000: 21272 msgs / 182
-   days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?) 
+   days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?)
 
 

Modified: python/branches/py3k-issue1717/Doc/using/cmdline.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/using/cmdline.rst	(original)
+++ python/branches/py3k-issue1717/Doc/using/cmdline.rst	Sun Jan 25 21:08:20 2009
@@ -8,8 +8,8 @@
 The CPython interpreter scans the command line and the environment for various
 settings.
 
-.. note:: 
-   
+.. note::
+
    Other implementations' command line schemes may differ.  See
    :ref:`implementations` for further resources.
 
@@ -61,7 +61,7 @@
    Execute the Python code in *command*.  *command* can be one ore more
    statements separated by newlines, with significant leading whitespace as in
    normal module code.
-   
+
    If this option is given, the first element of :data:`sys.argv` will be
    ``"-c"`` and the current directory will be added to the start of
    :data:`sys.path` (allowing modules in that directory to be imported as top
@@ -72,7 +72,7 @@
 
    Search :data:`sys.path` for the named module and execute its contents as
    the :mod:`__main__` module.
-   
+
    Since the argument is a *module* name, you must not give a file extension
    (``.py``).  The ``module-name`` should be a valid Python module name, but
    the implementation may not always enforce this (e.g. it may allow you to
@@ -84,18 +84,18 @@
       written in C, since they do not have Python module files. However, it
       can still be used for precompiled modules, even if the original source
       file is not available.
-   
+
    If this option is given, the first element of :data:`sys.argv` will be the
    full path to the module file. As with the :option:`-c` option, the current
    directory will be added to the start of :data:`sys.path`.
-   
+
    Many standard library modules contain code that is invoked on their execution
    as a script.  An example is the :mod:`timeit` module::
 
        python -mtimeit -s 'setup here' 'benchmarked code here'
        python -mtimeit -h # for details
 
-   .. seealso:: 
+   .. seealso::
       :func:`runpy.run_module`
          The actual implementation of this feature.
 
@@ -152,7 +152,7 @@
                --version
 
    Print the Python version number and exit.  Example output could be::
-    
+
        Python 3.0
 
 
@@ -189,7 +189,7 @@
    enter interactive mode after executing the script or the command, even when
    :data:`sys.stdin` does not appear to be a terminal.  The
    :envvar:`PYTHONSTARTUP` file is not read.
-   
+
    This can be useful to inspect global variables or a stack trace when a script
    raises an exception.  See also :envvar:`PYTHONINSPECT`.
 
@@ -222,10 +222,10 @@
 
 
 .. cmdoption:: -u
-   
+
    Force stdin, stdout and stderr to be totally unbuffered.  On systems where it
    matters, also put stdin, stdout and stderr in binary mode.
-   
+
    Note that there is internal buffering in :meth:`file.readlines` and
    :ref:`bltin-file-objects` (``for line in sys.stdin``) which is not influenced
    by this option.  To work around this, you will want to use
@@ -237,7 +237,7 @@
 .. XXX should the -U option be documented?
 
 .. cmdoption:: -v
-   
+
    Print a message each time a module is initialized, showing the place
    (filename or built-in module) from which it is loaded.  When given twice
    (:option:`-vv`), print a message for each file that is checked for when
@@ -246,13 +246,13 @@
 
 
 .. cmdoption:: -W arg
-   
+
    Warning control.  Python's warning machinery by default prints warning
    messages to :data:`sys.stderr`.  A typical warning message has the following
    form::
 
        file:line: category: message
-       
+
    By default, each warning is printed once for each source line where it
    occurs.  This option controls how often warnings are printed.
 
@@ -260,13 +260,13 @@
    one option, the action for the last matching option is performed.  Invalid
    :option:`-W` options are ignored (though, a warning message is printed about
    invalid options when the first warning is issued).
-   
+
    Warnings can also be controlled from within a Python program using the
    :mod:`warnings` module.
 
    The simplest form of argument is one of the following action strings (or a
    unique abbreviation):
-    
+
    ``ignore``
       Ignore all warnings.
    ``default``
@@ -282,9 +282,9 @@
       Print each warning only the first time it occurs in the program.
    ``error``
       Raise an exception instead of printing a warning message.
-      
-   The full form of argument is:: 
-   
+
+   The full form of argument is::
+
        action:message:category:module:line
 
    Here, *action* is as explained above but only applies to messages that match
@@ -305,10 +305,10 @@
 
 
 .. cmdoption:: -x
-   
+
    Skip the first line of the source, allowing use of non-Unix forms of
    ``#!cmd``.  This is intended for a DOS specific hack only.
-   
+
    .. warning:: The line numbers in error messages will be off by one!
 
 .. _using-on-envvars:
@@ -319,13 +319,13 @@
 These environment variables influence Python's behavior.
 
 .. envvar:: PYTHONHOME
-   
+
    Change the location of the standard Python libraries.  By default, the
    libraries are searched in :file:`{prefix}/lib/python{version}` and
    :file:`{exec_prefix}/lib/python{version}`, where :file:`{prefix}` and
    :file:`{exec_prefix}` are installation-dependent directories, both defaulting
    to :file:`/usr/local`.
-   
+
    When :envvar:`PYTHONHOME` is set to a single directory, its value replaces
    both :file:`{prefix}` and :file:`{exec_prefix}`.  To specify different values
    for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`.
@@ -341,11 +341,11 @@
    In addition to normal directories, individual :envvar:`PYTHONPATH` entries
    may refer to zipfiles containing pure Python modules (in either source or
    compiled form). Extension modules cannot be imported from zipfiles.
-   
+
    The default search path is installation dependent, but generally begins with
-   :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above).  It
+   :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above).  It
    is *always* appended to :envvar:`PYTHONPATH`.
-   
+
    An additional directory will be inserted in the search path in front of
    :envvar:`PYTHONPATH` as described above under
    :ref:`using-on-interface-options`. The search path can be manipulated from
@@ -353,7 +353,7 @@
 
 
 .. envvar:: PYTHONSTARTUP
-   
+
    If this is the name of a readable file, the Python commands in that file are
    executed before the first prompt is displayed in interactive mode.  The file
    is executed in the same namespace where interactive commands are executed so
@@ -363,7 +363,7 @@
 
 
 .. envvar:: PYTHONY2K
-   
+
    Set this to a non-empty string to cause the :mod:`time` module to require
    dates specified as strings to include 4-digit years, otherwise 2-digit years
    are converted based on rules described in the :mod:`time` module
@@ -371,21 +371,21 @@
 
 
 .. envvar:: PYTHONOPTIMIZE
-   
+
    If this is set to a non-empty string it is equivalent to specifying the
    :option:`-O` option.  If set to an integer, it is equivalent to specifying
    :option:`-O` multiple times.
 
 
 .. envvar:: PYTHONDEBUG
-   
+
    If this is set to a non-empty string it is equivalent to specifying the
    :option:`-d` option.  If set to an integer, it is equivalent to specifying
    :option:`-d` multiple times.
 
 
 .. envvar:: PYTHONINSPECT
-   
+
    If this is set to a non-empty string it is equivalent to specifying the
    :option:`-i` option.
 
@@ -394,20 +394,20 @@
 
 
 .. envvar:: PYTHONUNBUFFERED
-   
+
    If this is set to a non-empty string it is equivalent to specifying the
    :option:`-u` option.
 
 
 .. envvar:: PYTHONVERBOSE
-   
+
    If this is set to a non-empty string it is equivalent to specifying the
    :option:`-v` option.  If set to an integer, it is equivalent to specifying
    :option:`-v` multiple times.
 
 
 .. envvar:: PYTHONCASEOK
-   
+
    If this is set, Python ignores case in :keyword:`import` statements.  This
    only works on Windows.
 

Modified: python/branches/py3k-issue1717/Doc/using/unix.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/using/unix.rst	(original)
+++ python/branches/py3k-issue1717/Doc/using/unix.rst	Sun Jan 25 21:08:20 2009
@@ -19,7 +19,7 @@
 package on all others.  However there are certain features you might want to use
 that are not available on your distro's package.  You can easily compile the
 latest version of Python from source.
-	
+
 In the event that Python doesn't come preinstalled and isn't in the repositories as
 well, you can easily make packages for your own distro.  Have a look at the
 following links:
@@ -45,8 +45,8 @@
 
 * OpenBSD users use::
 
-     pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/<insert your architecture here>/python-<version>.tgz 
-	
+     pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/<insert your architecture here>/python-<version>.tgz
+
   For example i386 users get the 2.5.1 version of Python using::
 
      pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz
@@ -87,7 +87,7 @@
 
 Python-related paths and files
 ==============================
- 
+
 These are subject to difference depending on local installation conventions;
 :envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``${exec_prefix}``)
 are installation-dependent and should be interpreted as for GNU software; they
@@ -112,7 +112,7 @@
 |                                               | by the user module; not used by default  |
 |                                               | or by most applications.                 |
 +-----------------------------------------------+------------------------------------------+
- 
+
 
 Miscellaneous
 =============

Modified: python/branches/py3k-issue1717/Doc/using/windows.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/using/windows.rst	(original)
+++ python/branches/py3k-issue1717/Doc/using/windows.rst	Sun Jan 25 21:08:20 2009
@@ -86,9 +86,9 @@
 ---------------------------------------
 
 Windows has a built-in dialog for changing environment variables (following
-guide applies to XP classical view): Right-click the icon for your machine 
-(usually located on your Desktop and called "My Computer") and choose 
-:menuselection:`Properties` there.  Then, open the :guilabel:`Advanced` tab 
+guide applies to XP classical view): Right-click the icon for your machine
+(usually located on your Desktop and called "My Computer") and choose
+:menuselection:`Properties` there.  Then, open the :guilabel:`Advanced` tab
 and click the :guilabel:`Environment Variables` button.
 
 In short, your path is:
@@ -191,11 +191,11 @@
 
 #. Launch a command prompt.
 #. Associate the correct file group with ``.py`` scripts::
-   
+
       assoc .py=Python.File
 
 #. Redirect all Python files to the new executable::
-   
+
       ftype Python.File=C:\Path\to\pythonw.exe "%1" %*
 
 

Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.0.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/2.0.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/2.0.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ****************************
-  What's New in Python 2.0  
+  What's New in Python 2.0
 ****************************
 
 :Author: A.M. Kuchling and Moshe Zadka
@@ -277,11 +277,11 @@
 finding all the strings in the list containing a given substring.  You could
 write the following to do it::
 
-   # Given the list L, make a list of all strings 
+   # Given the list L, make a list of all strings
    # containing the substring S.
-   sublist = filter( lambda s, substring=S: 
+   sublist = filter( lambda s, substring=S:
                         string.find(s, substring) != -1,
-   	          L)
+                     L)
 
 Because of Python's scoping rules, a default argument is used so that the
 anonymous function created by the :keyword:`lambda` statement knows what
@@ -291,9 +291,9 @@
 
 List comprehensions have the form::
 
-   [ expression for expr in sequence1 
+   [ expression for expr in sequence1
                 for expr2 in sequence2 ...
-   	     for exprN in sequenceN
+                for exprN in sequenceN
                 if condition ]
 
 The :keyword:`for`...\ :keyword:`in` clauses contain the sequences to be
@@ -312,8 +312,8 @@
        ...
            for exprN in sequenceN:
                 if (condition):
-                     # Append the value of 
-                     # the expression to the 
+                     # Append the value of
+                     # the expression to the
                      # resulting list.
 
 This means that when there are multiple :keyword:`for`...\ :keyword:`in`
@@ -368,7 +368,7 @@
        def __init__(self, value):
            self.value = value
        def __iadd__(self, increment):
-   	return Number( self.value + increment)
+           return Number( self.value + increment)
 
    n = Number(5)
    n += 3
@@ -590,7 +590,7 @@
 
    def f():
        print "i=",i
-       i = i + 1 
+       i = i + 1
    f()
 
 Two new exceptions, :exc:`TabError` and :exc:`IndentationError`, have been
@@ -627,7 +627,7 @@
 the following lines of code::
 
    if dict.has_key( key ): return dict[key]
-   else: 
+   else:
        dict[key] = []
        return dict[key]
 
@@ -836,14 +836,14 @@
 :file:`setup.py` can be just a few lines long::
 
    from distutils.core import setup
-   setup (name = "foo", version = "1.0", 
+   setup (name = "foo", version = "1.0",
           py_modules = ["module1", "module2"])
 
 The :file:`setup.py` file isn't much more complicated if the software consists
 of a few packages::
 
    from distutils.core import setup
-   setup (name = "foo", version = "1.0", 
+   setup (name = "foo", version = "1.0",
           packages = ["package", "package.subpackage"])
 
 A C extension can be the most complicated case; here's an example taken from
@@ -852,15 +852,14 @@
    from distutils.core import setup, Extension
 
    expat_extension = Extension('xml.parsers.pyexpat',
-   	define_macros = [('XML_NS', None)],
-   	include_dirs = [ 'extensions/expat/xmltok',
-   	                 'extensions/expat/xmlparse' ],
-   	sources = [ 'extensions/pyexpat.c',
-   	            'extensions/expat/xmltok/xmltok.c',
-    		    'extensions/expat/xmltok/xmlrole.c',
-                     ]
+        define_macros = [('XML_NS', None)],
+        include_dirs = [ 'extensions/expat/xmltok',
+                         'extensions/expat/xmlparse' ],
+        sources = [ 'extensions/pyexpat.c',
+                    'extensions/expat/xmltok/xmltok.c',
+                    'extensions/expat/xmltok/xmlrole.c', ]
           )
-   setup (name = "PyXML", version = "0.5.4", 
+   setup (name = "PyXML", version = "0.5.4",
           ext_modules =[ expat_extension ] )
 
 The Distutils can also take care of creating source and binary distributions.

Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.1.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/2.1.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/2.1.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ****************************
-  What's New in Python 2.1  
+  What's New in Python 2.1
 ****************************
 
 :Author: A.M. Kuchling
@@ -98,7 +98,7 @@
    x = 1
    def f():
        # The next line is a syntax error
-       exec 'x=2'  
+       exec 'x=2'
        def g():
            return x
 

Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.2.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/2.2.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/2.2.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ****************************
-  What's New in Python 2.2  
+  What's New in Python 2.2
 ****************************
 
 :Author: A.M. Kuchling
@@ -295,7 +295,7 @@
 
    class D (B,C):
        def save (self):
-   	# Call superclass .save()
+           # Call superclass .save()
            super(D, self).save()
            # Save D's private information here
            ...
@@ -473,7 +473,7 @@
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    StopIteration
-   >>>      
+   >>>
 
 In 2.2, Python's :keyword:`for` statement no longer expects a sequence; it
 expects something for which :func:`iter` will return an iterator. For backward
@@ -909,7 +909,7 @@
    x = 1
    def f():
        # The next line is a syntax error
-       exec 'x=2'  
+       exec 'x=2'
        def g():
            return x
 
@@ -952,8 +952,8 @@
      items = s.meerkat.getItems( {'channel': 4} )
 
      # 'items' is another list of dictionaries, like this:
-     # [{'link': 'http://freshmeat.net/releases/52719/', 
-     #   'description': 'A utility which converts HTML to XSL FO.', 
+     # [{'link': 'http://freshmeat.net/releases/52719/',
+     #   'description': 'A utility which converts HTML to XSL FO.',
      #   'title': 'html2fo 0.3 (Default)'}, ... ]
 
   The :mod:`SimpleXMLRPCServer` module makes it easy to create straightforward

Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.3.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/2.3.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/2.3.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ****************************
-  What's New in Python 2.3  
+  What's New in Python 2.3
 ****************************
 
 :Author: A.M. Kuchling
@@ -301,7 +301,7 @@
     --------                   -------
         8467                   1 file
    amk at nyman:~/src/python$ ./python
-   Python 2.3 (#1, Aug 1 2003, 19:54:32) 
+   Python 2.3 (#1, Aug 1 2003, 19:54:32)
    >>> import sys
    >>> sys.path.insert(0, '/tmp/example.zip')  # Add .zip file to front of path
    >>> import jwzthreading
@@ -671,7 +671,7 @@
          # ...
          }
 
-   if (hasattr(core, 'setup_keywords') and 
+   if (hasattr(core, 'setup_keywords') and
        'classifiers' in core.setup_keywords):
        kw['classifiers'] = \
            ['Topic :: Internet :: WWW/HTTP :: Dynamic Content',
@@ -1027,7 +1027,7 @@
   creating small dictionaries::
 
      >>> dict(red=1, blue=2, green=3, black=4)
-     {'blue': 2, 'black': 4, 'green': 3, 'red': 1}    
+     {'blue': 2, 'black': 4, 'green': 3, 'red': 1}
 
   (Contributed by Just van Rossum.)
 
@@ -1622,7 +1622,7 @@
      ...         self.valuelist.pop(i)
      ...     def keys(self):
      ...         return list(self.keylist)
-     ... 
+     ...
      >>> s = SeqDict()
      >>> dir(s)      # See that other dictionary methods are implemented
      ['__cmp__', '__contains__', '__delitem__', '__doc__', '__getitem__',
@@ -1779,7 +1779,7 @@
                            set input filename
      -lLENGTH, --length=LENGTH
                            set maximum length of output
-   $ 
+   $
 
 See the module's documentation for more details.
 

Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.4.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/2.4.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/2.4.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ****************************
-  What's New in Python 2.4  
+  What's New in Python 2.4
 ****************************
 
 :Author: A.M. Kuchling
@@ -63,10 +63,10 @@
    >>> a.add('z')                          # add a new element
    >>> a.update('wxy')                     # add multiple new elements
    >>> a
-   set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z'])       
+   set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'x', 'z'])
    >>> a.remove('x')                       # take one element out
    >>> a
-   set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z'])       
+   set(['a', 'c', 'b', 'd', 'r', 'w', 'y', 'z'])
 
 The :func:`frozenset` type is an immutable version of :func:`set`. Since it is
 immutable and hashable, it may be used as a dictionary key or as a member of
@@ -351,7 +351,7 @@
 
    >>> for i in reversed(xrange(1,4)):
    ...    print i
-   ... 
+   ...
    3
    2
    1
@@ -366,7 +366,7 @@
    >>> input = open('/etc/passwd', 'r')
    >>> for line in reversed(list(input)):
    ...   print line
-   ... 
+   ...
    root:*:0:0:System Administrator:/var/root:/bin/tcsh
      ...
 
@@ -396,10 +396,10 @@
 different keyword arguments. ::
 
    class Popen(args, bufsize=0, executable=None,
-   	    stdin=None, stdout=None, stderr=None,
-   	    preexec_fn=None, close_fds=False, shell=False,
-   	    cwd=None, env=None, universal_newlines=False,
-   	    startupinfo=None, creationflags=0):
+               stdin=None, stdout=None, stderr=None,
+               preexec_fn=None, close_fds=False, shell=False,
+               cwd=None, env=None, universal_newlines=False,
+               startupinfo=None, creationflags=0):
 
 *args* is commonly a sequence of strings that will be the arguments to the
 program executed as the subprocess.  (If the *shell* argument is true, *args*
@@ -650,7 +650,7 @@
    28
    >>> decimal.Decimal(1) / decimal.Decimal(7)
    Decimal("0.1428571428571428571428571429")
-   >>> decimal.getcontext().prec = 9 
+   >>> decimal.getcontext().prec = 9
    >>> decimal.Decimal(1) / decimal.Decimal(7)
    Decimal("0.142857143")
 
@@ -665,7 +665,7 @@
    >>> decimal.getcontext().traps[decimal.DivisionByZero] = False
    >>> decimal.Decimal(1) / decimal.Decimal(0)
    Decimal("Infinity")
-   >>> 
+   >>>
 
 The :class:`Context` instance also has various methods for formatting  numbers
 such as :meth:`to_eng_string` and :meth:`to_sci_string`.
@@ -803,7 +803,7 @@
      >>> 'www.python.org'.split('.', 1)
      ['www', 'python.org']
      'www.python.org'.rsplit('.', 1)
-     ['www.python', 'org']        
+     ['www.python', 'org']
 
 * Three keyword parameters, *cmp*, *key*, and *reverse*, were added to the
   :meth:`sort` method of lists. These parameters make some common usages of
@@ -1045,7 +1045,7 @@
      >>> list(d)                 # list the contents of the deque
      ['g', 'h', 'i']
      >>> 'h' in d                # search the deque
-     True  
+     True
 
   Several modules, such as the :mod:`Queue` and :mod:`threading` modules, now take
   advantage of :class:`collections.deque` for improved performance.  (Contributed
@@ -1106,13 +1106,13 @@
      >>> L = [2, 4, 6, 7, 8, 9, 11, 12, 14]
      >>> for key_val, it in itertools.groupby(L, lambda x: x % 2):
      ...    print key_val, list(it)
-     ... 
+     ...
      0 [2, 4, 6]
      1 [7]
      0 [8]
      1 [9, 11]
      0 [12, 14]
-     >>> 
+     >>>
 
   :func:`groupby` is typically used with sorted input.  The logic for
   :func:`groupby` is similar to the Unix ``uniq`` filter which makes it handy for
@@ -1120,21 +1120,21 @@
 
      >>> word = 'abracadabra'
      >>> letters = sorted(word)   # Turn string into a sorted list of letters
-     >>> letters 
+     >>> letters
      ['a', 'a', 'a', 'a', 'a', 'b', 'b', 'c', 'd', 'r', 'r']
      >>> for k, g in itertools.groupby(letters):
      ...    print k, list(g)
-     ... 
+     ...
      a ['a', 'a', 'a', 'a', 'a']
      b ['b', 'b']
      c ['c']
      d ['d']
      r ['r', 'r']
      >>> # List unique letters
-     >>> [k for k, g in groupby(letters)]                     
+     >>> [k for k, g in groupby(letters)]
      ['a', 'b', 'c', 'd', 'r']
      >>> # Count letter occurrences
-     >>> [(k, len(list(g))) for k, g in groupby(letters)]     
+     >>> [(k, len(list(g))) for k, g in groupby(letters)]
      [('a', 5), ('b', 2), ('c', 1), ('d', 1), ('r', 2)]
 
   (Contributed by Hye-Shik Chang.)
@@ -1175,7 +1175,7 @@
      import logging
      logging.basicConfig(filename='/var/log/application.log',
          level=0,  # Log all messages
-         format='%(levelname):%(process):%(thread):%(message)')	            
+         format='%(levelname):%(process):%(thread):%(message)')
 
   Other additions to the :mod:`logging` package include a :meth:`log(level, msg)`
   convenience method, as well as a :class:`TimedRotatingFileHandler` class that
@@ -1428,7 +1428,7 @@
 you get the following output::
 
    **********************************************************************
-   File ``t.py'', line 15, in g
+   File "t.py", line 15, in g
    Failed example:
        g(4)
    Differences (unified diff with -expected +actual):

Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.5.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/2.5.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/2.5.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ****************************
-  What's New in Python 2.5  
+  What's New in Python 2.5
 ****************************
 
 :Author: A.M. Kuchling
@@ -220,7 +220,7 @@
 required packages. ::
 
    VERSION = '1.0'
-   setup(name='PyPackage', 
+   setup(name='PyPackage',
          version=VERSION,
          requires=['numarray', 'zlib (>=1.1.4)'],
          obsoletes=['OldPackage']
@@ -388,7 +388,7 @@
    else:
        else-block
    finally:
-       final-block 
+       final-block
 
 The code in *block-1* is executed.  If the code raises an exception, the various
 :keyword:`except` blocks are tested: if the exception is of class
@@ -485,7 +485,7 @@
    9
    >>> print it.next()
    Traceback (most recent call last):
-     File ``t.py'', line 15, in ?
+     File "t.py", line 15, in ?
        print it.next()
    StopIteration
 
@@ -835,8 +835,8 @@
        ...
    except (KeyboardInterrupt, SystemExit):
        raise
-   except: 
-       # Log error...  
+   except:
+       # Log error...
        # Continue running program...
 
 In Python 2.5, you can now write ``except Exception`` to achieve the same
@@ -947,7 +947,7 @@
 
    class C:
        def __index__ (self):
-           return self.value  
+           return self.value
 
 The return value must be either a Python integer or long integer. The
 interpreter will check that the type returned is correct, and raises a
@@ -1035,9 +1035,9 @@
 
      L = ['medium', 'longest', 'short']
      # Prints 'longest'
-     print max(L, key=len)              
+     print max(L, key=len)
      # Prints 'short', because lexicographically 'short' has the largest value
-     print max(L)         
+     print max(L)
 
   (Contributed by Steven Bethard and Raymond Hettinger.)
 
@@ -1070,8 +1070,8 @@
   using the default ASCII encoding.   The result of the comparison is false::
 
      >>> chr(128) == unichr(128)   # Can't convert chr(128) to Unicode
-     __main__:1: UnicodeWarning: Unicode equal comparison failed 
-       to convert both arguments to Unicode - interpreting them 
+     __main__:1: UnicodeWarning: Unicode equal comparison failed
+       to convert both arguments to Unicode - interpreting them
        as being unequal
      False
      >>> chr(127) == unichr(127)   # chr(127) can be converted
@@ -1259,10 +1259,10 @@
 
   Printing ``index`` results in the following output::
 
-     defaultdict(<type 'list'>, {'c': ['cammin', 'che'], 'e': ['era'], 
-             'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'], 
-             'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'], 
-             'p': ['per'], 's': ['selva', 'smarrita'], 
+     defaultdict(<type 'list'>, {'c': ['cammin', 'che'], 'e': ['era'],
+             'd': ['del', 'di', 'diritta'], 'm': ['mezzo', 'mi'],
+             'l': ['la'], 'o': ['oscura'], 'n': ['nel', 'nostra'],
+             'p': ['per'], 's': ['selva', 'smarrita'],
              'r': ['ritrovai'], 'u': ['una'], 'v': ['vita', 'via']}
 
   (Contributed by Guido van Rossum.)
@@ -1884,17 +1884,17 @@
 differently. ::
 
    # Old versions
-   h = md5.md5()   
-   h = md5.new()   
+   h = md5.md5()
+   h = md5.new()
 
-   # New version 
+   # New version
    h = hashlib.md5()
 
    # Old versions
-   h = sha.sha()   
-   h = sha.new()   
+   h = sha.sha()
+   h = sha.new()
 
-   # New version 
+   # New version
    h = hashlib.sha1()
 
    # Hash that weren't previously available
@@ -2191,7 +2191,7 @@
   case that your extensions were using it, you can replace it by something like
   the following::
 
-     range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll", 
+     range = PyObject_CallFunction((PyObject*) &PyRange_Type, "lll",
                                    start, stop, step);
 
 .. ======================================================================

Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/2.6.rst	Sun Jan 25 21:08:20 2009
@@ -590,30 +590,30 @@
 
 
     def factorial(queue, N):
-	"Compute a factorial."
-	# If N is a multiple of 4, this function will take much longer.
-	if (N % 4) == 0:
-	    time.sleep(.05 * N/4)
-
-	# Calculate the result
-	fact = 1L
-	for i in range(1, N+1):
-	    fact = fact * i
+        "Compute a factorial."
+        # If N is a multiple of 4, this function will take much longer.
+        if (N % 4) == 0:
+            time.sleep(.05 * N/4)
+
+        # Calculate the result
+        fact = 1L
+        for i in range(1, N+1):
+            fact = fact * i
 
-	# Put the result on the queue
-	queue.put(fact)
+        # Put the result on the queue
+        queue.put(fact)
 
     if __name__ == '__main__':
-	queue = Queue()
+        queue = Queue()
 
-	N = 5
+        N = 5
 
-	p = Process(target=factorial, args=(queue, N))
-	p.start()
-	p.join()
+        p = Process(target=factorial, args=(queue, N))
+        p.start()
+        p.join()
 
-	result = queue.get()
-	print 'Factorial', N, '=', result
+        result = queue.get()
+        print 'Factorial', N, '=', result
 
 A :class:`Queue` is used to communicate the input parameter *N* and
 the result.  The :class:`Queue` object is stored in a global variable.
@@ -634,12 +634,12 @@
     from multiprocessing import Pool
 
     def factorial(N, dictionary):
-	"Compute a factorial."
-	...
+        "Compute a factorial."
+        ...
     p = Pool(5)
     result = p.map(factorial, range(1, 1000, 10))
     for v in result:
-	print v
+        print v
 
 This produces the following output::
 
@@ -748,7 +748,7 @@
     >>> import sys
     >>> print 'Platform: {0.platform}\nPython version: {0.version}'.format(sys)
     Platform: darwin
-    Python version: 2.6a1+ (trunk:61261M, Mar  5 2008, 20:29:41) 
+    Python version: 2.6a1+ (trunk:61261M, Mar  5 2008, 20:29:41)
     [GCC 4.0.1 (Apple Computer, Inc. build 5367)]'
 
     >>> import mimetypes
@@ -962,8 +962,8 @@
 The primary use of :class:`bytes` in 2.6 will be to write tests of
 object type such as ``isinstance(x, bytes)``.  This will help the 2to3
 converter, which can't tell whether 2.x code intends strings to
-contain either characters or 8-bit bytes; you can now 
-use either :class:`bytes` or :class:`str` to represent your intention 
+contain either characters or 8-bit bytes; you can now
+use either :class:`bytes` or :class:`str` to represent your intention
 exactly, and the resulting code will also be correct in Python 3.0.
 
 There's also a ``__future__`` import that causes all string literals
@@ -1838,9 +1838,9 @@
   "/cgi-bin/add.py?category=1".  (Contributed by Alexandre Fiori and
   Nubis; :issue:`1817`.)
 
-  The :func:`parse_qs` and :func:`parse_qsl` functions have been 
+  The :func:`parse_qs` and :func:`parse_qsl` functions have been
   relocated from the :mod:`cgi` module to the :mod:`urlparse` module.
-  The versions still available in the :mod:`cgi` module will 
+  The versions still available in the :mod:`cgi` module will
   trigger :exc:`PendingDeprecationWarning` messages in 2.6
   (:issue:`600362`).
 
@@ -1889,9 +1889,9 @@
      ('id', 'name', 'type', 'size')
 
      >>> var = var_type(1, 'frequency', 'int', 4)
-     >>> print var[0], var.id		# Equivalent
+     >>> print var[0], var.id    # Equivalent
      1 1
-     >>> print var[2], var.type          # Equivalent
+     >>> print var[2], var.type  # Equivalent
      int int
      >>> var._asdict()
      {'size': 4, 'type': 'int', 'id': 1, 'name': 'frequency'}
@@ -1935,7 +1935,7 @@
 * A new window method in the :mod:`curses` module,
   :meth:`chgat`, changes the display attributes for a certain number of
   characters on a single line.  (Contributed by Fabian Kreutz.)
-  
+
   ::
 
      # Boldface text starting at y=0,x=21
@@ -2050,8 +2050,8 @@
 
      >>> list(itertools.product([1,2,3], [4,5,6]))
      [(1, 4), (1, 5), (1, 6),
-	  (2, 4), (2, 5), (2, 6),
-	  (3, 4), (3, 5), (3, 6)]
+      (2, 4), (2, 5), (2, 6),
+      (3, 4), (3, 5), (3, 6)]
 
   The optional *repeat* keyword argument is used for taking the
   product of an iterable or a set of iterables with themselves,
@@ -2432,9 +2432,9 @@
   :issue:`742598`, :issue:`1193577`.)
 
 * The :mod:`sqlite3` module, maintained by Gerhard Haering,
-  has been updated from version 2.3.2 in Python 2.5 to 
+  has been updated from version 2.3.2 in Python 2.5 to
   version 2.4.1.
- 
+
 * The :mod:`struct` module now supports the C99 :ctype:`_Bool` type,
   using the format character ``'?'``.
   (Contributed by David Remahl.)
@@ -2529,9 +2529,9 @@
   ``with tempfile.NamedTemporaryFile() as tmp: ...``.
   (Contributed by Alexander Belopolsky; :issue:`2021`.)
 
-* The :mod:`test.test_support` module gained a number 
-  of context managers useful for writing tests. 
-  :func:`EnvironmentVarGuard` is a 
+* The :mod:`test.test_support` module gained a number
+  of context managers useful for writing tests.
+  :func:`EnvironmentVarGuard` is a
   context manager that temporarily changes environment variables and
   automatically restores them to their old values.
 
@@ -2546,7 +2546,7 @@
           f = urllib.urlopen('https://sf.net')
           ...
 
-  Finally, :func:`check_warnings` resets the :mod:`warning` module's 
+  Finally, :func:`check_warnings` resets the :mod:`warning` module's
   warning filters and returns an object that will record all warning
   messages triggered (:issue:`3781`)::
 
@@ -2586,7 +2586,7 @@
   :meth:`activeCount` method is renamed to :meth:`active_count`.  Both
   the 2.6 and 3.0 versions of the module support the same properties
   and renamed methods, but don't remove the old methods.  No date has been set
-  for the deprecation of the old APIs in Python 3.x; the old APIs won't 
+  for the deprecation of the old APIs in Python 3.x; the old APIs won't
   be removed in any 2.x version.
   (Carried out by several people, most notably Benjamin Peterson.)
 
@@ -2643,7 +2643,7 @@
   (Added by Facundo Batista.)
 
 * The Unicode database provided by the :mod:`unicodedata` module
-  has been updated to version 5.1.0.  (Updated by 
+  has been updated to version 5.1.0.  (Updated by
   Martin von Loewis; :issue:`3811`.)
 
 * The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning`
@@ -2654,7 +2654,7 @@
   A new function, :func:`catch_warnings`, is a context manager
   intended for testing purposes that lets you temporarily modify the
   warning filters and then restore their original values (:issue:`3781`).
-  
+
 * The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer`
   classes can now be prevented from immediately opening and binding to
   their socket by passing True as the ``bind_and_activate``
@@ -3217,6 +3217,9 @@
   set ``__hash__ = None`` in their definitions to indicate
   the fact.
 
+* String exceptions have been removed.  Attempting to use them raises a
+  :exc:`TypeError`.
+
 * The :meth:`__init__` method of :class:`collections.deque`
   now clears any existing contents of the deque
   before adding elements from the iterable.  This change makes the
@@ -3224,8 +3227,8 @@
 
 * :meth:`object.__init__` previously accepted arbitrary arguments and
   keyword arguments, ignoring them.  In Python 2.6, this is no longer
-  allowed and will result in a :exc:`TypeError`.  This will affect 
-  :meth:`__init__` methods that end up calling the corresponding 
+  allowed and will result in a :exc:`TypeError`.  This will affect
+  :meth:`__init__` methods that end up calling the corresponding
   method on :class:`object` (perhaps through using :func:`super`).
   See :issue:`1683368` for discussion.
 
@@ -3285,7 +3288,7 @@
 
 The author would like to thank the following people for offering
 suggestions, corrections and assistance with various drafts of this
-article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, 
-Jim Jewett, Kent Johnson, Chris Lambacher,  Martin Michlmayr, 
+article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy,
+Jim Jewett, Kent Johnson, Chris Lambacher,  Martin Michlmayr,
 Antoine Pitrou, Brian Warner.
 

Modified: python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/2.7.rst	Sun Jan 25 21:08:20 2009
@@ -60,6 +60,11 @@
 .. ========================================================================
 
 
+Kristján Valur Jónsson, issue 4293
+Py_AddPendingCall is now thread safe.  This allows any worker thread
+to submit notifications to the python main thread.  This is particularly
+useful for asynchronous IO operations.
+
 
 Other Language Changes
 ======================
@@ -103,7 +108,28 @@
 :file:`Misc/NEWS` file in the source tree for a more complete list of
 changes, or look through the Subversion logs for all the details.
 
-* To be written.
+* A new function in the :mod:`subprocess` module,
+  :func:`check_output`, runs a command with a specified set of arguments
+  and returns the command's output as a string if the command runs without
+  error, or raises a :exc:`CalledProcessError` exception otherwise.
+
+  ::
+
+    >>> subprocess.check_output(['df', '-h', '.'])
+    'Filesystem     Size   Used  Avail Capacity  Mounted on\n
+    /dev/disk0s2    52G    49G   3.0G    94%    /\n'
+
+    >>> subprocess.check_output(['df', '-h', '/bogus'])
+      ...
+    subprocess.CalledProcessError: Command '['df', '-h', '/bogus']' returned non-zero exit status 1
+
+  (Contributed by Gregory P. Smith.)
+
+* It is not mandatory anymore to store clear text passwords in the
+  :file:`.pypirc` file when registering and uploading packages to PyPI. As long
+  as the username is present in that file, the :mod:`distutils` package will
+  prompt for the password if not present.  (Added by tarek, with the initial
+  contribution of Nathan Van Gheem; :issue:`4394`.)
 
 .. ======================================================================
 .. whole new modules get described in subsections here
@@ -116,13 +142,22 @@
 
 Changes to Python's build process and to the C API include:
 
-* To be written.
+* If you use the :file:`.gdbinit` file provided with Python,
+  the "pyo" macro in the 2.7 version will now work when the thread being
+  debugged doesn't hold the GIL; the macro will now acquire it before printing.
+  (Contributed by haypo XXX; :issue:`3632`.)
 
 .. ======================================================================
 
 Port-Specific Changes: Windows
 -----------------------------------
 
+* The :mod:`msvcrt` module now contains some constants from
+  the :file:`crtassem.h` header file:
+  :data:`CRT_ASSEMBLY_VERSION`,
+  :data:`VC_ASSEMBLY_PUBLICKEYTOKEN`,
+  and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`.
+  (Added by Martin von Loewis (XXX check); :issue:`4365`.)
 
 .. ======================================================================
 

Modified: python/branches/py3k-issue1717/Doc/whatsnew/3.0.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/3.0.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/3.0.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ****************************
-  What's New In Python 3.0  
+  What's New In Python 3.0
 ****************************
 
 .. XXX Add trademark info for Apple, Microsoft.
@@ -10,45 +10,45 @@
 
 .. $Id$
    Rules for maintenance:
-   
+
    * Anyone can add text to this document.  Do not spend very much time
    on the wording of your changes, because your text will probably
    get rewritten to some degree.
-   
+
    * The maintainer will go through Misc/NEWS periodically and add
    changes; it's therefore more important to add your changes to
    Misc/NEWS than to this file.  (Note: I didn't get to this for 3.0.
    GvR.)
-   
+
    * This is not a complete list of every single change; completeness
    is the purpose of Misc/NEWS.  Some changes I consider too small
    or esoteric to include.  If such a change is added to the text,
    I'll just remove it.  (This is another reason you shouldn't spend
    too much time on writing your addition.)
-   
+
    * If you want to draw your new text to the attention of the
    maintainer, add 'XXX' to the beginning of the paragraph or
    section.
-   
+
    * It's OK to just add a fragmentary note about a change.  For
    example: "XXX Describe the transmogrify() function added to the
    socket module."  The maintainer will research the change and
    write the necessary text.
-   
+
    * You can comment out your additions if you like, but it's not
    necessary (especially when a final release is some months away).
-   
+
    * Credit the author of a patch or bugfix.   Just the name is
    sufficient; the e-mail address isn't necessary.  (Due to time
    constraints I haven't managed to do this for 3.0.  GvR.)
-   
+
    * It's helpful to add the bug/patch number as a comment:
-   
+
    % Patch 12345
    XXX Describe the transmogrify() function added to the socket
    module.
    (Contributed by P.Y. Developer.)
-   
+
    This saves the maintainer the effort of going through the SVN log
    when researching a change.  (Again, I didn't get to this for 3.0.
    GvR.)
@@ -819,7 +819,7 @@
   need it; however, 99 percent of the time an explicit :keyword:`for`
   loop is more readable.
 
-* Removed :func:`reload`.  Use :func:`imp.reload`.  
+* Removed :func:`reload`.  Use :func:`imp.reload`.
 
 * Removed. :meth:`dict.has_key` -- use the :keyword:`in` operator
   instead.

Modified: python/branches/py3k-issue1717/Doc/whatsnew/3.1.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/whatsnew/3.1.rst	(original)
+++ python/branches/py3k-issue1717/Doc/whatsnew/3.1.rst	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 ****************************
-  What's New In Python 3.1  
+  What's New In Python 3.1
 ****************************
 
 .. XXX Add trademark info for Apple, Microsoft.
@@ -10,45 +10,45 @@
 
 .. $Id$
    Rules for maintenance:
-   
+
    * Anyone can add text to this document.  Do not spend very much time
    on the wording of your changes, because your text will probably
    get rewritten to some degree.
-   
+
    * The maintainer will go through Misc/NEWS periodically and add
    changes; it's therefore more important to add your changes to
    Misc/NEWS than to this file.  (Note: I didn't get to this for 3.0.
    GvR.)
-   
+
    * This is not a complete list of every single change; completeness
    is the purpose of Misc/NEWS.  Some changes I consider too small
    or esoteric to include.  If such a change is added to the text,
    I'll just remove it.  (This is another reason you shouldn't spend
    too much time on writing your addition.)
-   
+
    * If you want to draw your new text to the attention of the
    maintainer, add 'XXX' to the beginning of the paragraph or
    section.
-   
+
    * It's OK to just add a fragmentary note about a change.  For
    example: "XXX Describe the transmogrify() function added to the
    socket module."  The maintainer will research the change and
    write the necessary text.
-   
+
    * You can comment out your additions if you like, but it's not
    necessary (especially when a final release is some months away).
-   
+
    * Credit the author of a patch or bugfix.   Just the name is
    sufficient; the e-mail address isn't necessary.  (Due to time
    constraints I haven't managed to do this for 3.0.  GvR.)
-   
+
    * It's helpful to add the bug/patch number as a comment:
-   
+
    % Patch 12345
    XXX Describe the transmogrify() function added to the socket
    module.
    (Contributed by P.Y. Developer.)
-   
+
    This saves the maintainer the effort of going through the SVN log
    when researching a change.  (Again, I didn't get to this for 3.0.
    GvR.)

Modified: python/branches/py3k-issue1717/Include/abstract.h
==============================================================================
--- python/branches/py3k-issue1717/Include/abstract.h	(original)
+++ python/branches/py3k-issue1717/Include/abstract.h	Sun Jan 25 21:08:20 2009
@@ -589,7 +589,8 @@
 	is an iterator, this returns itself. */
 
 #define PyIter_Check(obj) \
-    ((obj)->ob_type->tp_iternext != NULL)
+    ((obj)->ob_type->tp_iternext != NULL && \
+     (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
 
      PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *);
      /* Takes an iterator object and calls its tp_iternext slot,
@@ -785,20 +786,14 @@
 
      #define PyNumber_Int PyNumber_Long
 
+     PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
+
        /*
 	 Returns the o converted to an integer object on success, or
 	 NULL on failure.  This is the equivalent of the Python
 	 expression: int(o).
        */
 
-     PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
-
-       /*
-	 Returns the o converted to a long integer object on success,
-	 or NULL on failure.  This is the equivalent of the Python
-	 expression: long(o).
-       */
-
      PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o);
 
        /*

Modified: python/branches/py3k-issue1717/Include/longobject.h
==============================================================================
--- python/branches/py3k-issue1717/Include/longobject.h	(original)
+++ python/branches/py3k-issue1717/Include/longobject.h	Sun Jan 25 21:08:20 2009
@@ -41,7 +41,7 @@
 #endif
 
 /* For use by intobject.c only */
-PyAPI_DATA(int) _PyLong_DigitValue[256];
+PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
 
 /* _PyLong_AsScaledDouble returns a double x and an exponent e such that
    the true value is approximately equal to x * 2**(SHIFT*e).  e is >= 0.

Modified: python/branches/py3k-issue1717/Include/memoryobject.h
==============================================================================
--- python/branches/py3k-issue1717/Include/memoryobject.h	(original)
+++ python/branches/py3k-issue1717/Include/memoryobject.h	Sun Jan 25 21:08:20 2009
@@ -20,53 +20,53 @@
 						  int buffertype, 
 						  char fort);
 
-	/* Return a contiguous chunk of memory representing the buffer
-	   from an object in a memory view object.  If a copy is made then the
-	   base object for the memory view will be a *new* bytes object. 
-	   
-	   Otherwise, the base-object will be the object itself and no 
-	   data-copying will be done. 
-
-	   The buffertype argument can be PyBUF_READ, PyBUF_WRITE,
-	   PyBUF_SHADOW to determine whether the returned buffer
-	   should be READONLY, WRITABLE, or set to update the
-	   original buffer if a copy must be made.  If buffertype is
-	   PyBUF_WRITE and the buffer is not contiguous an error will
-	   be raised.  In this circumstance, the user can use
-	   PyBUF_SHADOW to ensure that a a writable temporary
-	   contiguous buffer is returned.  The contents of this
-	   contiguous buffer will be copied back into the original
-	   object after the memoryview object is deleted as long as
-	   the original object is writable and allows setting an
-	   exclusive write lock. If this is not allowed by the
-	   original object, then a BufferError is raised.
-	   
-	   If the object is multi-dimensional and if fortran is 'F',
-	   the first dimension of the underlying array will vary the
-	   fastest in the buffer.  If fortran is 'C', then the last
-	   dimension will vary the fastest (C-style contiguous).  If
-	   fortran is 'A', then it does not matter and you will get
-	   whatever the object decides is more efficient.  
+    /* Return a contiguous chunk of memory representing the buffer
+       from an object in a memory view object.  If a copy is made then the
+       base object for the memory view will be a *new* bytes object. 
+       
+       Otherwise, the base-object will be the object itself and no 
+       data-copying will be done. 
+
+       The buffertype argument can be PyBUF_READ, PyBUF_WRITE,
+       PyBUF_SHADOW to determine whether the returned buffer
+       should be READONLY, WRITABLE, or set to update the
+       original buffer if a copy must be made.  If buffertype is
+       PyBUF_WRITE and the buffer is not contiguous an error will
+       be raised.  In this circumstance, the user can use
+       PyBUF_SHADOW to ensure that a a writable temporary
+       contiguous buffer is returned.  The contents of this
+       contiguous buffer will be copied back into the original
+       object after the memoryview object is deleted as long as
+       the original object is writable and allows setting an
+       exclusive write lock. If this is not allowed by the
+       original object, then a BufferError is raised.
+       
+       If the object is multi-dimensional and if fortran is 'F',
+       the first dimension of the underlying array will vary the
+       fastest in the buffer.  If fortran is 'C', then the last
+       dimension will vary the fastest (C-style contiguous).  If
+       fortran is 'A', then it does not matter and you will get
+       whatever the object decides is more efficient.  
 
-	   A new reference is returned that must be DECREF'd when finished.
-	*/
+       A new reference is returned that must be DECREF'd when finished.
+    */
 
 PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base);
 
 PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(Py_buffer *info);
-	/* create new if bufptr is NULL 
-	    will be a new bytesobject in base */
+    /* create new if bufptr is NULL 
+        will be a new bytesobject in base */
+
 
-	
 /* The struct is declared here so that macros can work, but it shouldn't
    be considered public. Don't access those fields directly, use the macros
    and functions instead! */
 typedef struct {
-	PyObject_HEAD
-	PyObject *base;
-	Py_buffer view;
+    PyObject_HEAD
+    PyObject *base;
+    Py_buffer view;
 } PyMemoryViewObject;
-	
+
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-issue1717/Include/object.h
==============================================================================
--- python/branches/py3k-issue1717/Include/object.h	(original)
+++ python/branches/py3k-issue1717/Include/object.h	Sun Jan 25 21:08:20 2009
@@ -144,16 +144,18 @@
 typedef struct bufferinfo {
 	void *buf;   
 	PyObject *obj;        /* owned reference */
-        Py_ssize_t len;
-        Py_ssize_t itemsize;  /* This is Py_ssize_t so it can be 
-                                 pointed to by strides in simple case.*/
-        int readonly;
-        int ndim;
-        char *format;
-        Py_ssize_t *shape;
-        Py_ssize_t *strides;
-        Py_ssize_t *suboffsets;
-        void *internal;
+	Py_ssize_t len;
+	Py_ssize_t itemsize;  /* This is Py_ssize_t so it can be 
+			         pointed to by strides in simple case.*/
+	int readonly;
+	int ndim;
+	char *format;
+	Py_ssize_t *shape;
+	Py_ssize_t *strides;
+	Py_ssize_t *suboffsets;
+	Py_ssize_t smalltable[2];  /* static store for shape and strides of
+				      mono-dimensional buffers. */
+	void *internal;
 } Py_buffer;
 
 typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
@@ -217,7 +219,7 @@
 	binaryfunc nb_xor;
 	binaryfunc nb_or;
 	unaryfunc nb_int;
-	unaryfunc nb_long;
+	void *nb_reserved;  /* the slot formerly known as nb_long */
 	unaryfunc nb_float;
 
 	binaryfunc nb_inplace_add;
@@ -433,6 +435,7 @@
 PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *);
 PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
 PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *);
+PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *);
 PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *);
 PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *,
 					      PyObject *, PyObject *);

Modified: python/branches/py3k-issue1717/Include/pydebug.h
==============================================================================
--- python/branches/py3k-issue1717/Include/pydebug.h	(original)
+++ python/branches/py3k-issue1717/Include/pydebug.h	Sun Jan 25 21:08:20 2009
@@ -18,6 +18,7 @@
 PyAPI_DATA(int) Py_DivisionWarningFlag;
 PyAPI_DATA(int) Py_DontWriteBytecodeFlag;
 PyAPI_DATA(int) Py_NoUserSiteDirectory;
+PyAPI_DATA(int) Py_UnbufferedStdioFlag;
 
 /* this is a wrapper around getenv() that pays attention to
    Py_IgnoreEnvironmentFlag.  It should be used for getting variables like

Modified: python/branches/py3k-issue1717/Include/pyerrors.h
==============================================================================
--- python/branches/py3k-issue1717/Include/pyerrors.h	(original)
+++ python/branches/py3k-issue1717/Include/pyerrors.h	Sun Jan 25 21:08:20 2009
@@ -144,7 +144,6 @@
 PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError;
 PyAPI_DATA(PyObject *) PyExc_ValueError;
 PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError;
-PyAPI_DATA(PyObject *) PyExc_BufferError;
 #ifdef MS_WINDOWS
 PyAPI_DATA(PyObject *) PyExc_WindowsError;
 #endif

Modified: python/branches/py3k-issue1717/Include/pymath.h
==============================================================================
--- python/branches/py3k-issue1717/Include/pymath.h	(original)
+++ python/branches/py3k-issue1717/Include/pymath.h	Sun Jan 25 21:08:20 2009
@@ -87,7 +87,7 @@
  * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan
  */
 #ifndef Py_IS_NAN
-#ifdef HAVE_ISNAN
+#if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1
 #define Py_IS_NAN(X) isnan(X)
 #else
 #define Py_IS_NAN(X) ((X) != (X))
@@ -104,7 +104,7 @@
  * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf
  */
 #ifndef Py_IS_INFINITY
-#ifdef HAVE_ISINF
+#if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1
 #define Py_IS_INFINITY(X) isinf(X)
 #else
 #define Py_IS_INFINITY(X) ((X) && (X)*0.5 == (X))
@@ -118,7 +118,9 @@
  * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite
  */
 #ifndef Py_IS_FINITE
-#ifdef HAVE_FINITE
+#if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1
+#define Py_IS_FINITE(X) isfinite(X)
+#elif defined HAVE_FINITE
 #define Py_IS_FINITE(X) finite(X)
 #else
 #define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))

Modified: python/branches/py3k-issue1717/Include/pyport.h
==============================================================================
--- python/branches/py3k-issue1717/Include/pyport.h	(original)
+++ python/branches/py3k-issue1717/Include/pyport.h	Sun Jan 25 21:08:20 2009
@@ -616,6 +616,15 @@
 #define Py_FORMAT_PARSETUPLE(func,p1,p2)
 #endif
 
+/*
+ * Specify alignment on compilers that support it.
+ */
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define Py_ALIGNED(x) __attribute__((aligned(x)))
+#else
+#define Py_ALIGNED(x)
+#endif
+
 /* Eliminate end-of-loop code not reached warnings from SunPro C
  * when using do{...}while(0) macros
  */

Modified: python/branches/py3k-issue1717/Include/unicodeobject.h
==============================================================================
--- python/branches/py3k-issue1717/Include/unicodeobject.h	(original)
+++ python/branches/py3k-issue1717/Include/unicodeobject.h	Sun Jan 25 21:08:20 2009
@@ -126,6 +126,10 @@
 typedef unsigned long Py_UCS4; 
 #endif
 
+/* Py_UNICODE is the native Unicode storage format (code unit) used by
+   Python and represents a single Unicode element in the Unicode
+   type. */
+
 typedef PY_UNICODE_TYPE Py_UNICODE;
 
 /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */
@@ -369,12 +373,12 @@
 
 #else
 
-/* Since splitting on whitespace is an important use case, and whitespace
-   in most situations is solely ASCII whitespace, we optimize for the common
-   case by using a quick look-up table with an inlined check.
- */
-PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
+/* Since splitting on whitespace is an important use case, and
+   whitespace in most situations is solely ASCII whitespace, we
+   optimize for the common case by using a quick look-up table
+   _Py_ascii_whitespace (see below) with an inlined check.
 
+ */
 #define Py_UNICODE_ISSPACE(ch) \
 	((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
 
@@ -409,13 +413,14 @@
 #define Py_UNICODE_COPY(target, source, length)				\
 	Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE))
 
-#define Py_UNICODE_FILL(target, value, length) do\
-    {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\
+#define Py_UNICODE_FILL(target, value, length) \
+    do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\
         for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\
     } while (0)
 
-/* check if substring matches at given offset.  the offset must be
+/* Check if substring matches at given offset.  the offset must be
    valid, and the substring must not be empty */
+
 #define Py_UNICODE_MATCH(string, offset, substring) \
     ((*((string)->str + (offset)) == *((substring)->str)) && \
     ((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \
@@ -425,8 +430,6 @@
 extern "C" {
 #endif
 
-PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
-
 /* --- Unicode Type ------------------------------------------------------- */
 
 typedef struct {
@@ -641,6 +644,17 @@
 
 PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal);
 
+/* --- Free-list management ----------------------------------------------- */
+
+/* Clear the free list used by the Unicode implementation.
+
+   This can be used to release memory used for objects on the free
+   list back to the Python memory allocator.
+
+*/
+
+PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
+
 /* === Builtin Codecs ===================================================== 
 
    Many of these APIs take two arguments encoding and errors. These
@@ -1477,6 +1491,10 @@
 
 /* === Characters Type APIs =============================================== */
 
+/* Helper array used by Py_UNICODE_ISSPACE(). */
+
+PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
+
 /* These should not be used directly. Use the Py_UNICODE_IS* and
    Py_UNICODE_TO* macros instead. 
 

Modified: python/branches/py3k-issue1717/LICENSE
==============================================================================
--- python/branches/py3k-issue1717/LICENSE	(original)
+++ python/branches/py3k-issue1717/LICENSE	Sun Jan 25 21:08:20 2009
@@ -89,15 +89,14 @@
 otherwise using this software ("Python") in source or binary form and
 its associated documentation.
 
-2. Subject to the terms and conditions of this License Agreement, PSF
-hereby grants Licensee a nonexclusive, royalty-free, world-wide
-license to reproduce, analyze, test, perform and/or display publicly,
-prepare derivative works, distribute, and otherwise use Python
-alone or in any derivative version, provided, however, that PSF's
-License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation; 
-All Rights Reserved" are retained in Python alone or in any derivative 
-version prepared by Licensee.
+2. Subject to the terms and conditions of this License Agreement, PSF hereby
+grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
+analyze, test, perform and/or display publicly, prepare derivative works,
+distribute, and otherwise use Python alone or in any derivative version,
+provided, however, that PSF's License Agreement and PSF's notice of copyright,
+i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python
+Software Foundation; All Rights Reserved" are retained in Python alone or in any
+derivative version prepared by Licensee.
 
 3. In the event Licensee prepares a derivative work that is based on
 or incorporates Python or any part thereof, and wants to make

Modified: python/branches/py3k-issue1717/Lib/_abcoll.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/_abcoll.py	(original)
+++ python/branches/py3k-issue1717/Lib/_abcoll.py	Sun Jan 25 21:08:20 2009
@@ -283,12 +283,12 @@
 
     @abstractmethod
     def add(self, value):
-        """Return True if it was added, False if already there."""
+        """Add an element."""
         raise NotImplementedError
 
     @abstractmethod
     def discard(self, value):
-        """Return True if it was deleted, False if not there."""
+        """Remove an element.  Do not raise an exception if absent."""
         raise NotImplementedError
 
     def remove(self, value):

Modified: python/branches/py3k-issue1717/Lib/ast.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/ast.py	(original)
+++ python/branches/py3k-issue1717/Lib/ast.py	Sun Jan 25 21:08:20 2009
@@ -64,6 +64,18 @@
         elif isinstance(node, Name):
             if node.id in _safe_names:
                 return _safe_names[node.id]
+        elif isinstance(node, BinOp) and \
+             isinstance(node.op, (Add, Sub)) and \
+             isinstance(node.right, Num) and \
+             isinstance(node.right.n, complex) and \
+             isinstance(node.left, Num) and \
+             isinstance(node.left.n, (int, float)):
+            left = node.left.n
+            right = node.right.n
+            if isinstance(node.op, Add):
+                return left + right
+            else:
+                return left - right
         raise ValueError('malformed string')
     return _convert(node_or_string)
 

Modified: python/branches/py3k-issue1717/Lib/collections.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/collections.py	(original)
+++ python/branches/py3k-issue1717/Lib/collections.py	Sun Jan 25 21:08:20 2009
@@ -1,5 +1,5 @@
 __all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
-            'UserString']
+            'UserString', 'Counter']
 # For bootstrapping reasons, the collection ABCs are defined in _abcoll.py.
 # They should however be considered an integral part of collections.py.
 from _abcoll import *
@@ -10,6 +10,9 @@
 from operator import itemgetter as _itemgetter
 from keyword import iskeyword as _iskeyword
 import sys as _sys
+import heapq as _heapq
+from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
+
 
 ################################################################################
 ### namedtuple
@@ -113,6 +116,248 @@
     return result
 
 
+########################################################################
+###  Counter
+########################################################################
+
+class Counter(dict):
+    '''Dict subclass for counting hashable items.  Sometimes called a bag
+    or multiset.  Elements are stored as dictionary keys and their counts
+    are stored as dictionary values.
+
+    >>> c = Counter('abracadabra')      # count elements from a string
+
+    >>> c.most_common(3)                # three most common elements
+    [('a', 5), ('r', 2), ('b', 2)]
+    >>> sorted(c)                       # list all unique elements
+    ['a', 'b', 'c', 'd', 'r']
+    >>> ''.join(sorted(c.elements()))   # list elements with repetitions
+    'aaaaabbcdrr'
+    >>> sum(c.values())                 # total of all counts
+    11
+
+    >>> c['a']                          # count of letter 'a'
+    5
+    >>> for elem in 'shazam':           # update counts from an iterable
+    ...     c[elem] += 1                # by adding 1 to each element's count
+    >>> c['a']                          # now there are seven 'a'
+    7
+    >>> del c['r']                      # remove all 'r'
+    >>> c['r']                          # now there are zero 'r'
+    0
+
+    >>> d = Counter('simsalabim')       # make another counter
+    >>> c.update(d)                     # add in the second counter
+    >>> c['a']                          # now there are nine 'a'
+    9
+
+    >>> c.clear()                       # empty the counter
+    >>> c
+    Counter()
+
+    Note:  If a count is set to zero or reduced to zero, it will remain
+    in the counter until the entry is deleted or the counter is cleared:
+
+    >>> c = Counter('aaabbc')
+    >>> c['b'] -= 2                     # reduce the count of 'b' by two
+    >>> c.most_common()                 # 'b' is still in, but its count is zero
+    [('a', 3), ('c', 1), ('b', 0)]
+
+    '''
+    # References:
+    #   http://en.wikipedia.org/wiki/Multiset
+    #   http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html
+    #   http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm
+    #   http://code.activestate.com/recipes/259174/
+    #   Knuth, TAOCP Vol. II section 4.6.3
+
+    def __init__(self, iterable=None, **kwds):
+        '''Create a new, empty Counter object.  And if given, count elements
+        from an input iterable.  Or, initialize the count from another mapping
+        of elements to their counts.
+
+        >>> c = Counter()                           # a new, empty counter
+        >>> c = Counter('gallahad')                 # a new counter from an iterable
+        >>> c = Counter({'a': 4, 'b': 2})           # a new counter from a mapping
+        >>> c = Counter(a=4, b=2)                   # a new counter from keyword args
+
+        '''
+        self.update(iterable, **kwds)
+
+    def __missing__(self, key):
+        'The count of elements not in the Counter is zero.'
+        # Needed so that self[missing_item] does not raise KeyError
+        return 0
+
+    def most_common(self, n=None):
+        '''List the n most common elements and their counts from the most
+        common to the least.  If n is None, then list all element counts.
+
+        >>> Counter('abracadabra').most_common(3)
+        [('a', 5), ('r', 2), ('b', 2)]
+
+        '''
+        # Emulate Bag.sortedByCount from Smalltalk
+        if n is None:
+            return sorted(self.items(), key=_itemgetter(1), reverse=True)
+        return _heapq.nlargest(n, self.items(), key=_itemgetter(1))
+
+    def elements(self):
+        '''Iterator over elements repeating each as many times as its count.
+
+        >>> c = Counter('ABCABC')
+        >>> sorted(c.elements())
+        ['A', 'A', 'B', 'B', 'C', 'C']
+
+        # Knuth's example for prime factors of 1836:  2**2 * 3**3 * 17**1
+        >>> prime_factors = Counter({2: 2, 3: 3, 17: 1})
+        >>> product = 1
+        >>> for factor in prime_factors.elements():     # loop over factors
+        ...     product *= factor                       # and multiply them
+        >>> product
+        1836
+
+        Note, if an element's count has been set to zero or is a negative
+        number, elements() will ignore it.
+
+        '''
+        # Emulate Bag.do from Smalltalk and Multiset.begin from C++.
+        return _chain.from_iterable(_starmap(_repeat, self.items()))
+
+    # Override dict methods where necessary
+
+    @classmethod
+    def fromkeys(cls, iterable, v=None):
+        # There is no equivalent method for counters because setting v=1
+        # means that no element can have a count greater than one.
+        raise NotImplementedError(
+            'Counter.fromkeys() is undefined.  Use Counter(iterable) instead.')
+
+    def update(self, iterable=None, **kwds):
+        '''Like dict.update() but add counts instead of replacing them.
+
+        Source can be an iterable, a dictionary, or another Counter instance.
+
+        >>> c = Counter('which')
+        >>> c.update('witch')           # add elements from another iterable
+        >>> d = Counter('watch')
+        >>> c.update(d)                 # add elements from another counter
+        >>> c['h']                      # four 'h' in which, witch, and watch
+        4
+
+        '''
+        # The regular dict.update() operation makes no sense here because the
+        # replace behavior results in the some of original untouched counts
+        # being mixed-in with all of the other counts for a mismash that
+        # doesn't have a straight-forward interpretation in most counting
+        # contexts.  Instead, we implement straight-addition.  Both the inputs
+        # and outputs are allowed to contain zero and negative counts.
+
+        if iterable is not None:
+            if isinstance(iterable, Mapping):
+                if self:
+                    for elem, count in iterable.items():
+                        self[elem] += count
+                else:
+                    dict.update(self, iterable) # fast path when counter is empty
+            else:
+                for elem in iterable:
+                    self[elem] += 1
+        if kwds:
+            self.update(kwds)
+
+    def copy(self):
+        'Like dict.copy() but returns a Counter instance instead of a dict.'
+        return Counter(self)
+
+    def __delitem__(self, elem):
+        'Like dict.__delitem__() but does not raise KeyError for missing values.'
+        if elem in self:
+            dict.__delitem__(self, elem)
+
+    def __repr__(self):
+        if not self:
+            return '%s()' % self.__class__.__name__
+        items = ', '.join(map('%r: %r'.__mod__, self.most_common()))
+        return '%s({%s})' % (self.__class__.__name__, items)
+
+    # Multiset-style mathematical operations discussed in:
+    #       Knuth TAOCP Volume II section 4.6.3 exercise 19
+    #       and at http://en.wikipedia.org/wiki/Multiset
+    #
+    # Outputs guaranteed to only include positive counts.
+    #
+    # To strip negative and zero counts, add-in an empty counter:
+    #       c += Counter()
+
+    def __add__(self, other):
+        '''Add counts from two counters.
+
+        >>> Counter('abbb') + Counter('bcc')
+        Counter({'b': 4, 'c': 2, 'a': 1})
+
+        '''
+        if not isinstance(other, Counter):
+            return NotImplemented
+        result = Counter()
+        for elem in set(self) | set(other):
+            newcount = self[elem] + other[elem]
+            if newcount > 0:
+                result[elem] = newcount
+        return result
+
+    def __sub__(self, other):
+        ''' Subtract count, but keep only results with positive counts.
+
+        >>> Counter('abbbc') - Counter('bccd')
+        Counter({'b': 2, 'a': 1})
+
+        '''
+        if not isinstance(other, Counter):
+            return NotImplemented
+        result = Counter()
+        for elem in set(self) | set(other):
+            newcount = self[elem] - other[elem]
+            if newcount > 0:
+                result[elem] = newcount
+        return result
+
+    def __or__(self, other):
+        '''Union is the maximum of value in either of the input counters.
+
+        >>> Counter('abbb') | Counter('bcc')
+        Counter({'b': 3, 'c': 2, 'a': 1})
+
+        '''
+        if not isinstance(other, Counter):
+            return NotImplemented
+        _max = max
+        result = Counter()
+        for elem in set(self) | set(other):
+            newcount = _max(self[elem], other[elem])
+            if newcount > 0:
+                result[elem] = newcount
+        return result
+
+    def __and__(self, other):
+        ''' Intersection is the minimum of corresponding counts.
+
+        >>> Counter('abbb') & Counter('bcc')
+        Counter({'b': 1})
+
+        '''
+        if not isinstance(other, Counter):
+            return NotImplemented
+        _min = min
+        result = Counter()
+        if len(self) < len(other):
+            self, other = other, self
+        for elem in filter(self.__contains__, other):
+            newcount = _min(self[elem], other[elem])
+            if newcount > 0:
+                result[elem] = newcount
+        return result
+
 
 ################################################################################
 ### UserDict
@@ -253,7 +498,6 @@
     def __str__(self): return str(self.data)
     def __repr__(self): return repr(self.data)
     def __int__(self): return int(self.data)
-    def __long__(self): return int(self.data)
     def __float__(self): return float(self.data)
     def __complex__(self): return complex(self.data)
     def __hash__(self): return hash(self.data)

Modified: python/branches/py3k-issue1717/Lib/ctypes/test/__init__.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/ctypes/test/__init__.py	(original)
+++ python/branches/py3k-issue1717/Lib/ctypes/test/__init__.py	Sun Jan 25 21:08:20 2009
@@ -67,9 +67,6 @@
             if verbosity > 1:
                 print("Skipped %s: %s" % (modname, detail), file=sys.stderr)
             continue
-        except Exception as detail:
-            print("Warning: could not import %s: %s" % (modname, detail), file=sys.stderr)
-            continue
         for name in dir(mod):
             if name.startswith("_"):
                 continue

Modified: python/branches/py3k-issue1717/Lib/ctypes/test/test_pep3118.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/ctypes/test/test_pep3118.py	(original)
+++ python/branches/py3k-issue1717/Lib/ctypes/test/test_pep3118.py	Sun Jan 25 21:08:20 2009
@@ -25,7 +25,10 @@
             v = memoryview(ob)
             try:
                 self.failUnlessEqual(normalize(v.format), normalize(fmt))
-                self.failUnlessEqual(len(v), sizeof(ob))
+                if shape is not None:
+                    self.failUnlessEqual(len(v), shape[0])
+                else:
+                    self.failUnlessEqual(len(v) * sizeof(itemtp), sizeof(ob))
                 self.failUnlessEqual(v.itemsize, sizeof(itemtp))
                 self.failUnlessEqual(v.shape, shape)
                 # ctypes object always have a non-strided memory block
@@ -37,7 +40,7 @@
                     n = 1
                     for dim in v.shape:
                         n = n * dim
-                    self.failUnlessEqual(v.itemsize * n, len(v))
+                    self.failUnlessEqual(n * v.itemsize, len(v.tobytes()))
             except:
                 # so that we can see the failing type
                 print(tp)
@@ -49,7 +52,10 @@
             v = memoryview(ob)
             try:
                 self.failUnlessEqual(v.format, fmt)
-                self.failUnlessEqual(len(v), sizeof(ob))
+                if shape is not None:
+                    self.failUnlessEqual(len(v), shape[0])
+                else:
+                    self.failUnlessEqual(len(v) * sizeof(itemtp), sizeof(ob))
                 self.failUnlessEqual(v.itemsize, sizeof(itemtp))
                 self.failUnlessEqual(v.shape, shape)
                 # ctypes object always have a non-strided memory block
@@ -61,7 +67,7 @@
                     n = 1
                     for dim in v.shape:
                         n = n * dim
-                    self.failUnlessEqual(v.itemsize * n, len(v))
+                    self.failUnlessEqual(n, len(v))
             except:
                 # so that we can see the failing type
                 print(tp)

Modified: python/branches/py3k-issue1717/Lib/ctypes/util.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/ctypes/util.py	(original)
+++ python/branches/py3k-issue1717/Lib/ctypes/util.py	Sun Jan 25 21:08:20 2009
@@ -89,20 +89,22 @@
         expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
         fdout, ccout = tempfile.mkstemp()
         os.close(fdout)
-        cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; else CC=cc; fi;' \
+        cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;' \
               '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name
         try:
             f = os.popen(cmd)
             try:
                 trace = f.read()
             finally:
-                f.close()
+                rv = f.close()
         finally:
             try:
                 os.unlink(ccout)
             except OSError as e:
                 if e.errno != errno.ENOENT:
                     raise
+        if rv == 10:
+            raise OSError('gcc or cc command not found')
         res = re.search(expr, trace)
         if not res:
             return None
@@ -129,7 +131,13 @@
             # assuming GNU binutils / ELF
             if not f:
                 return None
-            cmd = "objdump -p -j .dynamic 2>/dev/null " + f
+            cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10; fi;' \
+                  "objdump -p -j .dynamic 2>/dev/null " + f
+            f = os.popen(cmd)
+            dump = f.read()
+            rv = f.close()
+            if rv == 10:
+                raise OSError('objdump command not found')
             f = os.popen(cmd)
             try:
                 data = f.read()
@@ -193,8 +201,32 @@
                     return None
             return res.group(0)
 
+        def _findSoname_ldconfig(name):
+            import struct
+            if struct.calcsize('l') == 4:
+                machine = os.uname()[4] + '-32'
+            else:
+                machine = os.uname()[4] + '-64'
+            mach_map = {
+                'x86_64-64': 'libc6,x86-64',
+                'ppc64-64': 'libc6,64bit',
+                'sparc64-64': 'libc6,64bit',
+                's390x-64': 'libc6,64bit',
+                'ia64-64': 'libc6,IA-64',
+                }
+            abi_type = mach_map.get(machine, 'libc6')
+
+            # XXX assuming GLIBC's ldconfig (with option -p)
+            expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \
+                   % (abi_type, re.escape(name))
+            res = re.search(expr,
+                            os.popen('/sbin/ldconfig -p 2>/dev/null').read())
+            if not res:
+                return None
+            return res.group(1)
+
         def find_library(name):
-            return _get_soname(_findLib_ldconfig(name) or _findLib_gcc(name))
+            return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
 
 ################################################################
 # test code

Modified: python/branches/py3k-issue1717/Lib/decimal.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/decimal.py	(original)
+++ python/branches/py3k-issue1717/Lib/decimal.py	Sun Jan 25 21:08:20 2009
@@ -134,8 +134,8 @@
     'setcontext', 'getcontext', 'localcontext'
 ]
 
-import numbers as _numbers
 import copy as _copy
+import math as _math
 
 try:
     from collections import namedtuple as _namedtuple
@@ -217,7 +217,7 @@
         if args:
             ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True)
             return ans._fix_nan(context)
-        return NaN
+        return _NaN
 
 class ConversionSyntax(InvalidOperation):
     """Trying to convert badly formed string.
@@ -227,7 +227,7 @@
     syntax.  The result is [0,qNaN].
     """
     def handle(self, context, *args):
-        return NaN
+        return _NaN
 
 class DivisionByZero(DecimalException, ZeroDivisionError):
     """Division by 0.
@@ -243,7 +243,7 @@
     """
 
     def handle(self, context, sign, *args):
-        return Infsign[sign]
+        return _SignedInfinity[sign]
 
 class DivisionImpossible(InvalidOperation):
     """Cannot perform the division adequately.
@@ -254,7 +254,7 @@
     """
 
     def handle(self, context, *args):
-        return NaN
+        return _NaN
 
 class DivisionUndefined(InvalidOperation, ZeroDivisionError):
     """Undefined result of division.
@@ -265,7 +265,7 @@
     """
 
     def handle(self, context, *args):
-        return NaN
+        return _NaN
 
 class Inexact(DecimalException):
     """Had to round, losing information.
@@ -291,7 +291,7 @@
     """
 
     def handle(self, context, *args):
-        return NaN
+        return _NaN
 
 class Rounded(DecimalException):
     """Number got rounded (not  necessarily changed during rounding).
@@ -341,15 +341,15 @@
     def handle(self, context, sign, *args):
         if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN,
                                 ROUND_HALF_DOWN, ROUND_UP):
-            return Infsign[sign]
+            return _SignedInfinity[sign]
         if sign == 0:
             if context.rounding == ROUND_CEILING:
-                return Infsign[sign]
+                return _SignedInfinity[sign]
             return _dec_from_triple(sign, '9'*context.prec,
                             context.Emax-context.prec+1)
         if sign == 1:
             if context.rounding == ROUND_FLOOR:
-                return Infsign[sign]
+                return _SignedInfinity[sign]
             return _dec_from_triple(sign, '9'*context.prec,
                              context.Emax-context.prec+1)
 
@@ -500,7 +500,11 @@
 
 ##### Decimal class #######################################################
 
-class Decimal(_numbers.Real):
+# Do not subclass Decimal from numbers.Real and do not register it as such
+# (because Decimals are not interoperable with floats).  See the notes in
+# numbers.py for more detail.
+
+class Decimal(object):
     """Floating point class for decimal arithmetic."""
 
     __slots__ = ('_exp','_int','_sign', '_is_special')
@@ -654,6 +658,46 @@
 
         raise TypeError("Cannot convert %r to Decimal" % value)
 
+    # @classmethod, but @decorator is not valid Python 2.3 syntax, so
+    # don't use it (see notes on Py2.3 compatibility at top of file)
+    def from_float(cls, f):
+        """Converts a float to a decimal number, exactly.
+
+        Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
+        Since 0.1 is not exactly representable in binary floating point, the
+        value is stored as the nearest representable value which is
+        0x1.999999999999ap-4.  The exact equivalent of the value in decimal
+        is 0.1000000000000000055511151231257827021181583404541015625.
+
+        >>> Decimal.from_float(0.1)
+        Decimal('0.1000000000000000055511151231257827021181583404541015625')
+        >>> Decimal.from_float(float('nan'))
+        Decimal('NaN')
+        >>> Decimal.from_float(float('inf'))
+        Decimal('Infinity')
+        >>> Decimal.from_float(-float('inf'))
+        Decimal('-Infinity')
+        >>> Decimal.from_float(-0.0)
+        Decimal('-0')
+
+        """
+        if isinstance(f, int):                # handle integer inputs
+            return cls(f)
+        if _math.isinf(f) or _math.isnan(f):  # raises TypeError if not a float
+            return cls(repr(f))
+        if _math.copysign(1.0, f) == 1.0:
+            sign = 0
+        else:
+            sign = 1
+        n, d = abs(f).as_integer_ratio()
+        k = d.bit_length() - 1
+        result = _dec_from_triple(sign, str(n*5**k), -k)
+        if cls is Decimal:
+            return result
+        else:
+            return cls(result)
+    from_float = classmethod(from_float)
+
     def _isnan(self):
         """Returns whether the number is not actually one.
 
@@ -770,7 +814,7 @@
             else:
                 return 1
 
-        # check for zeros;  note that _cmp(0, -0) should return 0
+        # check for zeros;  Decimal('0') == Decimal('-0')
         if not self:
             if not other:
                 return 0
@@ -793,7 +837,7 @@
             if self_padded == other_padded:
                 return 0
             elif self_padded < other_padded:
-                return -((-1)**self._sign)
+                return -(-1)**self._sign
             else:
                 return (-1)**self._sign
         elif self_adjusted > other_adjusted:
@@ -1185,12 +1229,12 @@
             if self._isinfinity():
                 if not other:
                     return context._raise_error(InvalidOperation, '(+-)INF * 0')
-                return Infsign[resultsign]
+                return _SignedInfinity[resultsign]
 
             if other._isinfinity():
                 if not self:
                     return context._raise_error(InvalidOperation, '0 * (+-)INF')
-                return Infsign[resultsign]
+                return _SignedInfinity[resultsign]
 
         resultexp = self._exp + other._exp
 
@@ -1240,7 +1284,7 @@
                 return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF')
 
             if self._isinfinity():
-                return Infsign[sign]
+                return _SignedInfinity[sign]
 
             if other._isinfinity():
                 context._raise_error(Clamped, 'Division by infinity')
@@ -1340,7 +1384,7 @@
                 ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)')
                 return ans, ans
             else:
-                return (Infsign[sign],
+                return (_SignedInfinity[sign],
                         context._raise_error(InvalidOperation, 'INF % x'))
 
         if not other:
@@ -1488,7 +1532,7 @@
             if other._isinfinity():
                 return context._raise_error(InvalidOperation, 'INF // INF')
             else:
-                return Infsign[self._sign ^ other._sign]
+                return _SignedInfinity[self._sign ^ other._sign]
 
         if not other:
             if self:
@@ -1526,13 +1570,13 @@
 
     __trunc__ = __int__
 
-    @property
     def real(self):
         return self
+    real = property(real)
 
-    @property
     def imag(self):
         return Decimal(0)
+    imag = property(imag)
 
     def conjugate(self):
         return self
@@ -1728,14 +1772,10 @@
         >>> round(Decimal('Inf'))
         Traceback (most recent call last):
           ...
-          ...
-          ...
         OverflowError: cannot round an infinity
         >>> round(Decimal('NaN'))
         Traceback (most recent call last):
           ...
-          ...
-          ...
         ValueError: cannot round a NaN
 
         If a second argument n is supplied, self is rounded to n
@@ -1832,12 +1872,12 @@
                 if not other:
                     return context._raise_error(InvalidOperation,
                                                 'INF * 0 in fma')
-                product = Infsign[self._sign ^ other._sign]
+                product = _SignedInfinity[self._sign ^ other._sign]
             elif other._exp == 'F':
                 if not self:
                     return context._raise_error(InvalidOperation,
                                                 '0 * INF in fma')
-                product = Infsign[self._sign ^ other._sign]
+                product = _SignedInfinity[self._sign ^ other._sign]
         else:
             product = _dec_from_triple(self._sign ^ other._sign,
                                        str(int(self._int) * int(other._int)),
@@ -2187,7 +2227,7 @@
             if not self:
                 return context._raise_error(InvalidOperation, '0 ** 0')
             else:
-                return Dec_p1
+                return _One
 
         # result has sign 1 iff self._sign is 1 and other is an odd integer
         result_sign = 0
@@ -2209,19 +2249,19 @@
             if other._sign == 0:
                 return _dec_from_triple(result_sign, '0', 0)
             else:
-                return Infsign[result_sign]
+                return _SignedInfinity[result_sign]
 
         # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0
         if self._isinfinity():
             if other._sign == 0:
-                return Infsign[result_sign]
+                return _SignedInfinity[result_sign]
             else:
                 return _dec_from_triple(result_sign, '0', 0)
 
         # 1**other = 1, but the choice of exponent and the flags
         # depend on the exponent of self, and on whether other is a
         # positive integer, a negative integer, or neither
-        if self == Dec_p1:
+        if self == _One:
             if other._isinteger():
                 # exp = max(self._exp*max(int(other), 0),
                 # 1-context.prec) but evaluating int(other) directly
@@ -2254,7 +2294,7 @@
             if (other._sign == 0) == (self_adj < 0):
                 return _dec_from_triple(result_sign, '0', 0)
             else:
-                return Infsign[result_sign]
+                return _SignedInfinity[result_sign]
 
         # from here on, the result always goes through the call
         # to _fix at the end of this function.
@@ -2774,9 +2814,9 @@
         """
         # if one is negative and the other is positive, it's easy
         if self._sign and not other._sign:
-            return Dec_n1
+            return _NegativeOne
         if not self._sign and other._sign:
-            return Dec_p1
+            return _One
         sign = self._sign
 
         # let's handle both NaN types
@@ -2786,51 +2826,51 @@
             if self_nan == other_nan:
                 if self._int < other._int:
                     if sign:
-                        return Dec_p1
+                        return _One
                     else:
-                        return Dec_n1
+                        return _NegativeOne
                 if self._int > other._int:
                     if sign:
-                        return Dec_n1
+                        return _NegativeOne
                     else:
-                        return Dec_p1
-                return Dec_0
+                        return _One
+                return _Zero
 
             if sign:
                 if self_nan == 1:
-                    return Dec_n1
+                    return _NegativeOne
                 if other_nan == 1:
-                    return Dec_p1
+                    return _One
                 if self_nan == 2:
-                    return Dec_n1
+                    return _NegativeOne
                 if other_nan == 2:
-                    return Dec_p1
+                    return _One
             else:
                 if self_nan == 1:
-                    return Dec_p1
+                    return _One
                 if other_nan == 1:
-                    return Dec_n1
+                    return _NegativeOne
                 if self_nan == 2:
-                    return Dec_p1
+                    return _One
                 if other_nan == 2:
-                    return Dec_n1
+                    return _NegativeOne
 
         if self < other:
-            return Dec_n1
+            return _NegativeOne
         if self > other:
-            return Dec_p1
+            return _One
 
         if self._exp < other._exp:
             if sign:
-                return Dec_p1
+                return _One
             else:
-                return Dec_n1
+                return _NegativeOne
         if self._exp > other._exp:
             if sign:
-                return Dec_n1
+                return _NegativeOne
             else:
-                return Dec_p1
-        return Dec_0
+                return _One
+        return _Zero
 
 
     def compare_total_mag(self, other):
@@ -2871,11 +2911,11 @@
 
         # exp(-Infinity) = 0
         if self._isinfinity() == -1:
-            return Dec_0
+            return _Zero
 
         # exp(0) = 1
         if not self:
-            return Dec_p1
+            return _One
 
         # exp(Infinity) = Infinity
         if self._isinfinity() == 1:
@@ -3027,15 +3067,15 @@
 
         # ln(0.0) == -Infinity
         if not self:
-            return negInf
+            return _NegativeInfinity
 
         # ln(Infinity) = Infinity
         if self._isinfinity() == 1:
-            return Inf
+            return _Infinity
 
         # ln(1.0) == 0.0
-        if self == Dec_p1:
-            return Dec_0
+        if self == _One:
+            return _Zero
 
         # ln(negative) raises InvalidOperation
         if self._sign == 1:
@@ -3107,11 +3147,11 @@
 
         # log10(0.0) == -Infinity
         if not self:
-            return negInf
+            return _NegativeInfinity
 
         # log10(Infinity) = Infinity
         if self._isinfinity() == 1:
-            return Inf
+            return _Infinity
 
         # log10(negative or -Infinity) raises InvalidOperation
         if self._sign == 1:
@@ -3163,7 +3203,7 @@
 
         # logb(+/-Inf) = +Inf
         if self._isinfinity():
-            return Inf
+            return _Infinity
 
         # logb(0) = -Inf, DivisionByZero
         if not self:
@@ -3233,7 +3273,7 @@
         (opa, opb) = self._fill_logical(context, self._int, other._int)
 
         # make the operation, and clean starting zeroes
-        result = "".join(str(int(a)|int(b)) for a,b in zip(opa,opb))
+        result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)])
         return _dec_from_triple(0, result.lstrip('0') or '0', 0)
 
     def logical_xor(self, other, context=None):
@@ -3247,7 +3287,7 @@
         (opa, opb) = self._fill_logical(context, self._int, other._int)
 
         # make the operation, and clean starting zeroes
-        result = "".join(str(int(a)^int(b)) for a,b in zip(opa,opb))
+        result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)])
         return _dec_from_triple(0, result.lstrip('0') or '0', 0)
 
     def max_mag(self, other, context=None):
@@ -3320,7 +3360,7 @@
             return ans
 
         if self._isinfinity() == -1:
-            return negInf
+            return _NegativeInfinity
         if self._isinfinity() == 1:
             return _dec_from_triple(0, '9'*context.prec, context.Etop())
 
@@ -3343,7 +3383,7 @@
             return ans
 
         if self._isinfinity() == 1:
-            return Inf
+            return _Infinity
         if self._isinfinity() == -1:
             return _dec_from_triple(1, '9'*context.prec, context.Etop())
 
@@ -3842,6 +3882,23 @@
                                      "diagnostic info too long in NaN")
         return d._fix(self)
 
+    def create_decimal_from_float(self, f):
+        """Creates a new Decimal instance from a float but rounding using self
+        as the context.
+
+        >>> context = Context(prec=5, rounding=ROUND_DOWN)
+        >>> context.create_decimal_from_float(3.1415926535897932)
+        Decimal('3.1415')
+        >>> context = Context(prec=5, traps=[Inexact])
+        >>> context.create_decimal_from_float(3.1415926535897932)
+        Traceback (most recent call last):
+            ...
+        decimal.Inexact: None
+
+        """
+        d = Decimal.from_float(f)       # An exact conversion
+        return d._fix(self)             # Apply the context rounding
+
     # Methods
     def abs(self, a):
         """Returns the absolute value of the operand.
@@ -5584,15 +5641,15 @@
 ##### Useful Constants (internal use only) ################################
 
 # Reusable defaults
-Inf = Decimal('Inf')
-negInf = Decimal('-Inf')
-NaN = Decimal('NaN')
-Dec_0 = Decimal(0)
-Dec_p1 = Decimal(1)
-Dec_n1 = Decimal(-1)
+_Infinity = Decimal('Inf')
+_NegativeInfinity = Decimal('-Inf')
+_NaN = Decimal('NaN')
+_Zero = Decimal(0)
+_One = Decimal(1)
+_NegativeOne = Decimal(-1)
 
-# Infsign[sign] is infinity w/ that sign
-Infsign = (Inf, negInf)
+# _SignedInfinity[sign] is infinity w/ that sign
+_SignedInfinity = (_Infinity, _NegativeInfinity)
 
 
 

Modified: python/branches/py3k-issue1717/Lib/distutils/command/register.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/distutils/command/register.py	(original)
+++ python/branches/py3k-issue1717/Lib/distutils/command/register.py	Sun Jan 25 21:08:20 2009
@@ -174,19 +174,23 @@
                           log.INFO)
 
             # possibly save the login
-            if not self.has_config and code == 200:
-                self.announce(('I can store your PyPI login so future '
-                               'submissions will be faster.'), log.INFO)
-                self.announce('(the login will be stored in %s)' % \
-                              self._get_rc_file(), log.INFO)
-
-                choice = 'X'
-                while choice.lower() not in 'yn':
-                    choice = input('Save your login (y/N)?')
-                    if not choice:
-                        choice = 'n'
-                if choice.lower() == 'y':
-                    self._store_pypirc(username, password)
+            if code == 200:
+                if self.has_config:
+                    # sharing the password in the distribution instance
+                    # so the upload command can reuse it
+                    self.distribution.password = password
+                else:
+                    self.announce(('I can store your PyPI login so future '
+                                   'submissions will be faster.'), log.INFO)
+                    self.announce('(the login will be stored in %s)' % \
+                                  self._get_rc_file(), log.INFO)
+                    choice = 'X'
+                    while choice.lower() not in 'yn':
+                        choice = input('Save your login (y/N)?')
+                        if not choice:
+                            choice = 'n'
+                    if choice.lower() == 'y':
+                        self._store_pypirc(username, password)
 
         elif choice == '2':
             data = {':action': 'user'}

Modified: python/branches/py3k-issue1717/Lib/distutils/command/sdist.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/distutils/command/sdist.py	(original)
+++ python/branches/py3k-issue1717/Lib/distutils/command/sdist.py	Sun Jan 25 21:08:20 2009
@@ -4,7 +4,10 @@
 
 __revision__ = "$Id$"
 
-import sys, os
+import os
+import string
+import sys
+from types import *
 from glob import glob
 from distutils.core import Command
 from distutils import dir_util, dep_util, file_util, archive_util
@@ -332,9 +335,18 @@
 
         self.filelist.exclude_pattern(None, prefix=build.build_base)
         self.filelist.exclude_pattern(None, prefix=base_dir)
-        self.filelist.exclude_pattern(r'(^|/)(RCS|CVS|\.svn|\.hg|\.git|\.bzr|_darcs)/.*', is_regex=1)
 
-    def write_manifest(self):
+        if sys.platform == 'win32':
+            seps = r'/|\\'
+        else:
+            seps = '/'
+
+        vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr',
+                    '_darcs']
+        vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps)
+        self.filelist.exclude_pattern(vcs_ptrn, is_regex=1)
+
+    def write_manifest (self):
         """Write the file list in 'self.filelist' (presumably as filled in
         by 'add_defaults()' and 'read_template()') to the manifest file
         named by 'self.manifest'.

Modified: python/branches/py3k-issue1717/Lib/distutils/command/upload.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/distutils/command/upload.py	(original)
+++ python/branches/py3k-issue1717/Lib/distutils/command/upload.py	Sun Jan 25 21:08:20 2009
@@ -48,6 +48,11 @@
             self.repository = config['repository']
             self.realm = config['realm']
 
+        # getting the password from the distribution
+        # if previously set by the register command
+        if not self.password and self.distribution.password:
+            self.password = self.distribution.password
+
     def run(self):
         if not self.distribution.dist_files:
             raise DistutilsOptionError("No dist file created in earlier command")

Modified: python/branches/py3k-issue1717/Lib/distutils/config.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/distutils/config.py	(original)
+++ python/branches/py3k-issue1717/Lib/distutils/config.py	Sun Jan 25 21:08:20 2009
@@ -82,12 +82,12 @@
                 for server in _servers:
                     current = {'server': server}
                     current['username'] = config.get(server, 'username')
-                    current['password'] = config.get(server, 'password')
 
                     # optional params
                     for key, default in (('repository',
                                           self.DEFAULT_REPOSITORY),
-                                         ('realm', self.DEFAULT_REALM)):
+                                         ('realm', self.DEFAULT_REALM),
+                                         ('password', None)):
                         if config.has_option(server, key):
                             current[key] = config.get(server, key)
                         else:

Modified: python/branches/py3k-issue1717/Lib/distutils/dist.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/distutils/dist.py	(original)
+++ python/branches/py3k-issue1717/Lib/distutils/dist.py	Sun Jan 25 21:08:20 2009
@@ -199,6 +199,7 @@
         self.extra_path = None
         self.scripts = None
         self.data_files = None
+        self.password = ''
 
         # And now initialize bookkeeping stuff that can't be supplied by
         # the caller at all.  'command_obj' maps command names to

Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_msvc9compiler.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/distutils/tests/test_msvc9compiler.py	(original)
+++ python/branches/py3k-issue1717/Lib/distutils/tests/test_msvc9compiler.py	Sun Jan 25 21:08:20 2009
@@ -13,6 +13,10 @@
         if sys.platform != 'win32':
             # this test is only for win32
             return
+        from distutils.msvccompiler import get_build_version
+        if get_build_version() < 8.0:
+            # this test is only for MSVC8.0 or above
+            return
         from distutils.msvc9compiler import query_vcvarsall
         def _find_vcvarsall(version):
             return None

Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_register.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/distutils/tests/test_register.py	(original)
+++ python/branches/py3k-issue1717/Lib/distutils/tests/test_register.py	Sun Jan 25 21:08:20 2009
@@ -2,6 +2,7 @@
 import sys
 import os
 import unittest
+import getpass
 
 from distutils.command.register import register
 from distutils.core import Distribution
@@ -9,7 +10,27 @@
 from distutils.tests import support
 from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase
 
-class RawInputs(object):
+PYPIRC_NOPASSWORD = """\
+[distutils]
+
+index-servers =
+    server1
+
+[server1]
+username:me
+"""
+
+WANTED_PYPIRC = """\
+[distutils]
+index-servers =
+    pypi
+
+[pypi]
+username:tarek
+password:password
+"""
+
+class Inputs(object):
     """Fakes user inputs."""
     def __init__(self, *answers):
         self.answers = answers
@@ -21,18 +42,33 @@
         finally:
             self.index += 1
 
-WANTED_PYPIRC = """\
-[distutils]
-index-servers =
-    pypi
-
-[pypi]
-username:tarek
-password:xxx
-"""
+class FakeServer(object):
+    """Fakes a PyPI server"""
+    def __init__(self):
+        self.calls = []
+
+    def __call__(self, *args):
+        # we want to compare them, so let's store
+        # something comparable
+        els = list(args[0].items())
+        els.sort()
+        self.calls.append(tuple(els))
+        return 200, 'OK'
 
 class registerTestCase(PyPIRCCommandTestCase):
 
+    def setUp(self):
+        PyPIRCCommandTestCase.setUp(self)
+        # patching the password prompt
+        self._old_getpass = getpass.getpass
+        def _getpass(prompt):
+            return 'password'
+        getpass.getpass = _getpass
+
+    def tearDown(self):
+        getpass.getpass = self._old_getpass
+        PyPIRCCommandTestCase.tearDown(self)
+
     def test_create_pypirc(self):
         # this test makes sure a .pypirc file
         # is created when requested.
@@ -50,30 +86,17 @@
         # we shouldn't have a .pypirc file yet
         self.assert_(not os.path.exists(self.rc))
 
-        # patching raw_input and getpass.getpass
+        # patching input and getpass.getpass
         # so register gets happy
         #
         # Here's what we are faking :
         # use your existing login (choice 1.)
         # Username : 'tarek'
-        # Password : 'xxx'
+        # Password : 'password'
         # Save your login (y/N)? : 'y'
-        inputs = RawInputs('1', 'tarek', 'y')
+        inputs = Inputs('1', 'tarek', 'y')
         from distutils.command import register as register_module
         register_module.input = inputs.__call__
-        def _getpass(prompt):
-            return 'xxx'
-        register_module.getpass.getpass = _getpass
-        class FakeServer(object):
-            def __init__(self):
-                self.calls = []
-
-            def __call__(self, *args):
-                # we want to compare them, so let's store
-                # something comparable
-                els = sorted(args[0].items())
-                self.calls.append(tuple(els))
-                return 200, 'OK'
 
         cmd.post_to_server = pypi_server = FakeServer()
 
@@ -101,6 +124,24 @@
         self.assert_(len(pypi_server.calls), 2)
         self.assert_(pypi_server.calls[0], pypi_server.calls[1])
 
+    def test_password_not_in_file(self):
+
+        f = open(self.rc, 'w')
+        f.write(PYPIRC_NOPASSWORD)
+        f.close()
+
+        dist = Distribution()
+        cmd = register(dist)
+        cmd.post_to_server = FakeServer()
+
+        cmd._set_config()
+        cmd.finalize_options()
+        cmd.send_metadata()
+
+        # dist.password should be set
+        # therefore used afterwards by other commands
+        self.assertEquals(dist.password, 'password')
+
 def test_suite():
     return unittest.makeSuite(registerTestCase)
 

Modified: python/branches/py3k-issue1717/Lib/distutils/tests/test_upload.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/distutils/tests/test_upload.py	(original)
+++ python/branches/py3k-issue1717/Lib/distutils/tests/test_upload.py	Sun Jan 25 21:08:20 2009
@@ -9,6 +9,17 @@
 from distutils.tests import support
 from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase
 
+PYPIRC_NOPASSWORD = """\
+[distutils]
+
+index-servers =
+    server1
+
+[server1]
+username:me
+"""
+
+
 class uploadTestCase(PyPIRCCommandTestCase):
 
     def test_finalize_options(self):
@@ -26,6 +37,24 @@
                              ('repository', 'http://pypi.python.org/pypi')):
             self.assertEquals(getattr(cmd, attr), waited)
 
+    def test_saved_password(self):
+        # file with no password
+        f = open(self.rc, 'w')
+        f.write(PYPIRC_NOPASSWORD)
+        f.close()
+
+        # make sure it passes
+        dist = Distribution()
+        cmd = upload(dist)
+        cmd.finalize_options()
+        self.assertEquals(cmd.password, None)
+
+        # make sure we get it as well, if another command
+        # initialized it at the dist level
+        dist.password = 'xxx'
+        cmd = upload(dist)
+        cmd.finalize_options()
+        self.assertEquals(cmd.password, 'xxx')
 
 def test_suite():
     return unittest.makeSuite(uploadTestCase)

Modified: python/branches/py3k-issue1717/Lib/fractions.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/fractions.py	(original)
+++ python/branches/py3k-issue1717/Lib/fractions.py	Sun Jan 25 21:08:20 2009
@@ -109,7 +109,7 @@
 
         """
         if isinstance(f, numbers.Integral):
-            f = float(f)
+            return cls(f)
         elif not isinstance(f, float):
             raise TypeError("%s.from_float() only takes floats, not %r (%s)" %
                             (cls.__name__, f, type(f).__name__))

Modified: python/branches/py3k-issue1717/Lib/gzip.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/gzip.py	(original)
+++ python/branches/py3k-issue1717/Lib/gzip.py	Sun Jan 25 21:08:20 2009
@@ -54,7 +54,7 @@
     max_read_chunk = 10 * 1024 * 1024   # 10Mb
 
     def __init__(self, filename=None, mode=None,
-                 compresslevel=9, fileobj=None):
+                 compresslevel=9, fileobj=None, mtime=None):
         """Constructor for the GzipFile class.
 
         At least one of fileobj and filename must be given a
@@ -81,6 +81,15 @@
         level of compression; 1 is fastest and produces the least compression,
         and 9 is slowest and produces the most compression.  The default is 9.
 
+        The mtime argument is an optional numeric timestamp to be written
+        to the stream when compressing.  All gzip compressed streams
+        are required to contain a timestamp.  If omitted or None, the
+        current time is used.  This module ignores the timestamp when
+        decompressing; however, some programs, such as gunzip, make use
+        of it.  The format of the timestamp is the same as that of the
+        return value of time.time() and of the st_mtime member of the
+        object returned by os.stat().
+
         """
 
         # guarantee the file is opened in binary mode on platforms
@@ -119,6 +128,7 @@
 
         self.fileobj = fileobj
         self.offset = 0
+        self.mtime = mtime
 
         if self.mode == WRITE:
             self._write_gzip_header()
@@ -157,7 +167,10 @@
         if fname:
             flags = FNAME
         self.fileobj.write(chr(flags).encode('latin-1'))
-        write32u(self.fileobj, int(time.time()))
+        mtime = self.mtime
+        if mtime is None:
+            mtime = time.time()
+        write32u(self.fileobj, int(mtime))
         self.fileobj.write(b'\002')
         self.fileobj.write(b'\377')
         if fname:
@@ -175,10 +188,10 @@
         if method != 8:
             raise IOError('Unknown compression method')
         flag = ord( self.fileobj.read(1) )
-        # modtime = self.fileobj.read(4)
+        self.mtime = read32(self.fileobj)
         # extraflag = self.fileobj.read(1)
         # os = self.fileobj.read(1)
-        self.fileobj.read(6)
+        self.fileobj.read(2)
 
         if flag & FEXTRA:
             # Read & discard the extra field, if present
@@ -459,6 +472,14 @@
         else:
             raise StopIteration
 
+    def __enter__(self):
+        if self.fileobj is None:
+            raise ValueError("I/O operation on closed GzipFile object")
+        return self
+
+    def __exit__(self, *args):
+        self.close()
+
 
 def _test():
     # Act like gzip; with -d, act like gunzip.
@@ -473,8 +494,8 @@
     for arg in args:
         if decompress:
             if arg == "-":
-                f = GzipFile(filename="", mode="rb", fileobj=sys.stdin)
-                g = sys.stdout
+                f = GzipFile(filename="", mode="rb", fileobj=sys.stdin.buffer)
+                g = sys.stdout.buffer
             else:
                 if arg[-3:] != ".gz":
                     print("filename doesn't end in .gz:", repr(arg))
@@ -483,8 +504,8 @@
                 g = builtins.open(arg[:-3], "wb")
         else:
             if arg == "-":
-                f = sys.stdin
-                g = GzipFile(filename="", mode="wb", fileobj=sys.stdout)
+                f = sys.stdin.buffer
+                g = GzipFile(filename="", mode="wb", fileobj=sys.stdout.buffer)
             else:
                 f = builtins.open(arg, "rb")
                 g = open(arg + ".gz", "wb")

Modified: python/branches/py3k-issue1717/Lib/heapq.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/heapq.py	(original)
+++ python/branches/py3k-issue1717/Lib/heapq.py	Sun Jan 25 21:08:20 2009
@@ -1,4 +1,4 @@
-# -*- coding: Latin-1 -*-
+# -*- coding: latin-1 -*-
 
 """Heap queue algorithm (a.k.a. priority queue).
 
@@ -129,7 +129,7 @@
 __all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge',
            'nlargest', 'nsmallest', 'heappushpop']
 
-from itertools import islice, repeat, count, tee
+from itertools import islice, repeat, count, tee, chain
 from operator import itemgetter, neg
 import bisect
 
@@ -354,9 +354,34 @@
 
     Equivalent to:  sorted(iterable, key=key)[:n]
     """
+    # Short-cut for n==1 is to use min() when len(iterable)>0
+    if n == 1:
+        it = iter(iterable)
+        head = list(islice(it, 1))
+        if not head:
+            return []
+        if key is None:
+            return [min(chain(head, it))]
+        return [min(chain(head, it), key=key)]
+
+    # When n>=size, it's faster to use sort()
+    try:
+        size = len(iterable)
+    except (TypeError, AttributeError):
+        pass
+    else:
+        if n >= size:
+            return sorted(iterable, key=key)[:n]
+
+    # When key is none, use simpler decoration
+    if key is None:
+        it = zip(iterable, count())                         # decorate
+        result = _nsmallest(n, it)
+        return list(map(itemgetter(0), result))             # undecorate
+
+    # General case, slowest method
     in1, in2 = tee(iterable)
-    keys = in1 if key is None else map(key, in1)
-    it = zip(keys, count(), in2)                           # decorate
+    it = zip(map(key, in1), count(), in2)                   # decorate
     result = _nsmallest(n, it)
     return list(map(itemgetter(2), result))                 # undecorate
 
@@ -366,9 +391,35 @@
 
     Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]
     """
+
+    # Short-cut for n==1 is to use max() when len(iterable)>0
+    if n == 1:
+        it = iter(iterable)
+        head = list(islice(it, 1))
+        if not head:
+            return []
+        if key is None:
+            return [max(chain(head, it))]
+        return [max(chain(head, it), key=key)]
+
+    # When n>=size, it's faster to use sort()
+    try:
+        size = len(iterable)
+    except (TypeError, AttributeError):
+        pass
+    else:
+        if n >= size:
+            return sorted(iterable, key=key, reverse=True)[:n]
+
+    # When key is none, use simpler decoration
+    if key is None:
+        it = zip(iterable, map(neg, count()))               # decorate
+        result = _nlargest(n, it)
+        return list(map(itemgetter(0), result))             # undecorate
+
+    # General case, slowest method
     in1, in2 = tee(iterable)
-    keys = in1 if key is None else map(key, in1)
-    it = zip(keys, map(neg, count()), in2)                 # decorate
+    it = zip(map(key, in1), map(neg, count()), in2)         # decorate
     result = _nlargest(n, it)
     return list(map(itemgetter(2), result))                 # undecorate
 

Modified: python/branches/py3k-issue1717/Lib/http/client.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/http/client.py	(original)
+++ python/branches/py3k-issue1717/Lib/http/client.py	Sun Jan 25 21:08:20 2009
@@ -697,6 +697,7 @@
         """Send the currently buffered request and clear the buffer.
 
         Appends an extra \\r\\n to the buffer.
+        A message_body may be specified, to be appended to the request.
         """
         self._buffer.extend((b"", b""))
         msg = b"\r\n".join(self._buffer)
@@ -704,9 +705,14 @@
         # If msg and message_body are sent in a single send() call,
         # it will avoid performance problems caused by the interaction
         # between delayed ack and the Nagle algorithim.
-        if message_body is not None:
+        if isinstance(message_body, bytes):
             msg += message_body
+            message_body = None
         self.send(msg)
+        if message_body is not None:
+            #message_body was not a string (i.e. it is a file) and
+            #we must run the risk of Nagle
+            self.send(message_body)
 
     def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):
         """Send a request to the server.
@@ -894,12 +900,7 @@
             self._set_content_length(body)
         for hdr, value in headers.items():
             self.putheader(hdr, value)
-        if isinstance(body, str):
-            self.endheaders(body.encode('ascii'))
-        else:
-            self.endheaders()
-            if body:  # when body is a file rather than a string
-                self.send(body)
+        self.endheaders(body.encode('ascii') if isinstance(body, str) else body)
 
     def getresponse(self):
         """Get the response from the server."""

Modified: python/branches/py3k-issue1717/Lib/idlelib/EditorWindow.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/idlelib/EditorWindow.py	(original)
+++ python/branches/py3k-issue1717/Lib/idlelib/EditorWindow.py	Sun Jan 25 21:08:20 2009
@@ -82,7 +82,7 @@
                     # Safari requires real file:-URLs
                     EditorWindow.help_url = 'file://' + EditorWindow.help_url
             else:
-                EditorWindow.help_url = "http://docs.python.org/dev/3.0/"
+                EditorWindow.help_url = "http://docs.python.org/%d.%d" % sys.version_info[:2]
         currentTheme=idleConf.CurrentTheme()
         self.flist = flist
         root = root or flist.root

Modified: python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py	(original)
+++ python/branches/py3k-issue1717/Lib/idlelib/IOBinding.py	Sun Jan 25 21:08:20 2009
@@ -7,7 +7,7 @@
 import tkinter.messagebox as tkMessageBox
 import re
 from tkinter import *
-from tkinter.simpledialog import SimpleDialog
+from tkinter.simpledialog import askstring
 
 from idlelib.configHandler import idleConf
 
@@ -74,10 +74,11 @@
     Raise a LookupError if the encoding is declared but unknown.
     """
     if isinstance(data, bytes):
-        try:
-            lines = data.decode('utf-8')
-        except UnicodeDecodeError:
-            return None
+        # This encoding might be wrong. However, the coding
+        # spec must be ASCII-only, so any non-ASCII characters
+        # around here will be ignored. Decoding to Latin-1 should
+        # never fail (except for memory outage)
+        lines = data.decode('iso-8859-1')
     else:
         lines = data
     # consider only the first two lines
@@ -210,7 +211,7 @@
         except IOError as msg:
             tkMessageBox.showerror("I/O Error", str(msg), master=self.text)
             return False
-        chars = self._decode(two_lines, bytes)
+        chars, converted = self._decode(two_lines, bytes)
         if chars is None:
             tkMessageBox.showerror("Decoding Error",
                                    "File %s\nFailed to Decode" % filename,
@@ -226,6 +227,10 @@
         self.text.insert("1.0", chars)
         self.reset_undo()
         self.set_filename(filename)
+        if converted:
+            # We need to save the conversion results first
+            # before being able to execute the code
+            self.set_saved(False)
         self.text.mark_set("insert", "1.0")
         self.text.see("insert")
         self.updaterecentfileslist(filename)
@@ -240,11 +245,11 @@
                 chars = bytes[3:].decode("utf-8")
             except UnicodeDecodeError:
                 # has UTF-8 signature, but fails to decode...
-                return None
+                return None, False
             else:
                 # Indicates that this file originally had a BOM
                 self.fileencoding = 'BOM'
-                return chars
+                return chars, False
         # Next look for coding specification
         try:
             enc = coding_spec(two_lines)
@@ -256,36 +261,48 @@
                 master = self.text)
             enc = None
         except UnicodeDecodeError:
-            return None
+            return None, False
         if enc:
             try:
                 chars = str(bytes, enc)
                 self.fileencoding = enc
-                return chars
+                return chars, False
             except UnicodeDecodeError:
                 pass
         # Try ascii:
         try:
             chars = str(bytes, 'ascii')
             self.fileencoding = None
-            return chars
+            return chars, False
         except UnicodeDecodeError:
             pass
         # Try utf-8:
         try:
             chars = str(bytes, 'utf-8')
             self.fileencoding = 'utf-8'
-            return chars
+            return chars, False
         except UnicodeDecodeError:
             pass
         # Finally, try the locale's encoding. This is deprecated;
         # the user should declare a non-ASCII encoding
         try:
-            chars = str(bytes, locale_encoding)
-            self.fileencoding = locale_encoding
-        except UnicodeDecodeError:
+            # Wait for the editor window to appear
+            self.editwin.text.update()
+            enc = askstring(
+                "Specify file encoding",
+                "The file's encoding is invalid for Python 3.x.\n"
+                "IDLE will convert it to UTF-8.\n"
+                "What is the current encoding of the file?",
+                initialvalue = locale_encoding,
+                parent = self.editwin.text)
+
+            if enc:
+                chars = str(bytes, enc)
+                self.fileencoding = None
+            return chars, True
+        except (UnicodeDecodeError, LookupError):
             pass
-        return chars  # None on failure
+        return None, False  # None on failure
 
     def maybesave(self):
         if self.get_saved():

Modified: python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt
==============================================================================
--- python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt	(original)
+++ python/branches/py3k-issue1717/Lib/idlelib/NEWS.txt	Sun Jan 25 21:08:20 2009
@@ -3,11 +3,21 @@
 
 *Release date: XX-XXX-XXXX*
 
+- Issue #4815: Offer conversion to UTF-8 if source files have
+  no encoding declaration and are not encoded in UTF-8.
+
+- Issue #4008: Fix problems with non-ASCII source files.
+
 - Issue #4323: Always encode source as UTF-8 without asking
   the user (unless a different encoding is declared); remove
   user configuration of source encoding; all according to
   PEP 3120.
 
+- Issue #3549: On MacOS the preferences menu was not present
+
+- Issue #2665: On Windows, an IDLE installation upgraded from an old version
+  would not start if a custom theme was defined.
+
 
 What's New in IDLE 3.0a3?
 =========================

Modified: python/branches/py3k-issue1717/Lib/idlelib/ScriptBinding.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/idlelib/ScriptBinding.py	(original)
+++ python/branches/py3k-issue1717/Lib/idlelib/ScriptBinding.py	Sun Jan 25 21:08:20 2009
@@ -24,7 +24,7 @@
 import tokenize
 import tkinter.messagebox as tkMessageBox
 from idlelib.EditorWindow import EditorWindow
-from idlelib import PyShell
+from idlelib import PyShell, IOBinding
 
 from idlelib.configHandler import idleConf
 
@@ -62,7 +62,13 @@
             return 'break'
 
     def tabnanny(self, filename):
-        f = open(filename, 'r')
+        # XXX: tabnanny should work on binary files as well
+        with open(filename, 'r', encoding='iso-8859-1') as f:
+            two_lines = f.readline() + f.readline()
+        encoding = IOBinding.coding_spec(two_lines)
+        if not encoding:
+            encoding = 'utf-8'
+        f = open(filename, 'r', encoding=encoding)
         try:
             tabnanny.process_tokens(tokenize.generate_tokens(f.readline))
         except tokenize.TokenError as msg:
@@ -82,14 +88,14 @@
         self.shell = shell = self.flist.open_shell()
         saved_stream = shell.get_warning_stream()
         shell.set_warning_stream(shell.stderr)
-        f = open(filename, 'r')
+        f = open(filename, 'rb')
         source = f.read()
         f.close()
-        if '\r' in source:
-            source = re.sub(r"\r\n", "\n", source)
-            source = re.sub(r"\r", "\n", source)
-        if source and source[-1] != '\n':
-            source = source + '\n'
+        if b'\r' in source:
+            source = source.replace(b'\r\n', b'\n')
+            source = source.replace(b'\r', b'\n')
+        if source and source[-1] != ord(b'\n'):
+            source = source + b'\n'
         editwin = self.editwin
         text = editwin.text
         text.tag_remove("ERROR", "1.0", "end")

Modified: python/branches/py3k-issue1717/Lib/idlelib/help.txt
==============================================================================
--- python/branches/py3k-issue1717/Lib/idlelib/help.txt	(original)
+++ python/branches/py3k-issue1717/Lib/idlelib/help.txt	Sun Jan 25 21:08:20 2009
@@ -90,7 +90,10 @@
 	Configure IDLE -- Open a configuration dialog.  Fonts, indentation,
                           keybindings, and color themes may be altered.
                           Startup Preferences may be set, and Additional Help
-                          Souces can be specified.
+                          Sources can be specified.
+			  
+			  On MacOS X this menu is not present, use
+			  menu 'IDLE -> Preferences...' instead.
 	---
 	Code Context --	  Open a pane at the top of the edit window which
 			  shows the block context of the section of code

Modified: python/branches/py3k-issue1717/Lib/idlelib/macosxSupport.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/idlelib/macosxSupport.py	(original)
+++ python/branches/py3k-issue1717/Lib/idlelib/macosxSupport.py	Sun Jan 25 21:08:20 2009
@@ -89,7 +89,9 @@
 
     ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding
     tkversion = root.tk.eval('info patchlevel')
-    if tkversion >= '8.4.14':
+    # Note: we cannot check if the string tkversion >= '8.4.14', because
+    # the string '8.4.7' is greater than the string '8.4.14'.
+    if tuple(map(int, tkversion.split('.'))) >= (8, 4, 14):
         Bindings.menudefs[0] =  ('application', [
                 ('About IDLE', '<<about-idle>>'),
                 None,

Modified: python/branches/py3k-issue1717/Lib/inspect.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/inspect.py	(original)
+++ python/branches/py3k-issue1717/Lib/inspect.py	Sun Jan 25 21:08:20 2009
@@ -63,7 +63,7 @@
     Class objects provide these attributes:
         __doc__         documentation string
         __module__      name of module in which this class was defined"""
-    return isinstance(object, type) or hasattr(object, '__bases__')
+    return isinstance(object, type)
 
 def ismethod(object):
     """Return true if the object is an instance method.
@@ -158,9 +158,8 @@
     Generator function objects provides same attributes as functions.
 
     See isfunction.__doc__ for attributes listing."""
-    if (isfunction(object) or ismethod(object)) and \
-        object.__code__.co_flags & CO_GENERATOR:
-        return True
+    return bool((isfunction(object) or ismethod(object)) and
+                object.__code__.co_flags & CO_GENERATOR)
 
 def isgenerator(object):
     """Return true if the object is a generator.
@@ -250,7 +249,10 @@
     Optionally, only return members that satisfy a given predicate."""
     results = []
     for key in dir(object):
-        value = getattr(object, key)
+        try:
+            value = getattr(object, key)
+        except AttributeError:
+            continue
         if not predicate or predicate(value):
             results.append((key, value))
     results.sort()
@@ -879,8 +881,8 @@
     specs = []
     if defaults:
         firstdefault = len(args) - len(defaults)
-    for i in range(len(args)):
-        spec = strseq(args[i], formatargandannotation, join)
+    for i, arg in enumerate(args):
+        spec = strseq(arg, formatargandannotation, join)
         if defaults and i >= firstdefault:
             spec = spec + formatvalue(defaults[i - firstdefault])
         specs.append(spec)
@@ -892,7 +894,7 @@
     if kwonlyargs:
         for kwonlyarg in kwonlyargs:
             spec = formatargandannotation(kwonlyarg)
-            if kwonlyarg in kwonlydefaults:
+            if kwonlydefaults and kwonlyarg in kwonlydefaults:
                 spec += formatvalue(kwonlydefaults[kwonlyarg])
             specs.append(spec)
     if varkw is not None:

Modified: python/branches/py3k-issue1717/Lib/io.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/io.py	(original)
+++ python/branches/py3k-issue1717/Lib/io.py	Sun Jan 25 21:08:20 2009
@@ -340,6 +340,7 @@
 
     def tell(self) -> int:
         """Return current stream position."""
+        self._checkClosed()
         return self.seek(0, 1)
 
     def truncate(self, pos: int = None) -> int:
@@ -358,6 +359,8 @@
         This is not implemented for read-only and non-blocking streams.
         """
         # XXX Should this return the number of bytes written???
+        if self.__closed:
+            raise ValueError("I/O operation on closed file.")
 
     __closed = False
 
@@ -530,6 +533,7 @@
         lines will be read if the total size (in bytes/characters) of all
         lines so far exceeds hint.
         """
+        self._checkClosed()
         if hint is None or hint <= 0:
             return list(self)
         n = 0
@@ -567,6 +571,7 @@
         Returns an empty bytes object on EOF, or None if the object is
         set not to block and has no data to read.
         """
+        self._checkClosed()
         if n is None:
             n = -1
         if n < 0:
@@ -578,6 +583,7 @@
 
     def readall(self):
         """Read until EOF, using multiple read() call."""
+        self._checkClosed()
         res = bytearray()
         while True:
             data = self.read(DEFAULT_BUFFER_SIZE)
@@ -673,6 +679,7 @@
         data at the moment.
         """
         # XXX This ought to work with anything that supports the buffer API
+        self._checkClosed()
         data = self.read(len(b))
         n = len(data)
         try:
@@ -787,13 +794,11 @@
     def getvalue(self):
         """Return the bytes value (contents) of the buffer
         """
-        if self.closed:
-            raise ValueError("getvalue on closed file")
+        self._checkClosed()
         return bytes(self._buffer)
 
     def read(self, n=None):
-        if self.closed:
-            raise ValueError("read from closed file")
+        self._checkClosed()
         if n is None:
             n = -1
         if n < 0:
@@ -811,8 +816,7 @@
         return self.read(n)
 
     def write(self, b):
-        if self.closed:
-            raise ValueError("write to closed file")
+        self._checkClosed()
         if isinstance(b, str):
             raise TypeError("can't write str to binary stream")
         n = len(b)
@@ -829,8 +833,7 @@
         return n
 
     def seek(self, pos, whence=0):
-        if self.closed:
-            raise ValueError("seek on closed file")
+        self._checkClosed()
         try:
             pos = pos.__index__()
         except AttributeError as err:
@@ -848,13 +851,11 @@
         return self._pos
 
     def tell(self):
-        if self.closed:
-            raise ValueError("tell on closed file")
+        self._checkClosed()
         return self._pos
 
     def truncate(self, pos=None):
-        if self.closed:
-            raise ValueError("truncate on closed file")
+        self._checkClosed()
         if pos is None:
             pos = self._pos
         elif pos < 0:
@@ -914,6 +915,7 @@
         mode. If n is negative, read until EOF or until read() would
         block.
         """
+        self._checkClosed()
         with self._read_lock:
             return self._read_unlocked(n)
 
@@ -970,6 +972,7 @@
         do at most one raw read to satisfy it.  We never return more
         than self.buffer_size.
         """
+        self._checkClosed()
         with self._read_lock:
             return self._peek_unlocked(n)
 
@@ -988,6 +991,7 @@
         """Reads up to n bytes, with at most one read() system call."""
         # Returns up to n bytes.  If at least one byte is buffered, we
         # only return buffered bytes.  Otherwise, we do one raw read.
+        self._checkClosed()
         if n <= 0:
             return b""
         with self._read_lock:
@@ -996,9 +1000,11 @@
                 min(n, len(self._read_buf) - self._read_pos))
 
     def tell(self):
+        self._checkClosed()
         return self.raw.tell() - len(self._read_buf) + self._read_pos
 
     def seek(self, pos, whence=0):
+        self._checkClosed()
         with self._read_lock:
             if whence == 1:
                 pos -= len(self._read_buf) - self._read_pos
@@ -1029,8 +1035,7 @@
         self._write_lock = Lock()
 
     def write(self, b):
-        if self.closed:
-            raise ValueError("write to closed file")
+        self._checkClosed()
         if isinstance(b, str):
             raise TypeError("can't write str to binary stream")
         with self._write_lock:
@@ -1060,6 +1065,7 @@
             return written
 
     def truncate(self, pos=None):
+        self._checkClosed()
         with self._write_lock:
             self._flush_unlocked()
             if pos is None:
@@ -1067,12 +1073,11 @@
             return self.raw.truncate(pos)
 
     def flush(self):
+        self._checkClosed()
         with self._write_lock:
             self._flush_unlocked()
 
     def _flush_unlocked(self):
-        if self.closed:
-            raise ValueError("flush of closed file")
         written = 0
         try:
             while self._write_buf:
@@ -1086,9 +1091,11 @@
             raise BlockingIOError(e.errno, e.strerror, written)
 
     def tell(self):
+        self._checkClosed()
         return self.raw.tell() + len(self._write_buf)
 
     def seek(self, pos, whence=0):
+        self._checkClosed()
         with self._write_lock:
             self._flush_unlocked()
             return self.raw.seek(pos, whence)
@@ -1186,6 +1193,7 @@
         return pos
 
     def tell(self):
+        self._checkClosed()
         if self._write_buf:
             return self.raw.tell() + len(self._write_buf)
         else:
@@ -1217,6 +1225,7 @@
         return BufferedReader.read1(self, n)
 
     def write(self, b):
+        self._checkClosed()
         if self._read_buf:
             # Undo readahead
             with self._read_lock:
@@ -1474,8 +1483,7 @@
         return self.buffer.isatty()
 
     def write(self, s: str):
-        if self.closed:
-            raise ValueError("write to closed file")
+        self._checkClosed()
         if not isinstance(s, str):
             raise TypeError("can't write %s to text stream" %
                             s.__class__.__name__)
@@ -1583,6 +1591,7 @@
         return position, dec_flags, bytes_to_feed, need_eof, chars_to_skip
 
     def tell(self):
+        self._checkClosed()
         if not self._seekable:
             raise IOError("underlying stream is not seekable")
         if not self._telling:
@@ -1653,8 +1662,7 @@
         return self.buffer.truncate()
 
     def seek(self, cookie, whence=0):
-        if self.closed:
-            raise ValueError("tell on closed file")
+        self._checkClosed()
         if not self._seekable:
             raise IOError("underlying stream is not seekable")
         if whence == 1: # seek relative to current position
@@ -1712,6 +1720,7 @@
         return cookie
 
     def read(self, n=None):
+        self._checkClosed()
         if n is None:
             n = -1
         decoder = self._decoder or self._get_decoder()
@@ -1732,6 +1741,7 @@
             return result
 
     def __next__(self):
+        self._checkClosed()
         self._telling = False
         line = self.readline()
         if not line:
@@ -1741,8 +1751,7 @@
         return line
 
     def readline(self, limit=None):
-        if self.closed:
-            raise ValueError("read from closed file")
+        self._checkClosed()
         if limit is None:
             limit = -1
 
@@ -1963,8 +1972,7 @@
 
         def getvalue(self) -> str:
             """Retrieve the entire contents of the object."""
-            if self.closed:
-                raise ValueError("read on closed file")
+            self._checkClosed()
             return self._getvalue()
 
         def write(self, s: str) -> int:
@@ -1972,8 +1980,7 @@
 
             Returns the number of characters written.
             """
-            if self.closed:
-                raise ValueError("write to closed file")
+            self._checkClosed()
             if not isinstance(s, str):
                 raise TypeError("can't write %s to text stream" %
                                 s.__class__.__name__)
@@ -1990,8 +1997,7 @@
             If the argument is negative or omitted, read until EOF
             is reached. Return an empty string at EOF.
             """
-            if self.closed:
-                raise ValueError("read to closed file")
+            self._checkClosed()
             if n is None:
                 n = -1
             res = self._pending
@@ -2006,8 +2012,7 @@
 
         def tell(self) -> int:
             """Tell the current file position."""
-            if self.closed:
-                raise ValueError("tell from closed file")
+            self._checkClosed()
             if self._pending:
                 return self._tell() - len(self._pending)
             else:
@@ -2022,8 +2027,7 @@
                 2  End of stream - pos must be 0.
             Returns the new absolute position.
             """
-            if self.closed:
-                raise ValueError("seek from closed file")
+            self._checkClosed()
             self._pending = ""
             return self._seek(pos, whence)
 
@@ -2034,14 +2038,12 @@
             returned by tell().  Imply an absolute seek to pos.
             Returns the new absolute position.
             """
-            if self.closed:
-                raise ValueError("truncate from closed file")
+            self._checkClosed()
             self._pending = ""
             return self._truncate(pos)
 
         def readline(self, limit: int = None) -> str:
-            if self.closed:
-                raise ValueError("read from closed file")
+            self._checkClosed()
             if limit is None:
                 limit = -1
             if limit >= 0:

Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixer_util.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/fixer_util.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/fixer_util.py	Sun Jan 25 21:08:20 2009
@@ -222,6 +222,29 @@
             return True
     return False
 
+def is_probably_builtin(node):
+    """
+    Check that something isn't an attribute or function name etc.
+    """
+    prev = node.get_prev_sibling()
+    if prev is not None and prev.type == token.DOT:
+        # Attribute lookup.
+        return False
+    parent = node.parent
+    if parent.type in (syms.funcdef, syms.classdef):
+        return False
+    if parent.type == syms.expr_stmt and parent.children[0] is node:
+        # Assignment.
+        return False
+    if parent.type == syms.parameters or \
+            (parent.type == syms.typedargslist and (
+            (prev is not None and prev.type == token.COMMA) or
+            parent.children[0] is node
+            )):
+        # The name of an argument.
+        return False
+    return True
+
 ###########################################################
 ### The following functions are to find bindings in a suite
 ###########################################################

Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_execfile.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_execfile.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_execfile.py	Sun Jan 25 21:08:20 2009
@@ -7,9 +7,9 @@
 exec() function.
 """
 
-from .. import pytree
 from .. import fixer_base
-from ..fixer_util import Comma, Name, Call, LParen, RParen, Dot
+from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node,
+                          ArgList, String, syms)
 
 
 class FixExecfile(fixer_base.BaseFix):
@@ -22,16 +22,30 @@
 
     def transform(self, node, results):
         assert results
-        syms = self.syms
         filename = results["filename"]
         globals = results.get("globals")
         locals = results.get("locals")
-        args = [Name('open'), LParen(), filename.clone(), RParen(), Dot(),
-                Name('read'), LParen(), RParen()]
-        args[0].set_prefix("")
+
+        # Copy over the prefix from the right parentheses end of the execfile
+        # call.
+        execfile_paren = node.children[-1].children[-1].clone()
+        # Construct open().read().
+        open_args = ArgList([filename.clone()], rparen=execfile_paren)
+        open_call = Node(syms.power, [Name("open"), open_args])
+        read = [Node(syms.trailer, [Dot(), Name('read')]),
+                Node(syms.trailer, [LParen(), RParen()])]
+        open_expr = [open_call] + read
+        # Wrap the open call in a compile call. This is so the filename will be
+        # preserved in the execed code.
+        filename_arg = filename.clone()
+        filename_arg.set_prefix(" ")
+        exec_str = String("'exec'", " ")
+        compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str]
+        compile_call = Call(Name("compile"), compile_args, "")
+        # Finally, replace the execfile call with an exec call.
+        args = [compile_call]
         if globals is not None:
             args.extend([Comma(), globals.clone()])
         if locals is not None:
             args.extend([Comma(), locals.clone()])
-
         return Call(Name("exec"), args, prefix=node.get_prefix())

Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_import.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_import.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_import.py	Sun Jan 25 21:08:20 2009
@@ -13,55 +13,78 @@
 # Local imports
 from .. import fixer_base
 from os.path import dirname, join, exists, pathsep
-from ..fixer_util import FromImport, syms
+from ..fixer_util import FromImport, syms, token
+
+
+def traverse_imports(names):
+    """
+    Walks over all the names imported in a dotted_as_names node.
+    """
+    pending = [names]
+    while pending:
+        node = pending.pop()
+        if node.type == token.NAME:
+            yield node.value
+        elif node.type == syms.dotted_name:
+            yield "".join([ch.value for ch in node.children])
+        elif node.type == syms.dotted_as_name:
+            pending.append(node.children[0])
+        elif node.type == syms.dotted_as_names:
+            pending.extend(node.children[::-2])
+        else:
+            raise AssertionError("unkown node type")
+
 
 class FixImport(fixer_base.BaseFix):
 
     PATTERN = """
-    import_from< type='from' imp=any 'import' ['('] any [')'] >
+    import_from< 'from' imp=any 'import' ['('] any [')'] >
     |
-    import_name< type='import' imp=any >
+    import_name< 'import' imp=any >
     """
 
     def transform(self, node, results):
         imp = results['imp']
 
-        mod_name = str(imp.children[0] if imp.type == syms.dotted_as_name \
-                               else imp)
-
-        if str(imp).startswith('.'):
-            # Already a new-style import
-            return
-
-        if not probably_a_local_import(str(mod_name), self.filename):
-            # I guess this is a global import -- skip it!
-            return
-
-        if results['type'].value == 'from':
+        if node.type == syms.import_from:
             # Some imps are top-level (eg: 'import ham')
             # some are first level (eg: 'import ham.eggs')
             # some are third level (eg: 'import ham.eggs as spam')
             # Hence, the loop
             while not hasattr(imp, 'value'):
                 imp = imp.children[0]
-            imp.value = "." + imp.value
-            node.changed()
+            if self.probably_a_local_import(imp.value):
+                imp.value = "." + imp.value
+                imp.changed()
+                return node
         else:
-            new = FromImport('.', getattr(imp, 'content', None) or [imp])
+            have_local = False
+            have_absolute = False
+            for mod_name in traverse_imports(imp):
+                if self.probably_a_local_import(mod_name):
+                    have_local = True
+                else:
+                    have_absolute = True
+            if have_absolute:
+                if have_local:
+                    # We won't handle both sibling and absolute imports in the
+                    # same statement at the moment.
+                    self.warning(node, "absolute and local imports together")
+                return
+
+            new = FromImport('.', [imp])
             new.set_prefix(node.get_prefix())
-            node = new
-        return node
+            return new
 
-def probably_a_local_import(imp_name, file_path):
-    # Must be stripped because the right space is included by the parser
-    imp_name = imp_name.split('.', 1)[0].strip()
-    base_path = dirname(file_path)
-    base_path = join(base_path, imp_name)
-    # If there is no __init__.py next to the file its not in a package
-    # so can't be a relative import.
-    if not exists(join(dirname(base_path), '__init__.py')):
+    def probably_a_local_import(self, imp_name):
+        imp_name = imp_name.split('.', 1)[0]
+        base_path = dirname(self.filename)
+        base_path = join(base_path, imp_name)
+        # If there is no __init__.py next to the file its not in a package
+        # so can't be a relative import.
+        if not exists(join(dirname(base_path), '__init__.py')):
+            return False
+        for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']:
+            if exists(base_path + ext):
+                return True
         return False
-    for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']:
-        if exists(base_path + ext):
-            return True
-    return False

Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports.py	Sun Jan 25 21:08:20 2009
@@ -25,7 +25,6 @@
            'tkFont': 'tkinter.font',
            'tkMessageBox': 'tkinter.messagebox',
            'ScrolledText': 'tkinter.scrolledtext',
-           'turtle': 'tkinter.turtle',
            'Tkconstants': 'tkinter.constants',
            'Tix': 'tkinter.tix',
            'Tkinter': 'tkinter',
@@ -89,6 +88,10 @@
     # This is overridden in fix_imports2.
     mapping = MAPPING
 
+    # We want to run this fixer late, so fix_import doesn't try to make stdlib
+    # renames into relative imports.
+    run_order = 6
+
     def build_pattern(self):
         return "|".join(build_pattern(self.mapping))
 
@@ -118,7 +121,7 @@
     def transform(self, node, results):
         import_mod = results.get("module_name")
         if import_mod:
-            new_name = self.mapping[(import_mod or mod_name).value]
+            new_name = self.mapping[import_mod.value]
             import_mod.replace(Name(new_name, prefix=import_mod.get_prefix()))
             if "name_import" in results:
                 # If it's not a "from x import x, y" or "import x as y" import,
@@ -129,10 +132,8 @@
                 # line (e.g., "import StringIO, urlparse"). The problem is that I
                 # can't figure out an easy way to make a pattern recognize the
                 # keys of MAPPING randomly sprinkled in an import statement.
-                while True:
-                    results = self.match(node)
-                    if not results:
-                        break
+                results = self.match(node)
+                if results:
                     self.transform(node, results)
         else:
             # Replace usage of the module.

Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports2.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports2.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_imports2.py	Sun Jan 25 21:08:20 2009
@@ -11,6 +11,6 @@
 
 class FixImports2(fix_imports.FixImports):
 
-    run_order = 6
+    run_order = 7
 
     mapping = MAPPING

Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_long.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_long.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_long.py	Sun Jan 25 21:08:20 2009
@@ -5,20 +5,18 @@
 """
 
 # Local imports
-from .. import pytree
 from .. import fixer_base
-from ..fixer_util import Name, Number
+from ..fixer_util import Name, Number, is_probably_builtin
 
 
 class FixLong(fixer_base.BaseFix):
 
     PATTERN = "'long'"
 
-    static_long = Name("long")
     static_int = Name("int")
 
     def transform(self, node, results):
-        assert node == self.static_long, node
-        new = self.static_int.clone()
-        new.set_prefix(node.get_prefix())
-        return new
+        if is_probably_builtin(node):
+            new = self.static_int.clone()
+            new.set_prefix(node.get_prefix())
+            return new

Modified: python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_urllib.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_urllib.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/fixes/fix_urllib.py	Sun Jan 25 21:08:20 2009
@@ -15,7 +15,10 @@
                      '_urlopener', 'urlcleanup']),
                 ('urllib.parse',
                     ['quote', 'quote_plus', 'unquote', 'unquote_plus',
-                     'urlencode', 'pahtname2url', 'url2pathname']),
+                     'urlencode', 'pathname2url', 'url2pathname', 'splitattr',
+                     'splithost', 'splitnport', 'splitpasswd', 'splitport',
+                     'splitquery', 'splittag', 'splittype', 'splituser',
+                     'splitvalue', ]),
                 ('urllib.error',
                     ['ContentTooShortError'])],
            'urllib2' : [
@@ -34,12 +37,12 @@
                      'FTPHandler', 'CacheFTPHandler',
                      'UnknownHandler']),
                 ('urllib.error',
-                    ['URLError', 'HTTPError'])],
+                    ['URLError', 'HTTPError']),
+           ]
 }
 
-
-# def alternates(members):
-#     return "(" + "|".join(map(repr, members)) + ")"
+# Duplicate the url parsing functions for urllib2.
+MAPPING["urllib2"].append(MAPPING["urllib"][1])
 
 
 def build_pattern():

Modified: python/branches/py3k-issue1717/Lib/lib2to3/main.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/main.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/main.py	Sun Jan 25 21:08:20 2009
@@ -41,7 +41,7 @@
         super(StdoutRefactoringTool, self).write_file(new_text,
                                                       filename, old_text)
         if not self.nobackups:
-            shutil.copymode(filename, backup)
+            shutil.copymode(backup, filename)
 
     def print_output(self, lines):
         for line in lines:

Modified: python/branches/py3k-issue1717/Lib/lib2to3/pgen2/driver.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/pgen2/driver.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/pgen2/driver.py	Sun Jan 25 21:08:20 2009
@@ -77,7 +77,8 @@
                 column = 0
         else:
             # We never broke out -- EOF is too soon (how can this happen???)
-            raise parse.ParseError("incomplete input", t, v, x)
+            raise parse.ParseError("incomplete input",
+                                   type, value, (prefix, start))
         return p.rootnode
 
     def parse_stream_raw(self, stream, debug=False):

Modified: python/branches/py3k-issue1717/Lib/lib2to3/refactor.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/refactor.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/refactor.py	Sun Jan 25 21:08:20 2009
@@ -287,17 +287,13 @@
         Returns:
             True if the tree was modified, False otherwise.
         """
-        # Two calls to chain are required because pre_order.values()
-        #   will be a list of lists of fixers:
-        #   [[<fixer ...>, <fixer ...>], [<fixer ...>]]
-        all_fixers = chain(self.pre_order, self.post_order)
-        for fixer in all_fixers:
+        for fixer in chain(self.pre_order, self.post_order):
             fixer.start_tree(tree, name)
 
         self.traverse_by(self.pre_order_heads, tree.pre_order())
         self.traverse_by(self.post_order_heads, tree.post_order())
 
-        for fixer in all_fixers:
+        for fixer in chain(self.pre_order, self.post_order):
             fixer.finish_tree(tree, name)
         return tree.was_changed
 

Modified: python/branches/py3k-issue1717/Lib/lib2to3/tests/data/py3_test_grammar.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/tests/data/py3_test_grammar.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/tests/data/py3_test_grammar.py	Sun Jan 25 21:08:20 2009
@@ -485,6 +485,14 @@
         global a, b
         global one, two, three, four, five, six, seven, eight, nine, ten
 
+    def testNonlocal(self):
+        # 'nonlocal' NAME (',' NAME)*
+        x = 0
+        y = 0
+        def f():
+            nonlocal x
+            nonlocal x, y
+
     def testAssert(self):
         # assert_stmt: 'assert' test [',' test]
         assert 1

Modified: python/branches/py3k-issue1717/Lib/lib2to3/tests/test_fixers.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/lib2to3/tests/test_fixers.py	(original)
+++ python/branches/py3k-issue1717/Lib/lib2to3/tests/test_fixers.py	Sun Jan 25 21:08:20 2009
@@ -1073,11 +1073,72 @@
         a = """z = type(x) in (int, int)"""
         self.check(b, a)
 
+    def test_unchanged(self):
+        s = """long = True"""
+        self.unchanged(s)
+
+        s = """s.long = True"""
+        self.unchanged(s)
+
+        s = """def long(): pass"""
+        self.unchanged(s)
+
+        s = """class long(): pass"""
+        self.unchanged(s)
+
+        s = """def f(long): pass"""
+        self.unchanged(s)
+
+        s = """def f(g, long): pass"""
+        self.unchanged(s)
+
+        s = """def f(x, long=True): pass"""
+        self.unchanged(s)
+
     def test_prefix_preservation(self):
         b = """x =   long(  x  )"""
         a = """x =   int(  x  )"""
         self.check(b, a)
 
+
+class Test_execfile(FixerTestCase):
+    fixer = "execfile"
+
+    def test_conversion(self):
+        b = """execfile("fn")"""
+        a = """exec(compile(open("fn").read(), "fn", 'exec'))"""
+        self.check(b, a)
+
+        b = """execfile("fn", glob)"""
+        a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)"""
+        self.check(b, a)
+
+        b = """execfile("fn", glob, loc)"""
+        a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)"""
+        self.check(b, a)
+
+        b = """execfile("fn", globals=glob)"""
+        a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)"""
+        self.check(b, a)
+
+        b = """execfile("fn", locals=loc)"""
+        a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)"""
+        self.check(b, a)
+
+        b = """execfile("fn", globals=glob, locals=loc)"""
+        a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)"""
+        self.check(b, a)
+
+    def test_spacing(self):
+        b = """execfile( "fn" )"""
+        a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))"""
+        self.check(b, a)
+
+        b = """execfile("fn",  globals = glob)"""
+        a = """exec(compile(open("fn").read(), "fn", 'exec'),  globals = glob)"""
+        self.check(b, a)
+
+
 class Test_isinstance(FixerTestCase):
     fixer = "isinstance"
 
@@ -3466,11 +3527,30 @@
         a = "from . import foo, bar"
         self.check_both(b, a)
 
+        b = "import foo, bar, x"
+        a = "from . import foo, bar, x"
+        self.check_both(b, a)
+
+        b = "import x, y, z"
+        a = "from . import x, y, z"
+        self.check_both(b, a)
+
     def test_import_as(self):
         b = "import foo as x"
         a = "from . import foo as x"
         self.check_both(b, a)
 
+        b = "import a as b, b as c, c as d"
+        a = "from . import a as b, b as c, c as d"
+        self.check_both(b, a)
+
+    def test_local_and_absolute(self):
+        self.always_exists = False
+        self.present_files = set(["foo.py", "__init__.py"])
+
+        s = "import foo, bar"
+        self.warns_unchanged(s, "absolute and local imports together")
+
     def test_dotted_import(self):
         b = "import foo.bar"
         a = "from . import foo.bar"

Modified: python/branches/py3k-issue1717/Lib/logging/__init__.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/logging/__init__.py	(original)
+++ python/branches/py3k-issue1717/Lib/logging/__init__.py	Sun Jan 25 21:08:20 2009
@@ -18,7 +18,7 @@
 Logging package for Python. Based on PEP 282 and comments thereto in
 comp.lang.python, and influenced by Apache's log4j system.
 
-Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved.
 
 To use, simply 'import logging' and log away!
 """
@@ -43,8 +43,8 @@
 
 __author__  = "Vinay Sajip <vinay_sajip at red-dove.com>"
 __status__  = "production"
-__version__ = "0.5.0.6"
-__date__    = "03 December 2008"
+__version__ = "0.5.0.7"
+__date__    = "20 January 2009"
 
 #---------------------------------------------------------------------------
 #   Miscellaneous module data
@@ -99,6 +99,11 @@
 logThreads = 1
 
 #
+# If you don't want multiprocessing information in the log, set this to zero
+#
+logMultiprocessing = 1
+
+#
 # If you don't want process information in the log, set this to zero
 #
 logProcesses = 1
@@ -263,6 +268,11 @@
         else:
             self.thread = None
             self.threadName = None
+        if logMultiprocessing:
+            from multiprocessing import current_process
+            self.processName = current_process().name
+        else:
+            self.processName = None
         if logProcesses and hasattr(os, 'getpid'):
             self.process = os.getpid()
         else:
@@ -727,7 +737,6 @@
         if strm is None:
             strm = sys.stderr
         self.stream = strm
-        self.formatter = None
 
     def flush(self):
         """
@@ -782,10 +791,12 @@
         self.mode = mode
         self.encoding = encoding
         if delay:
+            #We don't open the stream, but we still need to call the
+            #Handler constructor to set level, formatter, lock etc.
+            Handler.__init__(self)
             self.stream = None
         else:
-            stream = self._open()
-            StreamHandler.__init__(self, stream)
+            StreamHandler.__init__(self, self._open())
 
     def close(self):
         """
@@ -817,8 +828,7 @@
         constructor, open it before calling the superclass's emit.
         """
         if self.stream is None:
-            stream = self._open()
-            StreamHandler.__init__(self, stream)
+            self.stream = self._open()
         StreamHandler.emit(self, record)
 
 #---------------------------------------------------------------------------

Modified: python/branches/py3k-issue1717/Lib/logging/handlers.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/logging/handlers.py	(original)
+++ python/branches/py3k-issue1717/Lib/logging/handlers.py	Sun Jan 25 21:08:20 2009
@@ -19,9 +19,9 @@
 based on PEP 282 and comments thereto in comp.lang.python, and influenced by
 Apache's log4j system.
 
-Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved.
 
-To use, simply 'import logging' and log away!
+To use, simply 'import logging.handlers' and log away!
 """
 
 import logging, socket, os, pickle, struct, time, re
@@ -112,8 +112,8 @@
         """
         Do a rollover, as described in __init__().
         """
-
-        self.stream.close()
+        if self.stream:
+            self.stream.close()
         if self.backupCount > 0:
             for i in range(self.backupCount - 1, 0, -1):
                 sfn = "%s.%d" % (self.baseFilename, i)
@@ -138,6 +138,8 @@
         Basically, see if the supplied record would cause the file to exceed
         the size limit we have.
         """
+        if self.stream is None:                 # delay was set...
+            self.stream = self._open()
         if self.maxBytes > 0:                   # are we rolling over?
             msg = "%s\n" % self.format(record)
             self.stream.seek(0, 2)  #due to non-posix-compliant Windows feature
@@ -302,7 +304,8 @@
         then we have to get a list of matching filenames, sort them and remove
         the one with the oldest suffix.
         """
-        self.stream.close()
+        if self.stream:
+            self.stream.close()
         # get the time that this sequence started at and make it a TimeTuple
         t = self.rolloverAt - self.interval
         if self.utc:
@@ -1024,9 +1027,7 @@
                 h.putheader("Content-type",
                             "application/x-www-form-urlencoded")
                 h.putheader("Content-length", str(len(data)))
-            h.endheaders()
-            if self.method == "POST":
-                h.send(data)
+            h.endheaders(data if self.method == "POST" else None)
             h.getreply()    #can't do anything with the result
         except (KeyboardInterrupt, SystemExit):
             raise

Modified: python/branches/py3k-issue1717/Lib/multiprocessing/__init__.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/multiprocessing/__init__.py	(original)
+++ python/branches/py3k-issue1717/Lib/multiprocessing/__init__.py	Sun Jan 25 21:08:20 2009
@@ -48,7 +48,7 @@
     'allow_connection_pickling', 'BufferTooShort', 'TimeoutError',
     'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition',
     'Event', 'Queue', 'JoinableQueue', 'Pool', 'Value', 'Array',
-    'RawValue', 'RawArray'
+    'RawValue', 'RawArray', 'SUBDEBUG', 'SUBWARNING',
     ]
 
 __author__ = 'R. Oudkerk (r.m.oudkerk at gmail.com)'
@@ -61,6 +61,7 @@
 import sys
 
 from multiprocessing.process import Process, current_process, active_children
+from multiprocessing.util import SUBDEBUG, SUBWARNING
 
 #
 # Exceptions

Modified: python/branches/py3k-issue1717/Lib/multiprocessing/forking.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/multiprocessing/forking.py	(original)
+++ python/branches/py3k-issue1717/Lib/multiprocessing/forking.py	Sun Jan 25 21:08:20 2009
@@ -151,14 +151,10 @@
     import _subprocess
     import time
 
+    from pickle import dump, load, HIGHEST_PROTOCOL
     from ._multiprocessing import win32, Connection, PipeConnection
     from .util import Finalize
 
-    #try:
-    #    from cPickle import dump, load, HIGHEST_PROTOCOL
-    #except ImportError:
-    from pickle import load, HIGHEST_PROTOCOL
-
     def dump(obj, file, protocol=None):
         ForkingPickler(file, protocol).dump(obj)
 

Modified: python/branches/py3k-issue1717/Lib/multiprocessing/managers.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/multiprocessing/managers.py	(original)
+++ python/branches/py3k-issue1717/Lib/multiprocessing/managers.py	Sun Jan 25 21:08:20 2009
@@ -21,16 +21,12 @@
 import queue
 
 from traceback import format_exc
+from pickle import PicklingError
 from multiprocessing import Process, current_process, active_children, Pool, util, connection
 from multiprocessing.process import AuthenticationString
 from multiprocessing.forking import exit, Popen, assert_spawning, ForkingPickler
 from multiprocessing.util import Finalize, info
 
-try:
-    from cPickle import PicklingError
-except ImportError:
-    from pickle import PicklingError
-
 #
 # Register some things for pickling
 #
@@ -143,7 +139,7 @@
         self.listener = Listener(address=address, backlog=5)
         self.address = self.listener.address
 
-        self.id_to_obj = {0: (None, ())}
+        self.id_to_obj = {'0': (None, ())}
         self.id_to_refcount = {}
         self.mutex = threading.RLock()
         self.stop = 0
@@ -305,7 +301,7 @@
             keys = list(self.id_to_obj.keys())
             keys.sort()
             for ident in keys:
-                if ident != 0:
+                if ident != '0':
                     result.append('  %s:       refcount=%s\n    %s' %
                                   (ident, self.id_to_refcount[ident],
                                    str(self.id_to_obj[ident][0])[:75]))
@@ -317,7 +313,7 @@
         '''
         Number of shared objects
         '''
-        return len(self.id_to_obj) - 1      # don't count ident=0
+        return len(self.id_to_obj) - 1      # don't count ident='0'
 
     def shutdown(self, c):
         '''

Modified: python/branches/py3k-issue1717/Lib/multiprocessing/sharedctypes.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/multiprocessing/sharedctypes.py	(original)
+++ python/branches/py3k-issue1717/Lib/multiprocessing/sharedctypes.py	Sun Jan 25 21:08:20 2009
@@ -66,9 +66,12 @@
     Return a synchronization wrapper for a Value
     '''
     obj = RawValue(typecode_or_type, *args)
-    if lock is None:
+    if lock is False:
+        return obj
+    if lock in (True, None):
         lock = RLock()
-    assert hasattr(lock, 'acquire')
+    if not hasattr(lock, 'acquire'):
+        raise AttributeError("'%r' has no method 'acquire'" % lock)
     return synchronized(obj, lock)
 
 def Array(typecode_or_type, size_or_initializer, **kwds):
@@ -79,9 +82,12 @@
     if kwds:
         raise ValueError('unrecognized keyword argument(s): %s' % list(kwds.keys()))
     obj = RawArray(typecode_or_type, size_or_initializer)
-    if lock is None:
+    if lock is False:
+        return obj
+    if lock in (True, None):
         lock = RLock()
-    assert hasattr(lock, 'acquire')
+    if not hasattr(lock, 'acquire'):
+        raise AttributeError("'%r' has no method 'acquire'" % lock)
     return synchronized(obj, lock)
 
 def copy(obj):

Modified: python/branches/py3k-issue1717/Lib/multiprocessing/util.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/multiprocessing/util.py	(original)
+++ python/branches/py3k-issue1717/Lib/multiprocessing/util.py	Sun Jan 25 21:08:20 2009
@@ -17,7 +17,8 @@
 __all__ = [
     'sub_debug', 'debug', 'info', 'sub_warning', 'get_logger',
     'log_to_stderr', 'get_temp_dir', 'register_after_fork',
-    'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal'
+    'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal',
+    'SUBDEBUG', 'SUBWARNING',
     ]
 
 #
@@ -57,60 +58,47 @@
     Returns logger used by multiprocessing
     '''
     global _logger
-
-    if not _logger:
-        import logging, atexit
-
-        # XXX multiprocessing should cleanup before logging
-        if hasattr(atexit, 'unregister'):
-            atexit.unregister(_exit_function)
-            atexit.register(_exit_function)
-        else:
-            atexit._exithandlers.remove((_exit_function, (), {}))
-            atexit._exithandlers.append((_exit_function, (), {}))
-
-        _check_logger_class()
-        _logger = logging.getLogger(LOGGER_NAME)
-
-    return _logger
-
-def _check_logger_class():
-    '''
-    Make sure process name is recorded when loggers are used
-    '''
-    # XXX This function is unnecessary once logging is patched
-    import logging
-    if hasattr(logging, 'multiprocessing'):
-        return
+    import logging, atexit
 
     logging._acquireLock()
     try:
-        OldLoggerClass = logging.getLoggerClass()
-        if not getattr(OldLoggerClass, '_process_aware', False):
-            class ProcessAwareLogger(OldLoggerClass):
-                _process_aware = True
-                def makeRecord(self, *args, **kwds):
-                    record = OldLoggerClass.makeRecord(self, *args, **kwds)
-                    record.processName = current_process()._name
-                    return record
-            logging.setLoggerClass(ProcessAwareLogger)
+        if not _logger:
+
+            _logger = logging.getLogger(LOGGER_NAME)
+            _logger.propagate = 0
+            logging.addLevelName(SUBDEBUG, 'SUBDEBUG')
+            logging.addLevelName(SUBWARNING, 'SUBWARNING')
+
+            # XXX multiprocessing should cleanup before logging
+            if hasattr(atexit, 'unregister'):
+                atexit.unregister(_exit_function)
+                atexit.register(_exit_function)
+            else:
+                atexit._exithandlers.remove((_exit_function, (), {}))
+                atexit._exithandlers.append((_exit_function, (), {}))
+
     finally:
         logging._releaseLock()
 
+    return _logger
+
 def log_to_stderr(level=None):
     '''
     Turn on logging and add a handler which prints to stderr
     '''
     global _log_to_stderr
     import logging
+
     logger = get_logger()
     formatter = logging.Formatter(DEFAULT_LOGGING_FORMAT)
     handler = logging.StreamHandler()
     handler.setFormatter(formatter)
     logger.addHandler(handler)
-    if level is not None:
+
+    if level:
         logger.setLevel(level)
     _log_to_stderr = True
+    return _logger
 
 #
 # Function returning a temp directory which will be removed on exit

Modified: python/branches/py3k-issue1717/Lib/pickle.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/pickle.py	(original)
+++ python/branches/py3k-issue1717/Lib/pickle.py	Sun Jan 25 21:08:20 2009
@@ -470,7 +470,7 @@
             else:
                 self.write(LONG4 + pack("<i", n) + encoded)
             return
-        self.write(LONG + repr(obj).encode("ascii") + b'\n')
+        self.write(LONG + repr(obj).encode("ascii") + b'L\n')
     dispatch[int] = save_long
 
     def save_float(self, obj, pack=struct.pack):
@@ -830,7 +830,7 @@
         return k
 
     def persistent_load(self, pid):
-        raise UnpickingError("unsupported persistent id encountered")
+        raise UnpicklingError("unsupported persistent id encountered")
 
     dispatch = {}
 
@@ -890,6 +890,8 @@
 
     def load_long(self):
         val = self.readline()[:-1].decode("ascii")
+        if val and val[-1] == 'L':
+            val = val[:-1]
         self.append(int(val, 0))
     dispatch[LONG[0]] = load_long
 

Modified: python/branches/py3k-issue1717/Lib/pickletools.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/pickletools.py	(original)
+++ python/branches/py3k-issue1717/Lib/pickletools.py	Sun Jan 25 21:08:20 2009
@@ -527,6 +527,8 @@
     """
 
     s = read_stringnl(f, decode=False, stripquotes=False)
+    if s[-1:] == b'L':
+        s = s[:-1]
     return int(s)
 
 
@@ -2052,39 +2054,39 @@
     1: l        LIST       (MARK at 0)
     2: p    PUT        0
     5: L    LONG       1
-    8: a    APPEND
-    9: L    LONG       2
-   12: a    APPEND
-   13: (    MARK
-   14: L        LONG       3
-   17: L        LONG       4
-   20: t        TUPLE      (MARK at 13)
-   21: p    PUT        1
-   24: a    APPEND
-   25: (    MARK
-   26: d        DICT       (MARK at 25)
-   27: p    PUT        2
-   30: c    GLOBAL     'builtins bytes'
-   46: p    PUT        3
-   49: (    MARK
-   50: (        MARK
-   51: l            LIST       (MARK at 50)
-   52: p        PUT        4
-   55: L        LONG       97
-   59: a        APPEND
-   60: L        LONG       98
+    9: a    APPEND
+   10: L    LONG       2
+   14: a    APPEND
+   15: (    MARK
+   16: L        LONG       3
+   20: L        LONG       4
+   24: t        TUPLE      (MARK at 15)
+   25: p    PUT        1
+   28: a    APPEND
+   29: (    MARK
+   30: d        DICT       (MARK at 29)
+   31: p    PUT        2
+   34: c    GLOBAL     'builtins bytes'
+   50: p    PUT        3
+   53: (    MARK
+   54: (        MARK
+   55: l            LIST       (MARK at 54)
+   56: p        PUT        4
+   59: L        LONG       97
    64: a        APPEND
-   65: L        LONG       99
-   69: a        APPEND
-   70: t        TUPLE      (MARK at 49)
-   71: p    PUT        5
-   74: R    REDUCE
-   75: p    PUT        6
-   78: V    UNICODE    'def'
-   83: p    PUT        7
-   86: s    SETITEM
-   87: a    APPEND
-   88: .    STOP
+   65: L        LONG       98
+   70: a        APPEND
+   71: L        LONG       99
+   76: a        APPEND
+   77: t        TUPLE      (MARK at 53)
+   78: p    PUT        5
+   81: R    REDUCE
+   82: p    PUT        6
+   85: V    UNICODE    'def'
+   90: p    PUT        7
+   93: s    SETITEM
+   94: a    APPEND
+   95: .    STOP
 highest protocol among opcodes = 0
 
 Try again with a "binary" pickle.
@@ -2126,11 +2128,11 @@
 
 Exercise the INST/OBJ/BUILD family.
 
->>> import random
->>> dis(pickle.dumps(random.getrandbits, 0))
-    0: c    GLOBAL     'random getrandbits'
-   20: p    PUT        0
-   23: .    STOP
+>>> import pickletools
+>>> dis(pickle.dumps(pickletools.dis, 0))
+    0: c    GLOBAL     'pickletools dis'
+   17: p    PUT        0
+   20: .    STOP
 highest protocol among opcodes = 0
 
 >>> from pickletools import _Example
@@ -2157,12 +2159,12 @@
    92: V    UNICODE    'value'
    99: p    PUT        7
   102: L    LONG       42
-  106: s    SETITEM
-  107: b    BUILD
-  108: a    APPEND
-  109: g    GET        5
-  112: a    APPEND
-  113: .    STOP
+  107: s    SETITEM
+  108: b    BUILD
+  109: a    APPEND
+  110: g    GET        5
+  113: a    APPEND
+  114: .    STOP
 highest protocol among opcodes = 0
 
 >>> dis(pickle.dumps(x, 1))

Modified: python/branches/py3k-issue1717/Lib/random.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/random.py	(original)
+++ python/branches/py3k-issue1717/Lib/random.py	Sun Jan 25 21:08:20 2009
@@ -396,9 +396,11 @@
     def expovariate(self, lambd):
         """Exponential distribution.
 
-        lambd is 1.0 divided by the desired mean.  (The parameter would be
-        called "lambda", but that is a reserved word in Python.)  Returned
-        values range from 0 to positive infinity.
+        lambd is 1.0 divided by the desired mean.  It should be
+        nonzero.  (The parameter would be called "lambda", but that is
+        a reserved word in Python.)  Returned values range from 0 to
+        positive infinity if lambd is positive, and from negative
+        infinity to 0 if lambd is negative.
 
         """
         # lambd: rate lambd = 1/mean

Modified: python/branches/py3k-issue1717/Lib/smtplib.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/smtplib.py	(original)
+++ python/branches/py3k-issue1717/Lib/smtplib.py	Sun Jan 25 21:08:20 2009
@@ -336,7 +336,10 @@
         if self.file is None:
             self.file = self.sock.makefile('rb')
         while 1:
-            line = self.file.readline()
+            try:
+                line = self.file.readline()
+            except socket.error:
+                line = ''
             if not line:
                 self.close()
                 raise SMTPServerDisconnected("Connection unexpectedly closed")

Modified: python/branches/py3k-issue1717/Lib/socket.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/socket.py	(original)
+++ python/branches/py3k-issue1717/Lib/socket.py	Sun Jan 25 21:08:20 2009
@@ -225,11 +225,12 @@
         return self._writing and not self.closed
 
     def fileno(self):
+        self._checkClosed()
         return self._sock.fileno()
 
     @property
     def name(self):
-        return self._sock.fileno()
+        return self.fileno()
 
     @property
     def mode(self):
@@ -239,9 +240,12 @@
         if self.closed:
             return
         io.RawIOBase.close(self)
+        self._sock._decref_socketios()
+        self._sock = None
 
     def __del__(self):
-        self._sock._decref_socketios()
+        if not self.closed:
+            self._sock._decref_socketios()
 
 
 def getfqdn(name=''):

Deleted: python/branches/py3k-issue1717/Lib/test/crashers/iter.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/crashers/iter.py	Sun Jan 25 21:08:20 2009
+++ (empty file)
@@ -1,53 +0,0 @@
-# Calls to PyIter_Next, or direct calls to tp_iternext, on an object
-# which might no longer be an iterable because its 'next' method was
-# removed.  These are all variants of Issue3720.
-
-"""
-Run this script with an argument between 1 and <N> to test for
-different crashes.
-"""
-N = 8
-
-import sys
-
-class Foo(object):
-    def __iter__(self):
-        return self
-    def next(self):
-        del Foo.next
-        return (1, 2)
-
-def case1():
-    list(enumerate(Foo()))
-
-def case2():
-    x, y = Foo()
-
-def case3():
-    filter(None, Foo())
-
-def case4():
-    map(None, Foo(), Foo())
-
-def case5():
-    max(Foo())
-
-def case6():
-    sum(Foo(), ())
-
-def case7():
-    dict(Foo())
-
-def case8():
-    sys.stdout.writelines(Foo())
-
-# etc...
-
-
-if __name__ == '__main__':
-    if len(sys.argv) < 2:
-        print(__doc__.replace('<N>', str(N)))
-    else:
-        n = int(sys.argv[1])
-        func = globals()['case%d' % n]
-        func()

Modified: python/branches/py3k-issue1717/Lib/test/inspect_fodder2.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/inspect_fodder2.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/inspect_fodder2.py	Sun Jan 25 21:08:20 2009
@@ -105,3 +105,7 @@
 #line 105
 def annotated(arg1: list):
     pass
+
+#line 109
+def keyword_only_arg(*, arg):
+    pass

Modified: python/branches/py3k-issue1717/Lib/test/pickletester.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/pickletester.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/pickletester.py	Sun Jan 25 21:08:20 2009
@@ -90,21 +90,21 @@
 # the object returned by create_data().
 
 DATA0 = (
-    b'(lp0\nL0\naL1\naF2.0\nac'
+    b'(lp0\nL0L\naL1L\naF2.0\nac'
     b'builtins\ncomplex\n'
     b'p1\n(F3.0\nF0.0\ntp2\nRp'
-    b'3\naL1\naL-1\naL255\naL-'
-    b'255\naL-256\naL65535\na'
-    b'L-65535\naL-65536\naL2'
-    b'147483647\naL-2147483'
-    b'647\naL-2147483648\na('
+    b'3\naL1L\naL-1L\naL255L\naL-'
+    b'255L\naL-256L\naL65535L\na'
+    b'L-65535L\naL-65536L\naL2'
+    b'147483647L\naL-2147483'
+    b'647L\naL-2147483648L\na('
     b'Vabc\np4\ng4\nccopyreg'
     b'\n_reconstructor\np5\n('
     b'c__main__\nC\np6\ncbu'
     b'iltins\nobject\np7\nNt'
     b'p8\nRp9\n(dp10\nVfoo\np1'
-    b'1\nL1\nsVbar\np12\nL2\nsb'
-    b'g9\ntp13\nag13\naL5\na.'
+    b'1\nL1L\nsVbar\np12\nL2L\nsb'
+    b'g9\ntp13\nag13\naL5L\na.'
 )
 
 # Disassembly of DATA0
@@ -113,80 +113,80 @@
     1: l        LIST       (MARK at 0)
     2: p    PUT        0
     5: L    LONG       0
-    8: a    APPEND
-    9: L    LONG       1
-   12: a    APPEND
-   13: F    FLOAT      2.0
-   18: a    APPEND
-   19: c    GLOBAL     'builtins complex'
-   37: p    PUT        1
-   40: (    MARK
-   41: F        FLOAT      3.0
-   46: F        FLOAT      0.0
-   51: t        TUPLE      (MARK at 40)
-   52: p    PUT        2
-   55: R    REDUCE
-   56: p    PUT        3
-   59: a    APPEND
-   60: L    LONG       1
-   63: a    APPEND
-   64: L    LONG       -1
-   68: a    APPEND
-   69: L    LONG       255
-   74: a    APPEND
-   75: L    LONG       -255
-   81: a    APPEND
-   82: L    LONG       -256
-   88: a    APPEND
-   89: L    LONG       65535
-   96: a    APPEND
-   97: L    LONG       -65535
-  105: a    APPEND
-  106: L    LONG       -65536
+    9: a    APPEND
+   10: L    LONG       1
+   14: a    APPEND
+   15: F    FLOAT      2.0
+   20: a    APPEND
+   21: c    GLOBAL     'builtins complex'
+   39: p    PUT        1
+   42: (    MARK
+   43: F        FLOAT      3.0
+   48: F        FLOAT      0.0
+   53: t        TUPLE      (MARK at 42)
+   54: p    PUT        2
+   57: R    REDUCE
+   58: p    PUT        3
+   61: a    APPEND
+   62: L    LONG       1
+   66: a    APPEND
+   67: L    LONG       -1
+   72: a    APPEND
+   73: L    LONG       255
+   79: a    APPEND
+   80: L    LONG       -255
+   87: a    APPEND
+   88: L    LONG       -256
+   95: a    APPEND
+   96: L    LONG       65535
+  104: a    APPEND
+  105: L    LONG       -65535
   114: a    APPEND
-  115: L    LONG       2147483647
-  127: a    APPEND
-  128: L    LONG       -2147483647
-  141: a    APPEND
-  142: L    LONG       -2147483648
-  155: a    APPEND
-  156: (    MARK
-  157: V        UNICODE    'abc'
-  162: p        PUT        4
-  165: g        GET        4
-  168: c        GLOBAL     'copyreg _reconstructor'
-  192: p        PUT        5
-  195: (        MARK
-  196: c            GLOBAL     '__main__ C'
-  208: p            PUT        6
-  211: c            GLOBAL     'builtins object'
-  228: p            PUT        7
-  231: N            NONE
-  232: t            TUPLE      (MARK at 195)
-  233: p        PUT        8
-  236: R        REDUCE
-  237: p        PUT        9
-  240: (        MARK
-  241: d            DICT       (MARK at 240)
-  242: p        PUT        10
-  246: V        UNICODE    'foo'
-  251: p        PUT        11
-  255: L        LONG       1
-  258: s        SETITEM
-  259: V        UNICODE    'bar'
-  264: p        PUT        12
-  268: L        LONG       2
-  271: s        SETITEM
-  272: b        BUILD
-  273: g        GET        9
-  276: t        TUPLE      (MARK at 156)
-  277: p    PUT        13
-  281: a    APPEND
-  282: g    GET        13
-  286: a    APPEND
-  287: L    LONG       5
-  290: a    APPEND
-  291: .    STOP
+  115: L    LONG       -65536
+  124: a    APPEND
+  125: L    LONG       2147483647
+  138: a    APPEND
+  139: L    LONG       -2147483647
+  153: a    APPEND
+  154: L    LONG       -2147483648
+  168: a    APPEND
+  169: (    MARK
+  170: V        UNICODE    'abc'
+  175: p        PUT        4
+  178: g        GET        4
+  181: c        GLOBAL     'copyreg _reconstructor'
+  205: p        PUT        5
+  208: (        MARK
+  209: c            GLOBAL     '__main__ C'
+  221: p            PUT        6
+  224: c            GLOBAL     'builtins object'
+  241: p            PUT        7
+  244: N            NONE
+  245: t            TUPLE      (MARK at 208)
+  246: p        PUT        8
+  249: R        REDUCE
+  250: p        PUT        9
+  253: (        MARK
+  254: d            DICT       (MARK at 253)
+  255: p        PUT        10
+  259: V        UNICODE    'foo'
+  264: p        PUT        11
+  268: L        LONG       1
+  272: s        SETITEM
+  273: V        UNICODE    'bar'
+  278: p        PUT        12
+  282: L        LONG       2
+  286: s        SETITEM
+  287: b        BUILD
+  288: g        GET        9
+  291: t        TUPLE      (MARK at 169)
+  292: p    PUT        13
+  296: a    APPEND
+  297: g    GET        13
+  301: a    APPEND
+  302: L    LONG       5
+  306: a    APPEND
+  307: .    STOP
 highest protocol among opcodes = 0
 """
 
@@ -545,6 +545,16 @@
             got = self.loads(p)
             self.assertEqual(n, got)
 
+    def test_float(self):
+        test_values = [0.0, 4.94e-324, 1e-310, 7e-308, 6.626e-34, 0.1, 0.5,
+                       3.14, 263.44582062374053, 6.022e23, 1e30]
+        test_values = test_values + [-x for x in test_values]
+        for proto in protocols:
+            for value in test_values:
+                pickle = self.dumps(value, proto)
+                got = self.loads(pickle)
+                self.assertEqual(value, got)
+
     @run_with_locale('LC_ALL', 'de_DE', 'fr_FR')
     def test_float_format(self):
         # make sure that floats are formatted locale independent with proto 0

Modified: python/branches/py3k-issue1717/Lib/test/support.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/support.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/support.py	Sun Jan 25 21:08:20 2009
@@ -344,6 +344,18 @@
     withcommas = ", ".join(reprpairs)
     return "{%s}" % withcommas
 
+def make_bad_fd():
+    """
+    Create an invalid file descriptor by opening and closing a file and return
+    its fd.
+    """
+    file = open(TESTFN, "wb")
+    try:
+        return file.fileno()
+    finally:
+        file.close()
+        unlink(TESTFN)
+
 def check_syntax_error(testcase, statement):
     try:
         compile(statement, '<test string>', 'exec')

Modified: python/branches/py3k-issue1717/Lib/test/test_ast.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_ast.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_ast.py	Sun Jan 25 21:08:20 2009
@@ -265,6 +265,12 @@
         self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None))
         self.assertRaises(ValueError, ast.literal_eval, 'foo()')
 
+    def test_literal_eval_issue4907(self):
+        self.assertEqual(ast.literal_eval('2j'), 2j)
+        self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j)
+        self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j)
+        self.assertRaises(ValueError, ast.literal_eval, '2 + (3 + 4j)')
+
 
 def test_main():
     support.run_unittest(AST_Tests, ASTHelpers_Test)

Modified: python/branches/py3k-issue1717/Lib/test/test_binop.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_binop.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_binop.py	Sun Jan 25 21:08:20 2009
@@ -77,12 +77,6 @@
                                       repr(self))
         raise ValueError("can't convert %s to int" % repr(self))
 
-    def __long__(self):
-        """Convert a Rat to an long; self.den must be 1."""
-        if self.__den == 1:
-            return int(self.__num)
-        raise ValueError("can't convert %s to long" % repr(self))
-
     def __add__(self, other):
         """Add two Rats, or a Rat and a number."""
         if isint(other):

Modified: python/branches/py3k-issue1717/Lib/test/test_bz2.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_bz2.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_bz2.py	Sun Jan 25 21:08:20 2009
@@ -258,6 +258,28 @@
         bz2f.close()
         self.assertEqual(xlines, [b'Test'])
 
+    def testContextProtocol(self):
+        # BZ2File supports the context management protocol
+        f = None
+        with BZ2File(self.filename, "wb") as f:
+            f.write(b"xxx")
+        f = BZ2File(self.filename, "rb")
+        f.close()
+        try:
+            with f:
+                pass
+        except ValueError:
+            pass
+        else:
+            self.fail("__enter__ on a closed file didn't raise an exception")
+        try:
+            with BZ2File(self.filename, "wb") as f:
+                1/0
+        except ZeroDivisionError:
+            pass
+        else:
+            self.fail("1/0 didn't raise an exception")
+
 
 class BZ2CompressorTest(BaseTest):
     def testCompress(self):

Modified: python/branches/py3k-issue1717/Lib/test/test_capi.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_capi.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_capi.py	Sun Jan 25 21:08:20 2009
@@ -1,11 +1,16 @@
 # Run the _testcapi module tests (tests for the Python/C API):  by defn,
 # these are all functions _testcapi exports whose name begins with 'test_'.
 
+from __future__ import with_statement
 import sys
+import time
+import random
 import unittest
+import threading
 from test import support
 import _testcapi
 
+
 def testfunction(self):
     """some doc"""
     return self
@@ -28,6 +33,89 @@
         self.assertRaises(AttributeError, setattr, inst.testfunction, "attribute", "test")
 
 
+class TestPendingCalls(unittest.TestCase):
+
+    def pendingcalls_submit(self, l, n):
+        def callback():
+            #this function can be interrupted by thread switching so let's
+            #use an atomic operation
+            l.append(None)
+
+        for i in range(n):
+            time.sleep(random.random()*0.02) #0.01 secs on average
+            #try submitting callback until successful.
+            #rely on regular interrupt to flush queue if we are
+            #unsuccessful.
+            while True:
+                if _testcapi._pending_threadfunc(callback):
+                    break;
+
+    def pendingcalls_wait(self, l, n, context = None):
+        #now, stick around until l[0] has grown to 10
+        count = 0;
+        while len(l) != n:
+            #this busy loop is where we expect to be interrupted to
+            #run our callbacks.  Note that callbacks are only run on the
+            #main thread
+            if False and support.verbose:
+                print("(%i)"%(len(l),),)
+            for i in range(1000):
+                a = i*i
+            if context and not context.event.is_set():
+                continue
+            count += 1
+            self.failUnless(count < 10000,
+                "timeout waiting for %i callbacks, got %i"%(n, len(l)))
+        if False and support.verbose:
+            print("(%i)"%(len(l),))
+
+    def test_pendingcalls_threaded(self):
+
+        #do every callback on a separate thread
+        n = 32 #total callbacks
+        threads = []
+        class foo(object):pass
+        context = foo()
+        context.l = []
+        context.n = 2 #submits per thread
+        context.nThreads = n // context.n
+        context.nFinished = 0
+        context.lock = threading.Lock()
+        context.event = threading.Event()
+
+        for i in range(context.nThreads):
+            t = threading.Thread(target=self.pendingcalls_thread, args = (context,))
+            t.start()
+            threads.append(t)
+
+        self.pendingcalls_wait(context.l, n, context)
+
+        for t in threads:
+            t.join()
+
+    def pendingcalls_thread(self, context):
+        try:
+            self.pendingcalls_submit(context.l, context.n)
+        finally:
+            with context.lock:
+                context.nFinished += 1
+                nFinished = context.nFinished
+                if False and support.verbose:
+                    print("finished threads: ", nFinished)
+            if nFinished == context.nThreads:
+                context.event.set()
+
+    def test_pendingcalls_non_threaded(self):
+        #again, just using the main thread, likely they will all be dispathced at
+        #once.  It is ok to ask for too many, because we loop until we find a slot.
+        #the loop can be interrupted to dispatch.
+        #there are only 32 dispatch slots, so we go for twice that!
+        l = []
+        n = 64
+        self.pendingcalls_submit(l, n)
+        self.pendingcalls_wait(l, n)
+
+
 def test_main():
     support.run_unittest(CAPITest)
 
@@ -71,6 +159,8 @@
         t.start()
         t.join()
 
+    support.run_unittest(TestPendingCalls)
+
 
 if __name__ == "__main__":
     test_main()

Modified: python/branches/py3k-issue1717/Lib/test/test_cmath.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_cmath.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_cmath.py	Sun Jan 25 21:08:20 2009
@@ -182,11 +182,9 @@
             pass
         class MyInt(object):
             def __int__(self): return 2
-            def __long__(self): return 2
             def __index__(self): return 2
         class MyIntOS:
             def __int__(self): return 2
-            def __long__(self): return 2
             def __index__(self): return 2
 
         # other possible combinations of __float__ and __complex__
@@ -219,7 +217,7 @@
             self.assertEqual(f(JustFloatOS()), f(flt_arg))
             # TypeError should be raised for classes not providing
             # either __complex__ or __float__, even if they provide
-            # __int__, __long__ or __index__.  An old-style class
+            # __int__ or __index__.  An old-style class
             # currently raises AttributeError instead of a TypeError;
             # this could be considered a bug.
             self.assertRaises(TypeError, f, NeitherComplexNorFloat())

Modified: python/branches/py3k-issue1717/Lib/test/test_cmd_line.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_cmd_line.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_cmd_line.py	Sun Jan 25 21:08:20 2009
@@ -142,6 +142,23 @@
                 self.exit_code('-c', command),
                 0)
 
+    def test_unbuffered_output(self):
+        # Test expected operation of the '-u' switch
+        for stream in ('stdout', 'stderr'):
+            # Binary is unbuffered
+            code = ("import os, sys; sys.%s.buffer.write(b'x'); os._exit(0)"
+                % stream)
+            data, rc = self.start_python_and_exit_code('-u', '-c', code)
+            self.assertEqual(rc, 0)
+            self.assertEqual(data, b'x', "binary %s not unbuffered" % stream)
+            # Text is line-buffered
+            code = ("import os, sys; sys.%s.write('x\\n'); os._exit(0)"
+                % stream)
+            data, rc = self.start_python_and_exit_code('-u', '-c', code)
+            self.assertEqual(rc, 0)
+            self.assertEqual(data.strip(), b'x',
+                "text %s not line-buffered" % stream)
+
 
 def test_main():
     test.support.run_unittest(CmdLineTest)

Modified: python/branches/py3k-issue1717/Lib/test/test_codeccallbacks.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_codeccallbacks.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_codeccallbacks.py	Sun Jan 25 21:08:20 2009
@@ -592,7 +592,7 @@
         encs = ("ascii", "latin-1", "iso-8859-1", "iso-8859-15")
 
         for res in results:
-            codecs.register_error("test.badhandler", lambda: res)
+            codecs.register_error("test.badhandler", lambda x: res)
             for enc in encs:
                 self.assertRaises(
                     TypeError,

Modified: python/branches/py3k-issue1717/Lib/test/test_codecs.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_codecs.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_codecs.py	Sun Jan 25 21:08:20 2009
@@ -1475,6 +1475,36 @@
                                        info.streamwriter, 'strict') as srw:
             self.assertEquals(srw.read(), "\xfc")
 
+class TypesTest(unittest.TestCase):
+    def test_decode_unicode(self):
+        # Most decoders don't accept unicode input
+        decoders = [
+            codecs.utf_7_decode,
+            codecs.utf_8_decode,
+            codecs.utf_16_le_decode,
+            codecs.utf_16_be_decode,
+            codecs.utf_16_ex_decode,
+            codecs.utf_32_decode,
+            codecs.utf_32_le_decode,
+            codecs.utf_32_be_decode,
+            codecs.utf_32_ex_decode,
+            codecs.latin_1_decode,
+            codecs.ascii_decode,
+            codecs.charmap_decode,
+        ]
+        if hasattr(codecs, "mbcs_decode"):
+            decoders.append(codecs.mbcs_decode)
+        for decoder in decoders:
+            self.assertRaises(TypeError, decoder, "xxx")
+
+    def test_unicode_escape(self):
+        # Escape-decoding an unicode string is supported ang gives the same
+        # result as decoding the equivalent ASCII bytes string.
+        self.assertEquals(codecs.unicode_escape_decode(r"\u1234"), ("\u1234", 6))
+        self.assertEquals(codecs.unicode_escape_decode(br"\u1234"), ("\u1234", 6))
+        self.assertEquals(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6))
+        self.assertEquals(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6))
+
 
 def test_main():
     support.run_unittest(
@@ -1501,6 +1531,7 @@
         BasicUnicodeTest,
         CharmapTest,
         WithStmtTest,
+        TypesTest,
     )
 
 

Modified: python/branches/py3k-issue1717/Lib/test/test_collections.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_collections.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_collections.py	Sun Jan 25 21:08:20 2009
@@ -2,8 +2,10 @@
 
 import unittest, doctest
 from test import support
-from collections import namedtuple
+from collections import namedtuple, Counter, Mapping
 import pickle, copy
+from random import randrange
+import operator
 from collections import Hashable, Iterable, Iterator
 from collections import Sized, Container, Callable
 from collections import Set, MutableSet
@@ -357,11 +359,150 @@
             self.failUnless(issubclass(sample, MutableSequence))
         self.failIf(issubclass(str, MutableSequence))
 
+class TestCounter(unittest.TestCase):
+
+    def test_basics(self):
+        c = Counter('abcaba')
+        self.assertEqual(c, Counter({'a':3 , 'b': 2, 'c': 1}))
+        self.assertEqual(c, Counter(a=3, b=2, c=1))
+        self.assert_(isinstance(c, dict))
+        self.assert_(isinstance(c, Mapping))
+        self.assert_(issubclass(Counter, dict))
+        self.assert_(issubclass(Counter, Mapping))
+        self.assertEqual(len(c), 3)
+        self.assertEqual(sum(c.values()), 6)
+        self.assertEqual(sorted(c.values()), [1, 2, 3])
+        self.assertEqual(sorted(c.keys()), ['a', 'b', 'c'])
+        self.assertEqual(sorted(c), ['a', 'b', 'c'])
+        self.assertEqual(sorted(c.items()),
+                         [('a', 3), ('b', 2), ('c', 1)])
+        self.assertEqual(c['b'], 2)
+        self.assertEqual(c['z'], 0)
+        self.assertEqual(c.__contains__('c'), True)
+        self.assertEqual(c.__contains__('z'), False)
+        self.assertEqual(c.get('b', 10), 2)
+        self.assertEqual(c.get('z', 10), 10)
+        self.assertEqual(c, dict(a=3, b=2, c=1))
+        self.assertEqual(repr(c), "Counter({'a': 3, 'b': 2, 'c': 1})")
+        self.assertEqual(c.most_common(), [('a', 3), ('b', 2), ('c', 1)])
+        for i in range(5):
+            self.assertEqual(c.most_common(i),
+                             [('a', 3), ('b', 2), ('c', 1)][:i])
+        self.assertEqual(''.join(sorted(c.elements())), 'aaabbc')
+        c['a'] += 1         # increment an existing value
+        c['b'] -= 2         # sub existing value to zero
+        del c['c']          # remove an entry
+        del c['c']          # make sure that del doesn't raise KeyError
+        c['d'] -= 2         # sub from a missing value
+        c['e'] = -5         # directly assign a missing value
+        c['f'] += 4         # add to a missing value
+        self.assertEqual(c, dict(a=4, b=0, d=-2, e=-5, f=4))
+        self.assertEqual(''.join(sorted(c.elements())), 'aaaaffff')
+        self.assertEqual(c.pop('f'), 4)
+        self.assertEqual('f' in c, False)
+        for i in range(3):
+            elem, cnt = c.popitem()
+            self.assertEqual(elem in c, False)
+        c.clear()
+        self.assertEqual(c, {})
+        self.assertEqual(repr(c), 'Counter()')
+        self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc')
+        self.assertRaises(TypeError, hash, c)
+        c.update(dict(a=5, b=3))
+        c.update(c=1)
+        c.update(Counter('a' * 50 + 'b' * 30))
+        c.update()          # test case with no args
+        c.__init__('a' * 500 + 'b' * 300)
+        c.__init__('cdc')
+        c.__init__()
+        self.assertEqual(c, dict(a=555, b=333, c=3, d=1))
+        self.assertEqual(c.setdefault('d', 5), 1)
+        self.assertEqual(c['d'], 1)
+        self.assertEqual(c.setdefault('e', 5), 5)
+        self.assertEqual(c['e'], 5)
+
+    def test_copying(self):
+        # Check that counters are copyable, deepcopyable, picklable, and
+        #have a repr/eval round-trip
+        words = Counter('which witch had which witches wrist watch'.split())
+        update_test = Counter()
+        update_test.update(words)
+        for i, dup in enumerate([
+                    words.copy(),
+                    copy.copy(words),
+                    copy.deepcopy(words),
+                    pickle.loads(pickle.dumps(words, 0)),
+                    pickle.loads(pickle.dumps(words, 1)),
+                    pickle.loads(pickle.dumps(words, 2)),
+                    pickle.loads(pickle.dumps(words, -1)),
+                    eval(repr(words)),
+                    update_test,
+                    Counter(words),
+                    ]):
+            msg = (i, dup, words)
+            self.assert_(dup is not words)
+            self.assertEquals(dup, words)
+            self.assertEquals(len(dup), len(words))
+            self.assertEquals(type(dup), type(words))
+
+    def test_conversions(self):
+        # Convert to: set, list, dict
+        s = 'she sells sea shells by the sea shore'
+        self.assertEqual(sorted(Counter(s).elements()), sorted(s))
+        self.assertEqual(sorted(Counter(s)), sorted(set(s)))
+        self.assertEqual(dict(Counter(s)), dict(Counter(s).items()))
+        self.assertEqual(set(Counter(s)), set(s))
+
+    def test_invariant_for_the_in_operator(self):
+        c = Counter(a=10, b=-2, c=0)
+        for elem in c:
+            self.assert_(elem in c)
+
+    def test_multiset_operations(self):
+        # Verify that adding a zero counter will strip zeros and negatives
+        c = Counter(a=10, b=-2, c=0) + Counter()
+        self.assertEqual(dict(c), dict(a=10))
+
+        elements = 'abcd'
+        for i in range(1000):
+            # test random pairs of multisets
+            p = Counter(dict((elem, randrange(-2,4)) for elem in elements))
+            p.update(e=1, f=-1, g=0)
+            q = Counter(dict((elem, randrange(-2,4)) for elem in elements))
+            q.update(h=1, i=-1, j=0)
+            for counterop, numberop in [
+                (Counter.__add__, lambda x, y: max(0, x+y)),
+                (Counter.__sub__, lambda x, y: max(0, x-y)),
+                (Counter.__or__, lambda x, y: max(0,x,y)),
+                (Counter.__and__, lambda x, y: max(0, min(x,y))),
+            ]:
+                result = counterop(p, q)
+                for x in elements:
+                    self.assertEqual(numberop(p[x], q[x]), result[x],
+                                     (counterop, x, p, q))
+                # verify that results exclude non-positive counts
+                self.assert_(x>0 for x in result.values())
+
+        elements = 'abcdef'
+        for i in range(100):
+            # verify that random multisets with no repeats are exactly like sets
+            p = Counter(dict((elem, randrange(0, 2)) for elem in elements))
+            q = Counter(dict((elem, randrange(0, 2)) for elem in elements))
+            for counterop, setop in [
+                (Counter.__sub__, set.__sub__),
+                (Counter.__or__, set.__or__),
+                (Counter.__and__, set.__and__),
+            ]:
+                counter_result = counterop(p, q)
+                set_result = setop(set(p.elements()), set(q.elements()))
+                self.assertEqual(counter_result, dict.fromkeys(set_result, 1))
+
 import doctest, collections
 
 def test_main(verbose=None):
     NamedTupleDocs = doctest.DocTestSuite(module=collections)
-    test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, TestCollectionABCs]
+    test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs,
+                    TestCollectionABCs, TestCounter]
     support.run_unittest(*test_classes)
     support.run_doctest(collections, verbose)
 

Modified: python/branches/py3k-issue1717/Lib/test/test_datetime.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_datetime.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_datetime.py	Sun Jan 25 21:08:20 2009
@@ -845,6 +845,23 @@
         # A naive object replaces %z and %Z w/ empty strings.
         self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
 
+        #make sure that invalid format specifiers are handled correctly
+        #self.assertRaises(ValueError, t.strftime, "%e")
+        #self.assertRaises(ValueError, t.strftime, "%")
+        #self.assertRaises(ValueError, t.strftime, "%#")
+
+        #oh well, some systems just ignore those invalid ones.
+        #at least, excercise them to make sure that no crashes
+        #are generated
+        for f in ["%e", "%", "%#"]:
+            try:
+                t.strftime(f)
+            except ValueError:
+                pass
+
+        #check that this standard extension works
+        t.strftime("%f")
+
 
     def test_format(self):
         dt = self.theclass(2007, 9, 10)

Modified: python/branches/py3k-issue1717/Lib/test/test_decimal.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_decimal.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_decimal.py	Sun Jan 25 21:08:20 2009
@@ -168,7 +168,6 @@
         -context.Emin > DEC_MAX_MATH):
         return True
     if not v._is_special and v and (
-        len(v._int) > DEC_MAX_MATH or
         v.adjusted() > DEC_MAX_MATH or
         v.adjusted() < 1-2*DEC_MAX_MATH):
         return True
@@ -1415,6 +1414,55 @@
             r = d.to_integral(ROUND_DOWN)
             self.assertEqual(Decimal(math.trunc(d)), r)
 
+    def test_from_float(self):
+
+        class  MyDecimal(Decimal):
+            pass
+
+        r = MyDecimal.from_float(0.1)
+        self.assertEqual(type(r), MyDecimal)
+        self.assertEqual(str(r),
+                '0.1000000000000000055511151231257827021181583404541015625')
+        bigint = 12345678901234567890123456789
+        self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint))
+        self.assert_(MyDecimal.from_float(float('nan')).is_qnan())
+        self.assert_(MyDecimal.from_float(float('inf')).is_infinite())
+        self.assert_(MyDecimal.from_float(float('-inf')).is_infinite())
+        self.assertEqual(str(MyDecimal.from_float(float('nan'))),
+                         str(Decimal('NaN')))
+        self.assertEqual(str(MyDecimal.from_float(float('inf'))),
+                         str(Decimal('Infinity')))
+        self.assertEqual(str(MyDecimal.from_float(float('-inf'))),
+                         str(Decimal('-Infinity')))
+        self.assertRaises(TypeError, MyDecimal.from_float, 'abc')
+        for i in range(200):
+            x = random.expovariate(0.01) * (random.random() * 2.0 - 1.0)
+            self.assertEqual(x, float(MyDecimal.from_float(x))) # roundtrip
+
+    def test_create_decimal_from_float(self):
+        context = Context(prec=5, rounding=ROUND_DOWN)
+        self.assertEqual(
+            context.create_decimal_from_float(math.pi),
+            Decimal('3.1415')
+        )
+        context = Context(prec=5, rounding=ROUND_UP)
+        self.assertEqual(
+            context.create_decimal_from_float(math.pi),
+            Decimal('3.1416')
+        )
+        context = Context(prec=5, traps=[Inexact])
+        self.assertRaises(
+            Inexact,
+            context.create_decimal_from_float,
+            math.pi
+        )
+        self.assertEqual(repr(context.create_decimal_from_float(-0.0)),
+                         "Decimal('-0')")
+        self.assertEqual(repr(context.create_decimal_from_float(1.0)),
+                         "Decimal('1')")
+        self.assertEqual(repr(context.create_decimal_from_float(10)),
+                         "Decimal('10')")
+
 class ContextAPItests(unittest.TestCase):
 
     def test_pickle(self):

Modified: python/branches/py3k-issue1717/Lib/test/test_fileio.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_fileio.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_fileio.py	Sun Jan 25 21:08:20 2009
@@ -6,7 +6,8 @@
 from array import array
 from weakref import proxy
 
-from test.support import TESTFN, findfile, check_warnings, run_unittest
+from test.support import (TESTFN, findfile, check_warnings, run_unittest,
+                          make_bad_fd)
 from collections import UserList
 
 import _fileio
@@ -175,6 +176,10 @@
         f.close()
         os.unlink(TESTFN)
 
+    def testInvalidFd(self):
+        self.assertRaises(ValueError, _fileio._FileIO, -10)
+        self.assertRaises(OSError, _fileio._FileIO, make_bad_fd())
+
     def testBadModeArgument(self):
         # verify that we get a sensible error message for bad mode argument
         bad_mode = "qwerty"

Modified: python/branches/py3k-issue1717/Lib/test/test_fractions.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_fractions.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_fractions.py	Sun Jan 25 21:08:20 2009
@@ -136,6 +136,8 @@
     def testFromFloat(self):
         self.assertRaises(TypeError, F.from_float, 3+4j)
         self.assertEquals((10, 1), _components(F.from_float(10)))
+        bigint = 1234567890123456789
+        self.assertEquals((bigint, 1), _components(F.from_float(bigint)))
         self.assertEquals((0, 1), _components(F.from_float(-0.0)))
         self.assertEquals((10, 1), _components(F.from_float(10.0)))
         self.assertEquals((-5, 2), _components(F.from_float(-2.5)))

Modified: python/branches/py3k-issue1717/Lib/test/test_gzip.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_gzip.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_gzip.py	Sun Jan 25 21:08:20 2009
@@ -6,6 +6,7 @@
 from test import support
 import os
 import gzip
+import struct
 
 
 data1 = b"""  int length=DEFAULTALLOC, err = Z_OK;
@@ -160,6 +161,88 @@
             self.assertEqual(f.name, self.filename)
             f.close()
 
+    def test_mtime(self):
+        mtime = 123456789
+        fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime)
+        fWrite.write(data1)
+        fWrite.close()
+        fRead = gzip.GzipFile(self.filename)
+        dataRead = fRead.read()
+        self.assertEqual(dataRead, data1)
+        self.assert_(hasattr(fRead, 'mtime'))
+        self.assertEqual(fRead.mtime, mtime)
+        fRead.close()
+
+    def test_metadata(self):
+        mtime = 123456789
+
+        fWrite = gzip.GzipFile(self.filename, 'w', mtime = mtime)
+        fWrite.write(data1)
+        fWrite.close()
+
+        fRead = open(self.filename, 'rb')
+
+        # see RFC 1952: http://www.faqs.org/rfcs/rfc1952.html
+
+        idBytes = fRead.read(2)
+        self.assertEqual(idBytes, b'\x1f\x8b') # gzip ID
+
+        cmByte = fRead.read(1)
+        self.assertEqual(cmByte, b'\x08') # deflate
+
+        flagsByte = fRead.read(1)
+        self.assertEqual(flagsByte, b'\x08') # only the FNAME flag is set
+
+        mtimeBytes = fRead.read(4)
+        self.assertEqual(mtimeBytes, struct.pack('<i', mtime)) # little-endian
+
+        xflByte = fRead.read(1)
+        self.assertEqual(xflByte, b'\x02') # maximum compression
+
+        osByte = fRead.read(1)
+        self.assertEqual(osByte, b'\xff') # OS "unknown" (OS-independent)
+
+        # Since the FNAME flag is set, the zero-terminated filename follows.
+        # RFC 1952 specifies that this is the name of the input file, if any.
+        # However, the gzip module defaults to storing the name of the output
+        # file in this field.
+        expected = self.filename.encode('Latin-1') + b'\x00'
+        nameBytes = fRead.read(len(expected))
+        self.assertEqual(nameBytes, expected)
+
+        # Since no other flags were set, the header ends here.
+        # Rather than process the compressed data, let's seek to the trailer.
+        fRead.seek(os.stat(self.filename).st_size - 8)
+
+        crc32Bytes = fRead.read(4) # CRC32 of uncompressed data [data1]
+        self.assertEqual(crc32Bytes, b'\xaf\xd7d\x83')
+
+        isizeBytes = fRead.read(4)
+        self.assertEqual(isizeBytes, struct.pack('<i', len(data1)))
+
+        fRead.close()
+
+    def test_with_open(self):
+        # GzipFile supports the context management protocol
+        with gzip.GzipFile(self.filename, "wb") as f:
+            f.write(b"xxx")
+        f = gzip.GzipFile(self.filename, "rb")
+        f.close()
+        try:
+            with f:
+                pass
+        except ValueError:
+            pass
+        else:
+            self.fail("__enter__ on a closed file didn't raise an exception")
+        try:
+            with gzip.GzipFile(self.filename, "wb") as f:
+                1/0
+        except ZeroDivisionError:
+            pass
+        else:
+            self.fail("1/0 didn't raise an exception")
+
 def test_main(verbose=None):
     support.run_unittest(TestGzip)
 

Modified: python/branches/py3k-issue1717/Lib/test/test_hashlib.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_hashlib.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_hashlib.py	Sun Jan 25 21:08:20 2009
@@ -198,6 +198,19 @@
           "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"+
           "de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b")
 
+    def test_gil(self):
+        # Check things work fine with an input larger than the size required
+        # for multithreaded operation (which is hardwired to 2048).
+        gil_minsize = 2048
+
+        m = hashlib.md5()
+        m.update(b'1')
+        m.update(b'#' * gil_minsize)
+        m.update(b'1')
+        self.assertEquals(m.hexdigest(), 'cb1e1a2cbc80be75e19935d621fb9b21')
+
+        m = hashlib.md5(b'x' * gil_minsize)
+        self.assertEquals(m.hexdigest(), 'cfb767f225d58469c5de3632a8803958')
 
 def test_main():
     support.run_unittest(HashLibTestCase)

Modified: python/branches/py3k-issue1717/Lib/test/test_import.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_import.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_import.py	Sun Jan 25 21:08:20 2009
@@ -6,6 +6,7 @@
 import py_compile
 import warnings
 import imp
+import marshal
 from test.support import unlink, TESTFN, unload, run_unittest
 
 
@@ -230,6 +231,98 @@
         else:
             self.fail("import by path didn't raise an exception")
 
+class TestPycRewriting(unittest.TestCase):
+    # Test that the `co_filename` attribute on code objects always points
+    # to the right file, even when various things happen (e.g. both the .py
+    # and the .pyc file are renamed).
+
+    module_name = "unlikely_module_name"
+    module_source = """
+import sys
+code_filename = sys._getframe().f_code.co_filename
+module_filename = __file__
+constant = 1
+def func():
+    pass
+func_filename = func.__code__.co_filename
+"""
+    dir_name = os.path.abspath(TESTFN)
+    file_name = os.path.join(dir_name, module_name) + os.extsep + "py"
+    compiled_name = file_name + ("c" if __debug__ else "o")
+
+    def setUp(self):
+        self.sys_path = sys.path[:]
+        self.orig_module = sys.modules.pop(self.module_name, None)
+        os.mkdir(self.dir_name)
+        with open(self.file_name, "w") as f:
+            f.write(self.module_source)
+        sys.path.insert(0, self.dir_name)
+
+    def tearDown(self):
+        sys.path[:] = self.sys_path
+        if self.orig_module is not None:
+            sys.modules[self.module_name] = self.orig_module
+        else:
+            del sys.modules[self.module_name]
+        for file_name in self.file_name, self.compiled_name:
+            if os.path.exists(file_name):
+                os.remove(file_name)
+        if os.path.exists(self.dir_name):
+            shutil.rmtree(self.dir_name)
+
+    def import_module(self):
+        ns = globals()
+        __import__(self.module_name, ns, ns)
+        return sys.modules[self.module_name]
+
+    def test_basics(self):
+        mod = self.import_module()
+        self.assertEqual(mod.module_filename, self.file_name)
+        self.assertEqual(mod.code_filename, self.file_name)
+        self.assertEqual(mod.func_filename, self.file_name)
+        del sys.modules[self.module_name]
+        mod = self.import_module()
+        self.assertEqual(mod.module_filename, self.file_name)
+        self.assertEqual(mod.code_filename, self.file_name)
+        self.assertEqual(mod.func_filename, self.file_name)
+
+    def test_incorrect_code_name(self):
+        py_compile.compile(self.file_name, dfile="another_module.py")
+        mod = self.import_module()
+        self.assertEqual(mod.module_filename, self.file_name)
+        self.assertEqual(mod.code_filename, self.file_name)
+        self.assertEqual(mod.func_filename, self.file_name)
+
+    def test_module_without_source(self):
+        target = "another_module.py"
+        py_compile.compile(self.file_name, dfile=target)
+        os.remove(self.file_name)
+        mod = self.import_module()
+        self.assertEqual(mod.module_filename, self.compiled_name)
+        self.assertEqual(mod.code_filename, target)
+        self.assertEqual(mod.func_filename, target)
+
+    def test_foreign_code(self):
+        py_compile.compile(self.file_name)
+        with open(self.compiled_name, "rb") as f:
+            header = f.read(8)
+            code = marshal.load(f)
+        constants = list(code.co_consts)
+        foreign_code = test_main.__code__
+        pos = constants.index(1)
+        constants[pos] = foreign_code
+        code = type(code)(code.co_argcount, code.co_kwonlyargcount,
+                          code.co_nlocals, code.co_stacksize,
+                          code.co_flags, code.co_code, tuple(constants),
+                          code.co_names, code.co_varnames, code.co_filename,
+                          code.co_name, code.co_firstlineno, code.co_lnotab,
+                          code.co_freevars, code.co_cellvars)
+        with open(self.compiled_name, "wb") as f:
+            f.write(header)
+            marshal.dump(code, f)
+        mod = self.import_module()
+        self.assertEqual(mod.constant.co_filename, foreign_code.co_filename)
+
 class PathsTests(unittest.TestCase):
     SAMPLES = ('test', 'test\u00e4\u00f6\u00fc\u00df', 'test\u00e9\u00e8',
                'test\u00b0\u00b3\u00b2')
@@ -253,6 +346,27 @@
         self.assertEqual(mod.testdata, 'test_trailing_slash')
         unload("test_trailing_slash")
 
+    # http://bugs.python.org/issue3677
+    def _test_UNC_path(self):
+        f = open(os.path.join(self.path, 'test_trailing_slash.py'), 'w')
+        f.write("testdata = 'test_trailing_slash'")
+        f.close()
+        #create the UNC path, like \\myhost\c$\foo\bar
+        path = os.path.abspath(self.path)
+        import socket
+        hn = socket.gethostname()
+        drive = path[0]
+        unc = "\\\\%s\\%s$"%(hn, drive)
+        unc += path[2:]
+        sys.path.append(path)
+        mod = __import__("test_trailing_slash")
+        self.assertEqual(mod.testdata, 'test_trailing_slash')
+        unload("test_trailing_slash")
+
+    if sys.platform == "win32":
+        test_UNC_path = _test_UNC_path
+
+
 class RelativeImport(unittest.TestCase):
     def tearDown(self):
         try:
@@ -288,7 +402,7 @@
         self.assertRaises(ValueError, check_relative)
 
 def test_main(verbose=None):
-    run_unittest(ImportTest, PathsTests, RelativeImport)
+    run_unittest(ImportTest, TestPycRewriting, PathsTests, RelativeImport)
 
 if __name__ == '__main__':
     # test needs to be a package, so we can do relative import

Modified: python/branches/py3k-issue1717/Lib/test/test_inspect.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_inspect.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_inspect.py	Sun Jan 25 21:08:20 2009
@@ -74,7 +74,6 @@
     def test_excluding_predicates(self):
         self.istest(inspect.isbuiltin, 'sys.exit')
         self.istest(inspect.isbuiltin, '[].append')
-        self.istest(inspect.isclass, 'mod.StupidGit')
         self.istest(inspect.iscode, 'mod.spam.__code__')
         self.istest(inspect.isframe, 'tb.tb_frame')
         self.istest(inspect.isfunction, 'mod.spam')
@@ -99,6 +98,26 @@
         self.assert_(inspect.isroutine(mod.spam))
         self.assert_(inspect.isroutine([].count))
 
+    def test_isclass(self):
+        self.istest(inspect.isclass, 'mod.StupidGit')
+        self.assertTrue(inspect.isclass(list))
+
+        class CustomGetattr(object):
+            def __getattr__(self, attr):
+                return None
+        self.assertFalse(inspect.isclass(CustomGetattr()))
+
+    def test_get_slot_members(self):
+        class C(object):
+            __slots__ = ("a", "b")
+
+        x = C()
+        x.a = 42
+        members = dict(inspect.getmembers(x))
+        self.assert_('a' in members)
+        self.assert_('b' not in members)
+
+
 class TestInterpreterStack(IsTestBase):
     def __init__(self, *args, **kwargs):
         unittest.TestCase.__init__(self, *args, **kwargs)
@@ -375,6 +394,9 @@
 
         self.assertRaises(ValueError, self.assertArgSpecEquals,
                           mod2.annotated, [])
+        self.assertRaises(ValueError, self.assertArgSpecEquals,
+                          mod2.keyword_only_arg, [])
+
 
     def test_getfullargspec(self):
         self.assertFullArgSpecEquals(mod2.keyworded, [], varargs_e='arg1',
@@ -385,6 +407,10 @@
         self.assertFullArgSpecEquals(mod2.annotated, ['arg1'],
                                      ann_e={'arg1' : list},
                                      formatted='(arg1: list)')
+        self.assertFullArgSpecEquals(mod2.keyword_only_arg, [],
+                                     kwonlyargs_e=['arg'],
+                                     formatted='(*, arg)')
+
 
     def test_getargspec_method(self):
         class A(object):

Modified: python/branches/py3k-issue1717/Lib/test/test_io.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_io.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_io.py	Sun Jan 25 21:08:20 2009
@@ -233,6 +233,17 @@
             else:
                 self.fail("1/0 didn't raise an exception")
 
+    # issue 5008
+    def test_append_mode_tell(self):
+        with io.open(support.TESTFN, "wb") as f:
+            f.write(b"xxx")
+        with io.open(support.TESTFN, "ab", buffering=0) as f:
+            self.assertEqual(f.tell(), 3)
+        with io.open(support.TESTFN, "ab") as f:
+            self.assertEqual(f.tell(), 3)
+        with io.open(support.TESTFN, "a") as f:
+            self.assert_(f.tell() > 0)
+
     def test_destructor(self):
         record = []
         class MyFileIO(io.FileIO):
@@ -260,7 +271,7 @@
 
     def test_array_writes(self):
         a = array.array('i', range(10))
-        n = len(memoryview(a))
+        n = len(a.tostring())
         f = io.open(support.TESTFN, "wb", 0)
         self.assertEqual(f.write(a), n)
         f.close()
@@ -1021,6 +1032,10 @@
 
     def testSeekAndTell(self):
         """Test seek/tell using the StatefulIncrementalDecoder."""
+        # Make this test faster by forcing a smaller (but large enough)
+        # chunk size. The bigger the chunker size, the slower seek() is,
+        # as it tries to replay character decoding one byte at a time.
+        CHUNK_SIZE = 256
 
         def testSeekAndTellWithData(data, min_pos=0):
             """Tell/seek to various points within a data stream and ensure
@@ -1035,6 +1050,7 @@
             for i in range(min_pos, len(decoded) + 1): # seek positions
                 for j in [1, 5, len(decoded) - i]: # read lengths
                     f = io.open(support.TESTFN, encoding='test_decoder')
+                    f._CHUNK_SIZE = CHUNK_SIZE
                     self.assertEquals(f.read(i), decoded[:i])
                     cookie = f.tell()
                     self.assertEquals(f.read(j), decoded[i:i + j])
@@ -1052,7 +1068,6 @@
                 testSeekAndTellWithData(input)
 
             # Position each test case so that it crosses a chunk boundary.
-            CHUNK_SIZE = io.TextIOWrapper._CHUNK_SIZE
             for input, _, _ in StatefulIncrementalDecoderTest.test_cases:
                 offset = CHUNK_SIZE - len(input)//2
                 prefix = b'.'*offset
@@ -1324,6 +1339,45 @@
         f.close()
         g.close()
 
+    def test_io_after_close(self):
+        for kwargs in [
+                {"mode": "w"},
+                {"mode": "wb"},
+                {"mode": "w", "buffering": 1},
+                {"mode": "w", "buffering": 2},
+                {"mode": "wb", "buffering": 0},
+                {"mode": "r"},
+                {"mode": "rb"},
+                {"mode": "r", "buffering": 1},
+                {"mode": "r", "buffering": 2},
+                {"mode": "rb", "buffering": 0},
+                {"mode": "w+"},
+                {"mode": "w+b"},
+                {"mode": "w+", "buffering": 1},
+                {"mode": "w+", "buffering": 2},
+                {"mode": "w+b", "buffering": 0},
+            ]:
+            f = io.open(support.TESTFN, **kwargs)
+            f.close()
+            self.assertRaises(ValueError, f.flush)
+            self.assertRaises(ValueError, f.fileno)
+            self.assertRaises(ValueError, f.isatty)
+            self.assertRaises(ValueError, f.__iter__)
+            if hasattr(f, "peek"):
+                self.assertRaises(ValueError, f.peek, 1)
+            self.assertRaises(ValueError, f.read)
+            if hasattr(f, "read1"):
+                self.assertRaises(ValueError, f.read1, 1024)
+            if hasattr(f, "readinto"):
+                self.assertRaises(ValueError, f.readinto, bytearray(1024))
+            self.assertRaises(ValueError, f.readline)
+            self.assertRaises(ValueError, f.readlines)
+            self.assertRaises(ValueError, f.seek, 0)
+            self.assertRaises(ValueError, f.tell)
+            self.assertRaises(ValueError, f.truncate)
+            self.assertRaises(ValueError, f.write, "")
+            self.assertRaises(ValueError, f.writelines, [])
+
 
 def test_main():
     support.run_unittest(IOTest, BytesIOTest, StringIOTest,

Modified: python/branches/py3k-issue1717/Lib/test/test_iter.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_iter.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_iter.py	Sun Jan 25 21:08:20 2009
@@ -120,6 +120,13 @@
     def test_seq_class_iter(self):
         self.check_iterator(iter(SequenceClass(10)), list(range(10)))
 
+    # Test a new_style class with __iter__ but no next() method
+    def test_new_style_iter_class(self):
+        class IterClass(object):
+            def __iter__(self):
+                return self
+        self.assertRaises(TypeError, iter, IterClass())
+
     # Test two-argument iter() with callable instance
     def test_iter_callable(self):
         class C:
@@ -853,6 +860,21 @@
         self.assertEqual(list(b), list(zip(range(5), range(5))))
         self.assertEqual(list(b), [])
 
+    def test_3720(self):
+        # Avoid a crash, when an iterator deletes its next() method.
+        class BadIterator(object):
+            def __iter__(self):
+                return self
+            def __next__(self):
+                del BadIterator.__next__
+                return 1
+
+        try:
+            for i in BadIterator() :
+                pass
+        except TypeError:
+            pass
+
 
 def test_main():
     run_unittest(TestCase)

Modified: python/branches/py3k-issue1717/Lib/test/test_itertools.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_itertools.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_itertools.py	Sun Jan 25 21:08:20 2009
@@ -75,11 +75,11 @@
         self.assertRaises(TypeError, list, chain.from_iterable([2, 3]))
 
     def test_combinations(self):
-        self.assertRaises(TypeError, combinations, 'abc')   # missing r argument
+        self.assertRaises(TypeError, combinations, 'abc')       # missing r argument
         self.assertRaises(TypeError, combinations, 'abc', 2, 1) # too many arguments
         self.assertRaises(TypeError, combinations, None)        # pool is not iterable
         self.assertRaises(ValueError, combinations, 'abc', -2)  # r is negative
-        self.assertRaises(ValueError, combinations, 'abc', 32)  # r is too big
+        self.assertEqual(list(combinations('abc', 32)), [])     # r > n
         self.assertEqual(list(combinations(range(4), 3)),
                                            [(0,1,2), (0,1,3), (0,2,3), (1,2,3)])
 
@@ -87,6 +87,8 @@
             'Pure python version shown in the docs'
             pool = tuple(iterable)
             n = len(pool)
+            if r > n:
+                return
             indices = list(range(r))
             yield tuple(pool[i] for i in indices)
             while 1:
@@ -110,9 +112,9 @@
 
         for n in range(7):
             values = [5*x-12 for x in range(n)]
-            for r in range(n+1):
+            for r in range(n+2):
                 result = list(combinations(values, r))
-                self.assertEqual(len(result), fact(n) / fact(r) / fact(n-r)) # right number of combs
+                self.assertEqual(len(result), 0 if r>n else fact(n) / fact(r) / fact(n-r)) # right number of combs
                 self.assertEqual(len(result), len(set(result)))         # no repeats
                 self.assertEqual(result, sorted(result))                # lexicographic order
                 for c in result:
@@ -123,7 +125,7 @@
                     self.assertEqual(list(c),
                                      [e for e in values if e in c])      # comb is a subsequence of the input iterable
                 self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version
-                self.assertEqual(result, list(combinations2(values, r))) # matches first pure python version
+                self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version
 
         # Test implementation detail:  tuple re-use
         self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1)
@@ -134,7 +136,7 @@
         self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments
         self.assertRaises(TypeError, permutations, None)        # pool is not iterable
         self.assertRaises(ValueError, permutations, 'abc', -2)  # r is negative
-        self.assertRaises(ValueError, permutations, 'abc', 32)  # r is too big
+        self.assertEqual(list(permutations('abc', 32)), [])     # r > n
         self.assertRaises(TypeError, permutations, 'abc', 's')  # r is not an int or None
         self.assertEqual(list(permutations(range(3), 2)),
                                            [(0,1), (0,2), (1,0), (1,2), (2,0), (2,1)])
@@ -144,6 +146,8 @@
             pool = tuple(iterable)
             n = len(pool)
             r = n if r is None else r
+            if r > n:
+                return
             indices = list(range(n))
             cycles = list(range(n-r+1, n+1))[::-1]
             yield tuple(pool[i] for i in indices[:r])
@@ -172,9 +176,9 @@
 
         for n in range(7):
             values = [5*x-12 for x in range(n)]
-            for r in range(n+1):
+            for r in range(n+2):
                 result = list(permutations(values, r))
-                self.assertEqual(len(result), fact(n) / fact(n-r))      # right number of perms
+                self.assertEqual(len(result), 0 if r>n else fact(n) / fact(n-r))      # right number of perms
                 self.assertEqual(len(result), len(set(result)))         # no repeats
                 self.assertEqual(result, sorted(result))                # lexicographic order
                 for p in result:
@@ -182,7 +186,7 @@
                     self.assertEqual(len(set(p)), r)                    # no duplicate elements
                     self.assert_(all(e in values for e in p))           # elements taken from input iterable
                 self.assertEqual(result, list(permutations1(values, r))) # matches first pure python version
-                self.assertEqual(result, list(permutations2(values, r))) # matches first pure python version
+                self.assertEqual(result, list(permutations2(values, r))) # matches second pure python version
                 if r == n:
                     self.assertEqual(result, list(permutations(values, None))) # test r as None
                     self.assertEqual(result, list(permutations(values)))       # test default r
@@ -1298,6 +1302,30 @@
 ...         indices[i:] = [indices[i] + 1] * (r - i)
 ...         yield tuple(pool[i] for i in indices)
 
+>>> def unique_everseen(iterable, key=None):
+...     "List unique elements, preserving order. Remember all elements ever seen."
+...     # unique_everseen('AAAABBBCCDAABBB') --> A B C D
+...     # unique_everseen('ABBCcAD', str.lower) --> A B C D
+...     seen = set()
+...     seen_add = seen.add
+...     if key is None:
+...         for element in iterable:
+...             if element not in seen:
+...                 seen_add(element)
+...                 yield element
+...     else:
+...         for element in iterable:
+...             k = key(element)
+...             if k not in seen:
+...                 seen_add(k)
+...                 yield element
+
+>>> def unique_justseen(iterable, key=None):
+...     "List unique elements, preserving order. Remember only the element just seen."
+...     # unique_justseen('AAAABBBCCDAABBB') --> A B C D A B
+...     # unique_justseen('ABBCcAD', str.lower) --> A B C A D
+...     return map(next, map(itemgetter(1), groupby(iterable, key)))
+
 This is not part of the examples but it tests to make sure the definitions
 perform as purported.
 
@@ -1360,6 +1388,38 @@
 >>> list(combinations_with_replacement('abc', 2))
 [('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')]
 
+>>> list(combinations_with_replacement('01', 3))
+[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')]
+
+>>> def combinations_with_replacement2(iterable, r):
+...     'Alternate version that filters from product()'
+...     pool = tuple(iterable)
+...     n = len(pool)
+...     for indices in product(range(n), repeat=r):
+...         if sorted(indices) == list(indices):
+...             yield tuple(pool[i] for i in indices)
+
+>>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2))
+True
+
+>>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3))
+True
+
+>>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6))
+True
+
+>>> list(unique_everseen('AAAABBBCCDAABBB'))
+['A', 'B', 'C', 'D']
+
+>>> list(unique_everseen('ABBCcAD', str.lower))
+['A', 'B', 'C', 'D']
+
+>>> list(unique_justseen('AAAABBBCCDAABBB'))
+['A', 'B', 'C', 'D', 'A', 'B']
+
+>>> list(unique_justseen('ABBCcAD', str.lower))
+['A', 'B', 'C', 'A', 'D']
+
 """
 
 __test__ = {'libreftest' : libreftest}

Modified: python/branches/py3k-issue1717/Lib/test/test_kqueue.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_kqueue.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_kqueue.py	Sun Jan 25 21:08:20 2009
@@ -121,12 +121,15 @@
         client.send(b"Hello!")
         server.send(b"world!!!")
 
-        events = kq.control(None, 4, 1)
         # We may need to call it several times
-        for i in range(5):
+        for i in range(10):
+            events = kq.control(None, 4, 1)
             if len(events) == 4:
                 break
-            events = kq.control(None, 4, 1)
+            time.sleep(1.0)
+        else:
+            self.fail('timeout waiting for event notifications')
+
         events = [(e.ident, e.filter, e.flags) for e in events]
         events.sort()
 

Modified: python/branches/py3k-issue1717/Lib/test/test_long.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_long.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_long.py	Sun Jan 25 21:08:20 2009
@@ -284,6 +284,16 @@
 
         self.assertRaises(ValueError, int, '123\0')
         self.assertRaises(ValueError, int, '53', 40)
+        # trailing L should no longer be accepted...
+        self.assertRaises(ValueError, int, '123L')
+        self.assertRaises(ValueError, int, '123l')
+        self.assertRaises(ValueError, int, '0L')
+        self.assertRaises(ValueError, int, '-37L')
+        self.assertRaises(ValueError, int, '0x32L', 16)
+        self.assertRaises(ValueError, int, '1L', 21)
+        # ... but it's just a normal digit if base >= 22
+        self.assertEqual(int('1L', 22), 43)
+
         self.assertRaises(TypeError, int, 1, 12)
 
         # SF patch #1638879: embedded NULs were not detected with
@@ -367,7 +377,7 @@
 
 
     def test_conversion(self):
-        # Test __long__()
+        # Test __int__()
         class ClassicMissingMethods:
             pass
         self.assertRaises(TypeError, int, ClassicMissingMethods())
@@ -410,18 +420,32 @@
         class Classic:
             pass
         for base in (object, Classic):
-            class LongOverridesTrunc(base):
-                def __long__(self):
+            class IntOverridesTrunc(base):
+                def __int__(self):
                     return 42
                 def __trunc__(self):
                     return -12
-            self.assertEqual(int(LongOverridesTrunc()), 42)
+            self.assertEqual(int(IntOverridesTrunc()), 42)
 
             class JustTrunc(base):
                 def __trunc__(self):
                     return 42
             self.assertEqual(int(JustTrunc()), 42)
 
+            class JustLong(base):
+                # test that __long__ no longer used in 3.x
+                def __long__(self):
+                    return 42
+            self.assertRaises(TypeError, int, JustLong())
+
+            class LongTrunc(base):
+                # __long__ should be ignored in 3.x
+                def __long__(self):
+                    return 42
+                def __trunc__(self):
+                    return 1729
+            self.assertEqual(int(LongTrunc()), 1729)
+
             for trunc_result_base in (object, Classic):
                 class Integral(trunc_result_base):
                     def __int__(self):

Modified: python/branches/py3k-issue1717/Lib/test/test_memoryview.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_memoryview.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_memoryview.py	Sun Jan 25 21:08:20 2009
@@ -8,24 +8,30 @@
 import sys
 import gc
 import weakref
+import array
 
 
-class CommonMemoryTests:
-    #
-    # Tests common to direct memoryviews and sliced memoryviews
-    #
+class AbstractMemoryTests:
+    source_bytes = b"abcdef"
 
-    base_object = b"abcdef"
+    @property
+    def _source(self):
+        return self.source_bytes
+
+    @property
+    def _types(self):
+        return filter(None, [self.ro_type, self.rw_type])
 
     def check_getitem_with_type(self, tp):
-        b = tp(self.base_object)
+        item = self.getitem_type
+        b = tp(self._source)
         oldrefcount = sys.getrefcount(b)
         m = self._view(b)
-        self.assertEquals(m[0], b"a")
+        self.assertEquals(m[0], item(b"a"))
         self.assert_(isinstance(m[0], bytes), type(m[0]))
-        self.assertEquals(m[5], b"f")
-        self.assertEquals(m[-1], b"f")
-        self.assertEquals(m[-6], b"a")
+        self.assertEquals(m[5], item(b"f"))
+        self.assertEquals(m[-1], item(b"f"))
+        self.assertEquals(m[-6], item(b"a"))
         # Bounds checking
         self.assertRaises(IndexError, lambda: m[6])
         self.assertRaises(IndexError, lambda: m[-7])
@@ -38,14 +44,14 @@
         m = None
         self.assertEquals(sys.getrefcount(b), oldrefcount)
 
-    def test_getitem_readonly(self):
-        self.check_getitem_with_type(bytes)
-
-    def test_getitem_writable(self):
-        self.check_getitem_with_type(bytearray)
+    def test_getitem(self):
+        for tp in self._types:
+            self.check_getitem_with_type(tp)
 
     def test_setitem_readonly(self):
-        b = self.base_object
+        if not self.ro_type:
+            return
+        b = self.ro_type(self._source)
         oldrefcount = sys.getrefcount(b)
         m = self._view(b)
         def setitem(value):
@@ -57,27 +63,30 @@
         self.assertEquals(sys.getrefcount(b), oldrefcount)
 
     def test_setitem_writable(self):
-        b = bytearray(self.base_object)
+        if not self.rw_type:
+            return
+        tp = self.rw_type
+        b = self.rw_type(self._source)
         oldrefcount = sys.getrefcount(b)
         m = self._view(b)
-        m[0] = b"0"
-        self._check_contents(b, b"0bcdef")
-        m[1:3] = b"12"
-        self._check_contents(b, b"012def")
-        m[1:1] = b""
-        self._check_contents(b, b"012def")
-        m[:] = b"abcdef"
-        self._check_contents(b, b"abcdef")
+        m[0] = tp(b"0")
+        self._check_contents(tp, b, b"0bcdef")
+        m[1:3] = tp(b"12")
+        self._check_contents(tp, b, b"012def")
+        m[1:1] = tp(b"")
+        self._check_contents(tp, b, b"012def")
+        m[:] = tp(b"abcdef")
+        self._check_contents(tp, b, b"abcdef")
 
         # Overlapping copies of a view into itself
         m[0:3] = m[2:5]
-        self._check_contents(b, b"cdedef")
-        m[:] = b"abcdef"
+        self._check_contents(tp, b, b"cdedef")
+        m[:] = tp(b"abcdef")
         m[2:5] = m[0:3]
-        self._check_contents(b, b"ababcf")
+        self._check_contents(tp, b, b"ababcf")
 
         def setitem(key, value):
-            m[key] = value
+            m[key] = tp(value)
         # Bounds checking
         self.assertRaises(IndexError, setitem, 6, b"a")
         self.assertRaises(IndexError, setitem, -7, b"a")
@@ -96,159 +105,224 @@
         m = None
         self.assertEquals(sys.getrefcount(b), oldrefcount)
 
-    def test_len(self):
-        self.assertEquals(len(self._view(self.base_object)), 6)
-
     def test_tobytes(self):
-        m = self._view(self.base_object)
-        b = m.tobytes()
-        self.assertEquals(b, b"abcdef")
-        self.assert_(isinstance(b, bytes), type(b))
+        for tp in self._types:
+            m = self._view(tp(self._source))
+            b = m.tobytes()
+            # This calls self.getitem_type() on each separate byte of b"abcdef"
+            expected = b"".join(
+                self.getitem_type(bytes([c])) for c in b"abcdef")
+            self.assertEquals(b, expected)
+            self.assert_(isinstance(b, bytes), type(b))
 
     def test_tolist(self):
-        m = self._view(self.base_object)
-        l = m.tolist()
-        self.assertEquals(l, list(b"abcdef"))
+        for tp in self._types:
+            m = self._view(tp(self._source))
+            l = m.tolist()
+            self.assertEquals(l, list(b"abcdef"))
 
     def test_compare(self):
         # memoryviews can compare for equality with other objects
         # having the buffer interface.
-        m = self._view(self.base_object)
-        for tp in (bytes, bytearray):
-            self.assertTrue(m == tp(b"abcdef"))
-            self.assertFalse(m != tp(b"abcdef"))
-            self.assertFalse(m == tp(b"abcde"))
-            self.assertTrue(m != tp(b"abcde"))
-            self.assertFalse(m == tp(b"abcde1"))
-            self.assertTrue(m != tp(b"abcde1"))
-        self.assertTrue(m == m)
-        self.assertTrue(m == m[:])
-        self.assertTrue(m[0:6] == m[:])
-        self.assertFalse(m[0:5] == m)
-
-        # Comparison with objects which don't support the buffer API
-        self.assertFalse(m == "abc")
-        self.assertTrue(m != "abc")
-        self.assertFalse("abc" == m)
-        self.assertTrue("abc" != m)
-
-        # Unordered comparisons
-        for c in (m, b"abcdef"):
-            self.assertRaises(TypeError, lambda: m < c)
-            self.assertRaises(TypeError, lambda: c <= m)
-            self.assertRaises(TypeError, lambda: m >= c)
-            self.assertRaises(TypeError, lambda: c > m)
+        for tp in self._types:
+            m = self._view(tp(self._source))
+            for tp_comp in self._types:
+                self.assertTrue(m == tp_comp(b"abcdef"))
+                self.assertFalse(m != tp_comp(b"abcdef"))
+                self.assertFalse(m == tp_comp(b"abcde"))
+                self.assertTrue(m != tp_comp(b"abcde"))
+                self.assertFalse(m == tp_comp(b"abcde1"))
+                self.assertTrue(m != tp_comp(b"abcde1"))
+            self.assertTrue(m == m)
+            self.assertTrue(m == m[:])
+            self.assertTrue(m[0:6] == m[:])
+            self.assertFalse(m[0:5] == m)
+
+            # Comparison with objects which don't support the buffer API
+            self.assertFalse(m == "abcdef")
+            self.assertTrue(m != "abcdef")
+            self.assertFalse("abcdef" == m)
+            self.assertTrue("abcdef" != m)
+
+            # Unordered comparisons
+            for c in (m, b"abcdef"):
+                self.assertRaises(TypeError, lambda: m < c)
+                self.assertRaises(TypeError, lambda: c <= m)
+                self.assertRaises(TypeError, lambda: m >= c)
+                self.assertRaises(TypeError, lambda: c > m)
 
     def check_attributes_with_type(self, tp):
-        b = tp(self.base_object)
-        m = self._view(b)
-        self.assertEquals(m.format, 'B')
-        self.assertEquals(m.itemsize, 1)
+        m = self._view(tp(self._source))
+        self.assertEquals(m.format, self.format)
+        self.assertEquals(m.itemsize, self.itemsize)
         self.assertEquals(m.ndim, 1)
         self.assertEquals(m.shape, (6,))
         self.assertEquals(len(m), 6)
-        self.assertEquals(m.strides, (1,))
+        self.assertEquals(m.strides, (self.itemsize,))
         self.assertEquals(m.suboffsets, None)
         return m
 
     def test_attributes_readonly(self):
-        m = self.check_attributes_with_type(bytes)
+        if not self.ro_type:
+            return
+        m = self.check_attributes_with_type(self.ro_type)
         self.assertEquals(m.readonly, True)
 
     def test_attributes_writable(self):
-        m = self.check_attributes_with_type(bytearray)
+        if not self.rw_type:
+            return
+        m = self.check_attributes_with_type(self.rw_type)
         self.assertEquals(m.readonly, False)
 
     def test_getbuffer(self):
         # Test PyObject_GetBuffer() on a memoryview object.
-        b = self.base_object
-        oldrefcount = sys.getrefcount(b)
-        m = self._view(b)
-        oldviewrefcount = sys.getrefcount(m)
-        s = str(m, "utf-8")
-        self._check_contents(b, s.encode("utf-8"))
-        self.assertEquals(sys.getrefcount(m), oldviewrefcount)
-        m = None
-        self.assertEquals(sys.getrefcount(b), oldrefcount)
+        for tp in self._types:
+            b = tp(self._source)
+            oldrefcount = sys.getrefcount(b)
+            m = self._view(b)
+            oldviewrefcount = sys.getrefcount(m)
+            s = str(m, "utf-8")
+            self._check_contents(tp, b, s.encode("utf-8"))
+            self.assertEquals(sys.getrefcount(m), oldviewrefcount)
+            m = None
+            self.assertEquals(sys.getrefcount(b), oldrefcount)
 
     def test_gc(self):
-        class MyBytes(bytes):
-            pass
-        class MyObject:
-            pass
+        for tp in self._types:
+            if not isinstance(tp, type):
+                # If tp is a factory rather than a plain type, skip
+                continue
+
+            class MySource(tp):
+                pass
+            class MyObject:
+                pass
+
+            # Create a reference cycle through a memoryview object
+            b = MySource(tp(b'abc'))
+            m = self._view(b)
+            o = MyObject()
+            b.m = m
+            b.o = o
+            wr = weakref.ref(o)
+            b = m = o = None
+            # The cycle must be broken
+            gc.collect()
+            self.assert_(wr() is None, wr())
+
+
+# Variations on source objects for the buffer: bytes-like objects, then arrays
+# with itemsize > 1.
+# NOTE: support for multi-dimensional objects is unimplemented.
+
+class BaseBytesMemoryTests(AbstractMemoryTests):
+    ro_type = bytes
+    rw_type = bytearray
+    getitem_type = bytes
+    itemsize = 1
+    format = 'B'
+
+class BaseArrayMemoryTests(AbstractMemoryTests):
+    ro_type = None
+    rw_type = lambda self, b: array.array('i', list(b))
+    getitem_type = lambda self, b: array.array('i', list(b)).tostring()
+    itemsize = array.array('i').itemsize
+    format = 'i'
 
-        # Create a reference cycle through a memoryview object
-        b = MyBytes(b'abc')
-        m = self._view(b)
-        o = MyObject()
-        b.m = m
-        b.o = o
-        wr = weakref.ref(o)
-        b = m = o = None
-        # The cycle must be broken
-        gc.collect()
-        self.assert_(wr() is None, wr())
+    def test_getbuffer(self):
+        # XXX Test should be adapted for non-byte buffers
+        pass
+
+    def test_tolist(self):
+        # XXX NotImplementedError: tolist() only supports byte views
+        pass
 
 
-class MemoryviewTest(unittest.TestCase, CommonMemoryTests):
+# Variations on indirection levels: memoryview, slice of memoryview,
+# slice of slice of memoryview.
+# This is important to test allocation subtleties.
 
+class BaseMemoryviewTests:
     def _view(self, obj):
         return memoryview(obj)
 
-    def _check_contents(self, obj, contents):
-        self.assertEquals(obj, contents)
+    def _check_contents(self, tp, obj, contents):
+        self.assertEquals(obj, tp(contents))
 
-    def test_constructor(self):
-        ob = b'test'
-        self.assert_(memoryview(ob))
-        self.assert_(memoryview(object=ob))
-        self.assertRaises(TypeError, memoryview)
-        self.assertRaises(TypeError, memoryview, ob, ob)
-        self.assertRaises(TypeError, memoryview, argument=ob)
-        self.assertRaises(TypeError, memoryview, ob, argument=True)
-
-    def test_array_assign(self):
-        # Issue #4569: segfault when mutating a memoryview with itemsize != 1
-        from array import array
-        a = array('i', range(10))
-        m = memoryview(a)
-        new_a = array('i', range(9, -1, -1))
-        m[:] = new_a
-        self.assertEquals(a, new_a)
-
-
-class MemorySliceTest(unittest.TestCase, CommonMemoryTests):
-    base_object = b"XabcdefY"
+class BaseMemorySliceTests:
+    source_bytes = b"XabcdefY"
 
     def _view(self, obj):
         m = memoryview(obj)
         return m[1:7]
 
-    def _check_contents(self, obj, contents):
-        self.assertEquals(obj[1:7], contents)
+    def _check_contents(self, tp, obj, contents):
+        self.assertEquals(obj[1:7], tp(contents))
 
     def test_refs(self):
-        m = memoryview(b"ab")
-        oldrefcount = sys.getrefcount(m)
-        m[1:2]
-        self.assertEquals(sys.getrefcount(m), oldrefcount)
-
+        for tp in self._types:
+            m = memoryview(tp(self._source))
+            oldrefcount = sys.getrefcount(m)
+            m[1:2]
+            self.assertEquals(sys.getrefcount(m), oldrefcount)
 
-class MemorySliceSliceTest(unittest.TestCase, CommonMemoryTests):
-    base_object = b"XabcdefY"
+class BaseMemorySliceSliceTests:
+    source_bytes = b"XabcdefY"
 
     def _view(self, obj):
         m = memoryview(obj)
         return m[:7][1:]
 
-    def _check_contents(self, obj, contents):
-        self.assertEquals(obj[1:7], contents)
+    def _check_contents(self, tp, obj, contents):
+        self.assertEquals(obj[1:7], tp(contents))
 
 
-def test_main():
-    test.support.run_unittest(
-        MemoryviewTest, MemorySliceTest, MemorySliceSliceTest)
+# Concrete test classes
+
+class BytesMemoryviewTest(unittest.TestCase,
+    BaseMemoryviewTests, BaseBytesMemoryTests):
+
+    def test_constructor(self):
+        for tp in self._types:
+            ob = tp(self._source)
+            self.assert_(memoryview(ob))
+            self.assert_(memoryview(object=ob))
+            self.assertRaises(TypeError, memoryview)
+            self.assertRaises(TypeError, memoryview, ob, ob)
+            self.assertRaises(TypeError, memoryview, argument=ob)
+            self.assertRaises(TypeError, memoryview, ob, argument=True)
+
+class ArrayMemoryviewTest(unittest.TestCase,
+    BaseMemoryviewTests, BaseArrayMemoryTests):
+
+    def test_array_assign(self):
+        # Issue #4569: segfault when mutating a memoryview with itemsize != 1
+        a = array.array('i', range(10))
+        m = memoryview(a)
+        new_a = array.array('i', range(9, -1, -1))
+        m[:] = new_a
+        self.assertEquals(a, new_a)
 
 
+class BytesMemorySliceTest(unittest.TestCase,
+    BaseMemorySliceTests, BaseBytesMemoryTests):
+    pass
+
+class ArrayMemorySliceTest(unittest.TestCase,
+    BaseMemorySliceTests, BaseArrayMemoryTests):
+    pass
+
+class BytesMemorySliceSliceTest(unittest.TestCase,
+    BaseMemorySliceSliceTests, BaseBytesMemoryTests):
+    pass
+
+class ArrayMemorySliceSliceTest(unittest.TestCase,
+    BaseMemorySliceSliceTests, BaseArrayMemoryTests):
+    pass
+
+
+def test_main():
+    test.support.run_unittest(__name__)
+
 if __name__ == "__main__":
     test_main()

Modified: python/branches/py3k-issue1717/Lib/test/test_multibytecodec.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_multibytecodec.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_multibytecodec.py	Sun Jan 25 21:08:20 2009
@@ -44,7 +44,7 @@
         myreplace  = lambda exc: ('', sys.maxsize+1)
         codecs.register_error('test.cjktest', myreplace)
         self.assertRaises(IndexError, dec,
-                          'apple\x92ham\x93spam', 'test.cjktest')
+                          b'apple\x92ham\x93spam', 'test.cjktest')
 
     def test_codingspec(self):
         try:
@@ -61,6 +61,10 @@
         self.assertRaises(AttributeError,
                           _multibytecodec.MultibyteStreamWriter, None)
 
+    def test_decode_unicode(self):
+        # Trying to decode an unicode string should raise a TypeError
+        for enc in ALL_CJKENCODINGS:
+            self.assertRaises(TypeError, codecs.getdecoder(enc), "")
 
 class Test_IncrementalEncoder(unittest.TestCase):
 
@@ -146,6 +150,12 @@
         self.assertRaises(UnicodeDecodeError, decoder.decode, b'', True)
         self.assertEqual(decoder.decode(b'B@$'), '\u4e16')
 
+    def test_decode_unicode(self):
+        # Trying to decode an unicode string should raise a TypeError
+        for enc in ALL_CJKENCODINGS:
+            decoder = codecs.getincrementaldecoder(enc)()
+            self.assertRaises(TypeError, decoder.decode, "")
+
 class Test_StreamReader(unittest.TestCase):
     def test_bug1728403(self):
         try:

Modified: python/branches/py3k-issue1717/Lib/test/test_multiprocessing.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_multiprocessing.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_multiprocessing.py	Sun Jan 25 21:08:20 2009
@@ -62,6 +62,8 @@
 HAVE_GETVALUE = not getattr(_multiprocessing,
                             'HAVE_BROKEN_SEM_GETVALUE', False)
 
+WIN32 = (sys.platform == "win32")
+
 #
 # Creates a wrapper for a function which records the time it takes to finish
 #
@@ -830,10 +832,16 @@
         obj3 = val3.get_obj()
         self.assertEqual(lock, lock3)
 
-        arr4 = self.RawValue('i', 5)
+        arr4 = self.Value('i', 5, lock=False)
         self.assertFalse(hasattr(arr4, 'get_lock'))
         self.assertFalse(hasattr(arr4, 'get_obj'))
 
+        self.assertRaises(AttributeError, self.Value, 'i', 5, lock='navalue')
+
+        arr5 = self.RawValue('i', 5)
+        self.assertFalse(hasattr(arr5, 'get_lock'))
+        self.assertFalse(hasattr(arr5, 'get_obj'))
+
 
 class _TestArray(BaseTestCase):
 
@@ -888,9 +896,15 @@
         obj3 = arr3.get_obj()
         self.assertEqual(lock, lock3)
 
-        arr4 = self.RawArray('i', list(range(10)))
+        arr4 = self.Array('i', range(10), lock=False)
         self.assertFalse(hasattr(arr4, 'get_lock'))
         self.assertFalse(hasattr(arr4, 'get_obj'))
+        self.assertRaises(AttributeError,
+                          self.Array, 'i', range(10), lock='notalock')
+
+        arr5 = self.RawArray('i', range(10))
+        self.assertFalse(hasattr(arr5, 'get_lock'))
+        self.assertFalse(hasattr(arr5, 'get_obj'))
 
 #
 #
@@ -1044,8 +1058,10 @@
         multiprocessing.active_children()  # discard dead process objs
         gc.collect()                       # do garbage collection
         refs = self.manager._number_of_objects()
+        debug_info = self.manager._debug_info()
         if refs != EXPECTED_NUMBER:
             print(self.manager._debug_info())
+            print(debug_info)
 
         self.assertEqual(refs, EXPECTED_NUMBER)
 
@@ -1671,6 +1687,18 @@
         logger.setLevel(level=LOG_LEVEL)
 
 #
+# Test to verify handle verification, see issue 3321
+#
+
+class TestInvalidHandle(unittest.TestCase):
+
+    def test_invalid_handles(self):
+        if WIN32:
+            return
+        conn = _multiprocessing.Connection(44977608)
+        self.assertRaises(IOError, conn.poll)
+        self.assertRaises(IOError, _multiprocessing.Connection, -1)
+#
 # Functions used to create test cases from the base ones in this module
 #
 
@@ -1774,7 +1802,7 @@
                           multiprocessing.connection.answer_challenge,
                           _FakeConnection(), b'abc')
 
-testcases_other = [OtherTest]
+testcases_other = [OtherTest, TestInvalidHandle]
 
 #
 #

Modified: python/branches/py3k-issue1717/Lib/test/test_os.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_os.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_os.py	Sun Jan 25 21:08:20 2009
@@ -587,6 +587,67 @@
     def test_chmod(self):
         self.assertRaises(WindowsError, os.utime, support.TESTFN, 0)
 
+class TestInvalidFD(unittest.TestCase):
+    singles = ["fchdir", "dup", "fdopen", "fdatasync", "fstat",
+               "fstatvfs", "fsync", "tcgetpgrp", "ttyname"]
+    #singles.append("close")
+    #We omit close because it doesn'r raise an exception on some platforms
+    def get_single(f):
+        def helper(self):
+            if  hasattr(os, f):
+                self.check(getattr(os, f))
+        return helper
+    for f in singles:
+        locals()["test_"+f] = get_single(f)
+
+    def check(self, f, *args):
+        self.assertRaises(OSError, f, support.make_bad_fd(), *args)
+
+    def test_isatty(self):
+        if hasattr(os, "isatty"):
+            self.assertEqual(os.isatty(support.make_bad_fd()), False)
+
+    def test_closerange(self):
+        if hasattr(os, "closerange"):
+            fd = support.make_bad_fd()
+            self.assertEqual(os.closerange(fd, fd + 10), None)
+
+    def test_dup2(self):
+        if hasattr(os, "dup2"):
+            self.check(os.dup2, 20)
+
+    def test_fchmod(self):
+        if hasattr(os, "fchmod"):
+            self.check(os.fchmod, 0)
+
+    def test_fchown(self):
+        if hasattr(os, "fchown"):
+            self.check(os.fchown, -1, -1)
+
+    def test_fpathconf(self):
+        if hasattr(os, "fpathconf"):
+            self.check(os.fpathconf, "PC_NAME_MAX")
+
+    def test_ftruncate(self):
+        if hasattr(os, "ftruncate"):
+            self.check(os.ftruncate, 0)
+
+    def test_lseek(self):
+        if hasattr(os, "lseek"):
+            self.check(os.lseek, 0, 0)
+
+    def test_read(self):
+        if hasattr(os, "read"):
+            self.check(os.read, 1)
+
+    def test_tcsetpgrpt(self):
+        if hasattr(os, "tcsetpgrp"):
+            self.check(os.tcsetpgrp, 0)
+
+    def test_write(self):
+        if hasattr(os, "write"):
+            self.check(os.write, b" ")
+
 if sys.platform != 'win32':
     class Win32ErrorTests(unittest.TestCase):
         pass
@@ -601,7 +662,8 @@
         DevNullTests,
         URandomTests,
         ExecTests,
-        Win32ErrorTests
+        Win32ErrorTests,
+        TestInvalidFD
     )
 
 if __name__ == "__main__":

Modified: python/branches/py3k-issue1717/Lib/test/test_socket.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_socket.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_socket.py	Sun Jan 25 21:08:20 2009
@@ -603,6 +603,10 @@
         # Testing shutdown()
         msg = self.cli_conn.recv(1024)
         self.assertEqual(msg, MSG)
+        # wait for _testShutdown to finish: on OS X, when the server
+        # closes the connection the client also becomes disconnected,
+        # and the client's shutdown call will fail. (Issue #4397.)
+        self.done.wait()
 
     def _testShutdown(self):
         self.serv_conn.send(MSG)
@@ -856,6 +860,16 @@
         self.assertEqual(self.cli_file.mode, 'wb')
         self.assertEqual(self.cli_file.name, self.serv_conn.fileno())
 
+    def testRealClose(self):
+        self.serv_file.close()
+        self.assertRaises(ValueError, self.serv_file.fileno)
+        self.cli_conn.close()
+        self.assertRaises(socket.error, self.cli_conn.getsockname)
+
+    def _testRealClose(self):
+        pass
+
+
 class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase):
 
     """Repeat the tests from FileObjectClassTestCase with bufsize==0.
@@ -881,6 +895,29 @@
         self.cli_file.write(b"B. " + MSG)
         self.cli_file.flush()
 
+    def testMakefileClose(self):
+        # The file returned by makefile should keep the socket open...
+        self.cli_conn.close()
+        msg = self.cli_conn.recv(1024)
+        self.assertEqual(msg, MSG)
+        # ...until the file is itself closed
+        self.serv_file.close()
+        self.assertRaises(socket.error, self.cli_conn.recv, 1024)
+
+    def _testMakefileClose(self):
+        self.cli_file.write(MSG)
+        self.cli_file.flush()
+
+    def testMakefileCloseSocketDestroy(self):
+        refcount_before = sys.getrefcount(self.cli_conn)
+        self.serv_file.close()
+        refcount_after = sys.getrefcount(self.cli_conn)
+        self.assertEqual(refcount_before - 1, refcount_after)
+
+    def _testMakefileCloseSocketDestroy(self):
+        pass
+
+
 class LineBufferedFileObjectClassTestCase(FileObjectClassTestCase):
 
     bufsize = 1 # Default-buffered for reading; line-buffered for writing

Modified: python/branches/py3k-issue1717/Lib/test/test_struct.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_struct.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_struct.py	Sun Jan 25 21:08:20 2009
@@ -2,6 +2,8 @@
 import unittest
 import struct
 import warnings
+warnings.filterwarnings("ignore", "struct integer overflow masking is deprecated",
+                        DeprecationWarning)
 
 from functools import wraps
 from test.support import TestFailed, verbose, run_unittest
@@ -469,6 +471,11 @@
                 self.check_float_coerce(endian + fmt, 1.0)
                 self.check_float_coerce(endian + fmt, 1.5)
 
+    def test_issue4228(self):
+        # Packing a long may yield either 32 or 64 bits
+        x = struct.pack('L', -1)[:4]
+        self.assertEqual(x, b'\xff'*4)
+
     def test_unpack_from(self):
         test_string = b'abcd01234'
         fmt = '4s'

Modified: python/branches/py3k-issue1717/Lib/test/test_sys.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_sys.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_sys.py	Sun Jan 25 21:08:20 2009
@@ -559,7 +559,7 @@
         check(32768*32768-1, size(vh) + 2*self.H)
         check(32768*32768, size(vh) + 3*self.H)
         # memory
-        check(memoryview(b''), size(h + 'P PP2P2i5P'))
+        check(memoryview(b''), size(h + 'P PP2P2i7P'))
         # module
         check(unittest, size(h + '3P'))
         # None

Modified: python/branches/py3k-issue1717/Lib/test/test_urllib.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_urllib.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_urllib.py	Sun Jan 25 21:08:20 2009
@@ -130,10 +130,14 @@
             os.environ[k] = v
 
     def test_getproxies_environment_keep_no_proxies(self):
-        os.environ['NO_PROXY'] = 'localhost'
-        proxies = urllib.request.getproxies_environment()
-        # getproxies_environment use lowered case truncated (no '_proxy') keys
-        self.assertEquals('localhost', proxies['no'])
+        try:
+            os.environ['NO_PROXY'] = 'localhost'
+            proxies = urllib.request.getproxies_environment()
+            # getproxies_environment use lowered case truncated (no '_proxy') keys
+            self.assertEquals('localhost', proxies['no'])
+        finally:
+            # The old value will be restored by tearDown, if applicable.
+            del os.environ['NO_PROXY']
 
 
 class urlopen_HttpTests(unittest.TestCase):

Modified: python/branches/py3k-issue1717/Lib/test/test_wsgiref.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_wsgiref.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_wsgiref.py	Sun Jan 25 21:08:20 2009
@@ -50,7 +50,7 @@
 def run_amock(app=hello_app, data=b"GET / HTTP/1.0\n\n"):
     server = make_server("", 80, app, MockServer, MockHandler)
     inp = BufferedReader(BytesIO(data))
-    out = StringIO()
+    out = BytesIO()
     olderr = sys.stderr
     err = sys.stderr = StringIO()
 
@@ -128,13 +128,13 @@
 
     def check_hello(self, out, has_length=True):
         self.assertEqual(out,
-            "HTTP/1.0 200 OK\r\n"
+            ("HTTP/1.0 200 OK\r\n"
             "Server: WSGIServer/0.1 Python/"+sys.version.split()[0]+"\r\n"
             "Content-Type: text/plain\r\n"
             "Date: Mon, 05 Jun 2006 18:49:54 GMT\r\n" +
             (has_length and  "Content-Length: 13\r\n" or "") +
             "\r\n"
-            "Hello, world!"
+            "Hello, world!").encode("iso-8859-1")
         )
 
     def test_plain_hello(self):
@@ -152,7 +152,7 @@
             return ["Hello, world!"]
         out, err = run_amock(validator(bad_app))
         self.failUnless(out.endswith(
-            "A server error occurred.  Please contact the administrator."
+            b"A server error occurred.  Please contact the administrator."
         ))
         self.assertEqual(
             err.splitlines()[-2],
@@ -160,7 +160,37 @@
             " be of type list: <class 'tuple'>"
         )
 
+    def test_wsgi_input(self):
+        def bad_app(e,s):
+            e["wsgi.input"].read()
+            s(b"200 OK", [(b"Content-Type", b"text/plain; charset=utf-8")])
+            return [b"data"]
+        out, err = run_amock(validator(bad_app))
+        self.failUnless(out.endswith(
+            b"A server error occurred.  Please contact the administrator."
+        ))
+        self.assertEqual(
+            err.splitlines()[-2], "AssertionError"
+        )
 
+    def test_bytes_validation(self):
+        def app(e, s):
+            s(b"200 OK", [
+                (b"Content-Type", b"text/plain; charset=utf-8"),
+                ("Date", "Wed, 24 Dec 2008 13:29:32 GMT"),
+                ])
+            return [b"data"]
+        out, err = run_amock(validator(app))
+        self.failUnless(err.endswith('"GET / HTTP/1.0" 200 4\n'))
+        ver = sys.version.split()[0].encode('ascii')
+        self.assertEqual(
+                b"HTTP/1.0 200 OK\r\n"
+                b"Server: WSGIServer/0.1 Python/" + ver + b"\r\n"
+                b"Content-Type: text/plain; charset=utf-8\r\n"
+                b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n"
+                b"\r\n"
+                b"data",
+                out)
 
 
 
@@ -181,6 +211,8 @@
         util.setup_testing_defaults(env)
         if isinstance(value,StringIO):
             self.failUnless(isinstance(env[key],StringIO))
+        elif isinstance(value,BytesIO):
+            self.failUnless(isinstance(env[key],BytesIO))
         else:
             self.assertEqual(env[key],value)
 
@@ -260,7 +292,7 @@
             ('wsgi.run_once', 0),
             ('wsgi.multithread', 0),
             ('wsgi.multiprocess', 0),
-            ('wsgi.input', StringIO("")),
+            ('wsgi.input', BytesIO()),
             ('wsgi.errors', StringIO()),
             ('wsgi.url_scheme','http'),
         ]:
@@ -386,6 +418,28 @@
             '\r\n'
         )
 
+    def testBytes(self):
+        h = Headers([
+            (b"Content-Type", b"text/plain; charset=utf-8"),
+            ])
+        self.assertEqual("text/plain; charset=utf-8", h.get("Content-Type"))
+
+        h[b"Foo"] = bytes(b"bar")
+        self.assertEqual("bar", h.get("Foo"))
+        self.assertEqual("bar", h.get(b"Foo"))
+
+        h.setdefault(b"Bar", b"foo")
+        self.assertEqual("foo", h.get("Bar"))
+        self.assertEqual("foo", h.get(b"Bar"))
+
+        h.add_header(b'content-disposition', b'attachment',
+            filename=b'bud.gif')
+        self.assertEqual('attachment; filename="bud.gif"',
+            h.get("content-disposition"))
+
+        del h['content-disposition']
+        self.assert_(b'content-disposition' not in h)
+
 
 class ErrorHandler(BaseCGIHandler):
     """Simple handler subclass for testing BaseHandler"""
@@ -393,7 +447,7 @@
     def __init__(self,**kw):
         setup_testing_defaults(kw)
         BaseCGIHandler.__init__(
-            self, StringIO(''), StringIO(), StringIO(), kw,
+            self, BytesIO(), BytesIO(), StringIO(), kw,
             multithread=True, multiprocess=True
         )
 
@@ -474,21 +528,32 @@
             s('200 OK',[])(e['wsgi.url_scheme'])
             return []
 
+        def trivial_app3(e,s):
+            s('200 OK',[])
+            return ['\u0442\u0435\u0441\u0442'.encode("utf-8")]
+
         h = TestHandler()
         h.run(trivial_app1)
         self.assertEqual(h.stdout.getvalue(),
-            "Status: 200 OK\r\n"
+            ("Status: 200 OK\r\n"
             "Content-Length: 4\r\n"
             "\r\n"
-            "http")
+            "http").encode("iso-8859-1"))
 
         h = TestHandler()
         h.run(trivial_app2)
         self.assertEqual(h.stdout.getvalue(),
-            "Status: 200 OK\r\n"
+            ("Status: 200 OK\r\n"
             "\r\n"
-            "http")
+            "http").encode("iso-8859-1"))
 
+        h = TestHandler()
+        h.run(trivial_app3)
+        self.assertEqual(h.stdout.getvalue(),
+            b'Status: 200 OK\r\n'
+            b'Content-Length: 8\r\n'
+            b'\r\n'
+            b'\xd1\x82\xd0\xb5\xd1\x81\xd1\x82')
 
 
 
@@ -507,18 +572,19 @@
         h = ErrorHandler()
         h.run(non_error_app)
         self.assertEqual(h.stdout.getvalue(),
-            "Status: 200 OK\r\n"
+            ("Status: 200 OK\r\n"
             "Content-Length: 0\r\n"
-            "\r\n")
+            "\r\n").encode("iso-8859-1"))
         self.assertEqual(h.stderr.getvalue(),"")
 
         h = ErrorHandler()
         h.run(error_app)
         self.assertEqual(h.stdout.getvalue(),
-            "Status: %s\r\n"
+            ("Status: %s\r\n"
             "Content-Type: text/plain\r\n"
             "Content-Length: %d\r\n"
-            "\r\n%s" % (h.error_status,len(h.error_body),h.error_body))
+            "\r\n%s" % (h.error_status,len(h.error_body),h.error_body)
+            ).encode("iso-8859-1"))
 
         self.failUnless("AssertionError" in h.stderr.getvalue())
 
@@ -531,8 +597,8 @@
         h = ErrorHandler()
         h.run(error_app)
         self.assertEqual(h.stdout.getvalue(),
-            "Status: 200 OK\r\n"
-            "\r\n"+MSG)
+            ("Status: 200 OK\r\n"
+            "\r\n"+MSG).encode("iso-8859-1"))
         self.failUnless("AssertionError" in h.stderr.getvalue())
 
 
@@ -549,7 +615,7 @@
         )
         shortpat = (
             "Status: 200 OK\r\n" "Content-Length: 0\r\n" "\r\n"
-        )
+        ).encode("iso-8859-1")
 
         for ssw in "FooBar/1.0", None:
             sw = ssw and "Server: %s\r\n" % ssw or ""
@@ -570,13 +636,31 @@
                     h.server_software = ssw
                     h.run(non_error_app)
                     if proto=="HTTP/0.9":
-                        self.assertEqual(h.stdout.getvalue(),"")
+                        self.assertEqual(h.stdout.getvalue(),b"")
                     else:
                         self.failUnless(
-                            re.match(stdpat%(version,sw), h.stdout.getvalue()),
-                            (stdpat%(version,sw), h.stdout.getvalue())
+                            re.match((stdpat%(version,sw)).encode("iso-8859-1"),
+                                h.stdout.getvalue()),
+                            ((stdpat%(version,sw)).encode("iso-8859-1"),
+                                h.stdout.getvalue())
                         )
 
+    def testBytesData(self):
+        def app(e, s):
+            s(b"200 OK", [
+                (b"Content-Type", b"text/plain; charset=utf-8"),
+                ])
+            return [b"data"]
+
+        h = TestHandler()
+        h.run(app)
+        self.assertEqual(b"Status: 200 OK\r\n"
+            b"Content-Type: text/plain; charset=utf-8\r\n"
+            b"Content-Length: 4\r\n"
+            b"\r\n"
+            b"data",
+            h.stdout.getvalue())
+
 # This epilogue is needed for compatibility with the Python 2.5 regrtest module
 
 def test_main():

Modified: python/branches/py3k-issue1717/Lib/test/test_xmlrpc.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_xmlrpc.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_xmlrpc.py	Sun Jan 25 21:08:20 2009
@@ -232,7 +232,7 @@
         self.assertEqual(str(t2), str(d, "latin-1"))
 
 
-PORT = None
+ADDR = PORT = URL = None
 
 # The evt is set twice.  First when the server is ready to serve.
 # Second when the server has been shutdown.  The user must clear
@@ -258,12 +258,17 @@
             s.setblocking(True)
             return s, port
 
+    serv = MyXMLRPCServer(("localhost", 0),
+                          logRequests=False, bind_and_activate=False)
     try:
-        serv = MyXMLRPCServer(("localhost", 0),
-                              logRequests=False, bind_and_activate=False)
         serv.server_bind()
-        global PORT
-        PORT = serv.socket.getsockname()[1]
+        global ADDR, PORT, URL
+        ADDR, PORT = serv.socket.getsockname()
+        #connect to IP address directly.  This avoids socket.create_connection()
+        #trying to connect to to "localhost" using all address families, which
+        #causes slowdown e.g. on vista which supports AF_INET6.  The server listens
+        #on AF_INET only.
+        URL = "http://%s:%d"%(ADDR, PORT)
         serv.server_activate()
         serv.register_introspection_functions()
         serv.register_multicall_functions()
@@ -331,7 +336,7 @@
 
     def test_simple1(self):
         try:
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             self.assertEqual(p.pow(6,8), 6**8)
         except (xmlrpclib.ProtocolError, socket.error) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
@@ -343,7 +348,7 @@
     def XXXtest_404(self):
         # send POST with http.client, it should return 404 header and
         # 'Not Found' message.
-        conn = http.client.HTTPConnection('localhost', PORT)
+        conn = httplib.client.HTTPConnection(ADDR, PORT)
         conn.request('POST', '/this-is-not-valid')
         response = conn.getresponse()
         conn.close()
@@ -356,7 +361,7 @@
                                 'system.listMethods', 'system.methodHelp',
                                 'system.methodSignature', 'system.multicall'])
         try:
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             meth = p.system.listMethods()
             self.assertEqual(set(meth), expected_methods)
         except (xmlrpclib.ProtocolError, socket.error) as e:
@@ -369,7 +374,7 @@
     def test_introspection2(self):
         try:
             # test _methodHelp()
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             divhelp = p.system.methodHelp('div')
             self.assertEqual(divhelp, 'This is the div function')
         except (xmlrpclib.ProtocolError, socket.error) as e:
@@ -381,7 +386,7 @@
     def test_introspection3(self):
         try:
             # test native doc
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             myfunction = p.system.methodHelp('my_function')
             self.assertEqual(myfunction, 'This is my function')
         except (xmlrpclib.ProtocolError, socket.error) as e:
@@ -394,7 +399,7 @@
         # the SimpleXMLRPCServer doesn't support signatures, but
         # at least check that we can try making the call
         try:
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             divsig = p.system.methodSignature('div')
             self.assertEqual(divsig, 'signatures not supported')
         except (xmlrpclib.ProtocolError, socket.error) as e:
@@ -405,7 +410,7 @@
 
     def test_multicall(self):
         try:
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             multicall = xmlrpclib.MultiCall(p)
             multicall.add(2,3)
             multicall.pow(6,8)
@@ -422,7 +427,7 @@
 
     def test_non_existing_multicall(self):
         try:
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             multicall = xmlrpclib.MultiCall(p)
             multicall.this_is_not_exists()
             result = multicall()
@@ -491,7 +496,7 @@
 
         # test a call that shouldn't fail just as a smoke test
         try:
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             self.assertEqual(p.pow(6,8), 6**8)
         except (xmlrpclib.ProtocolError, socket.error) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
@@ -504,7 +509,7 @@
         xmlrpc.server.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass
 
         try:
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             p.pow(6,8)
         except (xmlrpclib.ProtocolError, socket.error) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
@@ -524,7 +529,7 @@
         xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = True
 
         try:
-            p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+            p = xmlrpclib.ServerProxy(URL)
             p.pow(6,8)
         except (xmlrpclib.ProtocolError, socket.error) as e:
             # ignore failures due to non-blocking socket 'unavailable' errors
@@ -605,15 +610,9 @@
 def test_main():
     xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase,
          BinaryTestCase, FaultTestCase]
-
-    # The test cases against a SimpleXMLRPCServer raise a socket error
-    # 10035 (WSAEWOULDBLOCK) in the server thread handle_request call when
-    # run on Windows. This only happens on the first test to run, but it
-    # fails every time and so these tests are skipped on win32 platforms.
-    if sys.platform != 'win32':
-        xmlrpc_tests.append(SimpleServerTestCase)
-        xmlrpc_tests.append(FailingServerTestCase)
-        xmlrpc_tests.append(CGIHandlerTestCase)
+    xmlrpc_tests.append(SimpleServerTestCase)
+    xmlrpc_tests.append(FailingServerTestCase)
+    xmlrpc_tests.append(CGIHandlerTestCase)
 
     support.run_unittest(*xmlrpc_tests)
 

Modified: python/branches/py3k-issue1717/Lib/test/test_zipfile.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/test/test_zipfile.py	(original)
+++ python/branches/py3k-issue1717/Lib/test/test_zipfile.py	Sun Jan 25 21:08:20 2009
@@ -9,9 +9,10 @@
 from random import randint, random
 
 import test.support as support
-from test.support import TESTFN, run_unittest
+from test.support import TESTFN, run_unittest, findfile
 
 TESTFN2 = TESTFN + "2"
+TESTFNDIR = TESTFN + "d"
 FIXEDTEST_SIZE = 1000
 
 SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'),
@@ -1000,6 +1001,28 @@
     def tearDown(self):
         os.remove(TESTFN2)
 
+class TestWithDirectory(unittest.TestCase):
+    def setUp(self):
+        os.mkdir(TESTFN2)
+
+    def testExtractDir(self):
+        zipf = zipfile.ZipFile(findfile("zipdir.zip"))
+        zipf.extractall(TESTFN2)
+        self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a")))
+        self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b")))
+        self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c")))
+
+    def testStoreDir(self):
+        os.mkdir(os.path.join(TESTFN2, "x"))
+        zipf = zipfile.ZipFile(TESTFN, "w")
+        zipf.write(os.path.join(TESTFN2, "x"), "x")
+        self.assertTrue(zipf.filelist[0].filename.endswith("x/"))
+
+    def tearDown(self):
+        shutil.rmtree(TESTFN2)
+        if os.path.exists(TESTFN):
+            os.remove(TESTFN)
+
 
 class UniversalNewlineTests(unittest.TestCase):
     def setUp(self):
@@ -1114,6 +1137,7 @@
 def test_main():
     run_unittest(TestsWithSourceFile, TestZip64InSmallFiles, OtherTests,
                  PyZipFileTests, DecryptionTests, TestsWithMultipleOpens,
+                 TestWithDirectory,
                  UniversalNewlineTests, TestsWithRandomBinaryFiles)
 
 if __name__ == "__main__":

Modified: python/branches/py3k-issue1717/Lib/tkinter/__init__.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/tkinter/__init__.py	(original)
+++ python/branches/py3k-issue1717/Lib/tkinter/__init__.py	Sun Jan 25 21:08:20 2009
@@ -49,12 +49,6 @@
 WRITABLE = _tkinter.WRITABLE
 EXCEPTION = _tkinter.EXCEPTION
 
-# These are not always defined, e.g. not on Win32 with Tk 8.0 :-(
-try: _tkinter.createfilehandler
-except AttributeError: _tkinter.createfilehandler = None
-try: _tkinter.deletefilehandler
-except AttributeError: _tkinter.deletefilehandler = None
-
 
 def _flatten(seq):
     """Internal function."""

Modified: python/branches/py3k-issue1717/Lib/tkinter/_fix.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/tkinter/_fix.py	(original)
+++ python/branches/py3k-issue1717/Lib/tkinter/_fix.py	Sun Jan 25 21:08:20 2009
@@ -10,6 +10,40 @@
 # <TCL_LIBRARY>\..\tcl<TCL_VERSION>, so anything close to
 # the real Tcl library will do.
 
+# Expand symbolic links on Vista
+try:
+    import ctypes
+    ctypes.windll.kernel32.GetFinalPathNameByHandleW
+except (ImportError, AttributeError):
+    def convert_path(s):
+        return s
+else:
+    def convert_path(s):
+        if isinstance(s, bytes):
+            s = s.decode("mbcs")
+        hdir = ctypes.windll.kernel32.\
+            CreateFileW(s, 0x80,    # FILE_READ_ATTRIBUTES
+                        1,          # FILE_SHARE_READ
+                        None, 3,    # OPEN_EXISTING
+                        0x02000000, # FILE_FLAG_BACKUP_SEMANTICS
+                        None)
+        if hdir == -1:
+            # Cannot open directory, give up
+            return s
+        buf = ctypes.create_unicode_buffer("", 32768)
+        res = ctypes.windll.kernel32.\
+            GetFinalPathNameByHandleW(hdir, buf, len(buf),
+                                      0) # VOLUME_NAME_DOS
+        ctypes.windll.kernel32.CloseHandle(hdir)
+        if res == 0:
+            # Conversion failed (e.g. network location)
+            return s
+        s = buf[:res]
+        # Ignore leading \\?\
+        if s.startswith("\\\\?\\"):
+            s = s[4:]
+        return s
+
 prefix = os.path.join(sys.prefix,"tcl")
 if not os.path.exists(prefix):
     # devdir/../tcltk/lib
@@ -17,6 +51,7 @@
     prefix = os.path.abspath(prefix)
 # if this does not exist, no further search is needed
 if os.path.exists(prefix):
+    prefix = convert_path(prefix)
     if "TCL_LIBRARY" not in os.environ:
         for name in os.listdir(prefix):
             if name.startswith("tcl"):

Modified: python/branches/py3k-issue1717/Lib/tkinter/tix.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/tkinter/tix.py	(original)
+++ python/branches/py3k-issue1717/Lib/tkinter/tix.py	Sun Jan 25 21:08:20 2009
@@ -293,7 +293,7 @@
         else:
             static_options = ['options']
 
-        for k,v in cnf.items()[:]:
+        for k,v in list(cnf.items()):
             if k in static_options:
                 extra = extra + ('-' + k, v)
                 del cnf[k]
@@ -448,7 +448,7 @@
         # we must be careful not to destroy the frame widget since this
         # also destroys the parent NoteBook thus leading to an exception
         # in Tkinter when it finally calls Tcl to destroy the NoteBook
-        for c in self.children.values(): c.destroy()
+        for c in list(self.children.values()): c.destroy()
         if self._name in self.master.children:
             del self.master.children[self._name]
         if self._name in self.master.subwidget_list:

Modified: python/branches/py3k-issue1717/Lib/unittest.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/unittest.py	(original)
+++ python/branches/py3k-issue1717/Lib/unittest.py	Sun Jan 25 21:08:20 2009
@@ -73,7 +73,7 @@
 
 __unittest = 1
 
-class TestResult:
+class TestResult(object):
     """Holder for test result information.
 
     Test results are automatically managed by the TestCase and TestSuite
@@ -149,7 +149,7 @@
                (_strclass(self.__class__), self.testsRun, len(self.errors),
                 len(self.failures))
 
-class AssertRaisesContext:
+class AssertRaisesContext(object):
     def __init__(self, expected, test_case, callable_obj=None):
         self.expected = expected
         self.failureException = test_case.failureException
@@ -179,7 +179,7 @@
         # Let unexpected exceptions skip through
         return False
 
-class TestCase:
+class TestCase(object):
     """A class whose instances are single test cases.
 
     By default, the test code itself should be placed in a method named
@@ -217,8 +217,8 @@
             testMethod = getattr(self, methodName)
             self._testMethodDoc = testMethod.__doc__
         except AttributeError:
-            raise ValueError("no such test method in %s: %s"
-                             % (self.__class__, methodName))
+            raise ValueError("no such test method in %s: %s" % \
+                  (self.__class__, methodName))
 
     def setUp(self):
         "Hook method for setting up the test fixture before exercising it."
@@ -273,9 +273,7 @@
         try:
             try:
                 self.setUp()
-            except KeyboardInterrupt:
-                raise
-            except:
+            except Exception:
                 result.addError(self, self._exc_info())
                 return
 
@@ -285,16 +283,12 @@
                 ok = True
             except self.failureException:
                 result.addFailure(self, self._exc_info())
-            except KeyboardInterrupt:
-                raise
-            except:
+            except Exception:
                 result.addError(self, self._exc_info())
 
             try:
                 self.tearDown()
-            except KeyboardInterrupt:
-                raise
-            except:
+            except Exception:
                 result.addError(self, self._exc_info())
                 ok = False
             if ok: result.addSuccess(self)
@@ -372,8 +366,8 @@
            as significant digits (measured from the most signficant digit).
         """
         if round(abs(second-first), places) != 0:
-            raise self.failureException(msg or '%r != %r within %r places'
-                                               % (first, second, places))
+            raise self.failureException(
+                  msg or '%r != %r within %r places' % (first, second, places))
 
     def failIfAlmostEqual(self, first, second, *, places=7, msg=None):
         """Fail if the two objects are equal as determined by their
@@ -384,8 +378,8 @@
            as significant digits (measured from the most signficant digit).
         """
         if round(abs(second-first), places) == 0:
-            raise self.failureException(msg or '%r == %r within %r places'
-                                               % (first, second, places))
+            raise self.failureException(
+                  msg or '%r == %r within %r places' % (first, second, places))
 
     # Synonyms for assertion methods
 
@@ -405,7 +399,7 @@
 
 
 
-class TestSuite:
+class TestSuite(object):
     """A test suite is a composite test consisting of a number of TestCases.
 
     For use, create an instance of TestSuite, then add test case instances.
@@ -548,7 +542,7 @@
 def cmp(x, y):
     return (x > y) - (x < y)
 
-class TestLoader:
+class TestLoader(object):
     """This class is responsible for loading tests according to various
     criteria and returning them wrapped in a TestSuite
     """
@@ -599,7 +593,7 @@
         for part in parts:
             parent, obj = obj, getattr(obj, part)
 
-        if type(obj) == types.ModuleType:
+        if isinstance(obj, types.ModuleType):
             return self.loadTestsFromModule(obj)
         elif isinstance(obj, type) and issubclass(obj, TestCase):
             return self.loadTestsFromTestCase(obj)
@@ -675,7 +669,7 @@
 # Text UI
 ##############################################################################
 
-class _WritelnDecorator:
+class _WritelnDecorator(object):
     """Used to decorate file-like objects with a handy 'writeln' method"""
     def __init__(self,stream):
         self.stream = stream
@@ -754,7 +748,7 @@
             self.stream.writeln("%s" % err)
 
 
-class TextTestRunner:
+class TextTestRunner(object):
     """A test runner class that displays results in textual form.
 
     It prints out the names of tests as they are run, errors as they
@@ -800,7 +794,7 @@
 # Facilities for running tests from the command line
 ##############################################################################
 
-class TestProgram:
+class TestProgram(object):
     """A command-line program that runs a set of tests; this is primarily
        for making test modules conveniently executable.
     """
@@ -822,7 +816,7 @@
     def __init__(self, module='__main__', defaultTest=None,
                  argv=None, testRunner=TextTestRunner,
                  testLoader=defaultTestLoader):
-        if type(module) == type(''):
+        if isinstance(module, str):
             self.module = __import__(module)
             for part in module.split('.')[1:]:
                 self.module = getattr(self.module, part)

Modified: python/branches/py3k-issue1717/Lib/wsgiref/handlers.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/wsgiref/handlers.py	(original)
+++ python/branches/py3k-issue1717/Lib/wsgiref/handlers.py	Sun Jan 25 21:08:20 2009
@@ -157,19 +157,29 @@
         elif self.headers is not None:
             raise AssertionError("Headers already set!")
 
-        assert type(status) is str,"Status must be a string"
+        status = self._convert_string_type(status, "Status")
         assert len(status)>=4,"Status must be at least 4 characters"
         assert int(status[:3]),"Status message must begin w/3-digit code"
         assert status[3]==" ", "Status message must have a space after code"
-        if __debug__:
-            for name,val in headers:
-                assert type(name) is str,"Header names must be strings"
-                assert type(val) is str,"Header values must be strings"
-                assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed"
+
+        str_headers = []
+        for name,val in headers:
+            name = self._convert_string_type(name, "Header name")
+            val = self._convert_string_type(val, "Header value")
+            str_headers.append((name, val))
+            assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed"
+
         self.status = status
-        self.headers = self.headers_class(headers)
+        self.headers = self.headers_class(str_headers)
         return self.write
 
+    def _convert_string_type(self, value, title):
+        """Convert/check value type."""
+        if isinstance(value, str):
+            return value
+        assert isinstance(value, bytes), \
+            "{0} must be a string or bytes object (not {1})".format(title, value)
+        return str(value, "iso-8859-1")
 
     def send_preamble(self):
         """Transmit version/status/date/server, via self._write()"""
@@ -188,7 +198,8 @@
     def write(self, data):
         """'write()' callable as specified by PEP 333"""
 
-        assert type(data) is str,"write() argument must be string"
+        assert isinstance(data, (str, bytes)), \
+            "write() argument must be a string or bytes"
 
         if not self.status:
             raise AssertionError("write() before start_response()")
@@ -382,8 +393,13 @@
         self.environ.update(self.base_env)
 
     def _write(self,data):
+        if isinstance(data, str):
+            try:
+                data = data.encode("iso-8859-1")
+            except UnicodeEncodeError:
+                raise ValueError("Unicode data must contain only code points"
+                    " representable in ISO-8859-1 encoding")
         self.stdout.write(data)
-        self._write = self.stdout.write
 
     def _flush(self):
         self.stdout.flush()

Modified: python/branches/py3k-issue1717/Lib/wsgiref/headers.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/wsgiref/headers.py	(original)
+++ python/branches/py3k-issue1717/Lib/wsgiref/headers.py	Sun Jan 25 21:08:20 2009
@@ -44,7 +44,19 @@
     def __init__(self,headers):
         if not isinstance(headers, list):
             raise TypeError("Headers must be a list of name/value tuples")
-        self._headers = headers
+        self._headers = []
+        for k, v in headers:
+            k = self._convert_string_type(k)
+            v = self._convert_string_type(v)
+            self._headers.append((k, v))
+
+    def _convert_string_type(self, value):
+        """Convert/check value type."""
+        if isinstance(value, str):
+            return value
+        assert isinstance(value, bytes), ("Header names/values must be"
+            " a string or bytes object (not {0})".format(value))
+        return str(value, "iso-8859-1")
 
     def __len__(self):
         """Return the total number of headers, including duplicates."""
@@ -53,14 +65,15 @@
     def __setitem__(self, name, val):
         """Set the value of a header."""
         del self[name]
-        self._headers.append((name, val))
+        self._headers.append(
+            (self._convert_string_type(name), self._convert_string_type(val)))
 
     def __delitem__(self,name):
         """Delete all occurrences of a header, if present.
 
         Does *not* raise an exception if the header is missing.
         """
-        name = name.lower()
+        name = self._convert_string_type(name.lower())
         self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name]
 
     def __getitem__(self,name):
@@ -91,13 +104,13 @@
         fields deleted and re-inserted are always appended to the header list.
         If no fields exist with the given name, returns an empty list.
         """
-        name = name.lower()
+        name = self._convert_string_type(name.lower())
         return [kv[1] for kv in self._headers if kv[0].lower()==name]
 
 
     def get(self,name,default=None):
         """Get the first header value for 'name', or return 'default'"""
-        name = name.lower()
+        name = self._convert_string_type(name.lower())
         for k,v in self._headers:
             if k.lower()==name:
                 return v
@@ -152,7 +165,8 @@
         and value 'value'."""
         result = self.get(name)
         if result is None:
-            self._headers.append((name,value))
+            self._headers.append((self._convert_string_type(name),
+                self._convert_string_type(value)))
             return value
         else:
             return result
@@ -176,13 +190,16 @@
         """
         parts = []
         if _value is not None:
+            _value = self._convert_string_type(_value)
             parts.append(_value)
         for k, v in _params.items():
+            k = self._convert_string_type(k)
             if v is None:
                 parts.append(k.replace('_', '-'))
             else:
+                v = self._convert_string_type(v)
                 parts.append(_formatparam(k.replace('_', '-'), v))
-        self._headers.append((_name, "; ".join(parts)))
+        self._headers.append((self._convert_string_type(_name), "; ".join(parts)))
 
 
 

Modified: python/branches/py3k-issue1717/Lib/wsgiref/simple_server.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/wsgiref/simple_server.py	(original)
+++ python/branches/py3k-issue1717/Lib/wsgiref/simple_server.py	Sun Jan 25 21:08:20 2009
@@ -111,8 +111,7 @@
         if length:
             env['CONTENT_LENGTH'] = length
 
-        for h in self.headers:
-            k,v = h.split(':',1)
+        for k, v in self.headers.items():
             k=k.replace('-','_').upper(); v=v.strip()
             if k in env:
                 continue                    # skip content length, type,etc.
@@ -168,11 +167,11 @@
     stdout = StringIO()
     print("Hello world!", file=stdout)
     print(file=stdout)
-    h = environ.items(); h.sort()
+    h = sorted(environ.items())
     for k,v in h:
         print(k,'=',repr(v), file=stdout)
-    start_response("200 OK", [('Content-Type','text/plain')])
-    return [stdout.getvalue()]
+    start_response(b"200 OK", [(b'Content-Type',b'text/plain; charset=utf-8')])
+    return [stdout.getvalue().encode("utf-8")]
 
 
 def make_server(

Modified: python/branches/py3k-issue1717/Lib/wsgiref/util.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/wsgiref/util.py	(original)
+++ python/branches/py3k-issue1717/Lib/wsgiref/util.py	Sun Jan 25 21:08:20 2009
@@ -149,8 +149,8 @@
     environ.setdefault('wsgi.multithread', 0)
     environ.setdefault('wsgi.multiprocess', 0)
 
-    from io import StringIO
-    environ.setdefault('wsgi.input', StringIO(""))
+    from io import StringIO, BytesIO
+    environ.setdefault('wsgi.input', BytesIO())
     environ.setdefault('wsgi.errors', StringIO())
     environ.setdefault('wsgi.url_scheme',guess_scheme(environ))
 

Modified: python/branches/py3k-issue1717/Lib/wsgiref/validate.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/wsgiref/validate.py	(original)
+++ python/branches/py3k-issue1717/Lib/wsgiref/validate.py	Sun Jan 25 21:08:20 2009
@@ -127,6 +127,13 @@
     if not cond:
         raise AssertionError(*args)
 
+def check_string_type(value, title):
+    if isinstance(value, str):
+        return value
+    assert isinstance(value, bytes), \
+        "{0} must be a string or bytes object (not {1})".format(title, value)
+    return str(value, "iso-8859-1")
+
 def validator(application):
 
     """
@@ -188,14 +195,14 @@
         self.input = wsgi_input
 
     def read(self, *args):
-        assert_(len(args) <= 1)
+        assert_(len(args) == 1)
         v = self.input.read(*args)
-        assert_(isinstance(v, str))
+        assert_(isinstance(v, bytes))
         return v
 
     def readline(self):
         v = self.input.readline()
-        assert_(isinstance(v, str))
+        assert_(isinstance(v, bytes))
         return v
 
     def readlines(self, *args):
@@ -203,7 +210,7 @@
         lines = self.input.readlines(*args)
         assert_(isinstance(lines, list))
         for line in lines:
-            assert_(isinstance(line, str))
+            assert_(isinstance(line, bytes))
         return lines
 
     def __iter__(self):
@@ -241,7 +248,7 @@
         self.writer = wsgi_writer
 
     def __call__(self, s):
-        assert_(isinstance(s, str))
+        assert_(isinstance(s, (str, bytes)))
         self.writer(s)
 
 class PartialIteratorWrapper:
@@ -364,8 +371,7 @@
             % (wsgi_errors, attr))
 
 def check_status(status):
-    assert_(isinstance(status, str),
-        "Status must be a string (not %r)" % status)
+    status = check_string_type(status, "Status")
     # Implicitly check that we can turn it into an integer:
     status_code = status.split(None, 1)[0]
     assert_(len(status_code) == 3,
@@ -389,6 +395,8 @@
             % (item, type(item)))
         assert_(len(item) == 2)
         name, value = item
+        name = check_string_type(name, "Header name")
+        value = check_string_type(value, "Header value")
         assert_(name.lower() != 'status',
             "The Status header cannot be used; it conflicts with CGI "
             "script, and HTTP status is not given through headers "
@@ -404,11 +412,13 @@
             % (value, bad_header_value_re.search(value).group(0)))
 
 def check_content_type(status, headers):
+    status = check_string_type(status, "Status")
     code = int(status.split(None, 1)[0])
     # @@: need one more person to verify this interpretation of RFC 2616
     #     http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
     NO_MESSAGE_BODY = (204, 304)
     for name, value in headers:
+        name = check_string_type(name, "Header name")
         if name.lower() == 'content-type':
             if code not in NO_MESSAGE_BODY:
                 return
@@ -426,6 +436,6 @@
     # Technically a string is legal, which is why it's a really bad
     # idea, because it may cause the response to be returned
     # character-by-character
-    assert_(not isinstance(iterator, str),
+    assert_(not isinstance(iterator, (str, bytes)),
         "You should not return a string as your application iterator, "
         "instead return a single-item list containing that string.")

Modified: python/branches/py3k-issue1717/Lib/zipfile.py
==============================================================================
--- python/branches/py3k-issue1717/Lib/zipfile.py	(original)
+++ python/branches/py3k-issue1717/Lib/zipfile.py	Sun Jan 25 21:08:20 2009
@@ -4,7 +4,7 @@
 XXX references to utf-8 need further investigation.
 """
 import struct, os, time, sys, shutil
-import binascii, io
+import binascii, io, stat
 
 try:
     import zlib # We may need its compression method
@@ -28,7 +28,7 @@
 
 error = BadZipfile      # The exception raised by this module
 
-ZIP64_LIMIT= (1 << 31) - 1
+ZIP64_LIMIT = (1 << 31) - 1
 ZIP_FILECOUNT_LIMIT = 1 << 16
 ZIP_MAX_COMMENT = (1 << 16) - 1
 
@@ -210,13 +210,9 @@
         # Append a blank comment and record start offset
         endrec.append(b"")
         endrec.append(filesize - sizeEndCentDir)
-        if endrec[_ECD_OFFSET] == 0xffffffff:
-            # the value for the "offset of the start of the central directory"
-            # indicates that there is a "Zip64 end of central directory"
-            # structure present, so go look for it
-            return _EndRecData64(fpin, -sizeEndCentDir, endrec)
 
-        return endrec
+        # Try to read the "Zip64 end of central directory" structure
+        return _EndRecData64(fpin, -sizeEndCentDir, endrec)
 
     # Either this is not a ZIP file, or it is a ZIP file with an archive
     # comment.  Search the end of the file for the "end of central directory"
@@ -237,11 +233,10 @@
             # Append the archive comment and start offset
             endrec.append(comment)
             endrec.append(maxCommentStart + start)
-            if endrec[_ECD_OFFSET] == 0xffffffff:
-                # There is apparently a "Zip64 end of central directory"
-                # structure present, so go look for it
-                return _EndRecData64(fpin, start - filesize, endrec)
-            return endrec
+
+            # Try to read the "Zip64 end of central directory" structure
+            return _EndRecData64(fpin, maxCommentStart + start - filesize,
+                                 endrec)
 
     # Unable to find a valid end of central directory structure
     return
@@ -964,11 +959,11 @@
         """
         # build the destination pathname, replacing
         # forward slashes to platform specific separators.
-        if targetpath[-1:] == "/":
+        if targetpath[-1:] in (os.path.sep, os.path.altsep):
             targetpath = targetpath[:-1]
 
         # don't include leading "/" from file name if present
-        if os.path.isabs(member.filename):
+        if member.filename[0] == '/':
             targetpath = os.path.join(targetpath, member.filename[1:])
         else:
             targetpath = os.path.join(targetpath, member.filename)
@@ -980,6 +975,10 @@
         if upperdirs and not os.path.exists(upperdirs):
             os.makedirs(upperdirs)
 
+        if member.filename[-1] == '/':
+            os.mkdir(targetpath)
+            return targetpath
+
         source = self.open(member, pwd=pwd)
         target = open(targetpath, "wb")
         shutil.copyfileobj(source, target)
@@ -1019,6 +1018,7 @@
                   "Attempt to write to ZIP archive that was already closed")
 
         st = os.stat(filename)
+        isdir = stat.S_ISDIR(st.st_mode)
         mtime = time.localtime(st.st_mtime)
         date_time = mtime[0:6]
         # Create ZipInfo instance to store file information
@@ -1027,6 +1027,8 @@
         arcname = os.path.normpath(os.path.splitdrive(arcname)[1])
         while arcname[0] in (os.sep, os.altsep):
             arcname = arcname[1:]
+        if isdir:
+            arcname += '/'
         zinfo = ZipInfo(arcname, date_time)
         zinfo.external_attr = (st[0] & 0xFFFF) << 16      # Unix attributes
         if compress_type is None:
@@ -1040,6 +1042,16 @@
 
         self._writecheck(zinfo)
         self._didModify = True
+
+        if isdir:
+            zinfo.file_size = 0
+            zinfo.compress_size = 0
+            zinfo.CRC = 0
+            self.filelist.append(zinfo)
+            self.NameToInfo[zinfo.filename] = zinfo
+            self.fp.write(zinfo.FileHeader())
+            return
+
         fp = io.open(filename, "rb")
         # Must overwrite CRC and sizes with correct data later
         zinfo.CRC = CRC = 0
@@ -1198,19 +1210,26 @@
 
             pos2 = self.fp.tell()
             # Write end-of-zip-archive record
+            centDirCount = count
+            centDirSize = pos2 - pos1
             centDirOffset = pos1
-            if pos1 > ZIP64_LIMIT:
+            if (centDirCount >= ZIP_FILECOUNT_LIMIT or
+                centDirOffset > ZIP64_LIMIT or
+                centDirSize > ZIP64_LIMIT):
                 # Need to write the ZIP64 end-of-archive records
                 zip64endrec = struct.pack(
                         structEndArchive64, stringEndArchive64,
-                        44, 45, 45, 0, 0, count, count, pos2 - pos1, pos1)
+                        44, 45, 45, 0, 0, centDirCount, centDirCount,
+                        centDirSize, centDirOffset)
                 self.fp.write(zip64endrec)
 
                 zip64locrec = struct.pack(
                         structEndArchive64Locator,
                         stringEndArchive64Locator, 0, pos2, 1)
                 self.fp.write(zip64locrec)
-                centDirOffset = 0xFFFFFFFF
+                centDirCount = min(centDirCount, 0xFFFF)
+                centDirSize = min(centDirSize, 0xFFFFFFFF)
+                centDirOffset = min(centDirOffset, 0xFFFFFFFF)
 
             # check for valid comment length
             if len(self.comment) >= ZIP_MAX_COMMENT:
@@ -1220,9 +1239,8 @@
                 self.comment = self.comment[:ZIP_MAX_COMMENT]
 
             endrec = struct.pack(structEndArchive, stringEndArchive,
-                                 0, 0, count % ZIP_FILECOUNT_LIMIT,
-                                 count % ZIP_FILECOUNT_LIMIT, pos2 - pos1,
-                                 centDirOffset, len(self.comment))
+                                 0, 0, centDirCount, centDirCount,
+                                 centDirSize, centDirOffset, len(self.comment))
             self.fp.write(endrec)
             self.fp.write(self.comment)
             self.fp.flush()

Modified: python/branches/py3k-issue1717/Makefile.pre.in
==============================================================================
--- python/branches/py3k-issue1717/Makefile.pre.in	(original)
+++ python/branches/py3k-issue1717/Makefile.pre.in	Sun Jan 25 21:08:20 2009
@@ -247,6 +247,16 @@
 
 ##########################################################################
 # Python
+
+OPCODETARGETS_H= \
+		$(srcdir)/Python/opcode_targets.h
+
+OPCODETARGETGEN= \
+		$(srcdir)/Python/makeopcodetargets.py
+
+OPCODETARGETGEN_FILES= \
+		$(OPCODETARGETGEN) $(srcdir)/Lib/opcode.py
+
 PYTHON_OBJS=	\
 		Python/_warnings.o \
 		Python/Python-ast.o \
@@ -263,7 +273,6 @@
 		Python/getargs.o \
 		Python/getcompiler.o \
 		Python/getcopyright.o \
-		Python/getmtime.o \
 		Python/getplatform.o \
 		Python/getversion.o \
 		Python/graminit.o \
@@ -412,10 +421,14 @@
 	if test $(INSTSONAME) != $(LDLIBRARY); then \
 		$(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
 		$(LN) -f $(INSTSONAME) $@; \
-	else\
+	else \
 		$(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
 	fi
 
+libpython$(VERSION).dylib: $(LIBRARY_OBJS)
+	 $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+		 
+
 libpython$(VERSION).sl: $(LIBRARY_OBJS)
 	$(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
 
@@ -556,16 +569,21 @@
 		$(srcdir)/Objects/stringlib/unicodedefs.h \
 		$(srcdir)/Objects/stringlib/localeutil.h
 
-Objects/stringobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
+Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
 
-Objects/bytesobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) 
+Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) 
 
 Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
-                                             $(BYTESTR_DEPS) \
-                                             $(srcdir)/Objects/stringlib/formatter.h
+				$(BYTESTR_DEPS) \
+				$(srcdir)/Objects/stringlib/formatter.h
+
+$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES)
+	$(OPCODETARGETGEN) $(OPCODETARGETS_H)
+
+Python/ceval.o: $(OPCODETARGETS_H)
 
 Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
-                                             $(BYTESTR_DEPS)
+				$(BYTESTR_DEPS)
 
 
 ############################################################################
@@ -773,13 +791,13 @@
 		fi; \
 	done
 	$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
-	if test -f libpython$(VERSION)$(SO); then \
-		if test "$(SO)" = .dll; then \
-			$(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
+	if test -f $(LDLIBRARY); then \
+		if test -n "$(DLLLIBRARY)" ; then \
+			$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
 		else \
-			$(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
-			if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
-				(cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
+			$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
+			if test $(LDLIBRARY) != $(INSTSONAME); then \
+				(cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
 			fi \
 		fi; \
 	else	true; \

Modified: python/branches/py3k-issue1717/Misc/ACKS
==============================================================================
--- python/branches/py3k-issue1717/Misc/ACKS	(original)
+++ python/branches/py3k-issue1717/Misc/ACKS	Sun Jan 25 21:08:20 2009
@@ -83,6 +83,7 @@
 Sebastian Boving
 Monty Brandenberg
 Georg Brandl
+Christopher Brannon
 Terrence Brannon
 Dave Brennan
 Tom Bridgman
@@ -178,6 +179,7 @@
 Quinn Dunkan
 Robin Dunn
 Luke Dunstan
+Virgil Dupras
 Andy Dustman
 Gary Duzan
 Eugene Dvurechenski
@@ -246,6 +248,7 @@
 Harry Henry Gebel
 Marius Gedminas
 Thomas Gellekum
+Gabriel Genellina
 Christos Georgiou
 Ben Gertzfield
 Dinu Gherman
@@ -313,6 +316,7 @@
 Naofumi Honda
 Jeffrey Honig
 Rob Hooft
+Michiel de Hoon
 Brian Hooper
 Randall Hopper
 Nadav Horesh
@@ -373,6 +377,7 @@
 Taek Joo Kim
 Paul Kippes
 Steve Kirsch
+Sebastian Kirsche
 Ron Klatchko
 Bastian Kleineidam
 Bob Kline
@@ -428,6 +433,7 @@
 Jason Lowe
 Tony Lownds
 Ray Loyzaga
+Lukas Lueg
 Loren Luke
 Fredrik Lundh
 Mark Lutz
@@ -779,3 +785,4 @@
 Uwe Zessin
 Tarek ZiadŽ
 Peter Åstrand
+Jesse Noller

Modified: python/branches/py3k-issue1717/Misc/NEWS
==============================================================================
--- python/branches/py3k-issue1717/Misc/NEWS	(original)
+++ python/branches/py3k-issue1717/Misc/NEWS	Sun Jan 25 21:08:20 2009
@@ -13,11 +13,72 @@
 -----------------
 
 - Issue #1717: Removed builtin cmp() function, dropped tp_compare
-  slot, the C API functions PyObject_Compare and PyUnicode_Compare
-  and the type definition cmpfunc. PyUnicode_CompareWithASCIIString 
-  was replaced PyUnicode_EqualToASCIIString.
-  The tp_compare slot is reserved for future usage. A type definition
-  with an assigned tp_compare slot will raise a TypeError. 
+  slot, the C API functions PyObject_Compare and PyUnicode_Compare and
+  the type definition cmpfunc.  The tp_compare slot is reserved for
+  future usage.
+
+- Issue #4874: Most builtin decoders now reject unicode input.
+
+- Issue #4842: Don't allow trailing 'L' when constructing an integer
+  from a string.
+
+- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors.
+
+- Issue #4838: When a module is deallocated, free the memory backing the
+  optional module state data.
+
+- Issue #4910: Rename nb_long slot to nb_reserved, and change its
+  type to (void *).
+
+- Issue #4935: The overflow checking code in the expandtabs() method common
+  to str, bytes and bytearray could be optimized away by the compiler, letting
+  the interpreter segfault instead of raising an error.
+
+- Issue #3720: Fix a crash when an iterator modifies its class and removes its
+  __next__ method.
+
+- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API
+  function no longer attempt to call the __long__ slot to convert an object
+  to an integer.  Only the __int__ and __trunc__ slots are examined.
+
+- Issue #4893: Use NT threading on CE.
+
+- Issue #4915: Port sysmodule to Windows CE.
+
+- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
+  common cases are optimized thanks to a dedicated fast path and a moderate
+  amount of loop unrolling.
+
+- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
+  collecting the oldest generation) so that allocating lots of objects without
+  destroying them does not show quadratic performance. Based on a proposal by
+  Martin von Löwis at
+  http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
+
+- Issue #4604: Some objects of the I/O library could still be used after
+  having been closed (for instance, a read() call could return some
+  previously buffered data). Patch by Dmitry Vasiliev.
+
+- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
+  flag to work properly. Furthermore, when specifying -u, the text stdout
+  and stderr streams have line-by-line buffering enabled (the default being
+  to buffer arbitrary chunks of data).
+
+- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
+  instead of ints (reducing its size from 4 to 8 times thereby reducing
+  Python's overall memory).
+
+- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
+  an existing .py counterpart, override the co_filename attributes of all
+  code objects if the original filename is obsolete (which can happen if the
+  file has been renamed, moved, or if it is accessed through different paths).
+  Patch by Ziga Seilnacht and Jean-Paul Calderone.
+
+- Issue #4580: Fix slicing of memoryviews when the item size is greater than
+  one byte. Also fixes the meaning of len() so that it returns the number of
+  items, rather than the size in bytes.
+
+- Issue #4075: Use OutputDebugStringW in Py_FatalError.
 
 - Issue #4747: When the terminal does not use utf-8, executing a script with
   non-ascii characters in its name could fail with a "SyntaxError: None" error.
@@ -83,10 +144,100 @@
 Library
 -------
 
-- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case 
-  no MSVC compiler is found under Windows. Original patch by Philip Jenvey. 
+- Fix and properly document the multiprocessing module's logging
+  support, expose the internal levels and provide proper usage
+  examples.
+
+- Issue #1672332: fix unpickling of subnormal floats, which was
+  producing a ValueError on some platforms.
+
+- Issue #3881: Help Tcl to load even when started through the
+  unreadable local symlink to "Program Files" on Vista.
+
+- Issue #4710: Extract directories properly in the zipfile module;
+  allow adding directories to a zipfile.
+
+- Issue #3807: _multiprocessing build fails when configure is passed 
+  --without-threads argument. When this occurs, _multiprocessing will
+  be disabled, and not compiled.
+
+- Issue #5008: When a file is opened in append mode with the new IO library,
+  do an explicit seek to the end of file (so that e.g. tell() returns the
+  file size rather than 0). This is consistent with the behaviour of the
+  traditional 2.x file object.
+
+- Issue #5013: Fixed a bug in FileHandler which occurred when the delay
+  parameter was set.
+
+- Issue #4842: Always append a trailing 'L' when pickling longs using
+  pickle protocol 0.  When reading, the 'L' is optional.
+
+- Add the importlib package.
+
+- Issue #4301: Patch the logging module to add processName support, remove
+  _check_logger_class from multiprocessing.
+
+- Issue #3325: Remove python2.x try: except: imports for old cPickle from
+  multiprocessing.
+
+- Issue #4959: inspect.formatargspec now works for keyword only arguments
+  without defaults.
+
+- Issue #3321: _multiprocessing.Connection() doesn't check handle; added checks
+  for *nix machines for negative handles and large int handles. Without this check
+  it is possible to segfault the interpreter.
+
+- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
+  in sharedctypes.py.
+
+- Issue #1225107: inspect.isclass() returned True for instances with a custom
+  __getattr__.
+
+- Issue #3826 and #4791: The socket module now closes the underlying socket
+  appropriately when it is being used via socket.makefile() objects
+  rather than delaying the close by waiting for garbage collection to do it.
+
+- Issue #1696199:  Add collections.Counter() for rapid and convenient
+  counting.
+
+- Issue #3860: GzipFile and BZ2File now support the context manager protocol.
+
+- Issue #4867: Fixed a crash in ctypes when passing a string to a
+  function without defining argtypes.
+
+- Issue #4272: Add an optional argument to the GzipFile constructor to override
+  the timestamp in the gzip stream. The default value remains the current time.
+  The information can be used by e.g. gunzip when decompressing. Patch by
+  Jacques Frechet.
+
+- Restore Python 2.3 compatibility for decimal.py.
+
+- Issue #3638: Remove functions from _tkinter module level that depend on
+  TkappObject to work with multiple threads.
 
-- Issue #4646: distutils was choking on empty options arg in the setup 
+- Issue #4718: Adapt the wsgiref package so that it actually works with
+  Python 3.x, in accordance with the `official amendments of the spec
+  <http://www.wsgi.org/wsgi/Amendments_1.0>`_.
+
+- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float()
+  to the decimal module.
+
+- Fractions.from_float() no longer loses precision for integers too big to
+  cast as floats.
+
+- Issue #4812: add missing underscore prefix to some internal-use-only
+  constants in the decimal module.  (Dec_0 becomes _Dec_0, etc.)
+
+- Issue 4790: The nsmallest() and nlargest() functions in the heapq module
+  did unnecessary work in the common case where no key function was specified.
+
+- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
+  the function is not a generator.
+
+- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case
+  no MSVC compiler is found under Windows. Original patch by Philip Jenvey.
+
+- Issue #4646: distutils was choking on empty options arg in the setup
   function. Original patch by Thomas Heller.
 
 - Issue #3767: Convert Tk object to string in tkColorChooser.
@@ -174,14 +325,72 @@
   support unusual filenames (such as those containing semi-colons) in
   Content-Disposition headers.
 
+- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
+  biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
+
 Tools/Demos
 -----------
 
 - Issue #4677: add two list comprehension tests to pybench.
 
+
+Build
+-----
+
+- Issue #4895: Use _strdup on Windows CE.
+
+- Issue #4472: "configure --enable-shared" now works on OSX
+
+- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
+
+- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
+
+- Issue #4289: Remove Cancel button from AdvancedDlg.
+
+- Issue #1656675: Register a drop handler for .py* files on Windows.
+
+- Issue #4120: Exclude manifest from extension modules in VS2008.
+
+- Issue #4091: Install pythonxy.dll in system32 again.
+
+- Issue #4018: Disable "for me" installations on Vista.
+
+- Issue #3758: Add ``patchcheck`` build target to .PHONY.
+
+- Issue #4204: Fixed module build errors on FreeBSD 4.
+
+
+C-API
+-----
+
+- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'.
+
+- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when
+  the GIL is released, or owned by another thread.
+
+- Issue #4122: On Windows, fix a compilation error when using the
+  Py_UNICODE_ISSPACE macro in an extension module.
+
+
 Extension Modules
 -----------------
 
+- Issue #4397: Fix occasional test_socket failure on OS X.
+
+- Issue #4279: Fix build of parsermodule under Cygwin.
+
+- Issue #4751: hashlib now releases the GIL when hashing large buffers
+  (with a hardwired threshold of 2048 bytes), allowing better parallelization
+  on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.
+
+- Issue #4051: Prevent conflict of UNICODE macros in cPickle.
+
+- Issue #4738: Each zlib object now has a separate lock, allowing to compress
+  or decompress several streams at once on multi-CPU systems. Also, the GIL
+  is now released when computing the CRC of a large buffer. Patch by ebfe.
+
+- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.
+
 - Issue #1040026: Fix os.times result on systems where HZ is incorrect.
 
 - Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris,
@@ -191,9 +400,6 @@
   has been exported, resulting in an interpreter crash when accessing the
   buffer.
 
-Build
------
-
 
 Docs
 ----

Modified: python/branches/py3k-issue1717/Misc/build.sh
==============================================================================
--- python/branches/py3k-issue1717/Misc/build.sh	(original)
+++ python/branches/py3k-issue1717/Misc/build.sh	Sun Jan 25 21:08:20 2009
@@ -264,7 +264,7 @@
     echo "Conflict detected in $CONFLICTED_FILE.  Doc build skipped." > ../build/$F
     err=1
 else
-    make update html >& ../build/$F
+    make checkout update html >& ../build/$F
     err=$?
 fi
 update_status "Making doc" "$F" $start

Modified: python/branches/py3k-issue1717/Modules/_codecsmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_codecsmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/_codecsmodule.c	Sun Jan 25 21:08:20 2009
@@ -258,7 +258,7 @@
     Py_ssize_t consumed;
     PyObject *decoded = NULL;
 
-    if (!PyArg_ParseTuple(args, "s*|zi:utf_7_decode",
+    if (!PyArg_ParseTuple(args, "y*|zi:utf_7_decode",
 			  &pbuf, &errors, &final))
 	return NULL;
     consumed = pbuf.len;
@@ -281,7 +281,7 @@
     Py_ssize_t consumed;
     PyObject *decoded = NULL;
 
-    if (!PyArg_ParseTuple(args, "s*|zi:utf_8_decode",
+    if (!PyArg_ParseTuple(args, "y*|zi:utf_8_decode",
 			  &pbuf, &errors, &final))
 	return NULL;
     consumed = pbuf.len;
@@ -305,7 +305,7 @@
     Py_ssize_t consumed;
     PyObject *decoded;
 
-    if (!PyArg_ParseTuple(args, "s*|zi:utf_16_decode",
+    if (!PyArg_ParseTuple(args, "y*|zi:utf_16_decode",
 			  &pbuf, &errors, &final))
 	return NULL;
     consumed = pbuf.len; /* This is overwritten unless final is true. */
@@ -328,7 +328,7 @@
     Py_ssize_t consumed;
     PyObject *decoded = NULL;
 
-    if (!PyArg_ParseTuple(args, "s*|zi:utf_16_le_decode",
+    if (!PyArg_ParseTuple(args, "y*|zi:utf_16_le_decode",
 			  &pbuf, &errors, &final))
 	return NULL;
 
@@ -352,7 +352,7 @@
     Py_ssize_t consumed;
     PyObject *decoded = NULL;
 
-    if (!PyArg_ParseTuple(args, "s*|zi:utf_16_be_decode",
+    if (!PyArg_ParseTuple(args, "y*|zi:utf_16_be_decode",
 			  &pbuf, &errors, &final))
 	return NULL;
 
@@ -384,7 +384,7 @@
     int final = 0;
     Py_ssize_t consumed;
 
-    if (!PyArg_ParseTuple(args, "s*|zii:utf_16_ex_decode",
+    if (!PyArg_ParseTuple(args, "y*|zii:utf_16_ex_decode",
 			  &pbuf, &errors, &byteorder, &final))
 	return NULL;
     consumed = pbuf.len; /* This is overwritten unless final is true. */
@@ -409,7 +409,7 @@
     Py_ssize_t consumed;
     PyObject *decoded;
 
-    if (!PyArg_ParseTuple(args, "s*|zi:utf_32_decode",
+    if (!PyArg_ParseTuple(args, "y*|zi:utf_32_decode",
 			  &pbuf, &errors, &final))
 	return NULL;
     consumed = pbuf.len; /* This is overwritten unless final is true. */
@@ -432,7 +432,7 @@
     Py_ssize_t consumed;
     PyObject *decoded;
 
-    if (!PyArg_ParseTuple(args, "s*|zi:utf_32_le_decode",
+    if (!PyArg_ParseTuple(args, "y*|zi:utf_32_le_decode",
 			  &pbuf, &errors, &final))
 	return NULL;
     consumed = pbuf.len; /* This is overwritten unless final is true. */
@@ -455,7 +455,7 @@
     Py_ssize_t consumed;
     PyObject *decoded;
 
-    if (!PyArg_ParseTuple(args, "s*|zi:utf_32_be_decode",
+    if (!PyArg_ParseTuple(args, "y*|zi:utf_32_be_decode",
 			  &pbuf, &errors, &final))
 	return NULL;
     consumed = pbuf.len; /* This is overwritten unless final is true. */
@@ -486,7 +486,7 @@
     int final = 0;
     Py_ssize_t consumed;
 
-    if (!PyArg_ParseTuple(args, "s*|zii:utf_32_ex_decode",
+    if (!PyArg_ParseTuple(args, "y*|zii:utf_32_ex_decode",
 			  &pbuf, &errors, &byteorder, &final))
 	return NULL;
     consumed = pbuf.len; /* This is overwritten unless final is true. */
@@ -542,7 +542,7 @@
 	PyObject *unicode;
     const char *errors = NULL;
 
-    if (!PyArg_ParseTuple(args, "s*|z:latin_1_decode",
+    if (!PyArg_ParseTuple(args, "y*|z:latin_1_decode",
 			  &pbuf, &errors))
 	return NULL;
 
@@ -559,7 +559,7 @@
 	PyObject *unicode;
     const char *errors = NULL;
 
-    if (!PyArg_ParseTuple(args, "s*|z:ascii_decode",
+    if (!PyArg_ParseTuple(args, "y*|z:ascii_decode",
 			  &pbuf, &errors))
 	return NULL;
 
@@ -577,7 +577,7 @@
     const char *errors = NULL;
     PyObject *mapping = NULL;
 
-    if (!PyArg_ParseTuple(args, "s*|zO:charmap_decode",
+    if (!PyArg_ParseTuple(args, "y*|zO:charmap_decode",
 			  &pbuf, &errors, &mapping))
 	return NULL;
     if (mapping == Py_None)
@@ -600,7 +600,7 @@
     Py_ssize_t consumed;
     PyObject *decoded = NULL;
 
-    if (!PyArg_ParseTuple(args, "s*|zi:mbcs_decode",
+    if (!PyArg_ParseTuple(args, "y*|zi:mbcs_decode",
 			  &pbuf, &errors, &final))
 	return NULL;
     consumed = pbuf.len;

Modified: python/branches/py3k-issue1717/Modules/_collectionsmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_collectionsmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/_collectionsmodule.c	Sun Jan 25 21:08:20 2009
@@ -909,7 +909,7 @@
 	it->deque = deque;
 	it->state = deque->state;
 	it->counter = deque->len;
-	_PyObject_GC_TRACK(it);
+	PyObject_GC_Track(it);
 	return (PyObject *)it;
 }
 
@@ -1019,7 +1019,7 @@
 	it->deque = deque;
 	it->state = deque->state;
 	it->counter = deque->len;
-	_PyObject_GC_TRACK(it);
+	PyObject_GC_Track(it);
 	return (PyObject *)it;
 }
 

Modified: python/branches/py3k-issue1717/Modules/_ctypes/callproc.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_ctypes/callproc.c	(original)
+++ python/branches/py3k-issue1717/Modules/_ctypes/callproc.c	Sun Jan 25 21:08:20 2009
@@ -645,8 +645,8 @@
 
 #ifdef CTYPES_UNICODE
 	if (PyUnicode_Check(obj)) {
-#ifdef HAVE_USABLE_WCHAR_T
 		pa->ffi_type = &ffi_type_pointer;
+#ifdef HAVE_USABLE_WCHAR_T
 		pa->value.p = PyUnicode_AS_UNICODE(obj);
 		Py_INCREF(obj);
 		pa->keep = obj;

Modified: python/branches/py3k-issue1717/Modules/_ctypes/cfield.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_ctypes/cfield.c	(original)
+++ python/branches/py3k-issue1717/Modules/_ctypes/cfield.c	Sun Jan 25 21:08:20 2009
@@ -1472,11 +1472,14 @@
 		size += 1; /* terminating NUL */
 		size *= sizeof(wchar_t);
 		buffer = (wchar_t *)PyMem_Malloc(size);
-		if (!buffer)
+		if (!buffer) {
+			Py_DECREF(value);
 			return PyErr_NoMemory();
+		}
 		memset(buffer, 0, size);
 		keep = PyCObject_FromVoidPtr(buffer, PyMem_Free);
 		if (!keep) {
+			Py_DECREF(value);
 			PyMem_Free(buffer);
 			return NULL;
 		}

Modified: python/branches/py3k-issue1717/Modules/_ctypes/libffi_msvc/ffi.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_ctypes/libffi_msvc/ffi.c	(original)
+++ python/branches/py3k-issue1717/Modules/_ctypes/libffi_msvc/ffi.c	Sun Jan 25 21:08:20 2009
@@ -34,7 +34,7 @@
 /* ffi_prep_args is called by the assembly routine once stack space
    has been allocated for the function's arguments */
 
-extern void Py_FatalError(char *msg);
+extern void Py_FatalError(const char *msg);
 
 /*@-exportheader@*/
 void ffi_prep_args(char *stack, extended_cif *ecif)

Modified: python/branches/py3k-issue1717/Modules/_dbmmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_dbmmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/_dbmmodule.c	Sun Jan 25 21:08:20 2009
@@ -2,6 +2,7 @@
 /* DBM module using dictionary interface */
 
 
+#define PY_SSIZE_T_CLEAN
 #include "Python.h"
 
 #include <sys/types.h>

Modified: python/branches/py3k-issue1717/Modules/_fileio.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_fileio.c	(original)
+++ python/branches/py3k-issue1717/Modules/_fileio.c	Sun Jan 25 21:08:20 2009
@@ -55,12 +55,15 @@
 
 #define PyFileIO_Check(op) (PyObject_TypeCheck((op), &PyFileIO_Type))
 
+static PyObject *
+portable_lseek(int fd, PyObject *posobj, int whence);
+
 /* Returns 0 on success, -1 with exception set on failure. */
 static int
 internal_close(PyFileIOObject *self)
 {
 	int err = 0;
-	int save_errno;
+	int save_errno = 0;
 	if (self->fd >= 0) {
 		int fd = self->fd;
 		self->fd = -1;
@@ -138,6 +141,24 @@
 	return 0;
 }
 
+static int
+check_fd(int fd)
+{
+#if defined(HAVE_FSTAT)
+	struct stat buf;
+	if (fstat(fd, &buf) < 0 && errno == EBADF) {
+		PyObject *exc;
+		char *msg = strerror(EBADF);
+		exc = PyObject_CallFunction(PyExc_OSError, "(is)",
+					    EBADF, msg);
+		PyErr_SetObject(PyExc_OSError, exc);
+		Py_XDECREF(exc);
+		return -1;
+	}
+#endif
+	return 0;
+}
+
 
 static int
 fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
@@ -170,6 +191,8 @@
 					"Negative filedescriptor");
 			return -1;
 		}
+		if (check_fd(fd))
+			return -1;
 	}
 	else {
 		PyErr_Clear();
@@ -295,6 +318,16 @@
 			goto error;
 	}
 
+	if (append) {
+		/* For consistent behaviour, we explicitly seek to the
+		   end of file (otherwise, it might be done only on the
+		   first write()). */
+		PyObject *pos = portable_lseek(self->fd, NULL, 2);
+		if (pos == NULL)
+			goto error;
+		Py_DECREF(pos);
+	}
+
 	goto done;
 
  error:
@@ -571,7 +604,7 @@
 #if SEEK_CUR != 1
 	case 1: whence = SEEK_CUR; break;
 #endif
-#if SEEL_END != 2
+#if SEEK_END != 2
 	case 2: whence = SEEK_END; break;
 #endif
 	}

Modified: python/branches/py3k-issue1717/Modules/_hashopenssl.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_hashopenssl.c	(original)
+++ python/branches/py3k-issue1717/Modules/_hashopenssl.c	Sun Jan 25 21:08:20 2009
@@ -26,15 +26,35 @@
 #define HASH_OBJ_CONSTRUCTOR 0
 #endif
 
+#define HASHLIB_GIL_MINSIZE 2048
+
+#ifdef WITH_THREAD
+    #include "pythread.h"
+
+    #define ENTER_HASHLIB(obj) \
+        if ((obj)->lock) { \
+            if (!PyThread_acquire_lock((obj)->lock, 0)) { \
+                Py_BEGIN_ALLOW_THREADS \
+                PyThread_acquire_lock((obj)->lock, 1); \
+                Py_END_ALLOW_THREADS \
+            } \
+        }
+    #define LEAVE_HASHLIB(obj) \
+        if ((obj)->lock) { \
+            PyThread_release_lock((obj)->lock); \
+        }
+#else
+    #define ENTER_HASHLIB(obj)
+    #define LEAVE_HASHLIB(obj)
+#endif
+
 typedef struct {
     PyObject_HEAD
     PyObject            *name;  /* name of this hash algorithm */
-    EVP_MD_CTX          ctx;    /* OpenSSL message digest context */
-    /*
-     * TODO investigate performance impact of including a lock for this object
-     * here and releasing the Python GIL while hash updates are in progress.
-     * (perhaps only release GIL if input length will take long to process?)
-     */
+    EVP_MD_CTX           ctx;   /* OpenSSL message digest context */
+#ifdef WITH_THREAD
+    PyThread_type_lock   lock;  /* OpenSSL context lock */
+#endif
 } EVPobject;
 
 
@@ -63,19 +83,42 @@
     if (retval != NULL) {
         Py_INCREF(name);
         retval->name = name;
+#ifdef WITH_THREAD
+        retval->lock = NULL;
+#endif
     }
 
     return retval;
 }
 
+static void
+EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len)
+{
+    unsigned int process;
+    const unsigned char *cp = (const unsigned char *)vp;
+    while (0 < len) {
+        if (len > (Py_ssize_t)MUNCH_SIZE)
+            process = MUNCH_SIZE;
+        else
+            process = Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int);
+        EVP_DigestUpdate(&self->ctx, (const void*)cp, process);
+        len -= process;
+        cp += process;
+    }
+}
+
 /* Internal methods for a hash object */
 
 static void
-EVP_dealloc(PyObject *ptr)
+EVP_dealloc(EVPobject *self)
 {
-    EVP_MD_CTX_cleanup(&((EVPobject *)ptr)->ctx);
-    Py_XDECREF(((EVPobject *)ptr)->name);
-    PyObject_Del(ptr);
+#ifdef WITH_THREAD
+    if (self->lock != NULL)
+        PyThread_free_lock(self->lock);
+#endif
+    EVP_MD_CTX_cleanup(&self->ctx);
+    Py_XDECREF(self->name);
+    PyObject_Del(self);
 }
 
 
@@ -91,7 +134,9 @@
     if ( (newobj = newEVPobject(self->name))==NULL)
         return NULL;
 
+    ENTER_HASHLIB(self);
     EVP_MD_CTX_copy(&newobj->ctx, &self->ctx);
+    LEAVE_HASHLIB(self);
     return (PyObject *)newobj;
 }
 
@@ -106,7 +151,9 @@
     PyObject *retval;
     unsigned int digest_size;
 
+    ENTER_HASHLIB(self);
     EVP_MD_CTX_copy(&temp_ctx, &self->ctx);
+    LEAVE_HASHLIB(self);
     digest_size = EVP_MD_CTX_size(&temp_ctx);
     EVP_DigestFinal(&temp_ctx, digest, NULL);
 
@@ -128,7 +175,9 @@
     unsigned int i, j, digest_size;
 
     /* Get the raw (binary) digest value */
+    ENTER_HASHLIB(self);
     EVP_MD_CTX_copy(&temp_ctx, &self->ctx);
+    LEAVE_HASHLIB(self);
     digest_size = EVP_MD_CTX_size(&temp_ctx);
     EVP_DigestFinal(&temp_ctx, digest, NULL);
 
@@ -137,16 +186,16 @@
     /* Allocate a new buffer */
     hex_digest = PyMem_Malloc(digest_size * 2 + 1);
     if (!hex_digest)
-	return PyErr_NoMemory();
+        return PyErr_NoMemory();
 
     /* Make hex version of the digest */
     for(i=j=0; i<digest_size; i++) {
         char c;
         c = (digest[i] >> 4) & 0xf;
-	c = (c>9) ? c+'a'-10 : c + '0';
+        c = (c>9) ? c+'a'-10 : c + '0';
         hex_digest[j++] = c;
         c = (digest[i] & 0xf);
-	c = (c>9) ? c+'a'-10 : c + '0';
+        c = (c>9) ? c+'a'-10 : c + '0';
         hex_digest[j++] = c;
     }
     retval = PyUnicode_FromStringAndSize(hex_digest, digest_size * 2);
@@ -155,21 +204,26 @@
 }
 
 #define MY_GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) do { \
-                if (PyUnicode_Check(obj) || !PyObject_CheckBuffer((obj))) { \
-                    PyErr_SetString(PyExc_TypeError, \
-                                    "object supporting the buffer API required"); \
-                    return NULL; \
-                } \
-                if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \
-                    return NULL; \
-                } \
-                if ((viewp)->ndim > 1) { \
-                    PyErr_SetString(PyExc_BufferError, \
-                                    "Buffer must be single dimension"); \
-                    PyBuffer_Release((viewp)); \
-                    return NULL; \
-                } \
-            } while(0);
+        if (PyUnicode_Check((obj))) { \
+            PyErr_SetString(PyExc_TypeError, \
+                            "Unicode-objects must be encoded before hashing");\
+            return NULL; \
+        } \
+        if (!PyObject_CheckBuffer((obj))) { \
+            PyErr_SetString(PyExc_TypeError, \
+                            "object supporting the buffer API required"); \
+            return NULL; \
+        } \
+        if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \
+            return NULL; \
+        } \
+        if ((viewp)->ndim > 1) { \
+            PyErr_SetString(PyExc_BufferError, \
+                            "Buffer must be single dimension"); \
+            PyBuffer_Release((viewp)); \
+            return NULL; \
+        } \
+    } while(0);
 
 PyDoc_STRVAR(EVP_update__doc__,
 "Update this hash object's state with the provided string.");
@@ -184,41 +238,60 @@
         return NULL;
 
     MY_GET_BUFFER_VIEW_OR_ERROUT(obj, &view);
-    if (view.len > 0 && view.len <= MUNCH_SIZE) {
-        EVP_DigestUpdate(&self->ctx, view.buf, view.len);
-    } else {
-        Py_ssize_t offset = 0, len = view.len;
-        while (len) {
-            unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len;
-            EVP_DigestUpdate(&self->ctx, (unsigned char*)view.buf + offset, process);
-            len -= process;
-            offset += process;
+
+#ifdef WITH_THREAD
+    if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) {
+        self->lock = PyThread_allocate_lock();
+        if (self->lock == NULL) {
+            PyBuffer_Release(&view);
+            PyErr_SetString(PyExc_MemoryError, "unable to allocate lock");
+            return NULL;
         }
     }
-    PyBuffer_Release(&view);
 
-    Py_INCREF(Py_None);
-    return Py_None;
+    if (self->lock != NULL) {
+        Py_BEGIN_ALLOW_THREADS
+        PyThread_acquire_lock(self->lock, 1);
+        EVP_hash(self, view.buf, view.len);
+        PyThread_release_lock(self->lock);
+        Py_END_ALLOW_THREADS
+    } else {
+        EVP_hash(self, view.buf, view.len);
+    }
+#else
+    EVP_hash(self, view.buf, view.len);
+#endif
+
+    PyBuffer_Release(&view);
+    Py_RETURN_NONE;
 }
 
 static PyMethodDef EVP_methods[] = {
-    {"update",	  (PyCFunction)EVP_update,    METH_VARARGS, EVP_update__doc__},
-    {"digest",	  (PyCFunction)EVP_digest,    METH_NOARGS,  EVP_digest__doc__},
+    {"update",    (PyCFunction)EVP_update,    METH_VARARGS, EVP_update__doc__},
+    {"digest",    (PyCFunction)EVP_digest,    METH_NOARGS,  EVP_digest__doc__},
     {"hexdigest", (PyCFunction)EVP_hexdigest, METH_NOARGS,  EVP_hexdigest__doc__},
-    {"copy",	  (PyCFunction)EVP_copy,      METH_NOARGS,  EVP_copy__doc__},
-    {NULL,	  NULL}		/* sentinel */
+    {"copy",      (PyCFunction)EVP_copy,      METH_NOARGS,  EVP_copy__doc__},
+    {NULL, NULL}  /* sentinel */
 };
 
 static PyObject *
 EVP_get_block_size(EVPobject *self, void *closure)
 {
-    return PyLong_FromLong(EVP_MD_CTX_block_size(&((EVPobject *)self)->ctx));
+    long block_size;
+    ENTER_HASHLIB(self);
+    block_size = EVP_MD_CTX_block_size(&self->ctx);
+    LEAVE_HASHLIB(self);
+    return PyLong_FromLong(block_size);
 }
 
 static PyObject *
 EVP_get_digest_size(EVPobject *self, void *closure)
 {
-    return PyLong_FromLong(EVP_MD_CTX_size(&((EVPobject *)self)->ctx));
+    long size;
+    ENTER_HASHLIB(self);
+    size = EVP_MD_CTX_size(&self->ctx);
+    LEAVE_HASHLIB(self);
+    return PyLong_FromLong(size);
 }
 
 static PyMemberDef EVP_members[] = {
@@ -246,11 +319,11 @@
 
 
 static PyObject *
-EVP_repr(PyObject *self)
+EVP_repr(EVPobject *self)
 {
     char buf[100];
     PyOS_snprintf(buf, sizeof(buf), "<%s HASH object @ %p>",
-            _PyUnicode_AsString(((EVPobject *)self)->name), self);
+            _PyUnicode_AsString(self->name), self);
     return PyUnicode_FromString(buf);
 }
 
@@ -293,21 +366,16 @@
     Py_INCREF(self->name);
 
     if (data_obj) {
-        if (len > 0 && len <= MUNCH_SIZE) {
-        EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
-                                                          unsigned int));
+        if (view.len >= HASHLIB_GIL_MINSIZE) {
+            Py_BEGIN_ALLOW_THREADS
+            EVP_hash(self, view.buf, view.len);
+            Py_END_ALLOW_THREADS
         } else {
-            Py_ssize_t offset = 0, len = view.len;
-            while (len) {
-                unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len;
-                EVP_DigestUpdate(&self->ctx, (unsigned char*)view.buf + offset, process);
-                len -= process;
-                offset += process;
-            }
+            EVP_hash(self, view.buf, view.len);
         }
         PyBuffer_Release(&view);
     }
-    
+
     return 0;
 }
 #endif
@@ -332,15 +400,15 @@
 static PyTypeObject EVPtype = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "_hashlib.HASH",    /*tp_name*/
-    sizeof(EVPobject),	/*tp_basicsize*/
-    0,			/*tp_itemsize*/
+    sizeof(EVPobject),  /*tp_basicsize*/
+    0,                  /*tp_itemsize*/
     /* methods */
-    EVP_dealloc,	/*tp_dealloc*/
-    0,			/*tp_print*/
+    (destructor)EVP_dealloc, /*tp_dealloc*/
+    0,                  /*tp_print*/
     0,                  /*tp_getattr*/
     0,                  /*tp_setattr*/
     0,                  /*tp_reserved*/
-    EVP_repr,           /*tp_repr*/
+    (reprfunc)EVP_repr, /*tp_repr*/
     0,                  /*tp_as_number*/
     0,                  /*tp_as_sequence*/
     0,                  /*tp_as_mapping*/
@@ -353,13 +421,13 @@
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
     hashtype_doc,       /*tp_doc*/
     0,                  /*tp_traverse*/
-    0,			/*tp_clear*/
-    0,			/*tp_richcompare*/
-    0,			/*tp_weaklistoffset*/
-    0,			/*tp_iter*/
-    0,			/*tp_iternext*/
-    EVP_methods,	/* tp_methods */
-    EVP_members,	/* tp_members */
+    0,                  /*tp_clear*/
+    0,                  /*tp_richcompare*/
+    0,                  /*tp_weaklistoffset*/
+    0,                  /*tp_iter*/
+    0,                  /*tp_iternext*/
+    EVP_methods,        /* tp_methods */
+    EVP_members,        /* tp_members */
     EVP_getseters,      /* tp_getset */
 #if 1
     0,                  /* tp_base */
@@ -395,17 +463,12 @@
     }
 
     if (cp && len) {
-        if (len > 0 && len <= MUNCH_SIZE) {
-            EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
-                                                              unsigned int));
+        if (len >= HASHLIB_GIL_MINSIZE) {
+            Py_BEGIN_ALLOW_THREADS
+            EVP_hash(self, cp, len);
+            Py_END_ALLOW_THREADS
         } else {
-            Py_ssize_t offset = 0;
-            while (len) {
-                unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len;
-                EVP_DigestUpdate(&self->ctx, cp + offset, process);
-                len -= process;
-                offset += process;
-            }
+            EVP_hash(self, cp, len);
         }
     }
 
@@ -522,7 +585,7 @@
     CONSTRUCTOR_METH_DEF(sha256),
     CONSTRUCTOR_METH_DEF(sha384),
     CONSTRUCTOR_METH_DEF(sha512),
-    {NULL,	NULL}		 /* Sentinel */
+    {NULL, NULL}   /* Sentinel */
 };
 
 
@@ -530,15 +593,15 @@
 
 
 static struct PyModuleDef _hashlibmodule = {
-	PyModuleDef_HEAD_INIT,
-	"_hashlib",
-	NULL,
-	-1,
-	EVP_functions,
-	NULL,
-	NULL,
-	NULL,
-	NULL
+    PyModuleDef_HEAD_INIT,
+    "_hashlib",
+    NULL,
+    -1,
+    EVP_functions,
+    NULL,
+    NULL,
+    NULL,
+    NULL
 };
 
 PyMODINIT_FUNC

Modified: python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h
==============================================================================
--- python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h	(original)
+++ python/branches/py3k-issue1717/Modules/_multiprocessing/connection.h	Sun Jan 25 21:08:20 2009
@@ -362,7 +362,7 @@
 	}
 
 	Py_BEGIN_ALLOW_THREADS
-	res = conn_poll(self, timeout);
+	res = conn_poll(self, timeout, _save);
 	Py_END_ALLOW_THREADS
 
 	switch (res) {

Modified: python/branches/py3k-issue1717/Modules/_multiprocessing/pipe_connection.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_multiprocessing/pipe_connection.c	(original)
+++ python/branches/py3k-issue1717/Modules/_multiprocessing/pipe_connection.c	Sun Jan 25 21:08:20 2009
@@ -83,10 +83,8 @@
  * Check whether any data is available for reading
  */
 
-#define conn_poll(conn, timeout) conn_poll_save(conn, timeout, _save)
-
 static int
-conn_poll_save(ConnectionObject *conn, double timeout, PyThreadState *_save)
+conn_poll(ConnectionObject *conn, double timeout, PyThreadState *_save)
 {
 	DWORD bytes, deadline, delay;
 	int difference, res;

Modified: python/branches/py3k-issue1717/Modules/_multiprocessing/socket_connection.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_multiprocessing/socket_connection.c	(original)
+++ python/branches/py3k-issue1717/Modules/_multiprocessing/socket_connection.c	Sun Jan 25 21:08:20 2009
@@ -153,11 +153,23 @@
  */
 
 static int
-conn_poll(ConnectionObject *conn, double timeout)
+conn_poll(ConnectionObject *conn, double timeout, PyThreadState *_save)
 {
 	int res;
 	fd_set rfds;
 
+	/*
+	 * Verify the handle, issue 3321. Not required for windows.
+	 */ 
+	#ifndef MS_WINDOWS
+		if (((int)conn->handle) < 0 || ((int)conn->handle) >= FD_SETSIZE) {
+			Py_BLOCK_THREADS
+			PyErr_SetString(PyExc_IOError, "handle out of range in select()");
+			Py_UNBLOCK_THREADS
+			return MP_EXCEPTION_HAS_BEEN_SET;
+		}
+	#endif
+
 	FD_ZERO(&rfds);
 	FD_SET((SOCKET)conn->handle, &rfds);
 

Modified: python/branches/py3k-issue1717/Modules/_pickle.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_pickle.c	(original)
+++ python/branches/py3k-issue1717/Modules/_pickle.c	Sun Jan 25 21:08:20 2009
@@ -846,8 +846,8 @@
         /* Text-mode pickle, or long too big to fit in the 4-byte
          * signed BININT format:  store as a string.
          */
-        pdata[0] = LONG;        /* use LONG for consistence with pickle.py */
-        PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ld\n", x);
+        pdata[0] = LONG;        /* use LONG for consistency with pickle.py */
+        PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ldL\n", x);
         if (pickler_write(self, pdata, strlen(pdata)) < 0)
             return -1;
     }
@@ -977,8 +977,9 @@
     else {
         char *string;
 
-        /* proto < 2:  write the repr and newline.  This is quadratic-time
-           (in the number of digits), in both directions. */
+        /* proto < 2: write the repr and newline.  This is quadratic-time (in
+           the number of digits), in both directions.  We add a trailing 'L'
+           to the repr, for compatibility with Python 2.x. */
 
         repr = PyObject_Repr(obj);
         if (repr == NULL)
@@ -990,7 +991,7 @@
 
         if (pickler_write(self, &long_op, 1) < 0 ||
             pickler_write(self, string, size) < 0 ||
-            pickler_write(self, "\n", 1) < 0)
+            pickler_write(self, "L\n", 2) < 0)
             goto error;
     }
 
@@ -2888,8 +2889,16 @@
     if (len < 2)
         return bad_readline();
 
+    /* s[len-2] will usually be 'L' (and s[len-1] is '\n'); we need to remove
+       the 'L' before calling PyLong_FromString.  In order to maintain
+       compatibility with Python 3.0.0, we don't actually *require*
+       the 'L' to be present. */
+    if (s[len-2] == 'L') {
+        s[len-2] = '\0';
+    }
     /* XXX: Should the base argument explicitly set to 10? */
-    if ((value = PyLong_FromString(s, NULL, 0)) == NULL)
+    value = PyLong_FromString(s, NULL, 0);
+    if (value == NULL)
         return -1;
 
     PDATA_PUSH(self->stack, value, -1);
@@ -2949,7 +2958,8 @@
     errno = 0;
     d = PyOS_ascii_strtod(s, &endptr);
 
-    if (errno || (endptr[0] != '\n') || (endptr[1] != '\0')) {
+    if ((errno == ERANGE && !(fabs(d) <= 1.0)) ||
+        (endptr[0] != '\n') || (endptr[1] != '\0')) {
         PyErr_SetString(PyExc_ValueError, "could not convert string to float");
         return -1;
     }

Modified: python/branches/py3k-issue1717/Modules/_struct.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_struct.c	(original)
+++ python/branches/py3k-issue1717/Modules/_struct.c	Sun Jan 25 21:08:20 2009
@@ -127,8 +127,8 @@
 		return v;
 	}
 	m = Py_TYPE(v)->tp_as_number;
-	if (m != NULL && m->nb_long != NULL) {
-		v = m->nb_long(v);
+	if (m != NULL && m->nb_int != NULL) {
+		v = m->nb_int(v);
 		if (v == NULL)
 			return NULL;
 		if (PyLong_Check(v))
@@ -155,7 +155,7 @@
 			PyErr_Clear();
 			if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0)
 				return -1;
-			o = PyNumber_Int(v);
+			o = PyNumber_Long(v);
 			if (o == NULL)
 				return -1;
 			res = get_long(o, p);
@@ -260,7 +260,7 @@
 				PyErr_Clear();
 				if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0)
 					return -1;
-				o = PyNumber_Int(v);
+				o = PyNumber_Long(v);
 				if (o == NULL)
 					return -1;
 				res = get_wrapped_long(o, p);
@@ -299,7 +299,7 @@
 			PyErr_Clear();
 			if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0)
 				return -1;
-			o = PyNumber_Int(v);
+			o = PyNumber_Long(v);
 			if (o == NULL)
 				return -1;
 			res = get_wrapped_ulong(o, p);
@@ -661,7 +661,7 @@
 		return -1;
 #if (SIZEOF_LONG > SIZEOF_INT)
 	if ((x < ((long)INT_MIN)) || (x > ((long)INT_MAX)))
-		return _range_error(f, 0);
+		RANGE_ERROR(x, f, 0, -1);
 #endif
 	y = (int)x;
 	memcpy(p, (char *)&y, sizeof y);
@@ -673,12 +673,12 @@
 {
 	unsigned long x;
 	unsigned int y;
-	if (get_ulong(v, &x) < 0)
-		return _range_error(f, 1);
+	if (get_wrapped_ulong(v, &x) < 0)
+		return -1;
 	y = (unsigned int)x;
 #if (SIZEOF_LONG > SIZEOF_INT)
 	if (x > ((unsigned long)UINT_MAX))
-		return _range_error(f, 1);
+		RANGE_ERROR(y, f, 1, -1);
 #endif
 	memcpy(p, (char *)&y, sizeof y);
 	return 0;
@@ -698,8 +698,8 @@
 np_ulong(char *p, PyObject *v, const formatdef *f)
 {
 	unsigned long x;
-	if (get_ulong(v, &x) < 0)
-		return _range_error(f, 1);
+	if (get_wrapped_ulong(v, &x) < 0)
+		return -1;
 	memcpy(p, (char *)&x, sizeof x);
 	return 0;
 }

Modified: python/branches/py3k-issue1717/Modules/_testcapimodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_testcapimodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/_testcapimodule.c	Sun Jan 25 21:08:20 2009
@@ -919,6 +919,43 @@
 		return NULL;
 	Py_RETURN_NONE;
 }
+
+/* test Py_AddPendingCalls using threads */
+static int _pending_callback(void *arg)
+{
+	/* we assume the argument is callable object to which we own a reference */
+	PyObject *callable = (PyObject *)arg;
+	PyObject *r = PyObject_CallObject(callable, NULL);
+	Py_DECREF(callable);
+	Py_XDECREF(r);
+	return r != NULL ? 0 : -1;
+}
+
+/* The following requests n callbacks to _pending_callback.  It can be
+ * run from any python thread.
+ */
+PyObject *pending_threadfunc(PyObject *self, PyObject *arg)
+{
+	PyObject *callable;
+	int r;
+	if (PyArg_ParseTuple(arg, "O", &callable) == 0)
+		return NULL;
+
+	/* create the reference for the callbackwhile we hold the lock */
+	Py_INCREF(callable);
+
+	Py_BEGIN_ALLOW_THREADS
+	r = Py_AddPendingCall(&_pending_callback, callable);
+	Py_END_ALLOW_THREADS
+
+	if (r<0) {
+		Py_DECREF(callable); /* unsuccessful add, destroy the extra reference */
+		Py_INCREF(Py_False);
+		return Py_False;
+	}
+	Py_INCREF(Py_True);
+	return Py_True;
+}
 #endif
 
 /* Some tests of PyUnicode_FromFormat().  This needs more tests. */
@@ -1171,6 +1208,7 @@
 	{"test_Z_code",		(PyCFunction)test_Z_code,	 METH_NOARGS},
 #ifdef WITH_THREAD
 	{"_test_thread_state",  test_thread_state, 		 METH_VARARGS},
+	{"_pending_threadfunc",	pending_threadfunc,		 METH_VARARGS},
 #endif
 #ifdef HAVE_GETTIMEOFDAY
 	{"profile_int",		profile_int,			METH_NOARGS},

Modified: python/branches/py3k-issue1717/Modules/_tkinter.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/_tkinter.c	(original)
+++ python/branches/py3k-issue1717/Modules/_tkinter.c	Sun Jan 25 21:08:20 2009
@@ -2160,19 +2160,7 @@
 			      &file, &mask, &func))
 		return NULL;
 
-#ifdef WITH_THREAD
-	if (!self && !tcl_lock) {
-		/* We don't have the Tcl lock since Tcl is threaded. */
-		PyErr_SetString(PyExc_RuntimeError,
-				"_tkinter.createfilehandler not supported "
-				"for threaded Tcl");
-		return NULL;
-	}
-#endif
-
-	if (self) {
-		CHECK_TCL_APPARTMENT;
-	}
+	CHECK_TCL_APPARTMENT;
 
 	tfile = PyObject_AsFileDescriptor(file);
 	if (tfile < 0)
@@ -2203,19 +2191,7 @@
 	if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file))
 		return NULL;
 
-#ifdef WITH_THREAD
-	if (!self && !tcl_lock) {
-		/* We don't have the Tcl lock since Tcl is threaded. */
-		PyErr_SetString(PyExc_RuntimeError,
-				"_tkinter.deletefilehandler not supported "
-				"for threaded Tcl");
-		return NULL;
-	}
-#endif
-
-	if (self) {
-		CHECK_TCL_APPARTMENT;
-	}
+	CHECK_TCL_APPARTMENT;
 
 	tfile = PyObject_AsFileDescriptor(file);
 	if (tfile < 0)
@@ -2389,19 +2365,7 @@
 		return NULL;
 	}
 
-#ifdef WITH_THREAD
-	if (!self && !tcl_lock) {
-		/* We don't have the Tcl lock since Tcl is threaded. */
-		PyErr_SetString(PyExc_RuntimeError,
-				"_tkinter.createtimerhandler not supported "
-				"for threaded Tcl");
-		return NULL;
-	}
-#endif
-
-	if (self) {
-		CHECK_TCL_APPARTMENT;
-	}
+	CHECK_TCL_APPARTMENT;
 
 	v = Tktt_New(func);
 	if (v) {
@@ -2427,20 +2391,8 @@
 	if (!PyArg_ParseTuple(args, "|i:mainloop", &threshold))
 		return NULL;
 
-#ifdef WITH_THREAD
-	if (!self && !tcl_lock) {
-		/* We don't have the Tcl lock since Tcl is threaded. */
-		PyErr_SetString(PyExc_RuntimeError,
-				"_tkinter.mainloop not supported "
-				"for threaded Tcl");
-		return NULL;
-	}
-#endif
-
-	if (self) {
-		CHECK_TCL_APPARTMENT;
-		self->dispatching = 1;
-	}
+	CHECK_TCL_APPARTMENT;
+	self->dispatching = 1;
 
 	quitMainLoop = 0;
 	while (Tk_GetNumMainWindows() > threshold &&
@@ -2450,7 +2402,7 @@
 		int result;
 
 #ifdef WITH_THREAD
-		if (self && self->threaded) {
+		if (self->threaded) {
 			/* Allow other Python threads to run. */
 			ENTER_TCL
 			result = Tcl_DoOneEvent(0);
@@ -2472,15 +2424,13 @@
 #endif
 
 		if (PyErr_CheckSignals() != 0) {
-			if (self)
-				self->dispatching = 0;
+			self->dispatching = 0;
 			return NULL;
 		}
 		if (result < 0)
 			break;
 	}
-	if (self)
-		self->dispatching = 0;
+	self->dispatching = 0;
 	quitMainLoop = 0;
 
 	if (errorInCmd) {
@@ -2873,14 +2823,6 @@
 {
 	{"_flatten",           Tkinter_Flatten, METH_VARARGS},
 	{"create",             Tkinter_Create, METH_VARARGS},
-#ifdef HAVE_CREATEFILEHANDLER
-	{"createfilehandler",  Tkapp_CreateFileHandler, METH_VARARGS},
-	{"deletefilehandler",  Tkapp_DeleteFileHandler, METH_VARARGS},
-#endif
-	{"createtimerhandler", Tkapp_CreateTimerHandler, METH_VARARGS},
-	{"mainloop",           Tkapp_MainLoop, METH_VARARGS},
-	{"dooneevent",         Tkapp_DoOneEvent, METH_VARARGS},
-	{"quit",               Tkapp_Quit, METH_VARARGS},
 	{"setbusywaitinterval",Tkinter_setbusywaitinterval, METH_VARARGS,
 	                       setbusywaitinterval_doc},
 	{"getbusywaitinterval",(PyCFunction)Tkinter_getbusywaitinterval,

Modified: python/branches/py3k-issue1717/Modules/bz2module.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/bz2module.c	(original)
+++ python/branches/py3k-issue1717/Modules/bz2module.c	Sun Jan 25 21:08:20 2009
@@ -1086,6 +1086,36 @@
 	return ret;
 }
 
+PyDoc_STRVAR(BZ2File_enter_doc,
+"__enter__() -> self.");
+
+static PyObject *
+BZ2File_enter(BZ2FileObject *self)
+{
+	if (self->mode == MODE_CLOSED) {
+		PyErr_SetString(PyExc_ValueError,
+			"I/O operation on closed file");
+		return NULL;
+	}
+	Py_INCREF(self);
+	return (PyObject *) self;
+}
+
+PyDoc_STRVAR(BZ2File_exit_doc,
+"__exit__(*excinfo) -> None.  Closes the file.");
+
+static PyObject *
+BZ2File_exit(BZ2FileObject *self, PyObject *args)
+{
+	PyObject *ret = PyObject_CallMethod((PyObject *) self, "close", NULL);
+	if (!ret)
+		/* If error occurred, pass through */
+		return NULL;
+	Py_DECREF(ret);
+	Py_RETURN_NONE;
+}
+
+
 static PyObject *BZ2File_getiter(BZ2FileObject *self);
 
 static PyMethodDef BZ2File_methods[] = {
@@ -1097,6 +1127,8 @@
 	{"seek", (PyCFunction)BZ2File_seek, METH_VARARGS, BZ2File_seek__doc__},
 	{"tell", (PyCFunction)BZ2File_tell, METH_NOARGS, BZ2File_tell__doc__},
 	{"close", (PyCFunction)BZ2File_close, METH_NOARGS, BZ2File_close__doc__},
+	{"__enter__", (PyCFunction)BZ2File_enter, METH_NOARGS, BZ2File_enter_doc},
+	{"__exit__", (PyCFunction)BZ2File_exit, METH_VARARGS, BZ2File_exit_doc},
 	{NULL,		NULL}		/* sentinel */
 };
 

Modified: python/branches/py3k-issue1717/Modules/cjkcodecs/multibytecodec.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/cjkcodecs/multibytecodec.c	(original)
+++ python/branches/py3k-issue1717/Modules/cjkcodecs/multibytecodec.c	Sun Jan 25 21:08:20 2009
@@ -612,7 +612,7 @@
 	const char *data, *errors = NULL;
 	Py_ssize_t datalen, finalsize;
 
-	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|z:decode",
+	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|z:decode",
 				codeckwarglist, &pdata, &errors))
 		return NULL;
 	data = pdata.buf;
@@ -1038,7 +1038,7 @@
 	Py_ssize_t wsize, finalsize = 0, size, origpending;
 	int final = 0;
 
-	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s*|i:decode",
+	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i:decode",
 			incrementalkwarglist, &pdata, &final))
 		return NULL;
 	data = pdata.buf;

Modified: python/branches/py3k-issue1717/Modules/datetimemodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/datetimemodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/datetimemodule.c	Sun Jan 25 21:08:20 2009
@@ -2111,7 +2111,7 @@
 	0,					/*nb_xor*/
 	0,					/*nb_or*/
 	0,					/*nb_int*/
-	0,					/*nb_long*/
+	0,					/*nb_reserved*/
 	0,					/*nb_float*/
 	0,					/*nb_inplace_add*/
 	0,					/*nb_inplace_subtract*/

Modified: python/branches/py3k-issue1717/Modules/gcmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/gcmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/gcmodule.c	Sun Jan 25 21:08:20 2009
@@ -68,6 +68,55 @@
 /* Python string used to look for __del__ attribute. */
 static PyObject *delstr = NULL;
 
+/* This is the number of objects who survived the last full collection. It
+   approximates the number of long lived objects tracked by the GC.
+
+   (by "full collection", we mean a collection of the oldest generation).
+*/
+static Py_ssize_t long_lived_total = 0;
+
+/* This is the number of objects who survived all "non-full" collections,
+   and are awaiting to undergo a full collection for the first time.
+
+*/
+static Py_ssize_t long_lived_pending = 0;
+
+/*
+   NOTE: about the counting of long-lived objects.
+
+   To limit the cost of garbage collection, there are two strategies;
+     - make each collection faster, e.g. by scanning fewer objects
+     - do less collections
+   This heuristic is about the latter strategy.
+
+   In addition to the various configurable thresholds, we only trigger a
+   full collection if the ratio
+	long_lived_pending / long_lived_total
+   is above a given value (hardwired to 25%).
+
+   The reason is that, while "non-full" collections (i.e., collections of
+   the young and middle generations) will always examine roughly the same
+   number of objects -- determined by the aforementioned thresholds --,
+   the cost of a full collection is proportional to the total number of
+   long-lived objects, which is virtually unbounded.
+
+   Indeed, it has been remarked that doing a full collection every
+   <constant number> of object creations entails a dramatic performance
+   degradation in workloads which consist in creating and storing lots of
+   long-lived objects (e.g. building a large list of GC-tracked objects would
+   show quadratic performance, instead of linear as expected: see issue #4074).
+
+   Using the above ratio, instead, yields amortized linear performance in
+   the total number of objects (the effect of which can be summarized
+   thusly: "each full garbage collection is more and more costly as the
+   number of objects grows, but we do fewer and fewer of them").
+
+   This heuristic was suggested by Martin von Löwis on python-dev in
+   June 2008. His original analysis and proposal can be found at:
+	http://mail.python.org/pipermail/python-dev/2008-June/080579.html
+*/
+
+
 /* set for debugging information */
 #define DEBUG_STATS		(1<<0) /* print collection statistics */
 #define DEBUG_COLLECTABLE	(1<<1) /* print collectable objects */
@@ -795,8 +844,16 @@
 	move_unreachable(young, &unreachable);
 
 	/* Move reachable objects to next generation. */
-	if (young != old)
+	if (young != old) {
+		if (generation == NUM_GENERATIONS - 2) {
+			long_lived_pending += gc_list_size(young);
+		}
 		gc_list_merge(young, old);
+	}
+	else {
+		long_lived_pending = 0;
+		long_lived_total = gc_list_size(young);
+	}
 
 	/* All objects in unreachable are trash, but objects reachable from
 	 * finalizers can't safely be deleted.  Python programmers should take
@@ -890,6 +947,13 @@
 	 * generations younger than it will be collected. */
 	for (i = NUM_GENERATIONS-1; i >= 0; i--) {
 		if (generations[i].count > generations[i].threshold) {
+			/* Avoid quadratic performance degradation in number
+			   of tracked objects. See comments at the beginning
+			   of this file, and issue #4074.
+			*/
+			if (i == NUM_GENERATIONS - 1
+			    && long_lived_pending < long_lived_total / 4)
+				continue;
 			n = collect(i);
 			break;
 		}

Modified: python/branches/py3k-issue1717/Modules/grpmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/grpmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/grpmodule.c	Sun Jan 25 21:08:20 2009
@@ -90,7 +90,7 @@
     unsigned int gid;
     struct group *p;
 
-    py_int_id = PyNumber_Int(pyo_id);
+    py_int_id = PyNumber_Long(pyo_id);
     if (!py_int_id)
 	    return NULL;
     gid = PyLong_AS_LONG(py_int_id);

Modified: python/branches/py3k-issue1717/Modules/itertoolsmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/itertoolsmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/itertoolsmodule.c	Sun Jan 25 21:08:20 2009
@@ -886,7 +886,6 @@
 	long ok;
 	PyObject *(*iternext)(PyObject *);
 
-	assert(PyIter_Check(it));
 	iternext = *Py_TYPE(it)->tp_iternext;
 	for (;;) {
 		item = iternext(it);
@@ -1031,7 +1030,6 @@
 	if (lz->stop == 1)
 		return NULL;
 
-	assert(PyIter_Check(it));
 	item = (*Py_TYPE(it)->tp_iternext)(it);
 	if (item == NULL)
 		return NULL;
@@ -1218,7 +1216,6 @@
 	Py_ssize_t oldnext;
 	PyObject *(*iternext)(PyObject *);
 
-	assert(PyIter_Check(it));
 	iternext = *Py_TYPE(it)->tp_iternext;
 	while (lz->cnt < lz->next) {
 		item = iternext(it);
@@ -1229,7 +1226,6 @@
 	}
 	if (lz->stop != -1 && lz->cnt >= lz->stop)
 		return NULL;
-	assert(PyIter_Check(it));
 	item = iternext(it);
 	if (item == NULL)
 		return NULL;
@@ -1361,7 +1357,6 @@
 	PyObject *result;
 	PyObject *it = lz->it;
 
-	assert(PyIter_Check(it));
 	args = (*Py_TYPE(it)->tp_iternext)(it);
 	if (args == NULL)
 		return NULL;
@@ -1880,10 +1875,6 @@
 		PyErr_SetString(PyExc_ValueError, "r must be non-negative");
 		goto error;
 	}
-	if (r > n) {
-		PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable");
-		goto error;
-	}
 
 	indices = PyMem_Malloc(r * sizeof(Py_ssize_t));
 	if (indices == NULL) {
@@ -1903,7 +1894,7 @@
 	co->indices = indices;
 	co->result = NULL;
 	co->r = r;
-	co->stopped = 0;
+	co->stopped = r > n ? 1 : 0;
 
 	return (PyObject *)co;
 
@@ -2143,10 +2134,6 @@
 		PyErr_SetString(PyExc_ValueError, "r must be non-negative");
 		goto error;
 	}
-	if (r > n) {
-		PyErr_SetString(PyExc_ValueError, "r cannot be bigger than the iterable");
-		goto error;
-	}
 
 	indices = PyMem_Malloc(n * sizeof(Py_ssize_t));
 	cycles = PyMem_Malloc(r * sizeof(Py_ssize_t));
@@ -2170,7 +2157,7 @@
 	po->cycles = cycles;
 	po->result = NULL;
 	po->r = r;
-	po->stopped = 0;
+	po->stopped = r > n ? 1 : 0;
 
 	return (PyObject *)po;
 
@@ -2411,7 +2398,6 @@
 	long ok;
 	PyObject *(*iternext)(PyObject *);
 
-	assert(PyIter_Check(it));
 	iternext = *Py_TYPE(it)->tp_iternext;
 	for (;;) {
 		item = iternext(it);
@@ -2896,7 +2882,6 @@
                                 Py_INCREF(lz->fillvalue);
                                 item = lz->fillvalue;
                         } else {
-                                assert(PyIter_Check(it));
                                 item = (*Py_TYPE(it)->tp_iternext)(it);
                                 if (item == NULL) {
                                         lz->numactive -= 1;      
@@ -2925,7 +2910,6 @@
                                 Py_INCREF(lz->fillvalue);
                                 item = lz->fillvalue;
                         } else {
-                                assert(PyIter_Check(it));
                                 item = (*Py_TYPE(it)->tp_iternext)(it);
                                 if (item == NULL) {
                                         lz->numactive -= 1;      

Modified: python/branches/py3k-issue1717/Modules/main.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/main.c	(original)
+++ python/branches/py3k-issue1717/Modules/main.c	Sun Jan 25 21:08:20 2009
@@ -292,7 +292,6 @@
 	wchar_t *module = NULL;
 	FILE *fp = stdin;
 	char *p;
-	int unbuffered = 0;
 	int skipfirstline = 0;
 	int stdin_is_interactive = 0;
 	int help = 0;
@@ -374,7 +373,7 @@
 			break;
 
 		case 'u':
-			unbuffered++;
+			Py_UnbufferedStdioFlag = 1;
 			saw_unbuffered_flag = 1;
 			break;
 
@@ -423,7 +422,7 @@
 		Py_InspectFlag = 1;
 	if (!saw_unbuffered_flag &&
 	    (p = Py_GETENV("PYTHONUNBUFFERED")) && *p != '\0')
-		unbuffered = 1;
+		Py_UnbufferedStdioFlag = 1;
 
 	if (!Py_NoUserSiteDirectory &&
 	    (p = Py_GETENV("PYTHONNOUSERSITE")) && *p != '\0')
@@ -444,7 +443,7 @@
 
 	stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0);
 
-	if (unbuffered) {
+	if (Py_UnbufferedStdioFlag) {
 #if defined(MS_WINDOWS) || defined(__CYGWIN__)
 		_setmode(fileno(stdin), O_BINARY);
 		_setmode(fileno(stdout), O_BINARY);

Modified: python/branches/py3k-issue1717/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/posixmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/posixmodule.c	Sun Jan 25 21:08:20 2009
@@ -5114,10 +5114,8 @@
 	Py_BEGIN_ALLOW_THREADS
 	res = ftruncate(fd, length);
 	Py_END_ALLOW_THREADS
-	if (res < 0) {
-		PyErr_SetFromErrno(PyExc_IOError);
-		return NULL;
-	}
+	if (res < 0)
+		return posix_error();
 	Py_INCREF(Py_None);
 	return Py_None;
 }

Modified: python/branches/py3k-issue1717/Modules/selectmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/selectmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/selectmodule.c	Sun Jan 25 21:08:20 2009
@@ -515,7 +515,7 @@
 		return NULL;
 	}
 	else {
-		tout = PyNumber_Int(tout);
+		tout = PyNumber_Long(tout);
 		if (!tout)
 			return NULL;
 		timeout = PyLong_AsLong(tout);

Modified: python/branches/py3k-issue1717/Modules/socketmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/socketmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/socketmodule.c	Sun Jan 25 21:08:20 2009
@@ -3159,7 +3159,11 @@
 #ifdef HAVE_GETHOSTBYNAME_R_3_ARG
 	struct hostent_data data;
 #else
-	char buf[16384];
+	/* glibcs up to 2.10 assume that the buf argument to
+	   gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc
+	   does not ensure. The attribute below instructs the compiler
+	   to maintain this alignment. */
+	char buf[16384] Py_ALIGNED(8);
 	int buf_len = (sizeof buf) - 1;
 	int errnop;
 #endif

Modified: python/branches/py3k-issue1717/Modules/zlibmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Modules/zlibmodule.c	(original)
+++ python/branches/py3k-issue1717/Modules/zlibmodule.c	Sun Jan 25 21:08:20 2009
@@ -9,38 +9,15 @@
 #include "zlib.h"
 
 #ifdef WITH_THREAD
-#include "pythread.h"
-
-/* #defs ripped off from _tkinter.c, even though the situation here is much
-   simpler, because we don't have to worry about waiting for Tcl
-   events!  And, since zlib itself is threadsafe, we don't need to worry
-   about re-entering zlib functions.
-
-   N.B.
-
-   Since ENTER_ZLIB and LEAVE_ZLIB only need to be called on functions
-   that modify the components of preexisting de/compress objects, it
-   could prove to be a performance gain on multiprocessor machines if
-   there was an de/compress object-specific lock.  However, for the
-   moment the ENTER_ZLIB and LEAVE_ZLIB calls are global for ALL
-   de/compress objects.
- */
-
-static PyThread_type_lock zlib_lock = NULL; /* initialized on module load */
-
-#define ENTER_ZLIB \
-	Py_BEGIN_ALLOW_THREADS \
-	PyThread_acquire_lock(zlib_lock, 1); \
-	Py_END_ALLOW_THREADS
-
-#define LEAVE_ZLIB \
-	PyThread_release_lock(zlib_lock);
-
+    #include "pythread.h"
+    #define ENTER_ZLIB(obj) \
+        Py_BEGIN_ALLOW_THREADS; \
+        PyThread_acquire_lock((obj)->lock, 1); \
+        Py_END_ALLOW_THREADS;
+    #define LEAVE_ZLIB(obj) PyThread_release_lock((obj)->lock);
 #else
-
-#define ENTER_ZLIB
-#define LEAVE_ZLIB
-
+    #define ENTER_ZLIB(obj)
+    #define LEAVE_ZLIB(obj)
 #endif
 
 /* The following parameters are copied from zutil.h, version 0.95 */
@@ -67,6 +44,9 @@
     PyObject *unused_data;
     PyObject *unconsumed_tail;
     int is_initialised;
+    #ifdef WITH_THREAD
+        PyThread_type_lock lock;
+    #endif
 } compobject;
 
 static void
@@ -106,6 +86,9 @@
 	Py_DECREF(self);
 	return NULL;
     }
+#ifdef WITH_THREAD
+    self->lock = PyThread_allocate_lock();
+#endif
     return self;
 }
 
@@ -376,23 +359,30 @@
 }
 
 static void
-Comp_dealloc(compobject *self)
+Dealloc(compobject *self)
 {
-    if (self->is_initialised)
-	deflateEnd(&self->zst);
+#ifdef WITH_THREAD
+    PyThread_free_lock(self->lock);
+#endif
     Py_XDECREF(self->unused_data);
     Py_XDECREF(self->unconsumed_tail);
     PyObject_Del(self);
 }
 
 static void
+Comp_dealloc(compobject *self)
+{
+    if (self->is_initialised)
+        deflateEnd(&self->zst);
+    Dealloc(self);
+}
+
+static void
 Decomp_dealloc(compobject *self)
 {
     if (self->is_initialised)
-	inflateEnd(&self->zst);
-    Py_XDECREF(self->unused_data);
-    Py_XDECREF(self->unconsumed_tail);
-    PyObject_Del(self);
+        inflateEnd(&self->zst);
+    Dealloc(self);
 }
 
 PyDoc_STRVAR(comp_compress__doc__,
@@ -422,7 +412,7 @@
 	return NULL;
     }
 
-    ENTER_ZLIB
+    ENTER_ZLIB(self);
 
     start_total_out = self->zst.total_out;
     self->zst.avail_in = inplen;
@@ -468,7 +458,7 @@
     }
 
  error:
-    LEAVE_ZLIB
+    LEAVE_ZLIB(self);
     PyBuffer_Release(&pinput);
     return RetVal;
 }
@@ -514,7 +504,7 @@
 	return NULL;
     }
 
-    ENTER_ZLIB
+    ENTER_ZLIB(self);
 
     start_total_out = self->zst.total_out;
     self->zst.avail_in = inplen;
@@ -600,7 +590,7 @@
     }
 
  error:
-    LEAVE_ZLIB
+    LEAVE_ZLIB(self);
     PyBuffer_Release(&pinput);
     return RetVal;
 }
@@ -633,7 +623,7 @@
     if (!(RetVal = PyBytes_FromStringAndSize(NULL, length)))
 	return NULL;
 
-    ENTER_ZLIB
+    ENTER_ZLIB(self);
 
     start_total_out = self->zst.total_out;
     self->zst.avail_in = 0;
@@ -693,7 +683,7 @@
     }
 
  error:
-    LEAVE_ZLIB
+    LEAVE_ZLIB(self);
 
     return RetVal;
 }
@@ -714,7 +704,7 @@
     /* Copy the zstream state
      * We use ENTER_ZLIB / LEAVE_ZLIB to make this thread-safe
      */
-    ENTER_ZLIB
+    ENTER_ZLIB(self);
     err = deflateCopy(&retval->zst, &self->zst);
     switch(err) {
     case(Z_OK):
@@ -730,7 +720,6 @@
         zlib_error(self->zst, err, "while copying compression object");
         goto error;
     }
-
     Py_INCREF(self->unused_data);
     Py_INCREF(self->unconsumed_tail);
     Py_XDECREF(retval->unused_data);
@@ -741,11 +730,11 @@
     /* Mark it as being initialized */
     retval->is_initialised = 1;
 
-    LEAVE_ZLIB
+    LEAVE_ZLIB(self);
     return (PyObject *)retval;
 
 error:
-    LEAVE_ZLIB
+    LEAVE_ZLIB(self);
     Py_XDECREF(retval);
     return NULL;
 }
@@ -765,7 +754,7 @@
     /* Copy the zstream state
      * We use ENTER_ZLIB / LEAVE_ZLIB to make this thread-safe
      */
-    ENTER_ZLIB
+    ENTER_ZLIB(self);
     err = inflateCopy(&retval->zst, &self->zst);
     switch(err) {
     case(Z_OK):
@@ -792,11 +781,11 @@
     /* Mark it as being initialized */
     retval->is_initialised = 1;
 
-    LEAVE_ZLIB
+    LEAVE_ZLIB(self);
     return (PyObject *)retval;
 
 error:
-    LEAVE_ZLIB
+    LEAVE_ZLIB(self);
     Py_XDECREF(retval);
     return NULL;
 }
@@ -826,7 +815,7 @@
 	return NULL;
 
 
-    ENTER_ZLIB
+    ENTER_ZLIB(self);
 
     start_total_out = self->zst.total_out;
     self->zst.avail_out = length;
@@ -873,7 +862,7 @@
 
 error:
 
-    LEAVE_ZLIB
+    LEAVE_ZLIB(self);
 
     return retval;
 }
@@ -921,12 +910,20 @@
 PyZlib_adler32(PyObject *self, PyObject *args)
 {
     unsigned int adler32val = 1;  /* adler32(0L, Z_NULL, 0) */
-    Byte *buf;
-    int len;
+    Py_buffer pbuf;
 
-    if (!PyArg_ParseTuple(args, "s#|I:adler32", &buf, &len, &adler32val))
+    if (!PyArg_ParseTuple(args, "s*|I:adler32", &pbuf, &adler32val))
 	return NULL;
-    adler32val = adler32(adler32val, buf, len);
+    /* Releasing the GIL for very small buffers is inefficient
+       and may lower performance */
+    if (pbuf.len > 1024*5) {
+        Py_BEGIN_ALLOW_THREADS
+        adler32val = adler32(adler32val, pbuf.buf, pbuf.len);
+        Py_END_ALLOW_THREADS
+    } else {
+        adler32val = adler32(adler32val, pbuf.buf, pbuf.len);    
+    }
+    PyBuffer_Release(&pbuf);
     return PyLong_FromUnsignedLong(adler32val & 0xffffffffU);
 }
 
@@ -945,7 +942,15 @@
 
     if (!PyArg_ParseTuple(args, "s*|I:crc32", &pbuf, &crc32val))
 	return NULL;
-    signed_val = crc32(crc32val, pbuf.buf, pbuf.len);
+    /* Releasing the GIL for very small buffers is inefficient
+       and may lower performance */
+    if (pbuf.len > 1024*5) {
+        Py_BEGIN_ALLOW_THREADS
+        signed_val = crc32(crc32val, pbuf.buf, pbuf.len);
+        Py_END_ALLOW_THREADS
+    } else {
+        signed_val = crc32(crc32val, pbuf.buf, pbuf.len);    
+    }
     PyBuffer_Release(&pbuf);
     return PyLong_FromUnsignedLong(signed_val & 0xffffffffU);
 }
@@ -1096,8 +1101,5 @@
 
     PyModule_AddStringConstant(m, "__version__", "1.0");
 
-#ifdef WITH_THREAD
-    zlib_lock = PyThread_allocate_lock();
-#endif /* WITH_THREAD */
     return m;
 }

Modified: python/branches/py3k-issue1717/Objects/abstract.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/abstract.c	(original)
+++ python/branches/py3k-issue1717/Objects/abstract.c	Sun Jan 25 21:08:20 2009
@@ -1361,19 +1361,7 @@
 		}
 		return res;
 	}
-	if (m && m->nb_long) { /* This should include subclasses of long */
-		/* Classic classes always take this branch. */
-		PyObject *res = m->nb_long(o);
-		if (res && !PyLong_Check(res)) {
-			PyErr_Format(PyExc_TypeError,
-				     "__long__ returned non-long (type %.200s)",
-				     res->ob_type->tp_name);
-			Py_DECREF(res);
-			return NULL;
-		}
-		return res;
-	}
-	if (PyLong_Check(o)) /* A long subclass without nb_long */
+	if (PyLong_Check(o)) /* An int subclass without nb_int */
 		return _PyLong_Copy((PyLongObject *)o);
 	trunc_func = PyObject_GetAttr(o, trunc_name);
 	if (trunc_func) {
@@ -2730,7 +2718,6 @@
 PyIter_Next(PyObject *iter)
 {
 	PyObject *result;
-	assert(PyIter_Check(iter));
 	result = (*iter->ob_type->tp_iternext)(iter);
 	if (result == NULL &&
 	    PyErr_Occurred() &&

Modified: python/branches/py3k-issue1717/Objects/boolobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/boolobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/boolobject.c	Sun Jan 25 21:08:20 2009
@@ -109,7 +109,7 @@
 	bool_xor,		/* nb_xor */
 	bool_or,		/* nb_or */
 	0,			/* nb_int */
-	0,			/* nb_long */
+	0,			/* nb_reserved */
 	0,			/* nb_float */
 	0,			/* nb_inplace_add */
 	0,			/* nb_inplace_subtract */

Modified: python/branches/py3k-issue1717/Objects/bytesobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/bytesobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/bytesobject.c	Sun Jan 25 21:08:20 2009
@@ -26,7 +26,7 @@
 }
 
 #ifdef COUNT_ALLOCS
-int null_strings, one_strings;
+Py_ssize_t null_strings, one_strings;
 #endif
 
 static PyBytesObject *characters[UCHAR_MAX + 1];

Modified: python/branches/py3k-issue1717/Objects/complexobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/complexobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/complexobject.c	Sun Jan 25 21:08:20 2009
@@ -661,14 +661,6 @@
 }
 
 static PyObject *
-complex_long(PyObject *v)
-{
-	PyErr_SetString(PyExc_TypeError,
-		   "can't convert complex to long; use long(abs(z))");
-	return NULL;
-}
-
-static PyObject *
 complex_float(PyObject *v)
 {
 	PyErr_SetString(PyExc_TypeError,
@@ -1068,7 +1060,7 @@
 	0,					/* nb_xor */
 	0,					/* nb_or */
 	complex_int,				/* nb_int */
-	complex_long,				/* nb_long */
+	0,					/* nb_reserved */
 	complex_float,				/* nb_float */
 	0,					/* nb_inplace_add */
 	0,					/* nb_inplace_subtract */

Modified: python/branches/py3k-issue1717/Objects/exceptions.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/exceptions.c	(original)
+++ python/branches/py3k-issue1717/Objects/exceptions.c	Sun Jan 25 21:08:20 2009
@@ -1923,7 +1923,7 @@
 
     PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL);
     if (!PyExc_MemoryErrorInst)
-        Py_FatalError("Cannot pre-allocate MemoryError instance\n");
+        Py_FatalError("Cannot pre-allocate MemoryError instance");
 
     PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL);
     if (!PyExc_RecursionErrorInst)

Modified: python/branches/py3k-issue1717/Objects/floatobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/floatobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/floatobject.c	Sun Jan 25 21:08:20 2009
@@ -1495,12 +1495,6 @@
 		py_exponent = NULL;
 	}
 
-	/* Returns ints instead of longs where possible */
-	INPLACE_UPDATE(numerator, PyNumber_Int(numerator));
-	if (numerator == NULL) goto error;
-	INPLACE_UPDATE(denominator, PyNumber_Int(denominator));
-	if (denominator == NULL) goto error;
-
 	result_pair = PyTuple_Pack(2, numerator, denominator);
 
 #undef INPLACE_UPDATE
@@ -1798,7 +1792,7 @@
 	0,		/*nb_xor*/
 	0,		/*nb_or*/
 	float_trunc,	/*nb_int*/
-	float_trunc,	/*nb_long*/
+	0,		/*nb_reserved*/
 	float_float,	/*nb_float*/
 	0,		/* nb_inplace_add */
 	0,		/* nb_inplace_subtract */

Modified: python/branches/py3k-issue1717/Objects/longobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/longobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/longobject.c	Sun Jan 25 21:08:20 2009
@@ -175,7 +175,7 @@
 PyLong_FromLong(long ival)
 {
 	PyLongObject *v;
-        unsigned long abs_ival;
+	unsigned long abs_ival;
 	unsigned long t;  /* unsigned so >> doesn't propagate sign bit */
 	int ndigits = 0;
 	int sign = 1;
@@ -183,33 +183,35 @@
 	CHECK_SMALL_INT(ival);
 
 	if (ival < 0) {
-		/* if LONG_MIN == -LONG_MAX-1 (true on most platforms) then
-		   ANSI C says that the result of -ival is undefined when ival
-		   == LONG_MIN.  Hence the following workaround. */
-		abs_ival = (unsigned long)(-1-ival) + 1;
+		/* negate: can't write this as abs_ival = -ival since that
+		   invokes undefined behaviour when ival is LONG_MIN */
+		abs_ival = 0U-(unsigned long)ival;
 		sign = -1;
 	}
 	else {
 		abs_ival = (unsigned long)ival;
 	}
 
-	/* Fast path for single-digits ints */
-	if (!(ival>>PyLong_SHIFT)) {
+	/* Fast path for single-digit ints */
+	if (!(abs_ival >> PyLong_SHIFT)) {
 		v = _PyLong_New(1);
 		if (v) {
 			Py_SIZE(v) = sign;
-			v->ob_digit[0] = (digit)ival;
+			v->ob_digit[0] = Py_SAFE_DOWNCAST(
+				abs_ival, unsigned long, digit);
 		}
 		return (PyObject*)v;
 	}
 
 	/* 2 digits */
-	if (!(ival >> 2*PyLong_SHIFT)) {
+	if (!(abs_ival >> 2*PyLong_SHIFT)) {
 		v = _PyLong_New(2);
 		if (v) {
 			Py_SIZE(v) = 2*sign;
-			v->ob_digit[0] = (digit)ival & PyLong_MASK;
-			v->ob_digit[1] = (digit)(ival >> PyLong_SHIFT);
+			v->ob_digit[0] = Py_SAFE_DOWNCAST(
+				abs_ival & PyLong_MASK, unsigned long, digit);
+			v->ob_digit[1] = Py_SAFE_DOWNCAST(
+			      abs_ival >> PyLong_SHIFT, unsigned long, digit);
 		}
 		return (PyObject*)v;
 	}
@@ -226,7 +228,8 @@
 		Py_SIZE(v) = ndigits*sign;
 		t = abs_ival;
 		while (t) {
-			*p++ = (digit)(t & PyLong_MASK);
+			*p++ = Py_SAFE_DOWNCAST(
+				t & PyLong_MASK, unsigned long, digit);
 			t >>= PyLong_SHIFT;
 		}
 	}
@@ -739,7 +742,7 @@
 			/* Because we're going LSB to MSB, thisbyte is
 			   more significant than what's already in accum,
 			   so needs to be prepended to accum. */
-			accum |= thisbyte << accumbits;
+			accum |= (twodigits)thisbyte << accumbits;
 			accumbits += 8;
 			if (accumbits >= PyLong_SHIFT) {
 				/* There's enough to fill a Python digit. */
@@ -768,7 +771,7 @@
 		    unsigned char* bytes, size_t n,
 		    int little_endian, int is_signed)
 {
-	int i;			/* index into v->ob_digit */
+	Py_ssize_t i;		/* index into v->ob_digit */
 	Py_ssize_t ndigits;		/* |v->ob_size| */
 	twodigits accum;	/* sliding register */
 	unsigned int accumbits; /* # bits in accum */
@@ -813,7 +816,7 @@
 	accumbits = 0;
 	carry = do_twos_comp ? 1 : 0;
 	for (i = 0; i < ndigits; ++i) {
-		twodigits thisdigit = v->ob_digit[i];
+		digit thisdigit = v->ob_digit[i];
 		if (do_twos_comp) {
 			thisdigit = (thisdigit ^ PyLong_MASK) + carry;
 			carry = thisdigit >> PyLong_SHIFT;
@@ -822,26 +825,23 @@
 		/* Because we're going LSB to MSB, thisdigit is more
 		   significant than what's already in accum, so needs to be
 		   prepended to accum. */
-		accum |= thisdigit << accumbits;
-		accumbits += PyLong_SHIFT;
+		accum |= (twodigits)thisdigit << accumbits;
 
 		/* The most-significant digit may be (probably is) at least
 		   partly empty. */
 		if (i == ndigits - 1) {
 			/* Count # of sign bits -- they needn't be stored,
 			 * although for signed conversion we need later to
-			 * make sure at least one sign bit gets stored.
-			 * First shift conceptual sign bit to real sign bit.
-			 */
-			stwodigits s = (stwodigits)(thisdigit <<
-				(8*sizeof(stwodigits) - PyLong_SHIFT));
-			unsigned int nsignbits = 0;
-			while ((s < 0) == do_twos_comp && nsignbits < PyLong_SHIFT) {
-				++nsignbits;
-				s <<= 1;
+			 * make sure at least one sign bit gets stored. */
+			digit s = do_twos_comp ? thisdigit ^ PyLong_MASK :
+				                thisdigit;
+			while (s != 0) {
+				s >>= 1;
+				accumbits++;
 			}
-			accumbits -= nsignbits;
 		}
+		else
+			accumbits += PyLong_SHIFT;
 
 		/* Store as many bytes as possible. */
 		while (accumbits >= 8) {
@@ -1361,7 +1361,7 @@
 static digit
 v_iadd(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n)
 {
-	int i;
+	Py_ssize_t i;
 	digit carry = 0;
 
 	assert(m >= n);
@@ -1387,7 +1387,7 @@
 static digit
 v_isub(digit *x, Py_ssize_t m, digit *y, Py_ssize_t n)
 {
-	int i;
+	Py_ssize_t i;
 	digit borrow = 0;
 
 	assert(m >= n);
@@ -1453,7 +1453,7 @@
 		digit hi;
 		rem = (rem << PyLong_SHIFT) + *--pin;
 		*--pout = hi = (digit)(rem / n);
-		rem -= hi * n;
+		rem -= (twodigits)hi * n;
 	}
 	return (digit)rem;
 }
@@ -1646,7 +1646,7 @@
  * Note that when converting a base B string, a char c is a legitimate
  * base B digit iff _PyLong_DigitValue[Py_CHARPyLong_MASK(c)] < B.
  */
-int _PyLong_DigitValue[256] = {
+unsigned char _PyLong_DigitValue[256] = {
 	37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
 	37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
 	37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
@@ -1710,13 +1710,13 @@
 	bits_in_accum = 0;
 	pdigit = z->ob_digit;
 	while (--p >= start) {
-		int k = _PyLong_DigitValue[Py_CHARMASK(*p)];
+		int k = (int)_PyLong_DigitValue[Py_CHARMASK(*p)];
 		assert(k >= 0 && k < base);
-		accum |= (twodigits)(k << bits_in_accum);
+		accum |= (twodigits)k << bits_in_accum;
 		bits_in_accum += bits_per_char;
 		if (bits_in_accum >= PyLong_SHIFT) {
 			*pdigit++ = (digit)(accum & PyLong_MASK);
-			assert(pdigit - z->ob_digit <= (int)n);
+			assert(pdigit - z->ob_digit <= n);
 			accum >>= PyLong_SHIFT;
 			bits_in_accum -= PyLong_SHIFT;
 			assert(bits_in_accum < PyLong_SHIFT);
@@ -1725,7 +1725,7 @@
 	if (bits_in_accum) {
 		assert(bits_in_accum <= PyLong_SHIFT);
 		*pdigit++ = (digit)accum;
-		assert(pdigit - z->ob_digit <= (int)n);
+		assert(pdigit - z->ob_digit <= n);
 	}
 	while (pdigit - z->ob_digit < n)
 		*pdigit++ = 0;
@@ -1926,7 +1926,7 @@
 			c = (digit)_PyLong_DigitValue[Py_CHARMASK(*str++)];
 			for (i = 1; i < convwidth && str != scan; ++i, ++str) {
 				c = (twodigits)(c *  base +
-					_PyLong_DigitValue[Py_CHARMASK(*str)]);
+					(int)_PyLong_DigitValue[Py_CHARMASK(*str)]);
 				assert(c < PyLong_BASE);
 			}
 
@@ -1990,8 +1990,6 @@
 		goto onError;
 	if (sign < 0)
 		Py_SIZE(z) = -(Py_SIZE(z));
-	if (*str == 'L' || *str == 'l')
-		str++;
 	while (*str && isspace(Py_CHARMASK(*str)))
 		str++;
 	if (*str != '\0')
@@ -2122,7 +2120,7 @@
 		digit vj = (j >= size_v) ? 0 : v->ob_digit[j];
 		twodigits q;
 		stwodigits carry = 0;
-		int i;
+		Py_ssize_t i;
 
 		SIGCHECK({
 			Py_DECREF(a);
@@ -2324,7 +2322,7 @@
 {
 	Py_ssize_t size_a = ABS(Py_SIZE(a)), size_b = ABS(Py_SIZE(b));
 	PyLongObject *z;
-	int i;
+	Py_ssize_t i;
 	digit carry = 0;
 
 	/* Ensure a is the larger of the two: */
@@ -3830,7 +3828,7 @@
 			long_xor,	/*nb_xor*/
 			long_or,	/*nb_or*/
 			long_long,	/*nb_int*/
-			long_long,	/*nb_long*/
+	0,				/*nb_reserved*/
 			long_float,	/*nb_float*/
 	0,				/* nb_inplace_add */
 	0,				/* nb_inplace_subtract */

Modified: python/branches/py3k-issue1717/Objects/memoryobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/memoryobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/memoryobject.c	Sun Jan 25 21:08:20 2009
@@ -3,46 +3,51 @@
 
 #include "Python.h"
 
-static void
-dup_buffer(Py_buffer *dest, Py_buffer *src)
-{
-	*dest = *src;
-        if (src->shape == &(src->len))
-            dest->shape = &(dest->len);
-        if (src->strides == &(src->itemsize))
-            dest->strides = &(dest->itemsize);
-}
-
-/* XXX The buffer API should mandate that the shape array be non-NULL, but
-   it would complicate some code since the (de)allocation semantics of shape
-   are not specified. */
 static Py_ssize_t
 get_shape0(Py_buffer *buf)
 {
     if (buf->shape != NULL)
         return buf->shape[0];
-    assert(buf->ndim == 1 && buf->itemsize > 0);
-    return buf->len / buf->itemsize;
+    if (buf->ndim == 0)
+        return 1;
+    PyErr_SetString(PyExc_TypeError,
+        "exported buffer does not have any shape information associated "
+        "to it");
+    return -1;
+}
+
+static void
+dup_buffer(Py_buffer *dest, Py_buffer *src)
+{
+    *dest = *src;
+    if (src->ndim == 1 && src->shape != NULL) {
+        dest->shape = &(dest->smalltable[0]);
+        dest->shape[0] = get_shape0(src);
+    }
+    if (src->ndim == 1 && src->strides != NULL) {
+        dest->strides = &(dest->smalltable[1]);
+        dest->strides[0] = src->strides[0];
+    }
 }
 
 static int
 memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags)
 {
-	int res = 0;
-	/* XXX for whatever reason fixing the flags seems necessary */
-	if (self->view.readonly)
-		flags &= ~PyBUF_WRITABLE;
-	if (self->view.obj != NULL)
-		res = PyObject_GetBuffer(self->view.obj, view, flags);
-	if (view)
-		dup_buffer(view, &self->view);
-	return res;
+    int res = 0;
+    /* XXX for whatever reason fixing the flags seems necessary */
+    if (self->view.readonly)
+        flags &= ~PyBUF_WRITABLE;
+    if (self->view.obj != NULL)
+        res = PyObject_GetBuffer(self->view.obj, view, flags);
+    if (view)
+        dup_buffer(view, &self->view);
+    return res;
 }
 
 static void
 memory_releasebuf(PyMemoryViewObject *self, Py_buffer *view)
 {
-	PyBuffer_Release(view);
+    PyBuffer_Release(view);
 }
 
 PyDoc_STRVAR(memory_doc,
@@ -53,61 +58,61 @@
 PyObject *
 PyMemoryView_FromBuffer(Py_buffer *info)
 {
-	PyMemoryViewObject *mview;
+    PyMemoryViewObject *mview;
 
-	mview = (PyMemoryViewObject *)
-		PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type);
-	if (mview == NULL)
-		return NULL;
-	mview->base = NULL;
-	dup_buffer(&mview->view, info);
-        /* NOTE: mview->view.obj should already have been incref'ed as
-           part of PyBuffer_FillInfo(). */
-	_PyObject_GC_TRACK(mview);
-	return (PyObject *)mview;
+    mview = (PyMemoryViewObject *)
+        PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type);
+    if (mview == NULL)
+        return NULL;
+    mview->base = NULL;
+    dup_buffer(&mview->view, info);
+    /* NOTE: mview->view.obj should already have been incref'ed as
+       part of PyBuffer_FillInfo(). */
+    _PyObject_GC_TRACK(mview);
+    return (PyObject *)mview;
 }
 
 PyObject *
 PyMemoryView_FromObject(PyObject *base)
 {
-        PyMemoryViewObject *mview;
-
-        if (!PyObject_CheckBuffer(base)) {
-                PyErr_SetString(PyExc_TypeError,
-                                "cannot make memory view because object does "
-                                "not have the buffer interface");
-                return NULL;
-        }
+    PyMemoryViewObject *mview;
 
-	mview = (PyMemoryViewObject *)
-		PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type);
-        if (mview == NULL)
-		return NULL;
-
-        mview->base = NULL;
-        if (PyObject_GetBuffer(base, &(mview->view), PyBUF_FULL_RO) < 0) {
-                Py_DECREF(mview);
-                return NULL;
-        }
-
-        mview->base = base;
-        Py_INCREF(base);
-	_PyObject_GC_TRACK(mview);
-        return (PyObject *)mview;
+    if (!PyObject_CheckBuffer(base)) {
+        PyErr_SetString(PyExc_TypeError,
+            "cannot make memory view because object does "
+            "not have the buffer interface");
+        return NULL;
+    }
+
+    mview = (PyMemoryViewObject *)
+        PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type);
+    if (mview == NULL)
+        return NULL;
+
+    mview->base = NULL;
+    if (PyObject_GetBuffer(base, &(mview->view), PyBUF_FULL_RO) < 0) {
+        Py_DECREF(mview);
+        return NULL;
+    }
+
+    mview->base = base;
+    Py_INCREF(base);
+    _PyObject_GC_TRACK(mview);
+    return (PyObject *)mview;
 }
 
 static PyObject *
 memory_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
 {
-	PyObject *obj;
-	static char *kwlist[] = {"object", 0};
+    PyObject *obj;
+    static char *kwlist[] = {"object", 0};
 
-	if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:memoryview", kwlist,
-					 &obj)) {
-		return NULL;
-	}
+    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:memoryview", kwlist,
+                                     &obj)) {
+        return NULL;
+    }
 
-	return PyMemoryView_FromObject(obj);
+    return PyMemoryView_FromObject(obj);
 }
 
 
@@ -115,58 +120,58 @@
 _strided_copy_nd(char *dest, char *src, int nd, Py_ssize_t *shape,
                  Py_ssize_t *strides, Py_ssize_t itemsize, char fort)
 {
-        int k;
-        Py_ssize_t outstride;
+    int k;
+    Py_ssize_t outstride;
 
-        if (nd==0) {
-                memcpy(dest, src, itemsize);
+    if (nd==0) {
+        memcpy(dest, src, itemsize);
+    }
+    else if (nd == 1) {
+        for (k = 0; k<shape[0]; k++) {
+            memcpy(dest, src, itemsize);
+            dest += itemsize;
+            src += strides[0];
         }
-        else if (nd == 1) {
-                for (k = 0; k<shape[0]; k++) {
-                        memcpy(dest, src, itemsize);
-                        dest += itemsize;
-                        src += strides[0];
-                }
+    }
+    else {
+        if (fort == 'F') {
+            /* Copy first dimension first,
+               second dimension second, etc...
+               Set up the recursive loop backwards so that final
+               dimension is actually copied last.
+            */
+            outstride = itemsize;
+            for (k=1; k<nd-1;k++) {
+                outstride *= shape[k];
+            }
+            for (k=0; k<shape[nd-1]; k++) {
+                _strided_copy_nd(dest, src, nd-1, shape,
+                                 strides, itemsize, fort);
+                dest += outstride;
+                src += strides[nd-1];
+            }
         }
+
         else {
-                if (fort == 'F') {
-                        /* Copy first dimension first,
-                           second dimension second, etc...
-                           Set up the recursive loop backwards so that final
-                           dimension is actually copied last.
-                        */
-                        outstride = itemsize;
-                        for (k=1; k<nd-1;k++) {
-                                outstride *= shape[k];
-                        }
-                        for (k=0; k<shape[nd-1]; k++) {
-                                _strided_copy_nd(dest, src, nd-1, shape,
-                                                 strides, itemsize, fort);
-                                dest += outstride;
-                                src += strides[nd-1];
-                        }
-                }
-
-                else {
-                        /* Copy last dimension first,
-                           second-to-last dimension second, etc.
-                           Set up the recursion so that the
-                           first dimension is copied last
-                        */
-                        outstride = itemsize;
-                        for (k=1; k < nd; k++) {
-                                outstride *= shape[k];
-                        }
-                        for (k=0; k<shape[0]; k++) {
-                                _strided_copy_nd(dest, src, nd-1, shape+1,
-                                                 strides+1, itemsize,
-                                                 fort);
-                                dest += outstride;
-                                src += strides[0];
-                        }
-                }
+            /* Copy last dimension first,
+               second-to-last dimension second, etc.
+               Set up the recursion so that the
+               first dimension is copied last
+            */
+            outstride = itemsize;
+            for (k=1; k < nd; k++) {
+                outstride *= shape[k];
+            }
+            for (k=0; k<shape[0]; k++) {
+                _strided_copy_nd(dest, src, nd-1, shape+1,
+                                 strides+1, itemsize,
+                                 fort);
+                dest += outstride;
+                src += strides[0];
+            }
         }
-        return;
+    }
+    return;
 }
 
 void _add_one_to_index_F(int nd, Py_ssize_t *index, Py_ssize_t *shape);
@@ -175,45 +180,45 @@
 static int
 _indirect_copy_nd(char *dest, Py_buffer *view, char fort)
 {
-        Py_ssize_t *indices;
-        int k;
-        Py_ssize_t elements;
-        char *ptr;
-        void (*func)(int, Py_ssize_t *, Py_ssize_t *);
+    Py_ssize_t *indices;
+    int k;
+    Py_ssize_t elements;
+    char *ptr;
+    void (*func)(int, Py_ssize_t *, Py_ssize_t *);
 
-        if (view->ndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) {
-                PyErr_NoMemory();
-                return -1;
-        }
+    if (view->ndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) {
+        PyErr_NoMemory();
+        return -1;
+    }
 
-        indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*view->ndim);
-        if (indices == NULL) {
-                PyErr_NoMemory();
-                return -1;
-        }
-        for (k=0; k<view->ndim;k++) {
-                indices[k] = 0;
-        }
+    indices = (Py_ssize_t *)PyMem_Malloc(sizeof(Py_ssize_t)*view->ndim);
+    if (indices == NULL) {
+        PyErr_NoMemory();
+        return -1;
+    }
+    for (k=0; k<view->ndim;k++) {
+        indices[k] = 0;
+    }
 
-        elements = 1;
-        for (k=0; k<view->ndim; k++) {
-                elements *= view->shape[k];
-        }
-        if (fort == 'F') {
-                func = _add_one_to_index_F;
-        }
-        else {
-                func = _add_one_to_index_C;
-        }
-        while (elements--) {
-                func(view->ndim, indices, view->shape);
-                ptr = PyBuffer_GetPointer(view, indices);
-                memcpy(dest, ptr, view->itemsize);
-                dest += view->itemsize;
-        }
+    elements = 1;
+    for (k=0; k<view->ndim; k++) {
+        elements *= view->shape[k];
+    }
+    if (fort == 'F') {
+        func = _add_one_to_index_F;
+    }
+    else {
+        func = _add_one_to_index_C;
+    }
+    while (elements--) {
+        func(view->ndim, indices, view->shape);
+        ptr = PyBuffer_GetPointer(view, indices);
+        memcpy(dest, ptr, view->itemsize);
+        dest += view->itemsize;
+    }
 
-        PyMem_Free(indices);
-        return 0;
+    PyMem_Free(indices);
+    return 0;
 }
 
 /*
@@ -235,181 +240,181 @@
                 the shadow buffer which can be written to and then
                 will be copied back into the other buffer when the memory
                 view is de-allocated.  While the shadow buffer is
-		being used, it will have an exclusive write lock on
-		the original buffer.
+                being used, it will have an exclusive write lock on
+                the original buffer.
  */
 
 PyObject *
 PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
 {
-        PyMemoryViewObject *mem;
-        PyObject *bytes;
-        Py_buffer *view;
-        int flags;
-        char *dest;
-
-        if (!PyObject_CheckBuffer(obj)) {
-                PyErr_SetString(PyExc_TypeError,
-                                "object does not have the buffer interface");
-                return NULL;
-        }
+    PyMemoryViewObject *mem;
+    PyObject *bytes;
+    Py_buffer *view;
+    int flags;
+    char *dest;
 
-        mem = PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type);
-        if (mem == NULL)
-		return NULL;
-
-        view = &mem->view;
-        flags = PyBUF_FULL_RO;
-        switch(buffertype) {
-        case PyBUF_WRITE:
-                flags = PyBUF_FULL;
-                break;
-        }
+    if (!PyObject_CheckBuffer(obj)) {
+        PyErr_SetString(PyExc_TypeError,
+                        "object does not have the buffer interface");
+        return NULL;
+    }
 
-        if (PyObject_GetBuffer(obj, view, flags) != 0) {
-                Py_DECREF(mem);
-                return NULL;
-        }
+    mem = PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type);
+    if (mem == NULL)
+        return NULL;
 
-        if (PyBuffer_IsContiguous(view, fort)) {
-                /* no copy needed */
-                Py_INCREF(obj);
-                mem->base = obj;
-		_PyObject_GC_TRACK(mem);
-                return (PyObject *)mem;
-        }
-        /* otherwise a copy is needed */
-        if (buffertype == PyBUF_WRITE) {
-                Py_DECREF(mem);
-                PyErr_SetString(PyExc_BufferError,
-                                "writable contiguous buffer requested "
-                                "for a non-contiguousobject.");
-                return NULL;
-        }
-        bytes = PyBytes_FromStringAndSize(NULL, view->len);
-        if (bytes == NULL) {
-                Py_DECREF(mem);
-                return NULL;
-        }
-        dest = PyBytes_AS_STRING(bytes);
-        /* different copying strategy depending on whether
-           or not any pointer de-referencing is needed
-        */
-        /* strided or in-direct copy */
-        if (view->suboffsets==NULL) {
-                _strided_copy_nd(dest, view->buf, view->ndim, view->shape,
-                                 view->strides, view->itemsize, fort);
-        }
-        else {
-                if (_indirect_copy_nd(dest, view, fort) < 0) {
-                        Py_DECREF(bytes);
-			Py_DECREF(mem);
-                        return NULL;
-                }
-        }
-        if (buffertype == PyBUF_SHADOW) {
-                /* return a shadowed memory-view object */
-                view->buf = dest;
-                mem->base = PyTuple_Pack(2, obj, bytes);
-                Py_DECREF(bytes);
-		if (mem->base == NULL) {
-			Py_DECREF(mem);
-			return NULL;
-		}
+    view = &mem->view;
+    flags = PyBUF_FULL_RO;
+    switch(buffertype) {
+    case PyBUF_WRITE:
+        flags = PyBUF_FULL;
+        break;
+    }
+
+    if (PyObject_GetBuffer(obj, view, flags) != 0) {
+        Py_DECREF(mem);
+        return NULL;
+    }
+
+    if (PyBuffer_IsContiguous(view, fort)) {
+        /* no copy needed */
+        Py_INCREF(obj);
+        mem->base = obj;
+        _PyObject_GC_TRACK(mem);
+        return (PyObject *)mem;
+    }
+    /* otherwise a copy is needed */
+    if (buffertype == PyBUF_WRITE) {
+        Py_DECREF(mem);
+        PyErr_SetString(PyExc_BufferError,
+                        "writable contiguous buffer requested "
+                        "for a non-contiguousobject.");
+        return NULL;
+    }
+    bytes = PyBytes_FromStringAndSize(NULL, view->len);
+    if (bytes == NULL) {
+        Py_DECREF(mem);
+        return NULL;
+    }
+    dest = PyBytes_AS_STRING(bytes);
+    /* different copying strategy depending on whether
+       or not any pointer de-referencing is needed
+    */
+    /* strided or in-direct copy */
+    if (view->suboffsets==NULL) {
+        _strided_copy_nd(dest, view->buf, view->ndim, view->shape,
+                         view->strides, view->itemsize, fort);
+    }
+    else {
+        if (_indirect_copy_nd(dest, view, fort) < 0) {
+            Py_DECREF(bytes);
+            Py_DECREF(mem);
+            return NULL;
         }
-        else {
-                PyBuffer_Release(view);  /* XXX ? */
-                /* steal the reference */
-                mem->base = bytes;
+    }
+    if (buffertype == PyBUF_SHADOW) {
+        /* return a shadowed memory-view object */
+        view->buf = dest;
+        mem->base = PyTuple_Pack(2, obj, bytes);
+        Py_DECREF(bytes);
+        if (mem->base == NULL) {
+            Py_DECREF(mem);
+            return NULL;
         }
-	_PyObject_GC_TRACK(mem);
-        return (PyObject *)mem;
+    }
+    else {
+        PyBuffer_Release(view);  /* XXX ? */
+        /* steal the reference */
+        mem->base = bytes;
+    }
+    _PyObject_GC_TRACK(mem);
+    return (PyObject *)mem;
 }
 
 
 static PyObject *
 memory_format_get(PyMemoryViewObject *self)
 {
-        return PyUnicode_FromString(self->view.format);
+    return PyUnicode_FromString(self->view.format);
 }
 
 static PyObject *
 memory_itemsize_get(PyMemoryViewObject *self)
 {
-        return PyLong_FromSsize_t(self->view.itemsize);
+    return PyLong_FromSsize_t(self->view.itemsize);
 }
 
 static PyObject *
 _IntTupleFromSsizet(int len, Py_ssize_t *vals)
 {
-        int i;
-        PyObject *o;
-        PyObject *intTuple;
-
-        if (vals == NULL) {
-                Py_INCREF(Py_None);
-                return Py_None;
-        }
-        intTuple = PyTuple_New(len);
-        if (!intTuple) return NULL;
-        for(i=0; i<len; i++) {
-                o = PyLong_FromSsize_t(vals[i]);
-                if (!o) {
-                        Py_DECREF(intTuple);
-                        return NULL;
-                }
-                PyTuple_SET_ITEM(intTuple, i, o);
+    int i;
+    PyObject *o;
+    PyObject *intTuple;
+
+    if (vals == NULL) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+    intTuple = PyTuple_New(len);
+    if (!intTuple) return NULL;
+    for(i=0; i<len; i++) {
+        o = PyLong_FromSsize_t(vals[i]);
+        if (!o) {
+            Py_DECREF(intTuple);
+            return NULL;
         }
-        return intTuple;
+        PyTuple_SET_ITEM(intTuple, i, o);
+    }
+    return intTuple;
 }
 
 static PyObject *
 memory_shape_get(PyMemoryViewObject *self)
 {
-        return _IntTupleFromSsizet(self->view.ndim, self->view.shape);
+    return _IntTupleFromSsizet(self->view.ndim, self->view.shape);
 }
 
 static PyObject *
 memory_strides_get(PyMemoryViewObject *self)
 {
-        return _IntTupleFromSsizet(self->view.ndim, self->view.strides);
+    return _IntTupleFromSsizet(self->view.ndim, self->view.strides);
 }
 
 static PyObject *
 memory_suboffsets_get(PyMemoryViewObject *self)
 {
-        return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets);
+    return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets);
 }
 
 static PyObject *
 memory_readonly_get(PyMemoryViewObject *self)
 {
-        return PyBool_FromLong(self->view.readonly);
+    return PyBool_FromLong(self->view.readonly);
 }
 
 static PyObject *
 memory_ndim_get(PyMemoryViewObject *self)
 {
-        return PyLong_FromLong(self->view.ndim);
+    return PyLong_FromLong(self->view.ndim);
 }
 
 static PyGetSetDef memory_getsetlist[] ={
-        {"format",	(getter)memory_format_get,	NULL, NULL},
-        {"itemsize",	(getter)memory_itemsize_get,	NULL, NULL},
-        {"shape",	(getter)memory_shape_get,	NULL, NULL},
-        {"strides",	(getter)memory_strides_get,	NULL, NULL},
-        {"suboffsets",	(getter)memory_suboffsets_get,	NULL, NULL},
-        {"readonly",	(getter)memory_readonly_get,	NULL, NULL},
-        {"ndim",	(getter)memory_ndim_get,	NULL, NULL},
-        {NULL, NULL, NULL, NULL},
+    {"format",                (getter)memory_format_get,      NULL, NULL},
+    {"itemsize",        (getter)memory_itemsize_get,    NULL, NULL},
+    {"shape",           (getter)memory_shape_get,       NULL, NULL},
+    {"strides",         (getter)memory_strides_get,     NULL, NULL},
+    {"suboffsets",      (getter)memory_suboffsets_get,  NULL, NULL},
+    {"readonly",        (getter)memory_readonly_get,    NULL, NULL},
+    {"ndim",            (getter)memory_ndim_get,        NULL, NULL},
+    {NULL, NULL, NULL, NULL},
 };
 
 
 static PyObject *
 memory_tobytes(PyMemoryViewObject *mem, PyObject *noargs)
 {
-	return PyObject_CallFunctionObjArgs(
-		(PyObject *) &PyBytes_Type, mem, NULL);
+    return PyObject_CallFunctionObjArgs(
+            (PyObject *) &PyBytes_Type, mem, NULL);
 }
 
 /* TODO: rewrite this function using the struct module to unpack
@@ -418,119 +423,111 @@
 static PyObject *
 memory_tolist(PyMemoryViewObject *mem, PyObject *noargs)
 {
-	Py_buffer *view = &(mem->view);
-	Py_ssize_t i;
-	PyObject *res, *item;
-	char *buf;
-
-	if (strcmp(view->format, "B") || view->itemsize != 1) {
-		PyErr_SetString(PyExc_NotImplementedError, 
-			"tolist() only supports byte views");
-		return NULL;
-	}
-	if (view->ndim != 1) {
-		PyErr_SetString(PyExc_NotImplementedError, 
-			"tolist() only supports one-dimensional objects");
-		return NULL;
-	}
-	res = PyList_New(view->len);
-	if (res == NULL)
-		return NULL;
-	buf = view->buf;
-	for (i = 0; i < view->len; i++) {
-		item = PyLong_FromUnsignedLong((unsigned char) *buf);
-		if (item == NULL) {
-			Py_DECREF(res);
-			return NULL;
-		}
-		PyList_SET_ITEM(res, i, item);
-		buf++;
-	}
-	return res;
+    Py_buffer *view = &(mem->view);
+    Py_ssize_t i;
+    PyObject *res, *item;
+    char *buf;
+
+    if (strcmp(view->format, "B") || view->itemsize != 1) {
+        PyErr_SetString(PyExc_NotImplementedError, 
+                "tolist() only supports byte views");
+        return NULL;
+    }
+    if (view->ndim != 1) {
+        PyErr_SetString(PyExc_NotImplementedError, 
+                "tolist() only supports one-dimensional objects");
+        return NULL;
+    }
+    res = PyList_New(view->len);
+    if (res == NULL)
+        return NULL;
+    buf = view->buf;
+    for (i = 0; i < view->len; i++) {
+        item = PyLong_FromUnsignedLong((unsigned char) *buf);
+        if (item == NULL) {
+            Py_DECREF(res);
+            return NULL;
+        }
+        PyList_SET_ITEM(res, i, item);
+        buf++;
+    }
+    return res;
 }
 
-
-
 static PyMethodDef memory_methods[] = {
-        {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL},
-        {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL},
-        {NULL,          NULL}           /* sentinel */
+    {"tobytes", (PyCFunction)memory_tobytes, METH_NOARGS, NULL},
+    {"tolist", (PyCFunction)memory_tolist, METH_NOARGS, NULL},
+    {NULL,          NULL}           /* sentinel */
 };
 
 
 static void
 memory_dealloc(PyMemoryViewObject *self)
 {
-	_PyObject_GC_UNTRACK(self);
-        if (self->view.obj != NULL) {
-            if (self->base && PyTuple_Check(self->base)) {
-                /* Special case when first element is generic object
-                   with buffer interface and the second element is a
-                   contiguous "shadow" that must be copied back into
-                   the data areay of the first tuple element before
-                   releasing the buffer on the first element.
-                */
-
-                PyObject_CopyData(PyTuple_GET_ITEM(self->base,0),
-                                  PyTuple_GET_ITEM(self->base,1));
-
-                /* The view member should have readonly == -1 in
-                   this instance indicating that the memory can
-                   be "locked" and was locked and will be unlocked
-                   again after this call.
-                */
-                PyBuffer_Release(&(self->view));
-            }
-            else {
-                PyBuffer_Release(&(self->view));
-            }
-            Py_CLEAR(self->base);
+    _PyObject_GC_UNTRACK(self);
+    if (self->view.obj != NULL) {
+        if (self->base && PyTuple_Check(self->base)) {
+            /* Special case when first element is generic object
+               with buffer interface and the second element is a
+               contiguous "shadow" that must be copied back into
+               the data areay of the first tuple element before
+               releasing the buffer on the first element.
+            */
+
+            PyObject_CopyData(PyTuple_GET_ITEM(self->base,0),
+                              PyTuple_GET_ITEM(self->base,1));
+
+            /* The view member should have readonly == -1 in
+               this instance indicating that the memory can
+               be "locked" and was locked and will be unlocked
+               again after this call.
+            */
+            PyBuffer_Release(&(self->view));
         }
-	PyObject_GC_Del(self);
+        else {
+            PyBuffer_Release(&(self->view));
+        }
+        Py_CLEAR(self->base);
+    }
+    PyObject_GC_Del(self);
 }
 
 static PyObject *
 memory_repr(PyMemoryViewObject *self)
 {
-	return PyUnicode_FromFormat("<memory at %p>", self);
+    return PyUnicode_FromFormat("<memory at %p>", self);
 }
 
 
 static PyObject *
 memory_str(PyMemoryViewObject *self)
 {
-        Py_buffer view;
-        PyObject *res;
+    Py_buffer view;
+    PyObject *res;
 
-        if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0)
-                return NULL;
+    if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0)
+        return NULL;
 
-	res = PyBytes_FromStringAndSize(NULL, view.len);
-        PyBuffer_ToContiguous(PyBytes_AS_STRING(res), &view, view.len, 'C');
-        PyBuffer_Release(&view);
-        return res;
+    res = PyBytes_FromStringAndSize(NULL, view.len);
+    PyBuffer_ToContiguous(PyBytes_AS_STRING(res), &view, view.len, 'C');
+    PyBuffer_Release(&view);
+    return res;
 }
 
 /* Sequence methods */
-
 static Py_ssize_t
 memory_length(PyMemoryViewObject *self)
 {
-        Py_buffer view;
-
-        if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0)
-                return -1;
-        PyBuffer_Release(&view);
-	return view.len;
+    return get_shape0(&self->view);
 }
 
 /*
   mem[obj] returns a bytes object holding the data for one element if
            obj fully indexes the memory view or another memory-view object
-	   if it does not.
+           if it does not.
 
-	   0-d memory-view objects can be referenced using ... or () but
-	   not with anything else.
+           0-d memory-view objects can be referenced using ... or () but
+           not with anything else.
  */
 static PyObject *
 memory_subscript(PyMemoryViewObject *self, PyObject *key)
@@ -539,94 +536,91 @@
     view = &(self->view);
     
     if (view->ndim == 0) {
-	    if (key == Py_Ellipsis ||
-		    (PyTuple_Check(key) && PyTuple_GET_SIZE(key)==0)) {
-		    Py_INCREF(self);
-		    return (PyObject *)self;
-	    }
-	    else {
-		    PyErr_SetString(PyExc_IndexError,
-                                        "invalid indexing of 0-dim memory");
-		    return NULL;
-	    }
+        if (key == Py_Ellipsis ||
+            (PyTuple_Check(key) && PyTuple_GET_SIZE(key)==0)) {
+            Py_INCREF(self);
+            return (PyObject *)self;
+        }
+        else {
+            PyErr_SetString(PyExc_IndexError,
+                                "invalid indexing of 0-dim memory");
+            return NULL;
+        }
     }
     if (PyIndex_Check(key)) {
-	    Py_ssize_t result;
-	    result = PyNumber_AsSsize_t(key, NULL);
-	    if (result == -1 && PyErr_Occurred())
-		    return NULL;
-	    if (view->ndim == 1) {
-		    /* Return a bytes object */
-		    char *ptr;
-		    ptr = (char *)view->buf;
-		    if (result < 0) {
+        Py_ssize_t result;
+        result = PyNumber_AsSsize_t(key, NULL);
+        if (result == -1 && PyErr_Occurred())
+                return NULL;
+        if (view->ndim == 1) {
+            /* Return a bytes object */
+            char *ptr;
+            ptr = (char *)view->buf;
+            if (result < 0) {
                 result += get_shape0(view);
-		    }
+            }
             if ((result < 0) || (result >= get_shape0(view))) {
-			    PyErr_SetString(PyExc_IndexError,
-					    "index out of bounds");
-			    return NULL;
-		    }
-		    if (view->strides == NULL)
-			    ptr += view->itemsize * result;
-		    else
-			    ptr += view->strides[0] * result;
-		    if (view->suboffsets != NULL &&
-                            view->suboffsets[0] >= 0)
-                        {
-			    ptr = *((char **)ptr) + view->suboffsets[0];
-		    }
-		    return PyBytes_FromStringAndSize(ptr, view->itemsize);
-	    }
-	    else {
-		    /* Return a new memory-view object */
-		    Py_buffer newview;
-		    memset(&newview, 0, sizeof(newview));
-		    /* XXX:  This needs to be fixed so it
-			         actually returns a sub-view
-		    */
-		    return PyMemoryView_FromBuffer(&newview);
-	    }
+                PyErr_SetString(PyExc_IndexError,
+                                "index out of bounds");
+                return NULL;
+            }
+            if (view->strides == NULL)
+                ptr += view->itemsize * result;
+            else
+                ptr += view->strides[0] * result;
+            if (view->suboffsets != NULL &&
+                view->suboffsets[0] >= 0) {
+                ptr = *((char **)ptr) + view->suboffsets[0];
+            }
+            return PyBytes_FromStringAndSize(ptr, view->itemsize);
+        }
+        else {
+            /* Return a new memory-view object */
+            Py_buffer newview;
+            memset(&newview, 0, sizeof(newview));
+            /* XXX:  This needs to be fixed so it
+                         actually returns a sub-view
+            */
+            return PyMemoryView_FromBuffer(&newview);
+        }
     }
     else if (PySlice_Check(key)) {
-	    Py_ssize_t start, stop, step, slicelength;
-    
+        Py_ssize_t start, stop, step, slicelength;
+
         if (PySlice_GetIndicesEx((PySliceObject*)key, get_shape0(view),
-			     &start, &stop, &step, &slicelength) < 0) {
-		    return NULL;
-	    }
+                                 &start, &stop, &step, &slicelength) < 0) {
+            return NULL;
+        }
     
-	    if (step == 1 && view->ndim == 1) {
-		    Py_buffer newview;
-		    void *newbuf = (char *) view->buf
-					    + start * view->itemsize;
-		    int newflags = view->readonly
-			    ? PyBUF_CONTIG_RO : PyBUF_CONTIG;
+        if (step == 1 && view->ndim == 1) {
+            Py_buffer newview;
+            void *newbuf = (char *) view->buf
+                                    + start * view->itemsize;
+            int newflags = view->readonly
+                    ? PyBUF_CONTIG_RO : PyBUF_CONTIG;
     
-		    /* XXX There should be an API to create a subbuffer */
-		    if (view->obj != NULL) {
-			    if (PyObject_GetBuffer(view->obj,
-					    &newview, newflags) == -1)
-				    return NULL;
-		    }
-		    else {
-			    newview = *view;
-		    }
-		    newview.buf = newbuf;
-		    newview.len = slicelength;
-		    newview.format = view->format;
-		    if (view->shape == &(view->len))
-			    newview.shape = &(newview.len);
-		    if (view->strides == &(view->itemsize))
-			    newview.strides = &(newview.itemsize);
-		    return PyMemoryView_FromBuffer(&newview);
-	    }
-	    PyErr_SetNone(PyExc_NotImplementedError);
-	    return NULL;
+            /* XXX There should be an API to create a subbuffer */
+            if (view->obj != NULL) {
+                if (PyObject_GetBuffer(view->obj, &newview, newflags) == -1)
+                    return NULL;
+            }
+            else {
+                newview = *view;
+            }
+            newview.buf = newbuf;
+            newview.len = slicelength * newview.itemsize;
+            newview.format = view->format;
+            newview.shape = &(newview.smalltable[0]);
+            newview.shape[0] = slicelength;
+            newview.strides = &(newview.itemsize);
+            return PyMemoryView_FromBuffer(&newview);
+        }
+        PyErr_SetNone(PyExc_NotImplementedError);
+        return NULL;
     }
     PyErr_Format(PyExc_TypeError,
-	    "cannot index memory using \"%.200s\"", 
-	    key->ob_type->tp_name);
+        "cannot index memory using \"%.200s\"", 
+        key->ob_type->tp_name);
     return NULL;
 }
 
@@ -727,118 +721,118 @@
 static PyObject *
 memory_richcompare(PyObject *v, PyObject *w, int op)
 {
-	Py_buffer vv, ww;
-	int equal = 0;
-	PyObject *res;
-
-	vv.obj = NULL;
-	ww.obj = NULL;
-	if (op != Py_EQ && op != Py_NE)
-		goto _notimpl;
-	if (PyObject_GetBuffer(v, &vv, PyBUF_CONTIG_RO) == -1) {
-		PyErr_Clear();
-		goto _notimpl;
-	}
-	if (PyObject_GetBuffer(w, &ww, PyBUF_CONTIG_RO) == -1) {
-		PyErr_Clear();
-		goto _notimpl;
-	}
+    Py_buffer vv, ww;
+    int equal = 0;
+    PyObject *res;
+
+    vv.obj = NULL;
+    ww.obj = NULL;
+    if (op != Py_EQ && op != Py_NE)
+        goto _notimpl;
+    if (PyObject_GetBuffer(v, &vv, PyBUF_CONTIG_RO) == -1) {
+        PyErr_Clear();
+        goto _notimpl;
+    }
+    if (PyObject_GetBuffer(w, &ww, PyBUF_CONTIG_RO) == -1) {
+        PyErr_Clear();
+        goto _notimpl;
+    }
 
-	if (vv.itemsize != ww.itemsize || vv.len != ww.len)
-		goto _end;
+    if (vv.itemsize != ww.itemsize || vv.len != ww.len)
+        goto _end;
 
-	equal = !memcmp(vv.buf, ww.buf, vv.len * vv.itemsize);
+    equal = !memcmp(vv.buf, ww.buf, vv.len);
 
 _end:
-	PyBuffer_Release(&vv);
-	PyBuffer_Release(&ww);
-	if ((equal && op == Py_EQ) || (!equal && op == Py_NE))
-		res = Py_True;
-	else
-		res = Py_False;
-	Py_INCREF(res);
-	return res;
+    PyBuffer_Release(&vv);
+    PyBuffer_Release(&ww);
+    if ((equal && op == Py_EQ) || (!equal && op == Py_NE))
+        res = Py_True;
+    else
+        res = Py_False;
+    Py_INCREF(res);
+    return res;
 
 _notimpl:
-	PyBuffer_Release(&vv);
-	PyBuffer_Release(&ww);
-	Py_INCREF(Py_NotImplemented);
-	return Py_NotImplemented;
+    PyBuffer_Release(&vv);
+    PyBuffer_Release(&ww);
+    Py_INCREF(Py_NotImplemented);
+    return Py_NotImplemented;
 }
 
 
 static int
 memory_traverse(PyMemoryViewObject *self, visitproc visit, void *arg)
 {
-	if (self->base != NULL)
-		Py_VISIT(self->base);
-	if (self->view.obj != NULL)
-		Py_VISIT(self->view.obj);
-	return 0;
+    if (self->base != NULL)
+        Py_VISIT(self->base);
+    if (self->view.obj != NULL)
+        Py_VISIT(self->view.obj);
+    return 0;
 }
 
 static int
 memory_clear(PyMemoryViewObject *self)
 {
-	Py_CLEAR(self->base);
-	PyBuffer_Release(&self->view);
-	return 0;
+    Py_CLEAR(self->base);
+    PyBuffer_Release(&self->view);
+    return 0;
 }
 
 
 /* As mapping */
 static PyMappingMethods memory_as_mapping = {
-	(lenfunc)memory_length, /*mp_length*/
-	(binaryfunc)memory_subscript, /*mp_subscript*/
-	(objobjargproc)memory_ass_sub, /*mp_ass_subscript*/
+    (lenfunc)memory_length,               /* mp_length */
+    (binaryfunc)memory_subscript,         /* mp_subscript */
+    (objobjargproc)memory_ass_sub,        /* mp_ass_subscript */
 };
 
 
 /* Buffer methods */
 
 static PyBufferProcs memory_as_buffer = {
-	(getbufferproc)memory_getbuf,         /* bf_getbuffer */
-        (releasebufferproc)memory_releasebuf, /* bf_releasebuffer */
+    (getbufferproc)memory_getbuf,         /* bf_getbuffer */
+    (releasebufferproc)memory_releasebuf, /* bf_releasebuffer */
 };
 
 
 PyTypeObject PyMemoryView_Type = {
-	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"memoryview",
-	sizeof(PyMemoryViewObject),
-	0,
-	(destructor)memory_dealloc, 		/* tp_dealloc */
-	0,					/* tp_print */
-	0,					/* tp_getattr */
-	0,					/* tp_setattr */
-	0,					/* tp_reserved */
-	(reprfunc)memory_repr,			/* tp_repr */
-	0,					/* tp_as_number */
-	0,			                /* tp_as_sequence */
-	&memory_as_mapping,	    	        /* tp_as_mapping */
-	0,		                        /* tp_hash */
-	0,					/* tp_call */
-	(reprfunc)memory_str,			/* tp_str */
-	PyObject_GenericGetAttr,		/* tp_getattro */
-	0,					/* tp_setattro */
-	&memory_as_buffer,			/* tp_as_buffer */
-	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
-	memory_doc,				/* tp_doc */
-	(traverseproc)memory_traverse,		/* tp_traverse */
-	(inquiry)memory_clear,			/* tp_clear */
-	memory_richcompare,                     /* tp_richcompare */
-	0,					/* tp_weaklistoffset */
-	0,					/* tp_iter */
-	0,					/* tp_iternext */
-	memory_methods,	   		        /* tp_methods */
-	0,	      		                /* tp_members */
-	memory_getsetlist,  		        /* tp_getset */
-	0,					/* tp_base */
-	0,					/* tp_dict */
-	0,					/* tp_descr_get */
-	0,					/* tp_descr_set */
-	0,					/* tp_dictoffset */
-	0,					/* tp_init */
-	0,					/* tp_alloc */
-	memory_new,				/* tp_new */
+    PyVarObject_HEAD_INIT(&PyType_Type, 0)
+    "memoryview",
+    sizeof(PyMemoryViewObject),
+    0,
+    (destructor)memory_dealloc,               /* tp_dealloc */
+    0,                                        /* tp_print */
+    0,                                        /* tp_getattr */
+    0,                                        /* tp_setattr */
+    0,                                        /* tp_reserved */
+    (reprfunc)memory_repr,                    /* tp_repr */
+    0,                                        /* tp_as_number */
+    0,                                        /* tp_as_sequence */
+    &memory_as_mapping,                       /* tp_as_mapping */
+    0,                                        /* tp_hash */
+    0,                                        /* tp_call */
+    (reprfunc)memory_str,                     /* tp_str */
+    PyObject_GenericGetAttr,                  /* tp_getattro */
+    0,                                        /* tp_setattro */
+    &memory_as_buffer,                        /* tp_as_buffer */
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,  /* tp_flags */
+    memory_doc,                               /* tp_doc */
+    (traverseproc)memory_traverse,            /* tp_traverse */
+    (inquiry)memory_clear,                    /* tp_clear */
+    memory_richcompare,                       /* tp_richcompare */
+    0,                                        /* tp_weaklistoffset */
+    0,                                        /* tp_iter */
+    0,                                        /* tp_iternext */
+    memory_methods,                           /* tp_methods */
+    0,                                        /* tp_members */
+    memory_getsetlist,                        /* tp_getset */
+    0,                                        /* tp_base */
+    0,                                        /* tp_dict */
+    0,                                        /* tp_descr_get */
+    0,                                        /* tp_descr_set */
+    0,                                        /* tp_dictoffset */
+    0,                                        /* tp_init */
+    0,                                        /* tp_alloc */
+    memory_new,                               /* tp_new */
 };

Modified: python/branches/py3k-issue1717/Objects/moduleobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/moduleobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/moduleobject.c	Sun Jan 25 21:08:20 2009
@@ -91,9 +91,9 @@
 
 	   This is a bit of a hack: when the shared library is loaded,
 	   the module name is "package.module", but the module calls
-	   Py_InitModule*() with just "module" for the name.  The shared
+	   PyModule_Create*() with just "module" for the name.  The shared
 	   library loader squirrels away the true name of the module in
-	   _Py_PackageContext, and Py_InitModule*() will substitute this
+	   _Py_PackageContext, and PyModule_Create*() will substitute this
 	   (if the name actually matches).
 	*/
 	if (_Py_PackageContext != NULL) {
@@ -315,6 +315,8 @@
 		_PyModule_Clear((PyObject *)m);
 		Py_DECREF(m->md_dict);
 	}
+	if (m->md_state != NULL)
+		PyMem_FREE(m->md_state);
 	Py_TYPE(m)->tp_free((PyObject *)m);
 }
 

Modified: python/branches/py3k-issue1717/Objects/object.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/object.c	(original)
+++ python/branches/py3k-issue1717/Objects/object.c	Sun Jan 25 21:08:20 2009
@@ -81,24 +81,29 @@
    garbage itself. If unlist_types_without_objects
    is set, they will be removed from the type_list
    once the last object is deallocated. */
-int unlist_types_without_objects;
-extern int tuple_zero_allocs, fast_tuple_allocs;
-extern int quick_int_allocs, quick_neg_int_allocs;
-extern int null_strings, one_strings;
+static int unlist_types_without_objects;
+extern Py_ssize_t tuple_zero_allocs, fast_tuple_allocs;
+extern Py_ssize_t quick_int_allocs, quick_neg_int_allocs;
+extern Py_ssize_t null_strings, one_strings;
 void
 dump_counts(FILE* f)
 {
 	PyTypeObject *tp;
 
 	for (tp = type_list; tp; tp = tp->tp_next)
-		fprintf(f, "%s alloc'd: %d, freed: %d, max in use: %d\n",
+		fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, "
+			"freed: %" PY_FORMAT_SIZE_T "d, "
+			"max in use: %" PY_FORMAT_SIZE_T "d\n",
 			tp->tp_name, tp->tp_allocs, tp->tp_frees,
 			tp->tp_maxalloc);
-	fprintf(f, "fast tuple allocs: %d, empty: %d\n",
+	fprintf(f, "fast tuple allocs: %" PY_FORMAT_SIZE_T "d, "
+		"empty: %" PY_FORMAT_SIZE_T "d\n",
 		fast_tuple_allocs, tuple_zero_allocs);
-	fprintf(f, "fast int allocs: pos: %d, neg: %d\n",
+	fprintf(f, "fast int allocs: pos: %" PY_FORMAT_SIZE_T "d, "
+		"neg: %" PY_FORMAT_SIZE_T "d\n",
 		quick_int_allocs, quick_neg_int_allocs);
-	fprintf(f, "null strings: %d, 1-strings: %d\n",
+	fprintf(f, "null strings: %" PY_FORMAT_SIZE_T "d, "
+		"1-strings: %" PY_FORMAT_SIZE_T "d\n",
 		null_strings, one_strings);
 }
 
@@ -896,6 +901,20 @@
 	return obj;
 }
 
+/* Helper used when the __next__ method is removed from a type:
+   tp_iternext is never NULL and can be safely called without checking
+   on every iteration.
+ */
+
+PyObject *
+_PyObject_NextNotImplemented(PyObject *self)
+{
+	PyErr_Format(PyExc_TypeError,
+		     "'%.200s' object is not iterable",
+		     Py_TYPE(self)->tp_name);
+	return NULL;
+}
+
 /* Generic GetAttr functions - put these in your tp_[gs]etattro slot */
 
 PyObject *

Modified: python/branches/py3k-issue1717/Objects/setobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/setobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/setobject.c	Sun Jan 25 21:08:20 2009
@@ -2075,7 +2075,7 @@
 	(binaryfunc)set_xor,		/*nb_xor*/
 	(binaryfunc)set_or,		/*nb_or*/
 	0,				/*nb_int*/
-	0,				/*nb_long*/
+	0,				/*nb_reserved*/
 	0,				/*nb_float*/
 	0,				/*nb_inplace_add*/
 	(binaryfunc)set_isub,		/*nb_inplace_subtract*/

Modified: python/branches/py3k-issue1717/Objects/stringlib/fastsearch.h
==============================================================================
--- python/branches/py3k-issue1717/Objects/stringlib/fastsearch.h	(original)
+++ python/branches/py3k-issue1717/Objects/stringlib/fastsearch.h	Sun Jan 25 21:08:20 2009
@@ -5,7 +5,7 @@
 
 /* fast search/count implementation, based on a mix between boyer-
    moore and horspool, with a few more bells and whistles on the top.
-   for some more background, see: http://effbot.org/stringlib */
+   for some more background, see: http://effbot.org/stringlib.htm */
 
 /* note: fastsearch may access s[n], which isn't a problem when using
    Python's ordinary string types, but may cause problems if you're

Modified: python/branches/py3k-issue1717/Objects/stringlib/transmogrify.h
==============================================================================
--- python/branches/py3k-issue1717/Objects/stringlib/transmogrify.h	(original)
+++ python/branches/py3k-issue1717/Objects/stringlib/transmogrify.h	Sun Jan 25 21:08:20 2009
@@ -22,76 +22,69 @@
 {
     const char *e, *p;
     char *q;
-    Py_ssize_t i, j, old_j;
+    size_t i, j;
     PyObject *u;
     int tabsize = 8;
-
+    
     if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize))
-	return NULL;
-
+        return NULL;
+    
     /* First pass: determine size of output string */
-    i = j = old_j = 0;
+    i = j = 0;
     e = STRINGLIB_STR(self) + STRINGLIB_LEN(self);
     for (p = STRINGLIB_STR(self); p < e; p++)
         if (*p == '\t') {
-	    if (tabsize > 0) {
-		j += tabsize - (j % tabsize);
-                /* XXX: this depends on a signed integer overflow to < 0 */
-                /* C compilers, including gcc, do -NOT- guarantee this. */
-		if (old_j > j) {
-		    PyErr_SetString(PyExc_OverflowError,
-				    "result is too long");
-		    return NULL;
-		}
-		old_j = j;
+            if (tabsize > 0) {
+                j += tabsize - (j % tabsize);
+                if (j > PY_SSIZE_T_MAX) {
+                    PyErr_SetString(PyExc_OverflowError,
+                                    "result is too long");
+                    return NULL;
+                }
             }
-	}
+        }
         else {
             j++;
             if (*p == '\n' || *p == '\r') {
                 i += j;
-                old_j = j = 0;
-                /* XXX: this depends on a signed integer overflow to < 0 */
-                /* C compilers, including gcc, do -NOT- guarantee this. */
-                if (i < 0) {
+                j = 0;
+                if (i > PY_SSIZE_T_MAX) {
                     PyErr_SetString(PyExc_OverflowError,
                                     "result is too long");
                     return NULL;
                 }
             }
         }
-
-    if ((i + j) < 0) {
-        /* XXX: this depends on a signed integer overflow to < 0 */
-        /* C compilers, including gcc, do -NOT- guarantee this. */
+    
+    if ((i + j) > PY_SSIZE_T_MAX) {
         PyErr_SetString(PyExc_OverflowError, "result is too long");
         return NULL;
     }
-
+    
     /* Second pass: create output string and fill it */
     u = STRINGLIB_NEW(NULL, i + j);
     if (!u)
         return NULL;
-
+    
     j = 0;
     q = STRINGLIB_STR(u);
-
+    
     for (p = STRINGLIB_STR(self); p < e; p++)
         if (*p == '\t') {
-	    if (tabsize > 0) {
-		i = tabsize - (j % tabsize);
-		j += i;
-		while (i--)
-		    *q++ = ' ';
-	    }
-	}
-	else {
+            if (tabsize > 0) {
+                i = tabsize - (j % tabsize);
+                j += i;
+                while (i--)
+                    *q++ = ' ';
+            }
+        }
+        else {
             j++;
-	    *q++ = *p;
+            *q++ = *p;
             if (*p == '\n' || *p == '\r')
                 j = 0;
         }
-
+    
     return u;
 }
 

Modified: python/branches/py3k-issue1717/Objects/tupleobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/tupleobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/tupleobject.c	Sun Jan 25 21:08:20 2009
@@ -19,8 +19,8 @@
 static int numfree[PyTuple_MAXSAVESIZE];
 #endif
 #ifdef COUNT_ALLOCS
-int fast_tuple_allocs;
-int tuple_zero_allocs;
+Py_ssize_t fast_tuple_allocs;
+Py_ssize_t tuple_zero_allocs;
 #endif
 
 PyObject *

Modified: python/branches/py3k-issue1717/Objects/typeobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/typeobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/typeobject.c	Sun Jan 25 21:08:20 2009
@@ -3602,7 +3602,6 @@
 		COPYNUM(nb_xor);
 		COPYNUM(nb_or);
 		COPYNUM(nb_int);
-		COPYNUM(nb_long);
 		COPYNUM(nb_float);
 		COPYNUM(nb_inplace_add);
 		COPYNUM(nb_inplace_subtract);
@@ -4832,7 +4831,6 @@
 SLOT1BIN(slot_nb_or, nb_or, "__or__", "__ror__")
 
 SLOT0(slot_nb_int, "__int__")
-SLOT0(slot_nb_long, "__long__")
 SLOT0(slot_nb_float, "__float__")
 SLOT1(slot_nb_inplace_add, "__iadd__", PyObject *, "O")
 SLOT1(slot_nb_inplace_subtract, "__isub__", PyObject *, "O")
@@ -5448,8 +5446,6 @@
 	RBINSLOT("__ror__", nb_or, slot_nb_or, "|"),
 	UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc,
 	       "int(x)"),
-	UNSLOT("__long__", nb_long, slot_nb_long, wrap_unaryfunc,
-	       "long(x)"),
 	UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc,
 	       "float(x)"),
 	NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc, 
@@ -5635,8 +5631,12 @@
 	}
 	do {
 		descr = _PyType_Lookup(type, p->name_strobj);
-		if (descr == NULL)
+		if (descr == NULL) {
+			if (ptr == (void**)&type->tp_iternext) {
+				specific = _PyObject_NextNotImplemented;
+			}
 			continue;
+		}
 		if (Py_TYPE(descr) == &PyWrapperDescr_Type) {
 			void **tptr = resolve_slotdups(type, p->name_strobj);
 			if (tptr == NULL || tptr == ptr)
@@ -5655,7 +5655,7 @@
 		else if (Py_TYPE(descr) == &PyCFunction_Type &&
 			 PyCFunction_GET_FUNCTION(descr) ==
 			 (PyCFunction)tp_new_wrapper &&
-			 strcmp(p->name, "__new__") == 0)
+			 ptr == (void**)&type->tp_new)
 		{
 			/* The __new__ wrapper is not a wrapper descriptor,
 			   so must be special-cased differently.
@@ -5675,7 +5675,7 @@
 			   point out a bug in this reasoning a beer. */
 		}
 		else if (descr == Py_None &&
-			 strcmp(p->name, "__hash__") == 0) {
+			 ptr == (void**)&type->tp_hash) {
 			/* We specifically allow __hash__ to be set to None
 			   to prevent inheritance of the default
 			   implementation from object.__hash__ */

Modified: python/branches/py3k-issue1717/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/unicodeobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/unicodeobject.c	Sun Jan 25 21:08:20 2009
@@ -1205,7 +1205,7 @@
 
     /* Decode via the codec registry */
     buffer = NULL;
-    if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_SIMPLE) < 0)
+    if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_FULL_RO) < 0)
         goto onError;
     buffer = PyMemoryView_FromBuffer(&info);
     if (buffer == NULL)
@@ -2001,6 +2001,19 @@
     return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL);
 }
 
+/* Mask to check or force alignment of a pointer to C 'long' boundaries */
+#define LONG_PTR_MASK (size_t) (SIZEOF_LONG - 1)
+
+/* Mask to quickly check whether a C 'long' contains a
+   non-ASCII, UTF8-encoded char. */
+#if (SIZEOF_LONG == 8)
+# define ASCII_CHAR_MASK 0x8080808080808080L
+#elif (SIZEOF_LONG == 4)
+# define ASCII_CHAR_MASK 0x80808080L
+#else
+# error C 'long' size should be either 4 or 8!
+#endif
+
 PyObject *PyUnicode_DecodeUTF8Stateful(const char *s,
 			                Py_ssize_t size,
 			                const char *errors,
@@ -2011,7 +2024,7 @@
     Py_ssize_t startinpos;
     Py_ssize_t endinpos;
     Py_ssize_t outpos;
-    const char *e;
+    const char *e, *aligned_end;
     PyUnicodeObject *unicode;
     Py_UNICODE *p;
     const char *errmsg = "";
@@ -2032,11 +2045,52 @@
     /* Unpack UTF-8 encoded data */
     p = unicode->str;
     e = s + size;
+    aligned_end = (const char *) ((size_t) e & ~LONG_PTR_MASK);
 
     while (s < e) {
         Py_UCS4 ch = (unsigned char)*s;
 
         if (ch < 0x80) {
+            /* Fast path for runs of ASCII characters. Given that common UTF-8
+               input will consist of an overwhelming majority of ASCII
+               characters, we try to optimize for this case by checking
+               as many characters as a C 'long' can contain.
+               First, check if we can do an aligned read, as most CPUs have
+               a penalty for unaligned reads.
+            */
+            if (!((size_t) s & LONG_PTR_MASK)) {
+                /* Help register allocation */
+                register const char *_s = s;
+                register Py_UNICODE *_p = p;
+                while (_s < aligned_end) {
+                    /* Read a whole long at a time (either 4 or 8 bytes),
+                       and do a fast unrolled copy if it only contains ASCII
+                       characters. */
+                    unsigned long data = *(unsigned long *) _s;
+                    if (data & ASCII_CHAR_MASK)
+                        break;
+                    _p[0] = (unsigned char) _s[0];
+                    _p[1] = (unsigned char) _s[1];
+                    _p[2] = (unsigned char) _s[2];
+                    _p[3] = (unsigned char) _s[3];
+#if (SIZEOF_LONG == 8)
+                    _p[4] = (unsigned char) _s[4];
+                    _p[5] = (unsigned char) _s[5];
+                    _p[6] = (unsigned char) _s[6];
+                    _p[7] = (unsigned char) _s[7];
+#endif
+                    _s += SIZEOF_LONG;
+                    _p += SIZEOF_LONG;
+                }
+                s = _s;
+                p = _p;
+                if (s == e)
+                    break;
+                ch = (unsigned char)*s;
+            }
+        }
+
+        if (ch < 0x80) {
             *p++ = (Py_UNICODE)ch;
             s++;
             continue;
@@ -2169,6 +2223,7 @@
 	     &starts, &e, &startinpos, &endinpos, &exc, &s,
 	     &unicode, &outpos, &p))
 	goto onError;
+	aligned_end = (const char *) ((size_t) e & ~LONG_PTR_MASK);
     }
     if (consumed)
 	*consumed = s-starts;
@@ -2188,6 +2243,9 @@
     return NULL;
 }
 
+#undef ASCII_CHAR_MASK
+
+
 /* Allocation strategy:  if the string is short, convert into a stack buffer
    and allocate exactly as much space needed at the end.  Else allocate the
    maximum possible needed (4 result bytes per Unicode character), and return
@@ -2582,6 +2640,23 @@
     return PyUnicode_DecodeUTF16Stateful(s, size, errors, byteorder, NULL);
 }
 
+/* Two masks for fast checking of whether a C 'long' may contain
+   UTF16-encoded surrogate characters. This is an efficient heuristic,
+   assuming that non-surrogate characters with a code point >= 0x8000 are
+   rare in most input.
+   FAST_CHAR_MASK is used when the input is in native byte ordering,
+   SWAPPED_FAST_CHAR_MASK when the input is in byteswapped ordering.
+   */
+#if (SIZEOF_LONG == 8)
+# define FAST_CHAR_MASK         0x8000800080008000L
+# define SWAPPED_FAST_CHAR_MASK 0x0080008000800080L
+#elif (SIZEOF_LONG == 4)
+# define FAST_CHAR_MASK         0x80008000L
+# define SWAPPED_FAST_CHAR_MASK 0x00800080L
+#else
+# error C 'long' size should be either 4 or 8!
+#endif
+
 PyObject *
 PyUnicode_DecodeUTF16Stateful(const char *s,
 			      Py_ssize_t size,
@@ -2595,8 +2670,9 @@
     Py_ssize_t outpos;
     PyUnicodeObject *unicode;
     Py_UNICODE *p;
-    const unsigned char *q, *e;
+    const unsigned char *q, *e, *aligned_end;
     int bo = 0;       /* assume native ordering by default */
+    int native_ordering = 0;
     const char *errmsg = "";
     /* Offsets from q for retrieving byte pairs in the right order. */
 #ifdef BYTEORDER_IS_LITTLE_ENDIAN
@@ -2618,7 +2694,7 @@
     /* Unpack UTF-16 encoded data */
     p = unicode->str;
     q = (unsigned char *)s;
-    e = q + size;
+    e = q + size - 1;
 
     if (byteorder)
         bo = *byteorder;
@@ -2662,20 +2738,86 @@
         ihi = 0;
         ilo = 1;
     }
+#ifdef BYTEORDER_IS_LITTLE_ENDIAN
+    native_ordering = ilo < ihi;
+#else
+    native_ordering = ilo > ihi;
+#endif
 
+    aligned_end = (const unsigned char *) ((size_t) e & ~LONG_PTR_MASK);
     while (q < e) {
 	Py_UNICODE ch;
-	/* remaining bytes at the end? (size should be even) */
-	if (e-q<2) {
-	    if (consumed)
-		break;
-	    errmsg = "truncated data";
-	    startinpos = ((const char *)q)-starts;
-	    endinpos = ((const char *)e)-starts;
-	    goto utf16Error;
-	    /* The remaining input chars are ignored if the callback
-	       chooses to skip the input */
-	}
+        /* First check for possible aligned read of a C 'long'. Unaligned
+           reads are more expensive, better to defer to another iteration. */
+        if (!((size_t) q & LONG_PTR_MASK)) {
+            /* Fast path for runs of non-surrogate chars. */
+            register const unsigned char *_q = q;
+            Py_UNICODE *_p = p;
+            if (native_ordering) {
+                /* Native ordering is simple: as long as the input cannot
+                   possibly contain a surrogate char, do an unrolled copy
+                   of several 16-bit code points to the target object.
+                   The non-surrogate check is done on several input bytes
+                   at a time (as many as a C 'long' can contain). */
+                while (_q < aligned_end) {
+                    unsigned long data = * (unsigned long *) _q;
+                    if (data & FAST_CHAR_MASK)
+                        break;
+                    _p[0] = ((unsigned short *) _q)[0];
+                    _p[1] = ((unsigned short *) _q)[1];
+#if (SIZEOF_LONG == 8)
+                    _p[2] = ((unsigned short *) _q)[2];
+                    _p[3] = ((unsigned short *) _q)[3];
+#endif
+                    _q += SIZEOF_LONG;
+                    _p += SIZEOF_LONG / 2;
+                }
+            }
+            else {
+                /* Byteswapped ordering is similar, but we must decompose
+                   the copy bytewise, and take care of zero'ing out the
+                   upper bytes if the target object is in 32-bit units
+                   (that is, in UCS-4 builds). */
+                while (_q < aligned_end) {
+                    unsigned long data = * (unsigned long *) _q;
+                    if (data & SWAPPED_FAST_CHAR_MASK)
+                        break;
+                    /* Zero upper bytes in UCS-4 builds */
+#if (Py_UNICODE_SIZE > 2)
+                    _p[0] = 0;
+                    _p[1] = 0;
+#if (SIZEOF_LONG == 8)
+                    _p[2] = 0;
+                    _p[3] = 0;
+#endif
+#endif
+                    /* Issue #4916; UCS-4 builds on big endian machines must
+                       fill the two last bytes of each 4-byte unit. */
+#if (!defined(BYTEORDER_IS_LITTLE_ENDIAN) && Py_UNICODE_SIZE > 2)
+# define OFF 2
+#else
+# define OFF 0
+#endif
+                    ((unsigned char *) _p)[OFF + 1] = _q[0];
+                    ((unsigned char *) _p)[OFF + 0] = _q[1];
+                    ((unsigned char *) _p)[OFF + 1 + Py_UNICODE_SIZE] = _q[2];
+                    ((unsigned char *) _p)[OFF + 0 + Py_UNICODE_SIZE] = _q[3];
+#if (SIZEOF_LONG == 8)
+                    ((unsigned char *) _p)[OFF + 1 + 2 * Py_UNICODE_SIZE] = _q[4];
+                    ((unsigned char *) _p)[OFF + 0 + 2 * Py_UNICODE_SIZE] = _q[5];
+                    ((unsigned char *) _p)[OFF + 1 + 3 * Py_UNICODE_SIZE] = _q[6];
+                    ((unsigned char *) _p)[OFF + 0 + 3 * Py_UNICODE_SIZE] = _q[7];
+#endif
+#undef OFF
+                    _q += SIZEOF_LONG;
+                    _p += SIZEOF_LONG / 2;
+                }
+            }
+            p = _p;
+            q = _q;
+            if (q >= e)
+                break;
+        }
 	ch = (q[ihi] << 8) | q[ilo];
 
 	q += 2;
@@ -2686,10 +2828,10 @@
 	}
 
 	/* UTF-16 code pair: */
-	if (q >= e) {
+	if (q > e) {
 	    errmsg = "unexpected end of data";
-	    startinpos = (((const char *)q)-2)-starts;
-	    endinpos = ((const char *)e)-starts;
+	    startinpos = (((const char *)q) - 2) - starts;
+	    endinpos = ((const char *)e) + 1 - starts;
 	    goto utf16Error;
 	}
 	if (0xD800 <= ch && ch <= 0xDBFF) {
@@ -2718,14 +2860,47 @@
 	/* Fall through to report the error */
 
     utf16Error:
-	outpos = p-PyUnicode_AS_UNICODE(unicode);
+	outpos = p - PyUnicode_AS_UNICODE(unicode);
 	if (unicode_decode_call_errorhandler(
-	         errors, &errorHandler,
-	         "utf16", errmsg,
-	         &starts, (const char **)&e, &startinpos, &endinpos, &exc, (const char **)&q,
-	         &unicode, &outpos, &p))
+                errors,
+                &errorHandler,
+                "utf16", errmsg,
+                &starts,
+                (const char **)&e,
+                &startinpos,
+                &endinpos,
+                &exc,
+                (const char **)&q,
+                &unicode,
+                &outpos,
+                &p))
 	    goto onError;
     }
+    /* remaining byte at the end? (size should be even) */
+    if (e == q) {
+        if (!consumed) {
+            errmsg = "truncated data";
+            startinpos = ((const char *)q) - starts;
+            endinpos = ((const char *)e) + 1 - starts;
+            outpos = p - PyUnicode_AS_UNICODE(unicode);
+            if (unicode_decode_call_errorhandler(
+                    errors,
+                    &errorHandler,
+                    "utf16", errmsg,
+                    &starts,
+                    (const char **)&e,
+                    &startinpos,
+                    &endinpos,
+                    &exc,
+                    (const char **)&q,
+                    &unicode,
+                    &outpos,
+                    &p))
+                goto onError;
+            /* The remaining input chars are ignored if the callback
+               chooses to skip the input */
+        }
+    }
 
     if (byteorder)
         *byteorder = bo;
@@ -2748,6 +2923,9 @@
     return NULL;
 }
 
+#undef FAST_CHAR_MASK
+#undef SWAPPED_FAST_CHAR_MASK
+
 PyObject *
 PyUnicode_EncodeUTF16(const Py_UNICODE *s,
 		      Py_ssize_t size,
@@ -3571,6 +3749,7 @@
 {
     PyUnicodeObject *v;
     Py_UNICODE *p;
+    const char *e, *unrolled_end;
 
     /* Latin-1 is equivalent to the first 256 ordinals in Unicode. */
     if (size == 1) {
@@ -3584,8 +3763,20 @@
     if (size == 0)
 	return (PyObject *)v;
     p = PyUnicode_AS_UNICODE(v);
-    while (size-- > 0)
-	*p++ = (unsigned char)*s++;
+    e = s + size;
+    /* Unrolling the copy makes it much faster by reducing the looping
+       overhead. This is similar to what many memcpy() implementations do. */
+    unrolled_end = e - 4;
+    while (s < unrolled_end) {
+        p[0] = (unsigned char) s[0];
+        p[1] = (unsigned char) s[1];
+        p[2] = (unsigned char) s[2];
+        p[3] = (unsigned char) s[3];
+        s += 4;
+        p += 4;
+    }
+    while (s < e)
+        *p++ = (unsigned char) *s++;
     return (PyObject *)v;
 
  onError:

Modified: python/branches/py3k-issue1717/Objects/weakrefobject.c
==============================================================================
--- python/branches/py3k-issue1717/Objects/weakrefobject.c	(original)
+++ python/branches/py3k-issue1717/Objects/weakrefobject.c	Sun Jan 25 21:08:20 2009
@@ -488,8 +488,7 @@
 WRAP_BINARY(proxy_and, PyNumber_And)
 WRAP_BINARY(proxy_xor, PyNumber_Xor)
 WRAP_BINARY(proxy_or, PyNumber_Or)
-WRAP_UNARY(proxy_int, PyNumber_Int)
-WRAP_UNARY(proxy_long, PyNumber_Long)
+WRAP_UNARY(proxy_int, PyNumber_Long)
 WRAP_UNARY(proxy_float, PyNumber_Float)
 WRAP_BINARY(proxy_iadd, PyNumber_InPlaceAdd)
 WRAP_BINARY(proxy_isub, PyNumber_InPlaceSubtract)
@@ -595,7 +594,7 @@
     proxy_xor,              /*nb_xor*/
     proxy_or,               /*nb_or*/
     proxy_int,              /*nb_int*/
-    proxy_long,             /*nb_long*/
+    0,                      /*nb_reserved*/
     proxy_float,            /*nb_float*/
     proxy_iadd,             /*nb_inplace_add*/
     proxy_isub,             /*nb_inplace_subtract*/

Modified: python/branches/py3k-issue1717/PC/VC6/_tkinter.dsp
==============================================================================
--- python/branches/py3k-issue1717/PC/VC6/_tkinter.dsp	(original)
+++ python/branches/py3k-issue1717/PC/VC6/_tkinter.dsp	Sun Jan 25 21:08:20 2009
@@ -54,7 +54,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept /libpath:"C:\Program Files\Tcl\lib"
+# ADD LINK32 ..\..\..\tcltk\lib\tk85g.lib ..\..\..\tcltk\lib\tcl85g.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept
 # SUBTRACT LINK32 /pdb:none
 
 !ELSEIF  "$(CFG)" == "_tkinter - Win32 Release"
@@ -82,7 +82,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 ..\..\..\tcltk\lib\tk84.lib ..\..\..\tcltk\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" /libpath:"C:\Program Files\Tcl\lib"
+# ADD LINK32 ..\..\..\tcltk\lib\tk85.lib ..\..\..\tcltk\lib\tcl85.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd"
 # SUBTRACT LINK32 /pdb:none
 
 !ENDIF 

Modified: python/branches/py3k-issue1717/PC/VC6/bz2.dsp
==============================================================================
--- python/branches/py3k-issue1717/PC/VC6/bz2.dsp	(original)
+++ python/branches/py3k-issue1717/PC/VC6/bz2.dsp	Sun Jan 25 21:08:20 2009
@@ -44,7 +44,7 @@
 # PROP Target_Dir ""
 F90=df.exe
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.3" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -54,7 +54,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd"
+# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd"
 # SUBTRACT LINK32 /pdb:none /nodefaultlib
 
 !ELSEIF  "$(CFG)" == "bz2 - Win32 Debug"
@@ -72,7 +72,7 @@
 # PROP Target_Dir ""
 F90=df.exe
 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.3" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /I "..\..\..\bzip2-1.0.5" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -82,7 +82,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ..\..\..\bzip2-1.0.3\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept
+# ADD LINK32 ..\..\..\bzip2-1.0.5\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept
 # SUBTRACT LINK32 /pdb:none
 
 !ENDIF 

Modified: python/branches/py3k-issue1717/PC/VC6/pythoncore.dsp
==============================================================================
--- python/branches/py3k-issue1717/PC/VC6/pythoncore.dsp	(original)
+++ python/branches/py3k-issue1717/PC/VC6/pythoncore.dsp	Sun Jan 25 21:08:20 2009
@@ -402,10 +402,6 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\..\Python\getmtime.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\..\Python\getopt.c
 # End Source File
 # Begin Source File

Modified: python/branches/py3k-issue1717/PC/VC6/readme.txt
==============================================================================
--- python/branches/py3k-issue1717/PC/VC6/readme.txt	(original)
+++ python/branches/py3k-issue1717/PC/VC6/readme.txt	Sun Jan 25 21:08:20 2009
@@ -64,18 +64,25 @@
 
 _tkinter
     Python wrapper for the Tk windowing system.  Requires building
-    Tcl/Tk first.  Following are instructions for Tcl/Tk 8.4.12.
+    Tcl/Tk first.  Following are instructions for Tcl/Tk 8.5.2.
 
     Get source
     ----------
     In the dist directory, run
-    svn export http://svn.python.org/projects/external/tcl8.4.12
-    svn export http://svn.python.org/projects/external/tk8.4.12
-    svn export http://svn.python.org/projects/external/tix-8.4.0
+    svn export http://svn.python.org/projects/external/tcl-8.5.2.1 tcl8.5.2
+    svn export http://svn.python.org/projects/external/tk-8.5.2.0 tk8.5.2
+    svn export http://svn.python.org/projects/external/tix-8.4.3.1 tix8.4.3
+
+    Debug Build
+    -----------
+    To build debug version, add DEBUG=1 to all nmake call bellow.
 
     Build Tcl first (done here w/ MSVC 6 on Win2K)
     ---------------
-    cd dist\tcl8.4.12\win
+    If your environment doesn't have struct _stat64, you need to apply
+    tcl852.patch in this directory to dist\tcl8.5.2\generic\tcl.h.
+
+    cd dist\tcl8.5.2\win
     run vcvars32.bat
     nmake -f makefile.vc
     nmake -f makefile.vc INSTALLDIR=..\..\tcltk install
@@ -85,16 +92,16 @@
     Optional:  run tests, via
         nmake -f makefile.vc test
 
-        all.tcl:        Total   10835   Passed  10096   Skipped 732     Failed  7
-        Sourced 129 Test Files.
-        Files with failing tests: exec.test expr.test io.test main.test string.test stri
+        all.tcl:        Total   24242   Passed  23358   Skipped 877     Failed  7
+        Sourced 137 Test Files.
+        Files with failing tests: exec.test http.test io.test main.test string.test stri
         ngObj.test
 
     Build Tk
     --------
-    cd dist\tk8.4.12\win
-    nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12
-    nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install
+    cd dist\tk8.5.2\win
+    nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2
+    nmake -f makefile.vc TCLDIR=..\..\tcl8.5.2 INSTALLDIR=..\..\tcltk install
 
     XXX Should we compile with OPTS=threads?
 
@@ -102,26 +109,26 @@
     XXX failed.  It popped up tons of little windows, and did lots of
     XXX stuff, and nothing blew up.
 
-   Built Tix
-   ---------
-   cd dist\tix-8.4.0\win
-   nmake -f python.mak
-   nmake -f python.mak install
+    Build Tix
+    ---------
+    cd dist\tix8.4.3\win
+    nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0
+    nmake -f python.mak TCL_MAJOR=8 TCL_MINOR=5 TCL_PATCH=2 MACHINE=IX86 DEBUG=0 INSTALL_DIR=..\..\tcltk install
 
 bz2
     Python wrapper for the libbz2 compression library.  Homepage
-        http://sources.redhat.com/bzip2/
+        http://www.bzip.org/
     Download the source from the python.org copy into the dist
     directory:
 
-    svn export http://svn.python.org/projects/external/bzip2-1.0.3
+    svn export http://svn.python.org/projects/external/bzip2-1.0.5
 
     And requires building bz2 first.
 
-    cd dist\bzip2-1.0.3
+    cd dist\bzip2-1.0.5
     nmake -f makefile.msc
 
-    All of this managed to build bzip2-1.0.3\libbz2.lib, which the Python
+    All of this managed to build bzip2-1.0.5\libbz2.lib, which the Python
     project links in.
 
 

Modified: python/branches/py3k-issue1717/PC/VS7.1/pythoncore.vcproj
==============================================================================
--- python/branches/py3k-issue1717/PC/VS7.1/pythoncore.vcproj	(original)
+++ python/branches/py3k-issue1717/PC/VS7.1/pythoncore.vcproj	Sun Jan 25 21:08:20 2009
@@ -557,9 +557,6 @@
 			RelativePath="..\..\Python\getcopyright.c">
 		</File>
 		<File
-			RelativePath="..\..\Python\getmtime.c">
-		</File>
-		<File
 			RelativePath="..\..\Python\getopt.c">
 		</File>
 		<File

Modified: python/branches/py3k-issue1717/PC/VS8.0/pythoncore.vcproj
==============================================================================
--- python/branches/py3k-issue1717/PC/VS8.0/pythoncore.vcproj	(original)
+++ python/branches/py3k-issue1717/PC/VS8.0/pythoncore.vcproj	Sun Jan 25 21:08:20 2009
@@ -1651,10 +1651,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\Python\getmtime.c"
-				>
-			</File>
-			<File
 				RelativePath="..\..\Python\getopt.c"
 				>
 			</File>

Modified: python/branches/py3k-issue1717/PC/example_nt/example.c
==============================================================================
--- python/branches/py3k-issue1717/PC/example_nt/example.c	(original)
+++ python/branches/py3k-issue1717/PC/example_nt/example.c	Sun Jan 25 21:08:20 2009
@@ -13,8 +13,20 @@
 	{NULL, NULL}
 };
 
+static struct PyModuleDef examplemodule = {
+	PyModuleDef_HEAD_INIT,
+	"example",
+	"example module doc string",
+	-1,
+	example_methods,
+	NULL,
+	NULL,
+	NULL,
+	NULL
+};
+
 PyMODINIT_FUNC
-initexample(void)
+PyInit_example(void)
 {
-	Py_InitModule("example", example_methods);
+	return PyModule_Create(&examplemodule);
 }

Modified: python/branches/py3k-issue1717/PC/os2emx/Makefile
==============================================================================
--- python/branches/py3k-issue1717/PC/os2emx/Makefile	(original)
+++ python/branches/py3k-issue1717/PC/os2emx/Makefile	Sun Jan 25 21:08:20 2009
@@ -339,7 +339,6 @@
 		Python/getargs.c \
 		Python/getcompiler.c \
 		Python/getcopyright.c \
-		Python/getmtime.c \
 		Python/getplatform.c \
 		Python/getversion.c \
 		Python/graminit.c \

Modified: python/branches/py3k-issue1717/PC/os2emx/python27.def
==============================================================================
--- python/branches/py3k-issue1717/PC/os2emx/python27.def	(original)
+++ python/branches/py3k-issue1717/PC/os2emx/python27.def	Sun Jan 25 21:08:20 2009
@@ -930,9 +930,6 @@
 ; From python26_s.lib(getcopyright)
   "Py_GetCopyright"
 
-; From python26_s.lib(getmtime)
-  "PyOS_GetLastModificationTime"
-
 ; From python26_s.lib(getplatform)
   "Py_GetPlatform"
 

Modified: python/branches/py3k-issue1717/PC/os2vacpp/makefile
==============================================================================
--- python/branches/py3k-issue1717/PC/os2vacpp/makefile	(original)
+++ python/branches/py3k-issue1717/PC/os2vacpp/makefile	Sun Jan 25 21:08:20 2009
@@ -1377,8 +1377,6 @@
 	 $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
 	 $(PY_INCLUDE)\tupleobject.h
 
-getmtime.obj: pyconfig.h
-
 getplatform.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
 	 $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
 	 pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \

Modified: python/branches/py3k-issue1717/PC/os2vacpp/makefile.omk
==============================================================================
--- python/branches/py3k-issue1717/PC/os2vacpp/makefile.omk	(original)
+++ python/branches/py3k-issue1717/PC/os2vacpp/makefile.omk	Sun Jan 25 21:08:20 2009
@@ -939,8 +939,6 @@
 	 pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
 	 stringobject.h sysmodule.h traceback.h tupleobject.h
 
-getmtime.obj: pyconfig.h
-
 getplatform.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
 	 pyconfig.h dictobject.h fileobject.h floatobject.h funcobject.h \
 	 import.h intobject.h intrcheck.h listobject.h longobject.h \

Modified: python/branches/py3k-issue1717/PC/os2vacpp/python.def
==============================================================================
--- python/branches/py3k-issue1717/PC/os2vacpp/python.def	(original)
+++ python/branches/py3k-issue1717/PC/os2vacpp/python.def	Sun Jan 25 21:08:20 2009
@@ -280,7 +280,6 @@
                PyNumber_Xor
                PyOS_AfterFork
                PyOS_FiniInterrupts
-               PyOS_GetLastModificationTime
                PyOS_InitInterrupts
                PyOS_InterruptOccurred
                PyOS_Readline

Modified: python/branches/py3k-issue1717/PC/pyconfig.h
==============================================================================
--- python/branches/py3k-issue1717/PC/pyconfig.h	(original)
+++ python/branches/py3k-issue1717/PC/pyconfig.h	Sun Jan 25 21:08:20 2009
@@ -88,6 +88,12 @@
 #define USE_SOCKET
 #endif
 
+/* CE6 doesn't have strdup() but _strdup(). Assume the same for earlier versions. */
+#if defined(MS_WINCE)
+#  include <stdlib.h>
+#  define strdup _strdup
+#endif
+
 #ifdef MS_WINCE
 /* Python uses GetVersion() to distinguish between
  * Windows NT and 9x/ME where OS Unicode support is concerned.
@@ -395,11 +401,11 @@
 /* Define to 1 if you have the `copysign' function. */
 #define HAVE_COPYSIGN 1
 
-/* Define to 1 if you have the `isinf' function. */
-#define HAVE_ISINF 1
+/* Define to 1 if you have the `isinf' macro. */
+#define HAVE_DECL_ISINF 1
 
 /* Define to 1 if you have the `isnan' function. */
-#define HAVE_ISNAN 1
+#define HAVE_DECL_ISNAN 1
 
 /* Define if on AIX 3.
    System headers sometimes define this.

Modified: python/branches/py3k-issue1717/PC/winreg.c
==============================================================================
--- python/branches/py3k-issue1717/PC/winreg.c	(original)
+++ python/branches/py3k-issue1717/PC/winreg.c	Sun Jan 25 21:08:20 2009
@@ -451,7 +451,7 @@
 	PyHKEY_binaryFailureFunc,	/* nb_xor */
 	PyHKEY_binaryFailureFunc,	/* nb_or */
 	PyHKEY_intFunc,			/* nb_int */
-	PyHKEY_unaryFailureFunc,	/* nb_long */
+	0,				/* nb_reserved */
 	PyHKEY_unaryFailureFunc,	/* nb_float */
 };
 

Modified: python/branches/py3k-issue1717/PCbuild/pythoncore.vcproj
==============================================================================
--- python/branches/py3k-issue1717/PCbuild/pythoncore.vcproj	(original)
+++ python/branches/py3k-issue1717/PCbuild/pythoncore.vcproj	Sun Jan 25 21:08:20 2009
@@ -1651,10 +1651,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\Python\getmtime.c"
-				>
-			</File>
-			<File
 				RelativePath="..\Python\getopt.c"
 				>
 			</File>

Modified: python/branches/py3k-issue1717/Parser/asdl.py
==============================================================================
--- python/branches/py3k-issue1717/Parser/asdl.py	(original)
+++ python/branches/py3k-issue1717/Parser/asdl.py	Sun Jan 25 21:08:20 2009
@@ -176,7 +176,7 @@
         return Product(fields)
 
     def p_sum_0(self, constructor):
-        " sum ::= constructor """
+        " sum ::= constructor "
         return [constructor[0]]
 
     def p_sum_1(self, info):

Modified: python/branches/py3k-issue1717/Parser/printgrammar.c
==============================================================================
--- python/branches/py3k-issue1717/Parser/printgrammar.c	(original)
+++ python/branches/py3k-issue1717/Parser/printgrammar.c	Sun Jan 25 21:08:20 2009
@@ -16,6 +16,7 @@
 	fprintf(fp, "/* Generated by Parser/pgen */\n\n");
 	fprintf(fp, "#include \"pgenheaders.h\"\n");
 	fprintf(fp, "#include \"grammar.h\"\n");
+	fprintf(fp, "PyAPI_DATA(grammar) _PyParser_Grammar;\n");
 	printdfas(g, fp);
 	printlabels(g, fp);
 	fprintf(fp, "grammar _PyParser_Grammar = {\n");

Modified: python/branches/py3k-issue1717/Python/Python-ast.c
==============================================================================
--- python/branches/py3k-issue1717/Python/Python-ast.c	(original)
+++ python/branches/py3k-issue1717/Python/Python-ast.c	Sun Jan 25 21:08:20 2009
@@ -479,7 +479,7 @@
     0,                       /* tp_print */
     0,                       /* tp_getattr */
     0,                       /* tp_setattr */
-    0,                       /* tp_reserved */
+    0,                       /* tp_compare */
     0,                       /* tp_repr */
     0,                       /* tp_as_number */
     0,                       /* tp_as_sequence */

Modified: python/branches/py3k-issue1717/Python/ast.c
==============================================================================
--- python/branches/py3k-issue1717/Python/ast.c	(original)
+++ python/branches/py3k-issue1717/Python/ast.c	Sun Jan 25 21:08:20 2009
@@ -191,7 +191,7 @@
         default: {
             char buf[128];
 
-            sprintf(buf, "Non-statement found: %d %d\n",
+            sprintf(buf, "Non-statement found: %d %d",
                     TYPE(n), NCH(n));
             Py_FatalError(buf);
         }

Modified: python/branches/py3k-issue1717/Python/bltinmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Python/bltinmodule.c	(original)
+++ python/branches/py3k-issue1717/Python/bltinmodule.c	Sun Jan 25 21:08:20 2009
@@ -112,7 +112,7 @@
 		ns = PyDict_New();
 	}
 	else {
-		PyObject *pargs = Py_BuildValue("OO", name, bases);
+		PyObject *pargs = PyTuple_Pack(2, name, bases);
 		if (pargs == NULL) {
 			Py_DECREF(prep);
 			Py_DECREF(meta);
@@ -133,7 +133,7 @@
 	cell = PyObject_CallFunctionObjArgs(func, ns, NULL);
 	if (cell != NULL) {
 		PyObject *margs;
-		margs = Py_BuildValue("OOO", name, bases, ns);
+		margs = PyTuple_Pack(3, name, bases, ns);
 		if (margs != NULL) {
 			cls = PyEval_CallObjectWithKeywords(meta, margs, mkw);
 			Py_DECREF(margs);
@@ -375,7 +375,6 @@
 	long ok;
 	PyObject *(*iternext)(PyObject *);
 
-	assert(PyIter_Check(it));
 	iternext = *Py_TYPE(it)->tp_iternext;
 	for (;;) {
 		item = iternext(it);
@@ -735,7 +734,7 @@
 	PyObject *prog, *globals = Py_None, *locals = Py_None;
 	int plain = 0;
 
-	if (!PyArg_ParseTuple(args, "O|OO:exec", &prog, &globals, &locals))
+	if (!PyArg_UnpackTuple(args, "exec", 1, 3, &prog, &globals, &locals))
 		return NULL;
 	
 	if (globals == Py_None) {
@@ -801,8 +800,8 @@
 PyDoc_STRVAR(exec_doc,
 "exec(object[, globals[, locals]])\n\
 \n\
-Read and execute code from a object, which can be a string, a code\n\
-object or a file object.\n\
+Read and execute code from a object, which can be a string or a code\n\
+object.\n\
 The globals and locals are dictionaries, defaulting to the current\n\
 globals and locals.  If only globals is given, locals defaults to it.");
 
@@ -2125,7 +2124,6 @@
 		Py_INCREF(result);
 		for (i=0 ; i < tuplesize ; i++) {
 			it = PyTuple_GET_ITEM(lz->ittuple, i);
-			assert(PyIter_Check(it));
 			item = (*Py_TYPE(it)->tp_iternext)(it);
 			if (item == NULL) {
 				Py_DECREF(result);
@@ -2141,7 +2139,6 @@
 			return NULL;
 		for (i=0 ; i < tuplesize ; i++) {
 			it = PyTuple_GET_ITEM(lz->ittuple, i);
-			assert(PyIter_Check(it));
 			item = (*Py_TYPE(it)->tp_iternext)(it);
 			if (item == NULL) {
 				Py_DECREF(result);

Modified: python/branches/py3k-issue1717/Python/ceval.c
==============================================================================
--- python/branches/py3k-issue1717/Python/ceval.c	(original)
+++ python/branches/py3k-issue1717/Python/ceval.c	Sun Jan 25 21:08:20 2009
@@ -205,6 +205,7 @@
 #include "pythread.h"
 
 static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */
+static PyThread_type_lock pending_lock = 0; /* for pending calls */
 static long main_thread = 0;
 
 int
@@ -276,6 +277,7 @@
 	  adding a new function to each thread_*.h.  Instead, just
 	  create a new lock and waste a little bit of memory */
 	interpreter_lock = PyThread_allocate_lock();
+	pending_lock = PyThread_allocate_lock();
 	PyThread_acquire_lock(interpreter_lock, 1);
 	main_thread = PyThread_get_thread_ident();
 
@@ -348,19 +350,145 @@
 #ifdef WITH_THREAD
    Any thread can schedule pending calls, but only the main thread
    will execute them.
+   There is no facility to schedule calls to a particular thread, but
+   that should be easy to change, should that ever be required.  In
+   that case, the static variables here should go into the python
+   threadstate.
 #endif
+*/
+
+#ifdef WITH_THREAD
+
+/* The WITH_THREAD implementation is thread-safe.  It allows
+   scheduling to be made from any thread, and even from an executing
+   callback.
+ */
+
+#define NPENDINGCALLS 32
+static struct {
+	int (*func)(void *);
+	void *arg;
+} pendingcalls[NPENDINGCALLS];
+static int pendingfirst = 0;
+static int pendinglast = 0;
+static volatile int pendingcalls_to_do = 1; /* trigger initialization of lock */
+static char pendingbusy = 0;
+
+int
+Py_AddPendingCall(int (*func)(void *), void *arg)
+{
+	int i, j, result=0;
+	PyThread_type_lock lock = pending_lock;
+	
+	/* try a few times for the lock.  Since this mechanism is used
+	 * for signal handling (on the main thread), there is a (slim)
+	 * chance that a signal is delivered on the same thread while we
+	 * hold the lock during the Py_MakePendingCalls() function.
+	 * This avoids a deadlock in that case.
+	 * Note that signals can be delivered on any thread.  In particular,
+	 * on Windows, a SIGINT is delivered on a system-created worker
+	 * thread.
+	 * We also check for lock being NULL, in the unlikely case that
+	 * this function is called before any bytecode evaluation takes place.
+	 */
+	if (lock != NULL) {
+		for (i = 0; i<100; i++) {
+			if (PyThread_acquire_lock(lock, NOWAIT_LOCK))
+				break;
+		}
+		if (i == 100)
+			return -1;
+	}
+
+	i = pendinglast;
+	j = (i + 1) % NPENDINGCALLS;
+	if (j == pendingfirst) {
+		result = -1; /* Queue full */
+	} else {
+		pendingcalls[i].func = func;
+		pendingcalls[i].arg = arg;
+		pendinglast = j;
+	}
+	/* signal main loop */
+	_Py_Ticker = 0;
+	pendingcalls_to_do = 1;
+	if (lock != NULL)
+		PyThread_release_lock(lock);
+	return result;
+}
 
-   XXX WARNING!  ASYNCHRONOUSLY EXECUTING CODE!
+int
+Py_MakePendingCalls(void)
+{
+	int i;
+	int r = 0;
+
+	if (!pending_lock) {
+		/* initial allocation of the lock */
+		pending_lock = PyThread_allocate_lock();
+		if (pending_lock == NULL)
+			return -1;
+	}
+
+	/* only service pending calls on main thread */
+	if (main_thread && PyThread_get_thread_ident() != main_thread)
+		return 0; 
+	/* don't perform recursive pending calls */
+	if (pendingbusy)
+		return 0;
+	pendingbusy = 1;
+	/* perform a bounded number of calls, in case of recursion */
+	for (i=0; i<NPENDINGCALLS; i++) {
+		int j;  
+		int (*func)(void *);
+		void *arg = NULL;
+		
+		/* pop one item off the queue while holding the lock */
+		PyThread_acquire_lock(pending_lock, WAIT_LOCK);
+		j = pendingfirst;
+		if (j == pendinglast) {
+			func = NULL; /* Queue empty */
+		} else {
+			func = pendingcalls[j].func;
+			arg = pendingcalls[j].arg;
+			pendingfirst = (j + 1) % NPENDINGCALLS;
+		}
+		pendingcalls_to_do = pendingfirst != pendinglast;
+		PyThread_release_lock(pending_lock);
+		/* having released the lock, perform the callback */
+		if (func == NULL)
+			break;
+		r = func(arg);
+		if (r)
+			break;
+	}
+	pendingbusy = 0;
+	return r;
+}
+
+#else /* if ! defined WITH_THREAD */
+
+/*
+   WARNING!  ASYNCHRONOUSLY EXECUTING CODE!
+   This code is used for signal handling in python that isn't built
+   with WITH_THREAD.
+   Don't use this implementation when Py_AddPendingCalls() can happen
+   on a different thread!
+ 
    There are two possible race conditions:
-   (1) nested asynchronous registry calls;
-   (2) registry calls made while pending calls are being processed.
-   While (1) is very unlikely, (2) is a real possibility.
+   (1) nested asynchronous calls to Py_AddPendingCall()
+   (2) AddPendingCall() calls made while pending calls are being processed.
+   
+   (1) is very unlikely because typically signal delivery
+   is blocked during signal handling.  So it should be impossible.
+   (2) is a real possibility.
    The current code is safe against (2), but not against (1).
    The safety against (2) is derived from the fact that only one
-   thread (the main thread) ever takes things out of the queue.
-
-   XXX Darn!  With the advent of thread state, we should have an array
-   of pending calls per thread in the thread state!  Later...
+   thread is present, interrupted by signals, and that the critical
+   section is protected with the "busy" variable.  On Windows, which
+   delivers SIGINT on a system thread, this does not hold and therefore
+   Windows really shouldn't use this version.
+   The two threads could theoretically wiggle around the "busy" variable.
 */
 
 #define NPENDINGCALLS 32
@@ -370,7 +498,7 @@
 } pendingcalls[NPENDINGCALLS];
 static volatile int pendingfirst = 0;
 static volatile int pendinglast = 0;
-static volatile int things_to_do = 0;
+static volatile int pendingcalls_to_do = 0;
 
 int
 Py_AddPendingCall(int (*func)(void *), void *arg)
@@ -378,8 +506,6 @@
 	static volatile int busy = 0;
 	int i, j;
 	/* XXX Begin critical section */
-	/* XXX If you want this to be safe against nested
-	   XXX asynchronous calls, you'll have to work harder! */
 	if (busy)
 		return -1;
 	busy = 1;
@@ -394,7 +520,7 @@
 	pendinglast = j;
 
 	_Py_Ticker = 0;
-	things_to_do = 1; /* Signal main loop */
+	pendingcalls_to_do = 1; /* Signal main loop */
 	busy = 0;
 	/* XXX End critical section */
 	return 0;
@@ -404,14 +530,10 @@
 Py_MakePendingCalls(void)
 {
 	static int busy = 0;
-#ifdef WITH_THREAD
-	if (main_thread && PyThread_get_thread_ident() != main_thread)
-		return 0;
-#endif
 	if (busy)
 		return 0;
 	busy = 1;
-	things_to_do = 0;
+	pendingcalls_to_do = 0;
 	for (;;) {
 		int i;
 		int (*func)(void *);
@@ -424,7 +546,7 @@
 		pendingfirst = (i + 1) % NPENDINGCALLS;
 		if (func(arg) < 0) {
 			busy = 0;
-			things_to_do = 1; /* We're not done yet */
+			pendingcalls_to_do = 1; /* We're not done yet */
 			return -1;
 		}
 	}
@@ -432,6 +554,8 @@
 	return 0;
 }
 
+#endif /* WITH_THREAD */
+
 
 /* The interpreter's recursion limit */
 
@@ -518,7 +642,7 @@
 /* for manipulating the thread switch and periodic "stuff" - used to be
    per thread, now just a pair o' globals */
 int _Py_CheckInterval = 100;
-volatile int _Py_Ticker = 100;
+volatile int _Py_Ticker = 0; /* so that we hit a "tick" first thing */
 
 PyObject *
 PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
@@ -581,6 +705,114 @@
 	char *filename;
 #endif
 
+/* Computed GOTOs, or
+       the-optimization-commonly-but-improperly-known-as-"threaded code"
+   using gcc's labels-as-values extension
+   (http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html).
+
+   The traditional bytecode evaluation loop uses a "switch" statement, which
+   decent compilers will optimize as a single indirect branch instruction 
+   combined with a lookup table of jump addresses. However, since the
+   indirect jump instruction is shared by all opcodes, the CPU will have a
+   hard time making the right prediction for where to jump next (actually,
+   it will be always wrong except in the uncommon case of a sequence of
+   several identical opcodes).
+
+   "Threaded code" in contrast, uses an explicit jump table and an explicit
+   indirect jump instruction at the end of each opcode. Since the jump
+   instruction is at a different address for each opcode, the CPU will make a
+   separate prediction for each of these instructions, which is equivalent to
+   predicting the second opcode of each opcode pair. These predictions have
+   a much better chance to turn out valid, especially in small bytecode loops.
+
+   A mispredicted branch on a modern CPU flushes the whole pipeline and
+   can cost several CPU cycles (depending on the pipeline depth), 
+   and potentially many more instructions (depending on the pipeline width).
+   A correctly predicted branch, however, is nearly free.
+
+   At the time of this writing, the "threaded code" version is up to 15-20%
+   faster than the normal "switch" version, depending on the compiler and the
+   CPU architecture.
+
+   We disable the optimization if DYNAMIC_EXECUTION_PROFILE is defined,
+   because it would render the measurements invalid.
+
+
+   NOTE: care must be taken that the compiler doesn't try to "optimize" the
+   indirect jumps by sharing them between all opcodes. Such optimizations
+   can be disabled on gcc by using the -fno-gcse flag (or possibly
+   -fno-crossjumping).
+*/
+
+#if defined(USE_COMPUTED_GOTOS) && defined(DYNAMIC_EXECUTION_PROFILE)
+#undef USE_COMPUTED_GOTOS
+#endif
+
+#ifdef USE_COMPUTED_GOTOS
+/* Import the static jump table */
+#include "opcode_targets.h"
+
+/* This macro is used when several opcodes defer to the same implementation
+   (e.g. SETUP_LOOP, SETUP_FINALLY) */
+#define TARGET_WITH_IMPL(op, impl) \
+	TARGET_##op: \
+		opcode = op; \
+		if (HAS_ARG(op)) \
+			oparg = NEXTARG(); \
+	case op: \
+		goto impl; \
+
+#define TARGET(op) \
+	TARGET_##op: \
+		opcode = op; \
+		if (HAS_ARG(op)) \
+			oparg = NEXTARG(); \
+	case op:
+
+
+#define DISPATCH() \
+	{ \
+		/* Avoid multiple loads from _Py_Ticker despite `volatile` */ \
+		int _tick = _Py_Ticker - 1; \
+		_Py_Ticker = _tick; \
+		if (_tick >= 0) { \
+			FAST_DISPATCH(); \
+		} \
+		continue; \
+	}
+
+#ifdef LLTRACE
+#define FAST_DISPATCH() \
+	{ \
+		if (!lltrace && !_Py_TracingPossible) { \
+			f->f_lasti = INSTR_OFFSET(); \
+			goto *opcode_targets[*next_instr++]; \
+		} \
+		goto fast_next_opcode; \
+	}
+#else
+#define FAST_DISPATCH() \
+	{ \
+		if (!_Py_TracingPossible) { \
+			f->f_lasti = INSTR_OFFSET(); \
+			goto *opcode_targets[*next_instr++]; \
+		} \
+		goto fast_next_opcode; \
+	}
+#endif
+
+#else
+#define TARGET(op) \
+	case op:
+#define TARGET_WITH_IMPL(op, impl) \
+	/* silence compiler warnings about `impl` unused */ \
+	if (0) goto impl; \
+	case op:
+#define DISPATCH() continue
+#define FAST_DISPATCH() goto fast_next_opcode
+#endif
+
+
 /* Tuple access macros */
 
 #ifndef Py_DEBUG
@@ -658,16 +890,23 @@
 	predictions turned-on and interpret the results as if some opcodes
 	had been combined or turn-off predictions so that the opcode frequency
 	counter updates for both opcodes.
+
+    Opcode prediction is disabled with threaded code, since the latter allows
+	the CPU to record separate branch prediction information for each
+	opcode.
+
 */
 
-#ifdef DYNAMIC_EXECUTION_PROFILE
+#if defined(DYNAMIC_EXECUTION_PROFILE) || defined(USE_COMPUTED_GOTOS)
 #define PREDICT(op)		if (0) goto PRED_##op
+#define PREDICTED(op)		PRED_##op:
+#define PREDICTED_WITH_ARG(op)	PRED_##op:
 #else
 #define PREDICT(op)		if (*next_instr == op) goto PRED_##op
-#endif
-
 #define PREDICTED(op)		PRED_##op: next_instr++
 #define PREDICTED_WITH_ARG(op)	PRED_##op: oparg = PEEKARG(); next_instr += 3
+#endif
+
 
 /* Stack manipulation macros */
 
@@ -903,7 +1142,7 @@
 		/* Do periodic things.  Doing this every time through
 		   the loop would add too much overhead, so we do it
 		   only every Nth instruction.  We also do it if
-		   ``things_to_do'' is set, i.e. when an asynchronous
+		   ``pendingcalls_to_do'' is set, i.e. when an asynchronous
 		   event needs attention (e.g. a signal handler or
 		   async I/O handler); see Py_AddPendingCall() and
 		   Py_MakePendingCalls() above. */
@@ -919,12 +1158,12 @@
 #ifdef WITH_TSC
 			ticked = 1;
 #endif
-			if (things_to_do) {
+			if (pendingcalls_to_do) {
 				if (Py_MakePendingCalls() < 0) {
 					why = WHY_EXCEPTION;
 					goto on_error;
 				}
-				if (things_to_do)
+				if (pendingcalls_to_do)
 					/* MakePendingCalls() didn't succeed.
 					   Force early re-execution of this
 					   "periodic" code, possibly after
@@ -1029,56 +1268,56 @@
 
 		/* case STOP_CODE: this is an error! */
 
-		case NOP:
-			goto fast_next_opcode;
+		TARGET(NOP)
+			FAST_DISPATCH();
 
-		case LOAD_FAST:
+		TARGET(LOAD_FAST)
 			x = GETLOCAL(oparg);
 			if (x != NULL) {
 				Py_INCREF(x);
 				PUSH(x);
-				goto fast_next_opcode;
+				FAST_DISPATCH();
 			}
 			format_exc_check_arg(PyExc_UnboundLocalError,
 				UNBOUNDLOCAL_ERROR_MSG,
 				PyTuple_GetItem(co->co_varnames, oparg));
 			break;
 
-		case LOAD_CONST:
+		TARGET(LOAD_CONST)
 			x = GETITEM(consts, oparg);
 			Py_INCREF(x);
 			PUSH(x);
-			goto fast_next_opcode;
+			FAST_DISPATCH();
 
 		PREDICTED_WITH_ARG(STORE_FAST);
-		case STORE_FAST:
+		TARGET(STORE_FAST)
 			v = POP();
 			SETLOCAL(oparg, v);
-			goto fast_next_opcode;
+			FAST_DISPATCH();
 
 		PREDICTED(POP_TOP);
-		case POP_TOP:
+		TARGET(POP_TOP)
 			v = POP();
 			Py_DECREF(v);
-			goto fast_next_opcode;
+			FAST_DISPATCH();
 
-		case ROT_TWO:
+		TARGET(ROT_TWO)
 			v = TOP();
 			w = SECOND();
 			SET_TOP(w);
 			SET_SECOND(v);
-			goto fast_next_opcode;
+			FAST_DISPATCH();
 
-		case ROT_THREE:
+		TARGET(ROT_THREE)
 			v = TOP();
 			w = SECOND();
 			x = THIRD();
 			SET_TOP(w);
 			SET_SECOND(x);
 			SET_THIRD(v);
-			goto fast_next_opcode;
+			FAST_DISPATCH();
 
-		case ROT_FOUR:
+		TARGET(ROT_FOUR)
 			u = TOP();
 			v = SECOND();
 			w = THIRD();
@@ -1087,15 +1326,15 @@
 			SET_SECOND(w);
 			SET_THIRD(x);
 			SET_FOURTH(u);
-			goto fast_next_opcode;
+			FAST_DISPATCH();
 
-		case DUP_TOP:
+		TARGET(DUP_TOP)
 			v = TOP();
 			Py_INCREF(v);
 			PUSH(v);
-			goto fast_next_opcode;
+			FAST_DISPATCH();
 
-		case DUP_TOPX:
+		TARGET(DUP_TOPX)
 			if (oparg == 2) {
 				x = TOP();
 				Py_INCREF(x);
@@ -1104,7 +1343,7 @@
 				STACKADJ(2);
 				SET_TOP(x);
 				SET_SECOND(w);
-				goto fast_next_opcode;
+				FAST_DISPATCH();
 			} else if (oparg == 3) {
 				x = TOP();
 				Py_INCREF(x);
@@ -1116,106 +1355,106 @@
 				SET_TOP(x);
 				SET_SECOND(w);
 				SET_THIRD(v);
-				goto fast_next_opcode;
+				FAST_DISPATCH();
 			}
 			Py_FatalError("invalid argument to DUP_TOPX"
 				      " (bytecode corruption?)");
 			/* Never returns, so don't bother to set why. */
 			break;
 
-		case UNARY_POSITIVE:
+		TARGET(UNARY_POSITIVE)
 			v = TOP();
 			x = PyNumber_Positive(v);
 			Py_DECREF(v);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case UNARY_NEGATIVE:
+		TARGET(UNARY_NEGATIVE)
 			v = TOP();
 			x = PyNumber_Negative(v);
 			Py_DECREF(v);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case UNARY_NOT:
+		TARGET(UNARY_NOT)
 			v = TOP();
 			err = PyObject_IsTrue(v);
 			Py_DECREF(v);
 			if (err == 0) {
 				Py_INCREF(Py_True);
 				SET_TOP(Py_True);
-				continue;
+				DISPATCH();
 			}
 			else if (err > 0) {
 				Py_INCREF(Py_False);
 				SET_TOP(Py_False);
 				err = 0;
-				continue;
+				DISPATCH();
 			}
 			STACKADJ(-1);
 			break;
 
-		case UNARY_INVERT:
+		TARGET(UNARY_INVERT)
 			v = TOP();
 			x = PyNumber_Invert(v);
 			Py_DECREF(v);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_POWER:
+		TARGET(BINARY_POWER)
 			w = POP();
 			v = TOP();
 			x = PyNumber_Power(v, w, Py_None);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_MULTIPLY:
+		TARGET(BINARY_MULTIPLY)
 			w = POP();
 			v = TOP();
 			x = PyNumber_Multiply(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_TRUE_DIVIDE:
+		TARGET(BINARY_TRUE_DIVIDE)
 			w = POP();
 			v = TOP();
 			x = PyNumber_TrueDivide(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_FLOOR_DIVIDE:
+		TARGET(BINARY_FLOOR_DIVIDE)
 			w = POP();
 			v = TOP();
 			x = PyNumber_FloorDivide(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_MODULO:
+		TARGET(BINARY_MODULO)
 			w = POP();
 			v = TOP();
 			x = PyNumber_Remainder(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_ADD:
+		TARGET(BINARY_ADD)
 			w = POP();
 			v = TOP();
 			if (PyUnicode_CheckExact(v) &&
@@ -1231,152 +1470,152 @@
 		  skip_decref_vx:
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_SUBTRACT:
+		TARGET(BINARY_SUBTRACT)
 			w = POP();
 			v = TOP();
 			x = PyNumber_Subtract(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_SUBSCR:
+		TARGET(BINARY_SUBSCR)
 			w = POP();
 			v = TOP();
 			x = PyObject_GetItem(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_LSHIFT:
+		TARGET(BINARY_LSHIFT)
 			w = POP();
 			v = TOP();
 			x = PyNumber_Lshift(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_RSHIFT:
+		TARGET(BINARY_RSHIFT)
 			w = POP();
 			v = TOP();
 			x = PyNumber_Rshift(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_AND:
+		TARGET(BINARY_AND)
 			w = POP();
 			v = TOP();
 			x = PyNumber_And(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_XOR:
+		TARGET(BINARY_XOR)
 			w = POP();
 			v = TOP();
 			x = PyNumber_Xor(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case BINARY_OR:
+		TARGET(BINARY_OR)
 			w = POP();
 			v = TOP();
 			x = PyNumber_Or(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case LIST_APPEND:
+		TARGET(LIST_APPEND)
 			w = POP();
 			v = stack_pointer[-oparg];
 			err = PyList_Append(v, w);
 			Py_DECREF(w);
 			if (err == 0) {
 				PREDICT(JUMP_ABSOLUTE);
-				continue;
+				DISPATCH();
 			}
 			break;
 
-		case SET_ADD:
+		TARGET(SET_ADD)
 			w = POP();
 			v = stack_pointer[-oparg];
 			err = PySet_Add(v, w);
 			Py_DECREF(w);
 			if (err == 0) {
 				PREDICT(JUMP_ABSOLUTE);
-				continue;
+				DISPATCH();
 			}
 			break;
 
-		case INPLACE_POWER:
+		TARGET(INPLACE_POWER)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlacePower(v, w, Py_None);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_MULTIPLY:
+		TARGET(INPLACE_MULTIPLY)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceMultiply(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_TRUE_DIVIDE:
+		TARGET(INPLACE_TRUE_DIVIDE)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceTrueDivide(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_FLOOR_DIVIDE:
+		TARGET(INPLACE_FLOOR_DIVIDE)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceFloorDivide(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_MODULO:
+		TARGET(INPLACE_MODULO)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceRemainder(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_ADD:
+		TARGET(INPLACE_ADD)
 			w = POP();
 			v = TOP();
 			if (PyUnicode_CheckExact(v) &&
@@ -1392,70 +1631,70 @@
 		  skip_decref_v:
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_SUBTRACT:
+		TARGET(INPLACE_SUBTRACT)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceSubtract(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_LSHIFT:
+		TARGET(INPLACE_LSHIFT)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceLshift(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_RSHIFT:
+		TARGET(INPLACE_RSHIFT)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceRshift(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_AND:
+		TARGET(INPLACE_AND)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceAnd(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_XOR:
+		TARGET(INPLACE_XOR)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceXor(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case INPLACE_OR:
+		TARGET(INPLACE_OR)
 			w = POP();
 			v = TOP();
 			x = PyNumber_InPlaceOr(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case STORE_SUBSCR:
+		TARGET(STORE_SUBSCR)
 			w = TOP();
 			v = SECOND();
 			u = THIRD();
@@ -1465,10 +1704,10 @@
 			Py_DECREF(u);
 			Py_DECREF(v);
 			Py_DECREF(w);
-			if (err == 0) continue;
+			if (err == 0) DISPATCH();
 			break;
 
-		case DELETE_SUBSCR:
+		TARGET(DELETE_SUBSCR)
 			w = TOP();
 			v = SECOND();
 			STACKADJ(-2);
@@ -1476,10 +1715,10 @@
 			err = PyObject_DelItem(v, w);
 			Py_DECREF(v);
 			Py_DECREF(w);
-			if (err == 0) continue;
+			if (err == 0) DISPATCH();
 			break;
 
-		case PRINT_EXPR:
+		TARGET(PRINT_EXPR)
 			v = POP();
 			w = PySys_GetObject("displayhook");
 			if (w == NULL) {
@@ -1506,7 +1745,7 @@
 #ifdef CASE_TOO_BIG
 		default: switch (opcode) {
 #endif
-		case RAISE_VARARGS:
+		TARGET(RAISE_VARARGS)
 			v = w = NULL;
 			switch (oparg) {
 			case 2:
@@ -1524,19 +1763,19 @@
 			}
 			break;
 
-		case STORE_LOCALS:
+		TARGET(STORE_LOCALS)
 			x = POP();
 			v = f->f_locals;
 			Py_XDECREF(v);
 			f->f_locals = x;
-			continue;
+			DISPATCH();
 
-		case RETURN_VALUE:
+		TARGET(RETURN_VALUE)
 			retval = POP();
 			why = WHY_RETURN;
 			goto fast_block_end;
 
-		case YIELD_VALUE:
+		TARGET(YIELD_VALUE)
 			retval = POP();
 			f->f_stacktop = stack_pointer;
 			why = WHY_YIELD;
@@ -1546,7 +1785,7 @@
 			SWAP_EXC_STATE();
 			goto fast_yield;
 
-		case POP_EXCEPT:
+		TARGET(POP_EXCEPT)
 			{
 				PyTryBlock *b = PyFrame_BlockPop(f);
 				if (b->b_type != EXCEPT_HANDLER) {
@@ -1557,17 +1796,17 @@
 				}
 				UNWIND_EXCEPT_HANDLER(b);
 			}
-			continue;
+			DISPATCH();
 
-		case POP_BLOCK:
+		TARGET(POP_BLOCK)
 			{
 				PyTryBlock *b = PyFrame_BlockPop(f);
 				UNWIND_BLOCK(b);
 			}
-			continue;
+			DISPATCH();
 
 		PREDICTED(END_FINALLY);
-		case END_FINALLY:
+		TARGET(END_FINALLY)
 			v = POP();
 			if (PyLong_Check(v)) {
 				why = (enum why_code) PyLong_AS_LONG(v);
@@ -1607,7 +1846,7 @@
 			Py_DECREF(v);
 			break;
 
-		case LOAD_BUILD_CLASS:
+		TARGET(LOAD_BUILD_CLASS)
 			x = PyDict_GetItemString(f->f_builtins,
 						 "__build_class__");
 			if (x == NULL) {
@@ -1619,7 +1858,7 @@
 			PUSH(x);
 			break;
 
-		case STORE_NAME:
+		TARGET(STORE_NAME)
 			w = GETITEM(names, oparg);
 			v = POP();
 			if ((x = f->f_locals) != NULL) {
@@ -1628,14 +1867,14 @@
 				else
 					err = PyObject_SetItem(x, w, v);
 				Py_DECREF(v);
-				if (err == 0) continue;
+				if (err == 0) DISPATCH();
 				break;
 			}
 			PyErr_Format(PyExc_SystemError,
 				     "no locals found when storing %R", w);
 			break;
 
-		case DELETE_NAME:
+		TARGET(DELETE_NAME)
 			w = GETITEM(names, oparg);
 			if ((x = f->f_locals) != NULL) {
 				if ((err = PyObject_DelItem(x, w)) != 0)
@@ -1649,7 +1888,7 @@
 			break;
 
 		PREDICTED_WITH_ARG(UNPACK_SEQUENCE);
-		case UNPACK_SEQUENCE:
+		TARGET(UNPACK_SEQUENCE)
 			v = POP();
 			if (PyTuple_CheckExact(v) &&
 			    PyTuple_GET_SIZE(v) == oparg) {
@@ -1661,7 +1900,7 @@
 					PUSH(w);
 				}
 				Py_DECREF(v);
-				continue;
+				DISPATCH();
 			} else if (PyList_CheckExact(v) &&
 				   PyList_GET_SIZE(v) == oparg) {
 				PyObject **items = \
@@ -1681,7 +1920,7 @@
 			Py_DECREF(v);
 			break;
 
-		case UNPACK_EX:
+		TARGET(UNPACK_EX)
 		{
 			int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8);
 			v = POP();
@@ -1696,7 +1935,7 @@
 			break;
 		}
 
-		case STORE_ATTR:
+		TARGET(STORE_ATTR)
 			w = GETITEM(names, oparg);
 			v = TOP();
 			u = SECOND();
@@ -1704,10 +1943,10 @@
 			err = PyObject_SetAttr(v, w, u); /* v.w = u */
 			Py_DECREF(v);
 			Py_DECREF(u);
-			if (err == 0) continue;
+			if (err == 0) DISPATCH();
 			break;
 
-		case DELETE_ATTR:
+		TARGET(DELETE_ATTR)
 			w = GETITEM(names, oparg);
 			v = POP();
 			err = PyObject_SetAttr(v, w, (PyObject *)NULL);
@@ -1715,22 +1954,22 @@
 			Py_DECREF(v);
 			break;
 
-		case STORE_GLOBAL:
+		TARGET(STORE_GLOBAL)
 			w = GETITEM(names, oparg);
 			v = POP();
 			err = PyDict_SetItem(f->f_globals, w, v);
 			Py_DECREF(v);
-			if (err == 0) continue;
+			if (err == 0) DISPATCH();
 			break;
 
-		case DELETE_GLOBAL:
+		TARGET(DELETE_GLOBAL)
 			w = GETITEM(names, oparg);
 			if ((err = PyDict_DelItem(f->f_globals, w)) != 0)
 				format_exc_check_arg(
 				    PyExc_NameError, GLOBAL_NAME_ERROR_MSG, w);
 			break;
 
-		case LOAD_NAME:
+		TARGET(LOAD_NAME)
 			w = GETITEM(names, oparg);
 			if ((v = f->f_locals) == NULL) {
 				PyErr_Format(PyExc_SystemError,
@@ -1765,9 +2004,9 @@
 				Py_INCREF(x);
 			}
 			PUSH(x);
-			continue;
+			DISPATCH();
 
-		case LOAD_GLOBAL:
+		TARGET(LOAD_GLOBAL)
 			w = GETITEM(names, oparg);
 			if (PyUnicode_CheckExact(w)) {
 				/* Inline the PyDict_GetItem() calls.
@@ -1787,7 +2026,7 @@
 					if (x != NULL) {
 						Py_INCREF(x);
 						PUSH(x);
-						continue;
+						DISPATCH();
 					}
 					d = (PyDictObject *)(f->f_builtins);
 					e = d->ma_lookup(d, w, hash);
@@ -1799,7 +2038,7 @@
 					if (x != NULL) {
 						Py_INCREF(x);
 						PUSH(x);
-						continue;
+						DISPATCH();
 					}
 					goto load_global_error;
 				}
@@ -1818,13 +2057,13 @@
 			}
 			Py_INCREF(x);
 			PUSH(x);
-			continue;
+			DISPATCH();
 
-		case DELETE_FAST:
+		TARGET(DELETE_FAST)
 			x = GETLOCAL(oparg);
 			if (x != NULL) {
 				SETLOCAL(oparg, NULL);
-				continue;
+				DISPATCH();
 			}
 			format_exc_check_arg(
 				PyExc_UnboundLocalError,
@@ -1833,19 +2072,19 @@
 				);
 			break;
 
-		case LOAD_CLOSURE:
+		TARGET(LOAD_CLOSURE)
 			x = freevars[oparg];
 			Py_INCREF(x);
 			PUSH(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case LOAD_DEREF:
+		TARGET(LOAD_DEREF)
 			x = freevars[oparg];
 			w = PyCell_Get(x);
 			if (w != NULL) {
 				PUSH(w);
-				continue;
+				DISPATCH();
 			}
 			err = -1;
 			/* Don't stomp existing exception */
@@ -1866,14 +2105,14 @@
 			}
 			break;
 
-		case STORE_DEREF:
+		TARGET(STORE_DEREF)
 			w = POP();
 			x = freevars[oparg];
 			PyCell_Set(x, w);
 			Py_DECREF(w);
-			continue;
+			DISPATCH();
 
-		case BUILD_TUPLE:
+		TARGET(BUILD_TUPLE)
 			x = PyTuple_New(oparg);
 			if (x != NULL) {
 				for (; --oparg >= 0;) {
@@ -1881,11 +2120,11 @@
 					PyTuple_SET_ITEM(x, oparg, w);
 				}
 				PUSH(x);
-				continue;
+				DISPATCH();
 			}
 			break;
 
-		case BUILD_LIST:
+		TARGET(BUILD_LIST)
 			x =  PyList_New(oparg);
 			if (x != NULL) {
 				for (; --oparg >= 0;) {
@@ -1893,11 +2132,11 @@
 					PyList_SET_ITEM(x, oparg, w);
 				}
 				PUSH(x);
-				continue;
+				DISPATCH();
 			}
 			break;
 
-		case BUILD_SET:
+		TARGET(BUILD_SET)
 			x = PySet_New(NULL);
 			if (x != NULL) {
 				for (; --oparg >= 0;) {
@@ -1911,17 +2150,17 @@
 					break;
 				}
 				PUSH(x);
-				continue;
+				DISPATCH();
 			}
 			break;
 
-		case BUILD_MAP:
+		TARGET(BUILD_MAP)
 			x = _PyDict_NewPresized((Py_ssize_t)oparg);
 			PUSH(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case STORE_MAP:
+		TARGET(STORE_MAP)
 			w = TOP();     /* key */
 			u = SECOND();  /* value */
 			v = THIRD();   /* dict */
@@ -1930,10 +2169,10 @@
 			err = PyDict_SetItem(v, w, u);  /* v[w] = u */
 			Py_DECREF(u);
 			Py_DECREF(w);
-			if (err == 0) continue;
+			if (err == 0) DISPATCH();
 			break;
 
-		case MAP_ADD:
+		TARGET(MAP_ADD)
 			w = TOP();     /* key */
 			u = SECOND();  /* value */
 			STACKADJ(-2);
@@ -1944,20 +2183,20 @@
 			Py_DECREF(w);
 			if (err == 0) {
 				PREDICT(JUMP_ABSOLUTE);
-				continue;
+				DISPATCH();
 			}
 			break;
 
-		case LOAD_ATTR:
+		TARGET(LOAD_ATTR)
 			w = GETITEM(names, oparg);
 			v = TOP();
 			x = PyObject_GetAttr(v, w);
 			Py_DECREF(v);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case COMPARE_OP:
+		TARGET(COMPARE_OP)
 			w = POP();
 			v = TOP();
 			x = cmp_outcome(oparg, v, w);
@@ -1967,9 +2206,9 @@
 			if (x == NULL) break;
 			PREDICT(JUMP_IF_FALSE);
 			PREDICT(JUMP_IF_TRUE);
-			continue;
+			DISPATCH();
 
-		case IMPORT_NAME:
+		TARGET(IMPORT_NAME)
 			w = GETITEM(names, oparg);
 			x = PyDict_GetItemString(f->f_builtins, "__import__");
 			if (x == NULL) {
@@ -2010,10 +2249,10 @@
 			READ_TIMESTAMP(intr1);
 			Py_DECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case IMPORT_STAR:
+		TARGET(IMPORT_STAR)
 			v = POP();
 			PyFrame_FastToLocals(f);
 			if ((x = f->f_locals) == NULL) {
@@ -2026,33 +2265,33 @@
 			READ_TIMESTAMP(intr1);
 			PyFrame_LocalsToFast(f, 0);
 			Py_DECREF(v);
-			if (err == 0) continue;
+			if (err == 0) DISPATCH();
 			break;
 
-		case IMPORT_FROM:
+		TARGET(IMPORT_FROM)
 			w = GETITEM(names, oparg);
 			v = TOP();
 			READ_TIMESTAMP(intr0);
 			x = import_from(v, w);
 			READ_TIMESTAMP(intr1);
 			PUSH(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case JUMP_FORWARD:
+		TARGET(JUMP_FORWARD)
 			JUMPBY(oparg);
-			goto fast_next_opcode;
+			FAST_DISPATCH();
 
 		PREDICTED_WITH_ARG(JUMP_IF_FALSE);
-		case JUMP_IF_FALSE:
+		TARGET(JUMP_IF_FALSE)
 			w = TOP();
 			if (w == Py_True) {
 				PREDICT(POP_TOP);
-				goto fast_next_opcode;
+				FAST_DISPATCH();
 			}
 			if (w == Py_False) {
 				JUMPBY(oparg);
-				goto fast_next_opcode;
+				FAST_DISPATCH();
 			}
 			err = PyObject_IsTrue(w);
 			if (err > 0)
@@ -2061,18 +2300,18 @@
 				JUMPBY(oparg);
 			else
 				break;
-			continue;
+			DISPATCH();
 
 		PREDICTED_WITH_ARG(JUMP_IF_TRUE);
-		case JUMP_IF_TRUE:
+		TARGET(JUMP_IF_TRUE)
 			w = TOP();
 			if (w == Py_False) {
 				PREDICT(POP_TOP);
-				goto fast_next_opcode;
+				FAST_DISPATCH();
 			}
 			if (w == Py_True) {
 				JUMPBY(oparg);
-				goto fast_next_opcode;
+				FAST_DISPATCH();
 			}
 			err = PyObject_IsTrue(w);
 			if (err > 0) {
@@ -2083,10 +2322,10 @@
 				;
 			else
 				break;
-			continue;
+			DISPATCH();
 
 		PREDICTED_WITH_ARG(JUMP_ABSOLUTE);
-		case JUMP_ABSOLUTE:
+		TARGET(JUMP_ABSOLUTE)
 			JUMPTO(oparg);
 #if FAST_LOOPS
 			/* Enabling this path speeds-up all while and for-loops by bypassing
@@ -2094,14 +2333,14 @@
                            because it prevents detection of a control-break in tight loops like
                            "while 1: pass".  Compile with this option turned-on when you need
                            the speed-up and do not need break checking inside tight loops (ones
-                           that contain only instructions ending with goto fast_next_opcode).
+                           that contain only instructions ending with FAST_DISPATCH).
                         */
-			goto fast_next_opcode;
+			FAST_DISPATCH();
 #else
-			continue;
+			DISPATCH();
 #endif
 
-		case GET_ITER:
+		TARGET(GET_ITER)
 			/* before: [obj]; after [getiter(obj)] */
 			v = TOP();
 			x = PyObject_GetIter(v);
@@ -2109,13 +2348,13 @@
 			if (x != NULL) {
 				SET_TOP(x);
 				PREDICT(FOR_ITER);
-				continue;
+				DISPATCH();
 			}
 			STACKADJ(-1);
 			break;
 
 		PREDICTED_WITH_ARG(FOR_ITER);
-		case FOR_ITER:
+		TARGET(FOR_ITER)
 			/* before: [iter]; after: [iter, iter()] *or* [] */
 			v = TOP();
 			x = (*v->ob_type->tp_iternext)(v);
@@ -2123,7 +2362,7 @@
 				PUSH(x);
 				PREDICT(STORE_FAST);
 				PREDICT(UNPACK_SEQUENCE);
-				continue;
+				DISPATCH();
 			}
 			if (PyErr_Occurred()) {
 				if (!PyErr_ExceptionMatches(
@@ -2135,13 +2374,13 @@
  			x = v = POP();
 			Py_DECREF(v);
 			JUMPBY(oparg);
-			continue;
+			DISPATCH();
 
-		case BREAK_LOOP:
+		TARGET(BREAK_LOOP)
 			why = WHY_BREAK;
 			goto fast_block_end;
 
-		case CONTINUE_LOOP:
+		TARGET(CONTINUE_LOOP)
 			retval = PyLong_FromLong(oparg);
 			if (!retval) {
 				x = NULL;
@@ -2150,9 +2389,10 @@
 			why = WHY_CONTINUE;
 			goto fast_block_end;
 
-		case SETUP_LOOP:
-		case SETUP_EXCEPT:
-		case SETUP_FINALLY:
+		TARGET_WITH_IMPL(SETUP_LOOP, _setup_finally)
+		TARGET_WITH_IMPL(SETUP_EXCEPT, _setup_finally)
+		TARGET(SETUP_FINALLY)
+		_setup_finally:
 			/* NOTE: If you add any new block-setup opcodes that
 		           are not try/except/finally handlers, you may need
 		           to update the PyGen_NeedsFinalizing() function.
@@ -2160,9 +2400,9 @@
 
 			PyFrame_BlockSetup(f, opcode, INSTR_OFFSET() + oparg,
 					   STACK_LEVEL());
-			continue;
+			DISPATCH();
 
-		case WITH_CLEANUP:
+		TARGET(WITH_CLEANUP)
 		{
 			/* At the top of the stack are 1-3 values indicating
 			   how/why we entered the finally clause:
@@ -2226,7 +2466,7 @@
 			break;
 		}
 
-		case CALL_FUNCTION:
+		TARGET(CALL_FUNCTION)
 		{
 			PyObject **sp;
 			PCALL(PCALL_ALL);
@@ -2239,13 +2479,14 @@
 			stack_pointer = sp;
 			PUSH(x);
 			if (x != NULL)
-				continue;
+				DISPATCH();
 			break;
 		}
 
-		case CALL_FUNCTION_VAR:
-		case CALL_FUNCTION_KW:
-		case CALL_FUNCTION_VAR_KW:
+		TARGET_WITH_IMPL(CALL_FUNCTION_VAR, _call_function_var_kw)
+		TARGET_WITH_IMPL(CALL_FUNCTION_KW, _call_function_var_kw)
+		TARGET(CALL_FUNCTION_VAR_KW)
+		_call_function_var_kw:
 		{
 		    int na = oparg & 0xff;
 		    int nk = (oparg>>8) & 0xff;
@@ -2285,12 +2526,13 @@
 		    }
 		    PUSH(x);
 		    if (x != NULL)
-			    continue;
+			    DISPATCH();
 		    break;
 		}
 
-		case MAKE_CLOSURE:
-		case MAKE_FUNCTION:
+		TARGET_WITH_IMPL(MAKE_CLOSURE, _make_function)
+		TARGET(MAKE_FUNCTION)
+		_make_function:
 		{
 		    int posdefaults = oparg & 0xff;
 		    int kwdefaults = (oparg>>8) & 0xff;
@@ -2383,7 +2625,7 @@
 			break;
 		}
 
-		case BUILD_SLICE:
+		TARGET(BUILD_SLICE)
 			if (oparg == 3)
 				w = POP();
 			else
@@ -2395,14 +2637,17 @@
 			Py_DECREF(v);
 			Py_XDECREF(w);
 			SET_TOP(x);
-			if (x != NULL) continue;
+			if (x != NULL) DISPATCH();
 			break;
 
-		case EXTENDED_ARG:
+		TARGET(EXTENDED_ARG)
 			opcode = NEXTOP();
 			oparg = oparg<<16 | NEXTARG();
 			goto dispatch_opcode;
 
+#ifdef USE_COMPUTED_GOTOS
+		_unknown_opcode:
+#endif
 		default:
 			fprintf(stderr,
 				"XXX lineno: %d, opcode: %d\n",

Modified: python/branches/py3k-issue1717/Python/compile.c
==============================================================================
--- python/branches/py3k-issue1717/Python/compile.c	(original)
+++ python/branches/py3k-issue1717/Python/compile.c	Sun Jan 25 21:08:20 2009
@@ -1239,7 +1239,7 @@
 	    char buf[350];
 	    PyOS_snprintf(buf, sizeof(buf),
 			  "unknown scope for %.100s in %.100s(%s) in %s\n"
-			  "symbols: %s\nlocals: %s\nglobals: %s\n",
+			  "symbols: %s\nlocals: %s\nglobals: %s",
 			  PyBytes_AS_STRING(name), 
 			  PyBytes_AS_STRING(c->u->u_name), 
 			  PyObject_REPR(c->u->u_ste->ste_id),

Modified: python/branches/py3k-issue1717/Python/getcopyright.c
==============================================================================
--- python/branches/py3k-issue1717/Python/getcopyright.c	(original)
+++ python/branches/py3k-issue1717/Python/getcopyright.c	Sun Jan 25 21:08:20 2009
@@ -4,7 +4,7 @@
 
 static char cprt[] = 
 "\
-Copyright (c) 2001-2008 Python Software Foundation.\n\
+Copyright (c) 2001-2009 Python Software Foundation.\n\
 All Rights Reserved.\n\
 \n\
 Copyright (c) 2000 BeOpen.com.\n\

Deleted: python/branches/py3k-issue1717/Python/getmtime.c
==============================================================================
--- python/branches/py3k-issue1717/Python/getmtime.c	Sun Jan 25 21:08:20 2009
+++ (empty file)
@@ -1,26 +0,0 @@
-
-/* Subroutine to get the last modification time of a file */
-
-/* (A separate file because this may be OS dependent) */
-
-#include "Python.h"
-#include "pyconfig.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-time_t
-PyOS_GetLastModificationTime(char *path, FILE *fp)
-{
-	struct stat st;
-	if (fstat(fileno(fp), &st) != 0)
-		return -1;
-	else
-		return st.st_mtime;
-}
-
-#ifdef __cplusplus
-}
-#endif
-

Modified: python/branches/py3k-issue1717/Python/graminit.c
==============================================================================
--- python/branches/py3k-issue1717/Python/graminit.c	(original)
+++ python/branches/py3k-issue1717/Python/graminit.c	Sun Jan 25 21:08:20 2009
@@ -2,6 +2,7 @@
 
 #include "pgenheaders.h"
 #include "grammar.h"
+PyAPI_DATA(grammar) _PyParser_Grammar;
 static arc arcs_0_0[3] = {
 	{2, 1},
 	{3, 1},

Modified: python/branches/py3k-issue1717/Python/import.c
==============================================================================
--- python/branches/py3k-issue1717/Python/import.c	(original)
+++ python/branches/py3k-issue1717/Python/import.c	Sun Jan 25 21:08:20 2009
@@ -27,8 +27,6 @@
 typedef unsigned short mode_t;
 #endif
 
-extern time_t PyOS_GetLastModificationTime(char *, FILE *);
-						/* In getmtime.c */
 
 /* Magic word to reject .pyc files generated by other Python versions.
    It should change for each incompatible change to the bytecode.
@@ -961,6 +959,49 @@
 		PySys_WriteStderr("# wrote %s\n", cpathname);
 }
 
+static void
+update_code_filenames(PyCodeObject *co, PyObject *oldname, PyObject *newname)
+{
+	PyObject *constants, *tmp;
+	Py_ssize_t i, n;
+
+	if (PyUnicode_Compare(co->co_filename, oldname))
+		return;
+
+	tmp = co->co_filename;
+	co->co_filename = newname;
+	Py_INCREF(co->co_filename);
+	Py_DECREF(tmp);
+
+	constants = co->co_consts;
+	n = PyTuple_GET_SIZE(constants);
+	for (i = 0; i < n; i++) {
+		tmp = PyTuple_GET_ITEM(constants, i);
+		if (PyCode_Check(tmp))
+			update_code_filenames((PyCodeObject *)tmp,
+					      oldname, newname);
+	}
+}
+
+static int
+update_compiled_module(PyCodeObject *co, char *pathname)
+{
+	PyObject *oldname, *newname;
+
+	if (!PyUnicode_CompareWithASCIIString(co->co_filename, pathname))
+		return 0;
+
+	newname = PyUnicode_FromString(pathname);
+	if (newname == NULL)
+		return -1;
+
+	oldname = co->co_filename;
+	Py_INCREF(oldname);
+	update_code_filenames(co, oldname, newname);
+	Py_DECREF(oldname);
+	Py_DECREF(newname);
+	return 1;
+}
 
 /* Load a source module from a given file and return its module
    object WITH INCREMENTED REFERENCE COUNT.  If there's a matching
@@ -1001,6 +1042,8 @@
 		fclose(fpc);
 		if (co == NULL)
 			return NULL;
+		if (update_compiled_module(co, pathname) < 0)
+			return NULL;
 		if (Py_VerboseFlag)
 			PySys_WriteStderr("import %s # precompiled from %s\n",
 				name, cpathname);
@@ -3190,24 +3233,11 @@
 		PyErr_SetString(PyExc_ImportError, "empty pathname");
 		return -1;
 	} else {
+#ifndef MS_WINDOWS
 		struct stat statbuf;
 		int rv;
 
 		rv = stat(path, &statbuf);
-#ifdef MS_WINDOWS
-		/* MS Windows stat() chokes on paths like C:\path\. Try to
-		 * recover *one* time by stripping off a trailing slash or
-		 * backslash. http://bugs.python.org/issue1293
-		 */
-		if (rv != 0 && pathlen <= MAXPATHLEN &&
-		    (path[pathlen-1] == '/' || path[pathlen-1] == '\\')) {
-			char mangled[MAXPATHLEN+1];
-
-			strcpy(mangled, path);
-			mangled[pathlen-1] = '\0';
-			rv = stat(mangled, &statbuf);
-		}
-#endif
 		PyMem_Free(path);
 		if (rv == 0) {
 			/* it exists */
@@ -3218,6 +3248,24 @@
 				return -1;
 			}
 		}
+#else /* MS_WINDOWS */
+		DWORD rv;
+		/* see issue1293 and issue3677:
+		 * stat() on Windows doesn't recognise paths like
+		 * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs.
+		 */
+		rv = GetFileAttributesA(path);
+		PyMem_Free(path);
+		if (rv != INVALID_FILE_ATTRIBUTES) {
+			/* it exists */
+			if (rv & FILE_ATTRIBUTE_DIRECTORY) {
+				/* it's a directory */
+				PyErr_SetString(PyExc_ImportError,
+						"existing directory");
+				return -1;
+			}
+		}
+#endif
 	}
 	return 0;
 }

Modified: python/branches/py3k-issue1717/Python/pythonrun.c
==============================================================================
--- python/branches/py3k-issue1717/Python/pythonrun.c	(original)
+++ python/branches/py3k-issue1717/Python/pythonrun.c	Sun Jan 25 21:08:20 2009
@@ -23,6 +23,10 @@
 #include <signal.h>
 #endif
 
+#ifdef MS_WINDOWS
+#include "malloc.h" /* for alloca */
+#endif
+
 #ifdef HAVE_LANGINFO_H
 #include <locale.h>
 #include <langinfo.h>
@@ -84,6 +88,7 @@
 int Py_FrozenFlag; /* Needed by getpath.c */
 int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
 int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
+int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */
 
 /* PyModule_GetWarningsModule is no longer necessary as of 2.6
 since _warnings is builtin.  This API should not be used. */
@@ -724,6 +729,83 @@
 	}
 }
 
+static PyObject*
+create_stdio(PyObject* io,
+	int fd, int write_mode, char* name,
+	char* encoding, char* errors)
+{
+	PyObject *buf = NULL, *stream = NULL, *text = NULL, *raw = NULL, *res;
+	const char* mode;
+	PyObject *line_buffering;
+	int buffering, isatty;
+
+	if (Py_UnbufferedStdioFlag)
+		buffering = 0;
+	else
+		buffering = -1;
+	if (write_mode)
+		mode = "wb";
+	else
+		mode = "rb";
+	buf = PyObject_CallMethod(io, "open", "isiOOOi",
+				  fd, mode, buffering,
+				  Py_None, Py_None, Py_None, 0);
+	if (buf == NULL)
+		goto error;
+
+	if (!Py_UnbufferedStdioFlag) {
+		raw = PyObject_GetAttrString(buf, "raw");
+		if (raw == NULL)
+			goto error;
+	}
+	else {
+		raw = buf;
+		Py_INCREF(raw);
+	}
+
+	text = PyUnicode_FromString(name);
+	if (text == NULL || PyObject_SetAttrString(raw, "_name", text) < 0)
+		goto error;
+	res = PyObject_CallMethod(raw, "isatty", "");
+	if (res == NULL)
+		goto error;
+	isatty = PyObject_IsTrue(res);
+	Py_DECREF(res);
+	if (isatty == -1)
+		goto error;
+	if (isatty || Py_UnbufferedStdioFlag)
+		line_buffering = Py_True;
+	else
+		line_buffering = Py_False;
+
+	Py_CLEAR(raw);
+	Py_CLEAR(text);
+
+	stream = PyObject_CallMethod(io, "TextIOWrapper", "OsssO",
+				     buf, encoding, errors,
+				     "\n", line_buffering);
+	Py_CLEAR(buf);
+	if (stream == NULL)
+		goto error;
+
+	if (write_mode)
+		mode = "w";
+	else
+		mode = "r";
+	text = PyUnicode_FromString(mode);
+	if (!text || PyObject_SetAttrString(stream, "mode", text) < 0)
+		goto error;
+	Py_CLEAR(text);
+	return stream;
+
+error:
+	Py_XDECREF(buf);
+	Py_XDECREF(stream);
+	Py_XDECREF(text);
+	Py_XDECREF(raw);
+	return NULL;
+}
+
 /* Initialize sys.stdin, stdout, stderr and builtins.open */
 static int
 initstdio(void)
@@ -790,10 +872,9 @@
 #endif
 	}
 	else {
-		if (!(std = PyFile_FromFd(fd, "<stdin>", "r", -1, encoding, 
-					  errors, "\n", 0))) {
+		std = create_stdio(iomod, fd, 0, "<stdin>", encoding, errors);
+		if (std == NULL)
 			goto error;
-		}
 	} /* if (fd < 0) */
 	PySys_SetObject("__stdin__", std);
 	PySys_SetObject("stdin", std);
@@ -810,10 +891,9 @@
 #endif
 	}
 	else {
-		if (!(std = PyFile_FromFd(fd, "<stdout>", "w", -1, encoding, 
-					  errors, "\n", 0))) {
+		std = create_stdio(iomod, fd, 1, "<stdout>", encoding, errors);
+		if (std == NULL)
 			goto error;
-		}
 	} /* if (fd < 0) */
 	PySys_SetObject("__stdout__", std);
 	PySys_SetObject("stdout", std);
@@ -831,10 +911,9 @@
 #endif
 	}
 	else {
-		if (!(std = PyFile_FromFd(fd, "<stderr>", "w", -1, encoding,
-					  "backslashreplace", "\n", 0))) {
+		std = create_stdio(iomod, fd, 1, "<stderr>", encoding, "backslashreplace");
+		if (std == NULL)
 			goto error;
-		}
 	} /* if (fd < 0) */
 
 	/* Same as hack above, pre-import stderr's codec to avoid recursion
@@ -1918,9 +1997,21 @@
 		PyErr_Print();
 	}
 #ifdef MS_WINDOWS
-	OutputDebugString("Fatal Python error: ");
-	OutputDebugString(msg);
-	OutputDebugString("\n");
+	{
+		size_t len = strlen(msg);
+		WCHAR* buffer;
+		size_t i;
+
+		/* Convert the message to wchar_t. This uses a simple one-to-one
+		conversion, assuming that the this error message actually uses ASCII
+		only. If this ceases to be true, we will have to convert. */
+		buffer = alloca( (len+1) * (sizeof *buffer));
+		for( i=0; i<=len; ++i)
+			buffer[i] = msg[i];
+		OutputDebugStringW(L"Fatal Python error: ");
+		OutputDebugStringW(buffer);
+		OutputDebugStringW(L"\n");
+	}
 #ifdef _DEBUG
 	DebugBreak();
 #endif

Modified: python/branches/py3k-issue1717/Python/sysmodule.c
==============================================================================
--- python/branches/py3k-issue1717/Python/sysmodule.c	(original)
+++ python/branches/py3k-issue1717/Python/sysmodule.c	Sun Jan 25 21:08:20 2009
@@ -1257,8 +1257,13 @@
 		PyDict_SetItemString(sysdict, key, v);	\
 	Py_XDECREF(v)
 
+	/* Check that stdin is not a directory
+	Using shell redirection, you can redirect stdin to a directory,
+	crashing the Python interpreter. Catch this common mistake here
+	and output a useful error message. Note that under MS Windows,
+	the shell already prevents that. */
+#if !defined(MS_WINDOWS)
 	{
-		/* XXX: does this work on Win/Win64? (see posix_fstat) */
 		struct stat sb;
 		if (fstat(fileno(stdin), &sb) == 0 &&
 		    S_ISDIR(sb.st_mode)) {
@@ -1268,6 +1273,7 @@
 			exit(EXIT_FAILURE);
 		}
 	}
+#endif
 
         /* stdin/stdout/stderr are now set by pythonrun.c */
 
@@ -1483,7 +1489,7 @@
 {
 #if defined(HAVE_REALPATH)
 	wchar_t fullpath[MAXPATHLEN];
-#elif defined(MS_WINDOWS)
+#elif defined(MS_WINDOWS) && !defined(MS_WINCE)
 	wchar_t fullpath[MAX_PATH];
 #endif
 	PyObject *av = makeargvobject(argc, argv);
@@ -1529,7 +1535,10 @@
 #if SEP == '\\' /* Special case for MS filename syntax */
 		if (argc > 0 && argv0 != NULL && wcscmp(argv0, L"-c") != 0) {
 			wchar_t *q;
-#ifdef MS_WINDOWS
+#if defined(MS_WINDOWS) && !defined(MS_WINCE)
+			/* This code here replaces the first element in argv with the full
+			path that it represents. Under CE, there are no relative paths so
+			the argument must be the full path anyway. */
 			wchar_t *ptemp;
 			if (GetFullPathNameW(argv0,
 					   sizeof(fullpath)/sizeof(fullpath[0]),

Modified: python/branches/py3k-issue1717/Python/thread.c
==============================================================================
--- python/branches/py3k-issue1717/Python/thread.c	(original)
+++ python/branches/py3k-issue1717/Python/thread.c	Sun Jan 25 21:08:20 2009
@@ -133,10 +133,6 @@
 #include "thread_os2.h"
 #endif
 
-#ifdef WINCE_THREADS
-#include "thread_wince.h"
-#endif
-
 #ifdef PLAN9_THREADS
 #include "thread_plan9.h"
 #endif

Modified: python/branches/py3k-issue1717/Python/thread_nt.h
==============================================================================
--- python/branches/py3k-issue1717/Python/thread_nt.h	(original)
+++ python/branches/py3k-issue1717/Python/thread_nt.h	Sun Jan 25 21:08:20 2009
@@ -104,20 +104,21 @@
 typedef struct {
 	void (*func)(void*);
 	void *arg;
-	long id;
-	HANDLE done;
 } callobj;
 
-static int
+/* thunker to call adapt between the function type used by the system's
+thread start function and the internally used one. */
+#if defined(MS_WINCE)
+static DWORD WINAPI
+#else
+static unsigned __stdcall
+#endif
 bootstrap(void *call)
 {
 	callobj *obj = (callobj*)call;
-	/* copy callobj since other thread might free it before we're done */
 	void (*func)(void*) = obj->func;
 	void *arg = obj->arg;
-
-	obj->id = PyThread_get_thread_ident();
-	ReleaseSemaphore(obj->done, 1, NULL);
+	HeapFree(GetProcessHeap(), 0, obj);
 	func(arg);
 	return 0;
 }
@@ -125,42 +126,55 @@
 long
 PyThread_start_new_thread(void (*func)(void *), void *arg)
 {
-	Py_uintptr_t rv;
-	callobj obj;
-
+	HANDLE hThread;
+	unsigned threadID;
+	callobj *obj;
+	
 	dprintf(("%ld: PyThread_start_new_thread called\n",
 		 PyThread_get_thread_ident()));
 	if (!initialized)
 		PyThread_init_thread();
 
-	obj.id = -1;	/* guilty until proved innocent */
-	obj.func = func;
-	obj.arg = arg;
-	obj.done = CreateSemaphore(NULL, 0, 1, NULL);
-	if (obj.done == NULL)
+	obj = (callobj*)HeapAlloc(GetProcessHeap(), 0, sizeof(*obj));
+	if (!obj)
 		return -1;
-
-	rv = _beginthread(bootstrap,
+	obj->func = func;
+	obj->arg = arg;
+#if defined(MS_WINCE)
+	hThread = CreateThread(NULL,
+	                       Py_SAFE_DOWNCAST(_pythread_stacksize, Py_ssize_t, SIZE_T),
+	                       bootstrap, obj, 0, &threadID);
+#else
+	hThread = (HANDLE)_beginthreadex(0,
 			  Py_SAFE_DOWNCAST(_pythread_stacksize,
-					   Py_ssize_t, int),
-			  &obj);
-	if (rv == (Py_uintptr_t)-1) {
+					   Py_ssize_t, unsigned int),
+			  bootstrap, obj,
+			  0, &threadID);
+#endif
+	if (hThread == 0) {
+#if defined(MS_WINCE)
+		/* Save error in variable, to prevent PyThread_get_thread_ident
+		   from clobbering it. */
+		unsigned e = GetLastError();
+		dprintf(("%ld: PyThread_start_new_thread failed, win32 error code %u\n",
+		         PyThread_get_thread_ident(), e));
+#else
 		/* I've seen errno == EAGAIN here, which means "there are
 		 * too many threads".
 		 */
-		dprintf(("%ld: PyThread_start_new_thread failed: %p errno %d\n",
-		         PyThread_get_thread_ident(), (void*)rv, errno));
-		obj.id = -1;
+		int e = errno;
+		dprintf(("%ld: PyThread_start_new_thread failed, errno %d\n",
+		         PyThread_get_thread_ident(), e));
+#endif
+		threadID = (unsigned)-1;
+		HeapFree(GetProcessHeap(), 0, obj);
 	}
 	else {
 		dprintf(("%ld: PyThread_start_new_thread succeeded: %p\n",
-		         PyThread_get_thread_ident(), (void*)rv));
-		/* wait for thread to initialize, so we can get its id */
-		WaitForSingleObject(obj.done, INFINITE);
-		assert(obj.id != -1);
+		         PyThread_get_thread_ident(), (void*)hThread));
+		CloseHandle(hThread);
 	}
-	CloseHandle((HANDLE)obj.done);
-	return obj.id;
+	return (long) threadID;
 }
 
 /*
@@ -176,52 +190,26 @@
 	return GetCurrentThreadId();
 }
 
-static void
-do_PyThread_exit_thread(int no_cleanup)
-{
-	dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
-	if (!initialized)
-		if (no_cleanup)
-			_exit(0);
-		else
-			exit(0);
-	_endthread();
-}
-
 void
 PyThread_exit_thread(void)
 {
-	do_PyThread_exit_thread(0);
-}
-
-void
-PyThread__exit_thread(void)
-{
-	do_PyThread_exit_thread(1);
-}
-
-#ifndef NO_EXIT_PROG
-static void
-do_PyThread_exit_prog(int status, int no_cleanup)
-{
-	dprintf(("PyThread_exit_prog(%d) called\n", status));
+	dprintf(("%ld: PyThread_exit_thread called\n", PyThread_get_thread_ident()));
 	if (!initialized)
-		if (no_cleanup)
-			_exit(status);
-		else
-			exit(status);
+		exit(0);
+#if defined(MS_WINCE)
+	ExitThread(0);
+#else
+	_endthreadex(0);
+#endif
 }
 
+#ifndef NO_EXIT_PROG
 void
 PyThread_exit_prog(int status)
 {
-	do_PyThread_exit_prog(status, 0);
-}
-
-void
-PyThread__exit_prog(int status)
-{
-	do_PyThread_exit_prog(status, 1);
+	dprintf(("PyThread_exit_prog(%d) called\n", status));
+	if (!initialized)
+		exit(status);
 }
 #endif /* NO_EXIT_PROG */
 
@@ -309,3 +297,73 @@
 }
 
 #define THREAD_SET_STACKSIZE(x)	_pythread_nt_set_stacksize(x)
+
+
+/* use native Windows TLS functions */
+#define Py_HAVE_NATIVE_TLS
+
+#ifdef Py_HAVE_NATIVE_TLS
+int
+PyThread_create_key(void)
+{
+	return (int) TlsAlloc();
+}
+
+void
+PyThread_delete_key(int key)
+{
+	TlsFree(key);
+}
+
+/* We must be careful to emulate the strange semantics implemented in thread.c,
+ * where the value is only set if it hasn't been set before.
+ */
+int
+PyThread_set_key_value(int key, void *value)
+{
+	BOOL ok;
+	void *oldvalue;
+
+	assert(value != NULL);
+	oldvalue = TlsGetValue(key);
+	if (oldvalue != NULL)
+		/* ignore value if already set */
+		return 0;
+	ok = TlsSetValue(key, value);
+	if (!ok)
+		return -1;
+	return 0;
+}
+
+void *
+PyThread_get_key_value(int key)
+{
+	/* because TLS is used in the Py_END_ALLOW_THREAD macro,
+	 * it is necessary to preserve the windows error state, because
+	 * it is assumed to be preserved across the call to the macro.
+	 * Ideally, the macro should be fixed, but it is simpler to
+	 * do it here.
+	 */
+	DWORD error = GetLastError();
+	void *result = TlsGetValue(key);
+	SetLastError(error);
+	return result;
+}
+
+void
+PyThread_delete_key_value(int key)
+{
+	/* NULL is used as "key missing", and it is also the default
+	 * given by TlsGetValue() if nothing has been set yet.
+	 */
+	TlsSetValue(key, NULL);
+}
+
+/* reinitialization of TLS is not necessary after fork when using
+ * the native TLS functions.  And forking isn't supported on Windows either.
+ */
+void
+PyThread_ReInitTLS(void)
+{}
+
+#endif

Modified: python/branches/py3k-issue1717/README
==============================================================================
--- python/branches/py3k-issue1717/README	(original)
+++ python/branches/py3k-issue1717/README	Sun Jan 25 21:08:20 2009
@@ -2,7 +2,7 @@
 ==================================
 
 For notes specific to this release, see RELNOTES in this directory.
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 Python Software Foundation.
 All rights reserved.
 

Modified: python/branches/py3k-issue1717/Tools/scripts/patchcheck.py
==============================================================================
--- python/branches/py3k-issue1717/Tools/scripts/patchcheck.py	(original)
+++ python/branches/py3k-issue1717/Tools/scripts/patchcheck.py	Sun Jan 25 21:08:20 2009
@@ -62,12 +62,12 @@
 @status("Misc/ACKS updated", modal=True)
 def credit_given(file_paths):
     """Check if Misc/ACKS has been changed."""
-    return True if 'Misc/ACKS' in file_paths else False
+    return 'Misc/ACKS' in file_paths
 
 @status("Misc/NEWS updated", modal=True)
 def reported_news(file_paths):
     """Check if Misc/NEWS has been changed."""
-    return True if 'Misc/NEWS' in file_paths else False
+    return 'Misc/NEWS' in file_paths
 
 
 def main():

Modified: python/branches/py3k-issue1717/configure
==============================================================================
--- python/branches/py3k-issue1717/configure	(original)
+++ python/branches/py3k-issue1717/configure	Sun Jan 25 21:08:20 2009
@@ -1,12 +1,12 @@
 #! /bin/sh
-# From configure.in Revision: 67461 .
+# From configure.in Revision: 68440 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for python 3.1.
+# Generated by GNU Autoconf 2.63 for python 3.1.
 #
 # Report bugs to <http://www.python.org/python-bugs>.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -18,7 +18,7 @@
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -40,17 +40,45 @@
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
   else
-    PATH_SEPARATOR=:
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
   fi
-  rm -f conf$$.sh
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 # Support unset when possible.
@@ -66,8 +94,6 @@
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
@@ -90,7 +116,7 @@
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   { (exit 1); exit 1; }
 fi
 
@@ -103,17 +129,10 @@
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-  fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
 
 # Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
@@ -135,7 +154,7 @@
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
@@ -161,7 +180,7 @@
   as_have_required=no
 fi
 
-  if test $as_have_required = yes && 	 (eval ":
+  if test $as_have_required = yes &&	 (eval ":
 (as_func_return () {
   (exit \$1)
 }
@@ -243,7 +262,7 @@
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -264,7 +283,7 @@
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -344,10 +363,10 @@
 
       if test "x$CONFIG_SHELL" != x; then
   for as_var in BASH_ENV ENV
-        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-        done
-        export CONFIG_SHELL
-        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
 fi
 
 
@@ -416,9 +435,10 @@
 
 test \$exitcode = 0") || {
   echo No shell found that supports shell functions.
-  echo Please tell autoconf at gnu.org about your system,
-  echo including any error possibly output before this
-  echo message
+  echo Please tell bug-autoconf at gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
 }
 
 
@@ -454,7 +474,7 @@
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
@@ -482,7 +502,6 @@
 *)
   ECHO_N='-n';;
 esac
-
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -495,19 +514,22 @@
   rm -f conf$$.dir/conf$$.file
 else
   rm -f conf$$.dir
-  mkdir conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s='ln -s'
-  # ... but there are two gotchas:
-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-  # In both cases, we have to default to `cp -p'.
-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
@@ -532,10 +554,10 @@
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
 	case $1 in
-        -*)set "./$1";;
+	-*)set "./$1";;
 	esac;
 	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
 	???[sx]*):;;*)false;;esac;fi
@@ -616,123 +638,153 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-VERSION
-SOVERSION
-CONFIG_ARGS
-UNIVERSALSDK
-ARCH_RUN_32BIT
-PYTHONFRAMEWORK
-PYTHONFRAMEWORKIDENTIFIER
-PYTHONFRAMEWORKDIR
-PYTHONFRAMEWORKPREFIX
-PYTHONFRAMEWORKINSTALLDIR
-FRAMEWORKINSTALLFIRST
-FRAMEWORKINSTALLLAST
-FRAMEWORKALTINSTALLFIRST
-FRAMEWORKALTINSTALLLAST
-FRAMEWORKUNIXTOOLSPREFIX
-MACHDEP
-SGI_ABI
-CONFIGURE_MACOSX_DEPLOYMENT_TARGET
-EXPORT_MACOSX_DEPLOYMENT_TARGET
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CXX
-MAINCC
-CPP
-GREP
-EGREP
-BUILDEXEEXT
-LIBRARY
-LDLIBRARY
-DLLLIBRARY
-BLDLIBRARY
-LDLIBRARYDIR
-INSTSONAME
-RUNSHARED
-LINKCC
-RANLIB
-AR
-SVNVERSION
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-LN
-OPT
-BASECFLAGS
-UNIVERSAL_ARCH_FLAGS
-OTHER_LIBTOOL_OPT
-LIBTOOL_CRUFT
-SO
-LDSHARED
-BLDSHARED
-CCSHARED
-LINKFORSHARED
-CFLAGSFORSHARED
-SHLIBS
-USE_SIGNAL_MODULE
-SIGNAL_OBJS
-USE_THREAD_MODULE
-LDLAST
-THREADOBJ
-DLINCLDIR
-DYNLOADFILE
-MACHDEP_OBJS
-TRUE
-LIBOBJS
-HAVE_GETHOSTBYNAME_R_6_ARG
-HAVE_GETHOSTBYNAME_R_5_ARG
-HAVE_GETHOSTBYNAME_R_3_ARG
-HAVE_GETHOSTBYNAME_R
-HAVE_GETHOSTBYNAME
-LIBM
-LIBC
-THREADHEADERS
+ac_subst_vars='LTLIBOBJS
 SRCDIRS
-LTLIBOBJS'
+THREADHEADERS
+LIBC
+LIBM
+HAVE_GETHOSTBYNAME
+HAVE_GETHOSTBYNAME_R
+HAVE_GETHOSTBYNAME_R_3_ARG
+HAVE_GETHOSTBYNAME_R_5_ARG
+HAVE_GETHOSTBYNAME_R_6_ARG
+LIBOBJS
+TRUE
+MACHDEP_OBJS
+DYNLOADFILE
+DLINCLDIR
+THREADOBJ
+LDLAST
+USE_THREAD_MODULE
+SIGNAL_OBJS
+USE_SIGNAL_MODULE
+SHLIBS
+CFLAGSFORSHARED
+LINKFORSHARED
+CCSHARED
+BLDSHARED
+LDSHARED
+SO
+LIBTOOL_CRUFT
+OTHER_LIBTOOL_OPT
+UNIVERSAL_ARCH_FLAGS
+BASECFLAGS
+OPT
+LN
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+SVNVERSION
+AR
+RANLIB
+LINKCC
+RUNSHARED
+INSTSONAME
+LDLIBRARYDIR
+BLDLIBRARY
+DLLLIBRARY
+LDLIBRARY
+LIBRARY
+BUILDEXEEXT
+EGREP
+GREP
+CPP
+MAINCC
+CXX
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+EXPORT_MACOSX_DEPLOYMENT_TARGET
+CONFIGURE_MACOSX_DEPLOYMENT_TARGET
+SGI_ABI
+MACHDEP
+FRAMEWORKUNIXTOOLSPREFIX
+FRAMEWORKALTINSTALLLAST
+FRAMEWORKALTINSTALLFIRST
+FRAMEWORKINSTALLLAST
+FRAMEWORKINSTALLFIRST
+PYTHONFRAMEWORKINSTALLDIR
+PYTHONFRAMEWORKPREFIX
+PYTHONFRAMEWORKDIR
+PYTHONFRAMEWORKIDENTIFIER
+PYTHONFRAMEWORK
+ARCH_RUN_32BIT
+UNIVERSALSDK
+CONFIG_ARGS
+SOVERSION
+VERSION
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_universalsdk
+with_universal_archs
+with_framework_name
+enable_framework
+with_gcc
+with_cxx_main
+with_suffix
+enable_shared
+enable_profiling
+with_pydebug
+with_libs
+with_system_ffi
+with_signal_module
+with_dec_threads
+with_threads
+with_thread
+with_pth
+enable_ipv6
+with_doc_strings
+with_tsc
+with_pymalloc
+with_wctype_functions
+with_fpectl
+with_libm
+with_libc
+with_wide_unicode
+with_computed_gotos
+'
       ac_precious_vars='build_alias
 host_alias
 target_alias
@@ -747,6 +799,8 @@
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
@@ -845,13 +899,21 @@
     datarootdir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=no ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
 
   -docdir | --docdir | --docdi | --doc | --do)
     ac_prev=docdir ;;
@@ -864,13 +926,21 @@
     dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=\$ac_optarg ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1061,22 +1131,38 @@
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=\$ac_optarg ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=no ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -1096,7 +1182,7 @@
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; }
     ;;
@@ -1105,16 +1191,16 @@
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
@@ -1123,22 +1209,38 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute directory names.
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
 		libdir localedir mandir
 do
   eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
   case $ac_val in
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
    { (exit 1); exit 1; }; }
 done
 
@@ -1153,7 +1255,7 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
     If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
@@ -1169,10 +1271,10 @@
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { echo "$as_me: error: Working directory cannot be determined" >&2
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
    { (exit 1); exit 1; }; }
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { echo "$as_me: error: pwd does not report name of working directory" >&2
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
    { (exit 1); exit 1; }; }
 
 
@@ -1180,12 +1282,12 @@
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$0" : 'X\(//\)[^/]' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -1212,12 +1314,12 @@
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
 	pwd)`
 # When building in place, set srcdir=.
@@ -1266,9 +1368,9 @@
 
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-			  [$ac_default_prefix]
+                          [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-			  [PREFIX]
+                          [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -1278,25 +1380,25 @@
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR          info documentation [DATAROOTDIR/info]
-  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR           man documentation [DATAROOTDIR/man]
-  --docdir=DIR           documentation root [DATAROOTDIR/doc/python]
-  --htmldir=DIR          html documentation [DOCDIR]
-  --dvidir=DIR           dvi documentation [DOCDIR]
-  --pdfdir=DIR           pdf documentation [DOCDIR]
-  --psdir=DIR            ps documentation [DOCDIR]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/python]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -1310,6 +1412,7 @@
   cat <<\_ACEOF
 
 Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-universalsdk[=SDKDIR]
@@ -1353,6 +1456,8 @@
   --with-libm=STRING      math library
   --with-libc=STRING      C library
   --with-wide-unicode     Use 4-byte Unicode characters (default is 2 bytes)
+  --with-computed-gotos   Use computed gotos / threaded dispatch in evaluation
+                          loop (not available on all compilers)
 
 Some influential environment variables:
   CC          C compiler command
@@ -1375,15 +1480,17 @@
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" || continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
     ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1419,7 +1526,7 @@
       echo &&
       $SHELL "$ac_srcdir/configure" --help=recursive
     else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi || ac_status=$?
     cd "$ac_pwd" || { ac_status=$?; break; }
   done
@@ -1429,10 +1536,10 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 python configure 3.1
-generated by GNU Autoconf 2.61
+generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1443,7 +1550,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by python $as_me 3.1, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
 
@@ -1479,7 +1586,7 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
+  $as_echo "PATH: $as_dir"
 done
 IFS=$as_save_IFS
 
@@ -1514,7 +1621,7 @@
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
     *\'*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
     1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
@@ -1566,11 +1673,12 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
       *) $as_unset $ac_var ;;
       esac ;;
     esac
@@ -1600,9 +1708,9 @@
     do
       eval ac_val=\$$ac_var
       case $ac_val in
-      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
       esac
-      echo "$ac_var='\''$ac_val'\''"
+      $as_echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
@@ -1617,9 +1725,9 @@
       do
 	eval ac_val=\$$ac_var
 	case $ac_val in
-	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
 	esac
-	echo "$ac_var='\''$ac_val'\''"
+	$as_echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1635,8 +1743,8 @@
       echo
     fi
     test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
   } >&5
   rm -f core *.core core.conftest.* &&
     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -1678,21 +1786,24 @@
 
 
 # Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  set x "$CONFIG_SITE"
+  ac_site_file1=$CONFIG_SITE
 elif test "x$prefix" != xNONE; then
-  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
 else
-  set x "$ac_default_prefix/share/config.site" \
-	"$ac_default_prefix/etc/config.site"
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
 fi
-shift
-for ac_site_file
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
+  test "x$ac_site_file" = xNONE && continue
   if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
@@ -1702,16 +1813,16 @@
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
       *)                      . "./$cache_file";;
     esac
   fi
 else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
@@ -1725,29 +1836,38 @@
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-	ac_cache_corrupted=:
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1757,10 +1877,12 @@
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -1897,20 +2019,20 @@
 
 
 UNIVERSAL_ARCHS="32-bit"
-{ echo "$as_me:$LINENO: checking for --with-universal-archs" >&5
-echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-universal-archs" >&5
+$as_echo_n "checking for --with-universal-archs... " >&6; }
 
 # Check whether --with-universal-archs was given.
 if test "${with_universal_archs+set}" = set; then
   withval=$with_universal_archs;
-	{ echo "$as_me:$LINENO: result: $withval" >&5
-echo "${ECHO_T}$withval" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: $withval" >&5
+$as_echo "$withval" >&6; }
 	UNIVERSAL_ARCHS="$withval"
 
 else
 
- 	{ echo "$as_me:$LINENO: result: 32-bit" >&5
-echo "${ECHO_T}32-bit" >&6; }
+ 	{ $as_echo "$as_me:$LINENO: result: 32-bit" >&5
+$as_echo "32-bit" >&6; }
 
 fi
 
@@ -2030,8 +2152,8 @@
 ##
 # Set name for machine-dependent library files
 
-{ echo "$as_me:$LINENO: checking MACHDEP" >&5
-echo $ECHO_N "checking MACHDEP... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking MACHDEP" >&5
+$as_echo_n "checking MACHDEP... " >&6; }
 if test -z "$MACHDEP"
 then
 	ac_sys_system=`uname -s`
@@ -2194,8 +2316,8 @@
         LDFLAGS="$SGI_ABI $LDFLAGS"
         MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
 fi
-{ echo "$as_me:$LINENO: result: $MACHDEP" >&5
-echo "${ECHO_T}$MACHDEP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $MACHDEP" >&5
+$as_echo "$MACHDEP" >&6; }
 
 # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
 # it may influence the way we can build extensions, so distutils
@@ -2205,11 +2327,11 @@
 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
 EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
 
-{ echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5
-echo $ECHO_N "checking machine type as reported by uname -m... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5
+$as_echo_n "checking machine type as reported by uname -m... " >&6; }
 ac_sys_machine=`uname -m`
-{ echo "$as_me:$LINENO: result: $ac_sys_machine" >&5
-echo "${ECHO_T}$ac_sys_machine" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_sys_machine" >&5
+$as_echo "$ac_sys_machine" >&6; }
 
 # checks for alternative programs
 
@@ -2221,14 +2343,14 @@
 
 # XXX shouldn't some/most/all of this code be merged with the stuff later
 # on that fiddles with OPT and BASECFLAGS?
-{ echo "$as_me:$LINENO: checking for --without-gcc" >&5
-echo $ECHO_N "checking for --without-gcc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --without-gcc" >&5
+$as_echo_n "checking for --without-gcc... " >&6; }
 
 # Check whether --with-gcc was given.
 if test "${with_gcc+set}" = set; then
   withval=$with_gcc;
 	case $withval in
-	no)	CC=cc
+	no)	CC=${CC:-cc}
 		without_gcc=yes;;
 	yes)	CC=gcc
 		without_gcc=no;;
@@ -2247,15 +2369,15 @@
 	esac
 fi
 
-{ echo "$as_me:$LINENO: result: $without_gcc" >&5
-echo "${ECHO_T}$without_gcc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $without_gcc" >&5
+$as_echo "$without_gcc" >&6; }
 
 # If the user switches compilers, we can't believe the cache
 if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
 then
-  { { echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file
+  { { $as_echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file
 (it is also a good idea to do 'make clean' before compiling)" >&5
-echo "$as_me: error: cached CC is different -- throw away $cache_file
+$as_echo "$as_me: error: cached CC is different -- throw away $cache_file
 (it is also a good idea to do 'make clean' before compiling)" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -2268,10 +2390,10 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2284,7 +2406,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2295,11 +2417,11 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2308,10 +2430,10 @@
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2324,7 +2446,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2335,11 +2457,11 @@
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_CC" = x; then
@@ -2347,12 +2469,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -2365,10 +2483,10 @@
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2381,7 +2499,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2392,11 +2510,11 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2405,10 +2523,10 @@
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2426,7 +2544,7 @@
        continue
      fi
     ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2449,11 +2567,11 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2464,10 +2582,10 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2480,7 +2598,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2491,11 +2609,11 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2508,10 +2626,10 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2524,7 +2642,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2535,11 +2653,11 @@
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2551,12 +2669,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -2566,44 +2680,50 @@
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
 { (ac_try="$ac_compiler --version >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -v >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -V >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
@@ -2622,27 +2742,22 @@
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort.  b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions.  Remove them first so a
-# subsequent execution test works.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
 ac_rmfiles=
 for ac_file in $ac_files
 do
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
   esac
 done
@@ -2653,10 +2768,11 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
@@ -2667,7 +2783,7 @@
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
 	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
@@ -2694,25 +2810,27 @@
   ac_file=''
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 if test -z "$ac_file"; then
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
 See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
+$as_echo "$as_me: error: C compiler cannot create executables
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
 
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
@@ -2721,49 +2839,53 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
+$as_echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
     fi
   fi
 fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
 
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
@@ -2772,31 +2894,33 @@
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	  break;;
     * ) break;;
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
 if test "${ac_cv_objext+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2819,40 +2943,43 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   for ac_file in conftest.o conftest.obj conftest.*; do
   test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2878,20 +3005,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_compiler_gnu=no
@@ -2901,15 +3029,19 @@
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
@@ -2936,20 +3068,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	CFLAGS=""
@@ -2974,20 +3107,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_c_werror_flag=$ac_save_c_werror_flag
@@ -3013,20 +3147,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -3041,8 +3176,8 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -3058,10 +3193,10 @@
     CFLAGS=
   fi
 fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
 if test "${ac_cv_prog_cc_c89+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
@@ -3132,20 +3267,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_c89=$ac_arg
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -3161,15 +3297,15 @@
 # AC_CACHE_VAL
 case "x$ac_cv_prog_cc_c89" in
   x)
-    { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
   xno)
-    { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
     CC="$CC $ac_cv_prog_cc_c89"
-    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
 
 
@@ -3182,8 +3318,8 @@
 
 
 
-{ echo "$as_me:$LINENO: checking for --with-cxx-main=<compiler>" >&5
-echo $ECHO_N "checking for --with-cxx-main=<compiler>... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-cxx-main=<compiler>" >&5
+$as_echo_n "checking for --with-cxx-main=<compiler>... " >&6; }
 
 # Check whether --with-cxx_main was given.
 if test "${with_cxx_main+set}" = set; then
@@ -3208,8 +3344,8 @@
 
 fi
 
-{ echo "$as_me:$LINENO: result: $with_cxx_main" >&5
-echo "${ECHO_T}$with_cxx_main" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $with_cxx_main" >&5
+$as_echo "$with_cxx_main" >&6; }
 
 preset_cxx="$CXX"
 if test -z "$CXX"
@@ -3217,10 +3353,10 @@
         case "$CC" in
         gcc)    # Extract the first word of "g++", so it can be a program name with args.
 set dummy g++; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case $CXX in
   [\\/]* | ?:[\\/]*)
@@ -3235,7 +3371,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3248,20 +3384,20 @@
 fi
 CXX=$ac_cv_path_CXX
 if test -n "$CXX"; then
-  { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
  ;;
         cc)     # Extract the first word of "c++", so it can be a program name with args.
 set dummy c++; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case $CXX in
   [\\/]* | ?:[\\/]*)
@@ -3276,7 +3412,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3289,11 +3425,11 @@
 fi
 CXX=$ac_cv_path_CXX
 if test -n "$CXX"; then
-  { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
  ;;
@@ -3309,10 +3445,10 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
   ac_cv_prog_CXX="$CXX" # Let the user override the test.
@@ -3325,7 +3461,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CXX="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3336,11 +3472,11 @@
 fi
 CXX=$ac_cv_prog_CXX
 if test -n "$CXX"; then
-  { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3355,12 +3491,12 @@
 fi
 if test "$preset_cxx" != "$CXX"
 then
-        { echo "$as_me:$LINENO: WARNING:
+        { $as_echo "$as_me:$LINENO: WARNING:
 
   By default, distutils will build C++ extension modules with \"$CXX\".
   If this is not intended, then set CXX on the configure command line.
   " >&5
-echo "$as_me: WARNING:
+$as_echo "$as_me: WARNING:
 
   By default, distutils will build C++ extension modules with \"$CXX\".
   If this is not intended, then set CXX on the configure command line.
@@ -3375,15 +3511,15 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
   if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -3415,20 +3551,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Broken: fails on valid input.
@@ -3452,13 +3589,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -3466,7 +3604,7 @@
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Passes both tests.
@@ -3491,8 +3629,8 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -3520,20 +3658,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Broken: fails on valid input.
@@ -3557,13 +3696,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -3571,7 +3711,7 @@
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Passes both tests.
@@ -3587,11 +3727,13 @@
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 ac_ext=c
@@ -3601,42 +3743,37 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
 if test "${ac_cv_path_GREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
+  if test -z "$GREP"; then
   ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_prog in grep ggrep; do
-  for ac_exec_ext in '' $ac_executable_extensions; do
-    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
-    # Check for GNU ac_path_GREP and select it if it is found.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
 *)
   ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  $as_echo_n 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    echo 'GREP' >> "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     ac_count=`expr $ac_count + 1`
@@ -3651,74 +3788,60 @@
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_GREP_found && break 3
+      $ac_path_GREP_found && break 3
+    done
   done
 done
-
-done
 IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
    { (exit 1); exit 1; }; }
-fi
-
+  fi
 else
   ac_cv_path_GREP=$GREP
 fi
 
-
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
 
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
 if test "${ac_cv_path_EGREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
    then ac_cv_path_EGREP="$GREP -E"
    else
-     # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+     if test -z "$EGREP"; then
   ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_prog in egrep; do
-  for ac_exec_ext in '' $ac_executable_extensions; do
-    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
-    # Check for GNU ac_path_EGREP and select it if it is found.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
 *)
   ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  $as_echo_n 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    echo 'EGREP' >> "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     ac_count=`expr $ac_count + 1`
@@ -3733,158 +3856,605 @@
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_EGREP_found && break 3
+      $ac_path_EGREP_found && break 3
+    done
   done
 done
-
-done
 IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
    { (exit 1); exit 1; }; }
-fi
-
+  fi
 else
   ac_cv_path_EGREP=$EGREP
 fi
 
-
    fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-{ echo "$as_me:$LINENO: checking for AIX" >&5
-echo $ECHO_N "checking for AIX... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+	ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef _AIX
-  yes
-#endif
+#include <string.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-cat >>confdefs.h <<\_ACEOF
-#define _ALL_SOURCE 1
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  ac_cv_header_stdc=no
 fi
 rm -f conftest*
 
+fi
 
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 
-# Check for unsupported systems
-case $ac_sys_system/$ac_sys_release in
-atheos*|Linux*/1*)
-   echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
-   echo See README for details.
-   exit 1;;
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 
-{ echo "$as_me:$LINENO: checking for --with-suffix" >&5
-echo $ECHO_N "checking for --with-suffix... $ECHO_C" >&6; }
 
-# Check whether --with-suffix was given.
-if test "${with_suffix+set}" = set; then
-  withval=$with_suffix;
-	case $withval in
-	no)	EXEEXT=;;
-	yes)	EXEEXT=.exe;;
-	*)	EXEEXT=$withval;;
-	esac
 fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
 
-{ echo "$as_me:$LINENO: result: $EXEEXT" >&5
-echo "${ECHO_T}$EXEEXT" >&6; }
-
-# Test whether we're running on a non-case-sensitive system, in which
-# case we give a warning if no ext is given
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
 
-{ echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5
-echo $ECHO_N "checking for case-insensitive build directory... $ECHO_C" >&6; }
-if test ! -d CaseSensitiveTestDir; then
-mkdir CaseSensitiveTestDir
 fi
 
-if test -d casesensitivetestdir
-then
-    { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-    BUILDEXEEXT=.exe
-else
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-	BUILDEXEEXT=$EXEEXT
-fi
-rmdir CaseSensitiveTestDir
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
-case $MACHDEP in
-bsdos*)
-    case $CC in
-    gcc) CC="$CC -D_HAVE_BSDI";;
-    esac;;
-esac
 
-case $ac_sys_system in
-hp*|HP*)
-    case $CC in
-    cc|*/cc) CC="$CC -Ae";;
-    esac;;
-Monterey*)
-    case $CC in
-    cc) CC="$CC -Wl,-Bexport";;
-    esac;;
-SunOS*)
-    # Some functions have a prototype only with that define, e.g. confstr
 
-cat >>confdefs.h <<\_ACEOF
-#define __EXTENSIONS__ 1
-_ACEOF
 
-    ;;
-esac
 
 
 
-{ echo "$as_me:$LINENO: checking LIBRARY" >&5
-echo $ECHO_N "checking LIBRARY... $ECHO_C" >&6; }
-if test -z "$LIBRARY"
-then
-	LIBRARY='libpython$(VERSION).a'
-fi
-{ echo "$as_me:$LINENO: result: $LIBRARY" >&5
-echo "${ECHO_T}$LIBRARY" >&6; }
 
-# LDLIBRARY is the name of the library to link against (as opposed to the
-# name of the library into which to insert object files). BLDLIBRARY is also
-# the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
-# is blank as the main program is not linked directly against LDLIBRARY.
-# LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
-# systems without shared libraries, LDLIBRARY is the same as LIBRARY
-# (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,
-# DLLLIBRARY is the shared (i.e., DLL) library.
-#
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+  if test "${ac_cv_header_minix_config_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
+$as_echo_n "checking for minix/config.h... " >&6; }
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+$as_echo "$ac_cv_header_minix_config_h" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+$as_echo_n "checking minix/config.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <minix/config.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+$as_echo_n "checking minix/config.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <minix/config.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: minix/config.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ------------------------------------------------ ##
+## Report this to http://www.python.org/python-bugs ##
+## ------------------------------------------------ ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
+$as_echo_n "checking for minix/config.h... " >&6; }
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_minix_config_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+$as_echo "$ac_cv_header_minix_config_h" >&6; }
+
+fi
+if test "x$ac_cv_header_minix_config_h" = x""yes; then
+  MINIX=yes
+else
+  MINIX=
+fi
+
+
+  if test "$MINIX" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_SOURCE 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_1_SOURCE 2
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _MINIX 1
+_ACEOF
+
+  fi
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#	  define __EXTENSIONS__ 1
+	  $ac_includes_default
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_safe_to_define___extensions__=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_safe_to_define___extensions__=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    cat >>confdefs.h <<\_ACEOF
+#define __EXTENSIONS__ 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _ALL_SOURCE 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _GNU_SOURCE 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _POSIX_PTHREAD_SEMANTICS 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _TANDEM_SOURCE 1
+_ACEOF
+
+
+
+# Check for unsupported systems
+case $ac_sys_system/$ac_sys_release in
+atheos*|Linux*/1*)
+   echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
+   echo See README for details.
+   exit 1;;
+esac
+
+
+{ $as_echo "$as_me:$LINENO: checking for --with-suffix" >&5
+$as_echo_n "checking for --with-suffix... " >&6; }
+
+# Check whether --with-suffix was given.
+if test "${with_suffix+set}" = set; then
+  withval=$with_suffix;
+	case $withval in
+	no)	EXEEXT=;;
+	yes)	EXEEXT=.exe;;
+	*)	EXEEXT=$withval;;
+	esac
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $EXEEXT" >&5
+$as_echo "$EXEEXT" >&6; }
+
+# Test whether we're running on a non-case-sensitive system, in which
+# case we give a warning if no ext is given
+
+{ $as_echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5
+$as_echo_n "checking for case-insensitive build directory... " >&6; }
+if test ! -d CaseSensitiveTestDir; then
+mkdir CaseSensitiveTestDir
+fi
+
+if test -d casesensitivetestdir
+then
+    { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+    BUILDEXEEXT=.exe
+else
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+	BUILDEXEEXT=$EXEEXT
+fi
+rmdir CaseSensitiveTestDir
+
+case $MACHDEP in
+bsdos*)
+    case $CC in
+    gcc) CC="$CC -D_HAVE_BSDI";;
+    esac;;
+esac
+
+case $ac_sys_system in
+hp*|HP*)
+    case $CC in
+    cc|*/cc) CC="$CC -Ae";;
+    esac;;
+Monterey*)
+    case $CC in
+    cc) CC="$CC -Wl,-Bexport";;
+    esac;;
+SunOS*)
+    # Some functions have a prototype only with that define, e.g. confstr
+
+cat >>confdefs.h <<\_ACEOF
+#define __EXTENSIONS__ 1
+_ACEOF
+
+    ;;
+esac
+
+
+
+{ $as_echo "$as_me:$LINENO: checking LIBRARY" >&5
+$as_echo_n "checking LIBRARY... " >&6; }
+if test -z "$LIBRARY"
+then
+	LIBRARY='libpython$(VERSION).a'
+fi
+{ $as_echo "$as_me:$LINENO: result: $LIBRARY" >&5
+$as_echo "$LIBRARY" >&6; }
+
+# LDLIBRARY is the name of the library to link against (as opposed to the
+# name of the library into which to insert object files). BLDLIBRARY is also
+# the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
+# is blank as the main program is not linked directly against LDLIBRARY.
+# LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
+# systems without shared libraries, LDLIBRARY is the same as LIBRARY
+# (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,
+# DLLLIBRARY is the shared (i.e., DLL) library.
+#
 # RUNSHARED is used to run shared python without installed libraries
 #
 # INSTSONAME is the name of the shared library that will be use to install
@@ -3909,8 +4479,8 @@
 # This is altered for AIX in order to build the export list before
 # linking.
 
-{ echo "$as_me:$LINENO: checking LINKCC" >&5
-echo $ECHO_N "checking LINKCC... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking LINKCC" >&5
+$as_echo_n "checking LINKCC... " >&6; }
 if test -z "$LINKCC"
 then
 	LINKCC='$(PURIFY) $(MAINCC)'
@@ -3930,11 +4500,11 @@
 	   LINKCC=qcc;;
 	esac
 fi
-{ echo "$as_me:$LINENO: result: $LINKCC" >&5
-echo "${ECHO_T}$LINKCC" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $LINKCC" >&5
+$as_echo "$LINKCC" >&6; }
 
-{ echo "$as_me:$LINENO: checking for --enable-shared" >&5
-echo $ECHO_N "checking for --enable-shared... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --enable-shared" >&5
+$as_echo_n "checking for --enable-shared... " >&6; }
 # Check whether --enable-shared was given.
 if test "${enable_shared+set}" = set; then
   enableval=$enable_shared;
@@ -3950,11 +4520,11 @@
     enable_shared="no";;
   esac
 fi
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
 
-{ echo "$as_me:$LINENO: checking for --enable-profiling" >&5
-echo $ECHO_N "checking for --enable-profiling... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --enable-profiling" >&5
+$as_echo_n "checking for --enable-profiling... " >&6; }
 # Check whether --enable-profiling was given.
 if test "${enable_profiling+set}" = set; then
   enableval=$enable_profiling; ac_save_cc="$CC"
@@ -3976,29 +4546,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_enable_profiling="yes"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_enable_profiling="no"
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -4006,8 +4579,8 @@
  CC="$ac_save_cc"
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5
-echo "${ECHO_T}$ac_enable_profiling" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5
+$as_echo "$ac_enable_profiling" >&6; }
 
 case "$ac_enable_profiling" in
     "yes")
@@ -4016,8 +4589,8 @@
     ;;
 esac
 
-{ echo "$as_me:$LINENO: checking LDLIBRARY" >&5
-echo $ECHO_N "checking LDLIBRARY... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking LDLIBRARY" >&5
+$as_echo_n "checking LDLIBRARY... " >&6; }
 
 # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
 # library that we build, but we do not want to link against it (we
@@ -4085,6 +4658,12 @@
 	  BLDLIBRARY='-L. -lpython$(VERSION)'
 	  RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
 	  ;;
+    Darwin*)
+    	LDLIBRARY='libpython$(VERSION).dylib'
+	BLDLIBRARY='-L. -lpython$(VERSION)'
+	RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
+	;;
+
   esac
 else # shared is disabled
   case $ac_sys_system in
@@ -4095,16 +4674,16 @@
   esac
 fi
 
-{ echo "$as_me:$LINENO: result: $LDLIBRARY" >&5
-echo "${ECHO_T}$LDLIBRARY" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $LDLIBRARY" >&5
+$as_echo "$LDLIBRARY" >&6; }
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -4117,7 +4696,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4128,11 +4707,11 @@
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4141,10 +4720,10 @@
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
@@ -4157,7 +4736,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4168,11 +4747,11 @@
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_RANLIB" = x; then
@@ -4180,12 +4759,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     RANLIB=$ac_ct_RANLIB
@@ -4199,10 +4774,10 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$AR"; then
   ac_cv_prog_AR="$AR" # Let the user override the test.
@@ -4215,7 +4790,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AR="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4226,11 +4801,11 @@
 fi
 AR=$ac_cv_prog_AR
 if test -n "$AR"; then
-  { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4242,10 +4817,10 @@
 
 # Extract the first word of "svnversion", so it can be a program name with args.
 set dummy svnversion; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_SVNVERSION+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$SVNVERSION"; then
   ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test.
@@ -4258,7 +4833,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_SVNVERSION="found"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4270,11 +4845,11 @@
 fi
 SVNVERSION=$ac_cv_prog_SVNVERSION
 if test -n "$SVNVERSION"; then
-  { echo "$as_me:$LINENO: result: $SVNVERSION" >&5
-echo "${ECHO_T}$SVNVERSION" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $SVNVERSION" >&5
+$as_echo "$SVNVERSION" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4310,8 +4885,8 @@
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -4337,11 +4912,12 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -4370,17 +4946,29 @@
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
+
 done
 IFS=$as_save_IFS
 
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
@@ -4393,8 +4981,8 @@
     INSTALL=$ac_install_sh
   fi
 fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -4416,8 +5004,8 @@
 fi
 
 # Check for --with-pydebug
-{ echo "$as_me:$LINENO: checking for --with-pydebug" >&5
-echo $ECHO_N "checking for --with-pydebug... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-pydebug" >&5
+$as_echo_n "checking for --with-pydebug... " >&6; }
 
 # Check whether --with-pydebug was given.
 if test "${with_pydebug+set}" = set; then
@@ -4429,15 +5017,15 @@
 #define Py_DEBUG 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; };
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; };
   Py_DEBUG='true'
-else { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }; Py_DEBUG='false'
+else { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }; Py_DEBUG='false'
 fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4515,8 +5103,8 @@
     # Python violates C99 rules, by casting between incompatible
     # pointer types. GCC may generate bad code as a result of that,
     # so use -fno-strict-aliasing if supported.
-    { echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5
-echo $ECHO_N "checking whether $CC accepts -fno-strict-aliasing... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5
+$as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6; }
      ac_save_cc="$CC"
      CC="$CC -fno-strict-aliasing"
      if test "$cross_compiling" = yes; then
@@ -4536,36 +5124,39 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_no_strict_aliasing_ok=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_no_strict_aliasing_ok=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
      CC="$ac_save_cc"
-    { echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5
-echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; }
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5
+$as_echo "$ac_cv_no_strict_aliasing_ok" >&6; }
     if test $ac_cv_no_strict_aliasing_ok = yes
     then
       BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
@@ -4604,8 +5195,8 @@
 		   ARCH_RUN_32BIT="arch -i386 -ppc"
 
 		 else
-	           { { echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5
-echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;}
+	           { { $as_echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5
+$as_echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;}
    { (exit 1); exit 1; }; }
 
 		 fi
@@ -4679,10 +5270,10 @@
   ac_cv_opt_olimit_ok=no
 fi
 
-{ echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5
-echo $ECHO_N "checking whether $CC accepts -OPT:Olimit=0... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5
+$as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; }
 if test "${ac_cv_opt_olimit_ok+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_cc="$CC"
 CC="$CC -OPT:Olimit=0"
@@ -4703,29 +5294,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_opt_olimit_ok=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_opt_olimit_ok=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -4733,8 +5327,8 @@
 CC="$ac_save_cc"
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5
-echo "${ECHO_T}$ac_cv_opt_olimit_ok" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5
+$as_echo "$ac_cv_opt_olimit_ok" >&6; }
 if test $ac_cv_opt_olimit_ok = yes; then
     case $ac_sys_system in
 	# XXX is this branch needed? On MacOSX 10.2.2 the result of the
@@ -4747,10 +5341,10 @@
 	    ;;
     esac
 else
-  { echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5
-echo $ECHO_N "checking whether $CC accepts -Olimit 1500... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5
+$as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; }
   if test "${ac_cv_olimit_ok+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_cc="$CC"
   CC="$CC -Olimit 1500"
@@ -4771,29 +5365,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_olimit_ok=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_olimit_ok=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -4801,8 +5398,8 @@
   CC="$ac_save_cc"
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5
-echo "${ECHO_T}$ac_cv_olimit_ok" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5
+$as_echo "$ac_cv_olimit_ok" >&6; }
   if test $ac_cv_olimit_ok = yes; then
     BASECFLAGS="$BASECFLAGS -Olimit 1500"
   fi
@@ -4811,8 +5408,8 @@
 # Check whether GCC supports PyArg_ParseTuple format
 if test "$GCC" = "yes"
 then
-  { echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5
-echo $ECHO_N "checking whether gcc supports ParseTuple __format__... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5
+$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; }
   save_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -Werror"
   cat >conftest.$ac_ext <<_ACEOF
@@ -4838,13 +5435,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -4854,14 +5452,14 @@
 #define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -4874,10 +5472,10 @@
 # complain if unaccepted options are passed (e.g. gcc on Mac OS X).
 # So we have to see first whether pthreads are available without
 # options before we can check whether -Kpthread improves anything.
-{ echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5
-echo $ECHO_N "checking whether pthreads are available without options... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5
+$as_echo_n "checking whether pthreads are available without options... " >&6; }
 if test "${ac_cv_pthread_is_default+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_pthread_is_default=no
@@ -4908,19 +5506,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
   ac_cv_pthread_is_default=yes
@@ -4928,13 +5528,14 @@
   ac_cv_pthread=no
 
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_pthread_is_default=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -4942,8 +5543,8 @@
 
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5
-echo "${ECHO_T}$ac_cv_pthread_is_default" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5
+$as_echo "$ac_cv_pthread_is_default" >&6; }
 
 
 if test $ac_cv_pthread_is_default = yes
@@ -4955,10 +5556,10 @@
 # Some compilers won't report that they do not support -Kpthread,
 # so we need to run a program to see whether it really made the
 # function available.
-{ echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5
-echo $ECHO_N "checking whether $CC accepts -Kpthread... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5
+$as_echo_n "checking whether $CC accepts -Kpthread... " >&6; }
 if test "${ac_cv_kpthread+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_cc="$CC"
 CC="$CC -Kpthread"
@@ -4991,29 +5592,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_kpthread=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_kpthread=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -5021,8 +5625,8 @@
 CC="$ac_save_cc"
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5
-echo "${ECHO_T}$ac_cv_kpthread" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5
+$as_echo "$ac_cv_kpthread" >&6; }
 fi
 
 if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no
@@ -5032,10 +5636,10 @@
 # Some compilers won't report that they do not support -Kthread,
 # so we need to run a program to see whether it really made the
 # function available.
-{ echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5
-echo $ECHO_N "checking whether $CC accepts -Kthread... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5
+$as_echo_n "checking whether $CC accepts -Kthread... " >&6; }
 if test "${ac_cv_kthread+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_cc="$CC"
 CC="$CC -Kthread"
@@ -5068,29 +5672,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_kthread=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_kthread=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -5098,8 +5705,8 @@
 CC="$ac_save_cc"
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5
-echo "${ECHO_T}$ac_cv_kthread" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5
+$as_echo "$ac_cv_kthread" >&6; }
 fi
 
 if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no
@@ -5109,10 +5716,10 @@
 # Some compilers won't report that they do not support -pthread,
 # so we need to run a program to see whether it really made the
 # function available.
-{ echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5
-echo $ECHO_N "checking whether $CC accepts -pthread... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5
+$as_echo_n "checking whether $CC accepts -pthread... " >&6; }
 if test "${ac_cv_thread+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_cc="$CC"
 CC="$CC -pthread"
@@ -5145,29 +5752,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_pthread=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_pthread=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -5175,8 +5785,8 @@
 CC="$ac_save_cc"
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5
-echo "${ECHO_T}$ac_cv_pthread" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5
+$as_echo "$ac_cv_pthread" >&6; }
 fi
 
 # If we have set a CC compiler flag for thread support then
@@ -5184,8 +5794,8 @@
 ac_cv_cxx_thread=no
 if test ! -z "$CXX"
 then
-{ echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5
-echo $ECHO_N "checking whether $CXX also accepts flags for thread support... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5
+$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; }
 ac_save_cxx="$CXX"
 
 if test "$ac_cv_kpthread" = "yes"
@@ -5215,17 +5825,17 @@
   fi
   rm -fr conftest*
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5
-echo "${ECHO_T}$ac_cv_cxx_thread" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5
+$as_echo "$ac_cv_cxx_thread" >&6; }
 fi
 CXX="$ac_save_cxx"
 
 
 # checks for header files
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5252,20 +5862,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_header_stdc=no
@@ -5357,37 +5968,40 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5396,75 +6010,6 @@
 
 fi
 
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
 
 
 
@@ -5532,20 +6077,21 @@
 sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 bluetooth/bluetooth.h linux/tipc.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5561,32 +6107,33 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5600,51 +6147,52 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to http://www.python.org/python-bugs ##
@@ -5653,21 +6201,24 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -5681,11 +6232,11 @@
 
 ac_header_dirent=no
 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
-  as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
-echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
+  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5711,20 +6262,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_Header=no"
@@ -5732,12 +6284,15 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
 _ACEOF
 
 ac_header_dirent=$ac_hdr; break
@@ -5746,10 +6301,10 @@
 done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
-  { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
 if test "${ac_cv_search_opendir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
@@ -5787,26 +6342,30 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_search_opendir=$ac_res
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
   if test "${ac_cv_search_opendir+set}" = set; then
@@ -5821,8 +6380,8 @@
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
 ac_res=$ac_cv_search_opendir
 if test "$ac_res" != no; then
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
@@ -5830,10 +6389,10 @@
 fi
 
 else
-  { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
 if test "${ac_cv_search_opendir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
@@ -5871,26 +6430,30 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_search_opendir=$ac_res
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
   if test "${ac_cv_search_opendir+set}" = set; then
@@ -5905,8 +6468,8 @@
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
 ac_res=$ac_cv_search_opendir
 if test "$ac_res" != no; then
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
@@ -5915,10 +6478,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5
-echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5
+$as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
 if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5941,46 +6504,50 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_header_sys_types_h_makedev=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_header_sys_types_h_makedev=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5
-echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5
+$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; }
 
 if test $ac_cv_header_sys_types_h_makedev = no; then
 if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
-echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
+$as_echo_n "checking for sys/mkdev.h... " >&6; }
 if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
+$as_echo "$ac_cv_header_sys_mkdev_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5
-echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5
+$as_echo_n "checking sys/mkdev.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5996,32 +6563,33 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5
-echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5
+$as_echo_n "checking sys/mkdev.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6035,51 +6603,52 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/mkdev.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sys/mkdev.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to http://www.python.org/python-bugs ##
@@ -6088,18 +6657,18 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
-echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5
+$as_echo_n "checking for sys/mkdev.h... " >&6; }
 if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_header_sys_mkdev_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5
+$as_echo "$ac_cv_header_sys_mkdev_h" >&6; }
 
 fi
-if test $ac_cv_header_sys_mkdev_h = yes; then
+if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define MAJOR_IN_MKDEV 1
@@ -6111,17 +6680,17 @@
 
   if test $ac_cv_header_sys_mkdev_h = no; then
     if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
-echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
+$as_echo_n "checking for sys/sysmacros.h... " >&6; }
 if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
+$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5
-echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5
+$as_echo_n "checking sys/sysmacros.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6137,32 +6706,33 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5
-echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5
+$as_echo_n "checking sys/sysmacros.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6176,51 +6746,52 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/sysmacros.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sys/sysmacros.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to http://www.python.org/python-bugs ##
@@ -6229,18 +6800,18 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
-echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5
+$as_echo_n "checking for sys/sysmacros.h... " >&6; }
 if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_header_sys_sysmacros_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5
+$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; }
 
 fi
-if test $ac_cv_header_sys_sysmacros_h = yes; then
+if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define MAJOR_IN_SYSMACROS 1
@@ -6257,11 +6828,11 @@
 
 for ac_header in term.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -6283,20 +6854,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_Header=no"
@@ -6304,12 +6876,15 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -6321,11 +6896,11 @@
 
 for ac_header in linux/netlink.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -6350,20 +6925,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_Header=no"
@@ -6371,12 +6947,15 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -6386,8 +6965,8 @@
 
 # checks for typedefs
 was_it_defined=no
-{ echo "$as_me:$LINENO: checking for clock_t in time.h" >&5
-echo $ECHO_N "checking for clock_t in time.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for clock_t in time.h" >&5
+$as_echo_n "checking for clock_t in time.h... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6411,12 +6990,12 @@
 fi
 rm -f conftest*
 
-{ echo "$as_me:$LINENO: result: $was_it_defined" >&5
-echo "${ECHO_T}$was_it_defined" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5
+$as_echo "$was_it_defined" >&6; }
 
 # Check whether using makedev requires defining _OSF_SOURCE
-{ echo "$as_me:$LINENO: checking for makedev" >&5
-echo $ECHO_N "checking for makedev... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for makedev" >&5
+$as_echo_n "checking for makedev... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6438,26 +7017,30 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_has_makedev=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_has_makedev=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_has_makedev" = "no"; then
@@ -6486,26 +7069,30 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_has_makedev=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_has_makedev=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
     if test "$ac_cv_has_makedev" = "yes"; then
@@ -6516,8 +7103,8 @@
 
     fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5
-echo "${ECHO_T}$ac_cv_has_makedev" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5
+$as_echo "$ac_cv_has_makedev" >&6; }
 if test "$ac_cv_has_makedev" = "yes"; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6534,8 +7121,8 @@
 # work-around, disable LFS on such configurations
 
 use_lfs=yes
-{ echo "$as_me:$LINENO: checking Solaris LFS bug" >&5
-echo $ECHO_N "checking Solaris LFS bug... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking Solaris LFS bug" >&5
+$as_echo_n "checking Solaris LFS bug... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6561,28 +7148,29 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   sol_lfs_bug=no
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	sol_lfs_bug=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5
-echo "${ECHO_T}$sol_lfs_bug" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5
+$as_echo "$sol_lfs_bug" >&6; }
 if test "$sol_lfs_bug" = "yes"; then
   use_lfs=no
 fi
@@ -6610,26 +7198,58 @@
 EOF
 
 # Type availability checks
-{ echo "$as_me:$LINENO: checking for mode_t" >&5
-echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5
+$as_echo_n "checking for mode_t... " >&6; }
 if test "${ac_cv_type_mode_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_mode_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef mode_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (mode_t))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((mode_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -6640,30 +7260,39 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_mode_t=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_mode_t=no
+	ac_cv_type_mode_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
-echo "${ECHO_T}$ac_cv_type_mode_t" >&6; }
-if test $ac_cv_type_mode_t = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
+$as_echo "$ac_cv_type_mode_t" >&6; }
+if test "x$ac_cv_type_mode_t" = x""yes; then
   :
 else
 
@@ -6673,26 +7302,58 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for off_t" >&5
-echo $ECHO_N "checking for off_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for off_t" >&5
+$as_echo_n "checking for off_t... " >&6; }
 if test "${ac_cv_type_off_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_off_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef off_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (off_t))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((off_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -6703,30 +7364,39 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_off_t=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_off_t=no
+	ac_cv_type_off_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
-echo "${ECHO_T}$ac_cv_type_off_t" >&6; }
-if test $ac_cv_type_off_t = yes; then
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+$as_echo "$ac_cv_type_off_t" >&6; }
+if test "x$ac_cv_type_off_t" = x""yes; then
   :
 else
 
@@ -6736,26 +7406,58 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5
+$as_echo_n "checking for pid_t... " >&6; }
 if test "${ac_cv_type_pid_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_pid_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef pid_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (pid_t))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof ((pid_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -6766,30 +7468,39 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_pid_t=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_pid_t=no
+	ac_cv_type_pid_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
-if test $ac_cv_type_pid_t = yes; then
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+$as_echo "$ac_cv_type_pid_t" >&6; }
+if test "x$ac_cv_type_pid_t" = x""yes; then
   :
 else
 
@@ -6799,10 +7510,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
 if test "${ac_cv_type_signal+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -6827,20 +7538,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_type_signal=int
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_type_signal=void
@@ -6848,19 +7560,54 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define RETSIGTYPE $ac_cv_type_signal
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
+$as_echo_n "checking for size_t... " >&6; }
 if test "${ac_cv_type_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
+  ac_cv_type_size_t=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if (sizeof (size_t))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6868,14 +7615,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef size_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
+if (sizeof ((size_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -6886,30 +7630,39 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_size_t=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_size_t=no
+	ac_cv_type_size_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
-if test $ac_cv_type_size_t = yes; then
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+$as_echo "$ac_cv_type_size_t" >&6; }
+if test "x$ac_cv_type_size_t" = x""yes; then
   :
 else
 
@@ -6919,10 +7672,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
-echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
+$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
 if test "${ac_cv_type_uid_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -6942,8 +7695,8 @@
 rm -f conftest*
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
-echo "${ECHO_T}$ac_cv_type_uid_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
+$as_echo "$ac_cv_type_uid_t" >&6; }
 if test $ac_cv_type_uid_t = no; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6957,26 +7710,24 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for ssize_t" >&5
-echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for ssize_t" >&5
+$as_echo_n "checking for ssize_t... " >&6; }
 if test "${ac_cv_type_ssize_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_ssize_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef ssize_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
+if (sizeof (ssize_t))
+       return 0;
   ;
   return 0;
 }
@@ -6987,45 +7738,18 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_ssize_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_ssize_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
-echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; }
-if test $ac_cv_type_ssize_t = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SSIZE_T 1
-_ACEOF
-
-fi
-
-
-# Sizes of various common basic types
-# ANSI C requires sizeof(char) == 1, so no need to check it
-{ echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6; }
-if test "${ac_cv_type_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7033,14 +7757,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-typedef int ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
+if (sizeof ((ssize_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -7051,38 +7772,57 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_int=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_int=no
+	ac_cv_type_ssize_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
+$as_echo "$ac_cv_type_ssize_t" >&6; }
+if test "x$ac_cv_type_ssize_t" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SSIZE_T 1
+_ACEOF
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6; }
 
+
+# Sizes of various common basic types
+# ANSI C requires sizeof(char) == 1, so no need to check it
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
 if test "${ac_cv_sizeof_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -7093,11 +7833,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -7110,13 +7849,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -7130,11 +7870,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -7147,20 +7886,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -7174,7 +7914,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -7184,11 +7924,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)];
 test_array [0] = 0
 
   ;
@@ -7201,13 +7940,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -7221,11 +7961,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -7238,20 +7977,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -7265,7 +8005,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -7285,11 +8025,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef int ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -7302,20 +8041,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -7326,11 +8066,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_int=$ac_lo;;
 '') if test "$ac_cv_type_int" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
+$as_echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_int=0
    fi ;;
@@ -7343,9 +8085,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef int ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (int)); }
+static unsigned long int ulongval () { return (long int) (sizeof (int)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -7355,20 +8096,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (int))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (int))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (int))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -7381,43 +8124,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_int=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_int" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
+$as_echo "$as_me: error: cannot compute sizeof (int)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_int=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
 
 
 
@@ -7426,68 +8174,14 @@
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for long" >&5
-echo $ECHO_N "checking for long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_long=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_long=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-echo "${ECHO_T}$ac_cv_type_long" >&6; }
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long" >&5
-echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
 if test "${ac_cv_sizeof_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -7498,11 +8192,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -7515,13 +8208,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -7535,11 +8229,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -7552,20 +8245,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -7579,7 +8273,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -7589,11 +8283,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)];
 test_array [0] = 0
 
   ;
@@ -7606,13 +8299,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -7626,11 +8320,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -7643,20 +8336,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -7670,7 +8364,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -7690,11 +8384,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -7707,20 +8400,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -7731,11 +8425,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_long=$ac_lo;;
 '') if test "$ac_cv_type_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
+$as_echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long=0
    fi ;;
@@ -7748,9 +8444,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (long)); }
+static unsigned long int ulongval () { return (long int) (sizeof (long)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -7760,20 +8455,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (long))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (long))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (long))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -7786,43 +8483,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_long=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
+$as_echo "$as_me: error: cannot compute sizeof (long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
 
 
 
@@ -7831,68 +8533,14 @@
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for void *" >&5
-echo $ECHO_N "checking for void *... $ECHO_C" >&6; }
-if test "${ac_cv_type_void_p+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef void * ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_void_p=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_void_p=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
-echo "${ECHO_T}$ac_cv_type_void_p" >&6; }
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of void *" >&5
-echo $ECHO_N "checking size of void *... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
 if test "${ac_cv_sizeof_void_p+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -7903,11 +8551,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -7920,13 +8567,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -7940,11 +8588,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -7957,20 +8604,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -7984,7 +8632,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -7994,11 +8642,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)];
 test_array [0] = 0
 
   ;
@@ -8011,13 +8658,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -8031,11 +8679,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -8048,20 +8695,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -8075,7 +8723,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -8095,11 +8743,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -8112,20 +8759,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -8136,11 +8784,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_void_p=$ac_lo;;
 '') if test "$ac_cv_type_void_p" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void *)
+$as_echo "$as_me: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_void_p=0
    fi ;;
@@ -8153,9 +8803,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (void *)); }
+static unsigned long int ulongval () { return (long int) (sizeof (void *)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -8165,20 +8814,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (void *))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (void *))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (void *))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -8191,43 +8842,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_void_p=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_void_p" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void *)
+$as_echo "$as_me: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_void_p=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
-echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
 
 
 
@@ -8236,68 +8892,14 @@
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for short" >&5
-echo $ECHO_N "checking for short... $ECHO_C" >&6; }
-if test "${ac_cv_type_short+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef short ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_short=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_short=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
-echo "${ECHO_T}$ac_cv_type_short" >&6; }
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of short" >&5
-echo $ECHO_N "checking size of short... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
 if test "${ac_cv_sizeof_short+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -8308,11 +8910,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -8325,13 +8926,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -8345,11 +8947,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -8362,20 +8963,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -8389,7 +8991,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -8399,11 +9001,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)];
 test_array [0] = 0
 
   ;
@@ -8416,13 +9017,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -8436,11 +9038,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -8453,20 +9054,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -8480,7 +9082,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -8500,11 +9102,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef short ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -8517,20 +9118,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -8541,11 +9143,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_short=$ac_lo;;
 '') if test "$ac_cv_type_short" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short)
+$as_echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_short=0
    fi ;;
@@ -8558,9 +9162,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef short ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (short)); }
+static unsigned long int ulongval () { return (long int) (sizeof (short)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -8570,20 +9173,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (short))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (short))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (short))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -8596,43 +9201,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_short=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_short" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short)
+$as_echo "$as_me: error: cannot compute sizeof (short)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_short=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
-echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
 
 
 
@@ -8641,68 +9251,14 @@
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for float" >&5
-echo $ECHO_N "checking for float... $ECHO_C" >&6; }
-if test "${ac_cv_type_float+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef float ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_float=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_float=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5
-echo "${ECHO_T}$ac_cv_type_float" >&6; }
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of float" >&5
-echo $ECHO_N "checking size of float... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of float" >&5
+$as_echo_n "checking size of float... " >&6; }
 if test "${ac_cv_sizeof_float+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -8713,11 +9269,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef float ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -8730,13 +9285,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -8750,11 +9306,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef float ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -8767,20 +9322,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -8794,7 +9350,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -8804,11 +9360,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef float ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) < 0)];
 test_array [0] = 0
 
   ;
@@ -8821,13 +9376,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -8841,11 +9397,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef float ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -8858,20 +9413,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -8885,7 +9441,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -8905,11 +9461,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef float ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -8922,20 +9477,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -8946,11 +9502,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_float=$ac_lo;;
 '') if test "$ac_cv_type_float" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (float)
+$as_echo "$as_me: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_float=0
    fi ;;
@@ -8963,9 +9521,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef float ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (float)); }
+static unsigned long int ulongval () { return (long int) (sizeof (float)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -8975,20 +9532,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (float))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (float))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (float))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -9001,113 +9560,64 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_float=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_float" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (float)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (float)
+$as_echo "$as_me: error: cannot compute sizeof (float)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_float=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5
-echo "${ECHO_T}$ac_cv_sizeof_float" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5
+$as_echo "$ac_cv_sizeof_float" >&6; }
 
 
 
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_FLOAT $ac_cv_sizeof_float
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for double" >&5
-echo $ECHO_N "checking for double... $ECHO_C" >&6; }
-if test "${ac_cv_type_double+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef double ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_double=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_double=no
-fi
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_FLOAT $ac_cv_sizeof_float
+_ACEOF
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5
-echo "${ECHO_T}$ac_cv_type_double" >&6; }
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of double" >&5
-echo $ECHO_N "checking size of double... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of double" >&5
+$as_echo_n "checking size of double... " >&6; }
 if test "${ac_cv_sizeof_double+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -9118,11 +9628,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -9135,13 +9644,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -9155,11 +9665,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -9172,20 +9681,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -9199,7 +9709,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -9209,11 +9719,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)];
 test_array [0] = 0
 
   ;
@@ -9226,13 +9735,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -9246,11 +9756,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -9263,20 +9772,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -9290,7 +9800,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -9310,11 +9820,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -9327,20 +9836,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -9351,11 +9861,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_double=$ac_lo;;
 '') if test "$ac_cv_type_double" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (double)
+$as_echo "$as_me: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_double=0
    fi ;;
@@ -9368,9 +9880,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef double ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (double)); }
+static unsigned long int ulongval () { return (long int) (sizeof (double)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -9380,20 +9891,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (double))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (double))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (double))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -9406,43 +9919,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_double=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_double" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (double)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (double)
+$as_echo "$as_me: error: cannot compute sizeof (double)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_double=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5
-echo "${ECHO_T}$ac_cv_sizeof_double" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5
+$as_echo "$ac_cv_sizeof_double" >&6; }
 
 
 
@@ -9451,68 +9969,14 @@
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for fpos_t" >&5
-echo $ECHO_N "checking for fpos_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_fpos_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef fpos_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_fpos_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_fpos_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_fpos_t" >&5
-echo "${ECHO_T}$ac_cv_type_fpos_t" >&6; }
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of fpos_t" >&5
-echo $ECHO_N "checking size of fpos_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of fpos_t" >&5
+$as_echo_n "checking size of fpos_t... " >&6; }
 if test "${ac_cv_sizeof_fpos_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -9523,11 +9987,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -9540,13 +10003,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -9560,11 +10024,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -9577,20 +10040,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -9604,7 +10068,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -9614,11 +10078,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) < 0)];
 test_array [0] = 0
 
   ;
@@ -9631,13 +10094,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -9651,11 +10115,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -9668,20 +10131,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -9695,7 +10159,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -9715,11 +10179,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef fpos_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -9732,20 +10195,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -9756,11 +10220,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_fpos_t=$ac_lo;;
 '') if test "$ac_cv_type_fpos_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (fpos_t)
+$as_echo "$as_me: error: cannot compute sizeof (fpos_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_fpos_t=0
    fi ;;
@@ -9773,9 +10239,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef fpos_t ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (fpos_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (fpos_t)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -9785,20 +10250,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (fpos_t))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (fpos_t))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (fpos_t))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -9811,43 +10278,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_fpos_t=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_fpos_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (fpos_t)
+$as_echo "$as_me: error: cannot compute sizeof (fpos_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_fpos_t=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_fpos_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5
+$as_echo "$ac_cv_sizeof_fpos_t" >&6; }
 
 
 
@@ -9856,68 +10328,14 @@
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef size_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_size_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_size_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of size_t" >&5
-echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
 if test "${ac_cv_sizeof_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -9928,11 +10346,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -9945,13 +10362,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -9965,11 +10383,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -9982,20 +10399,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -10009,7 +10427,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -10019,11 +10437,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)];
 test_array [0] = 0
 
   ;
@@ -10036,13 +10453,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -10056,11 +10474,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -10073,20 +10490,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -10100,7 +10518,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -10120,11 +10538,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -10137,20 +10554,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -10161,11 +10579,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_size_t=$ac_lo;;
 '') if test "$ac_cv_type_size_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (size_t)
+$as_echo "$as_me: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_size_t=0
    fi ;;
@@ -10178,9 +10598,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (size_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (size_t)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -10190,20 +10609,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (size_t))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (size_t))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (size_t))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -10216,43 +10637,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_size_t=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_size_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (size_t)
+$as_echo "$as_me: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_size_t=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
 
 
 
@@ -10261,68 +10687,14 @@
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_pid_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef pid_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_pid_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_pid_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of pid_t" >&5
-echo $ECHO_N "checking size of pid_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of pid_t" >&5
+$as_echo_n "checking size of pid_t... " >&6; }
 if test "${ac_cv_sizeof_pid_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -10333,11 +10705,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef pid_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -10350,13 +10721,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -10370,11 +10742,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef pid_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -10387,20 +10758,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -10414,7 +10786,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -10424,11 +10796,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef pid_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) < 0)];
 test_array [0] = 0
 
   ;
@@ -10441,13 +10812,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -10461,11 +10833,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef pid_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -10478,20 +10849,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -10505,7 +10877,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -10525,11 +10897,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef pid_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -10542,20 +10913,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -10566,11 +10938,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_pid_t=$ac_lo;;
 '') if test "$ac_cv_type_pid_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (pid_t)
+$as_echo "$as_me: error: cannot compute sizeof (pid_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_pid_t=0
    fi ;;
@@ -10583,9 +10957,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef pid_t ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (pid_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (pid_t)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -10595,20 +10968,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (pid_t))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (pid_t))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (pid_t))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -10621,43 +10996,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_pid_t=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_pid_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (pid_t)
+$as_echo "$as_me: error: cannot compute sizeof (pid_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_pid_t=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_pid_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5
+$as_echo "$ac_cv_sizeof_pid_t" >&6; }
 
 
 
@@ -10667,8 +11047,8 @@
 
 
 
-{ echo "$as_me:$LINENO: checking for long long support" >&5
-echo $ECHO_N "checking for long long support... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for long long support" >&5
+$as_echo_n "checking for long long support... " >&6; }
 have_long_long=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -10691,13 +11071,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -10711,78 +11092,24 @@
   have_long_long=yes
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $have_long_long" >&5
-echo "${ECHO_T}$have_long_long" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $have_long_long" >&5
+$as_echo "$have_long_long" >&6; }
 if test "$have_long_long" = yes ; then
-{ echo "$as_me:$LINENO: checking for long long" >&5
-echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef long long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_long_long=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_long_long=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long long" >&5
-echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
 if test "${ac_cv_sizeof_long_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -10793,11 +11120,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -10810,13 +11136,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -10830,11 +11157,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -10847,20 +11173,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -10874,7 +11201,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -10884,11 +11211,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)];
 test_array [0] = 0
 
   ;
@@ -10901,13 +11227,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -10921,11 +11248,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -10938,20 +11264,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -10965,7 +11292,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -10985,11 +11312,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -11002,20 +11328,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -11026,11 +11353,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_long_long=$ac_lo;;
 '') if test "$ac_cv_type_long_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
+$as_echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long_long=0
    fi ;;
@@ -11043,9 +11372,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (long long)); }
+static unsigned long int ulongval () { return (long int) (sizeof (long long)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -11055,20 +11383,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (long long))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (long long))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (long long))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -11081,43 +11411,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_long_long=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_long_long" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
+$as_echo "$as_me: error: cannot compute sizeof (long long)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long_long=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
 
 
 
@@ -11128,8 +11463,8 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for long double support" >&5
-echo $ECHO_N "checking for long double support... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for long double support" >&5
+$as_echo_n "checking for long double support... " >&6; }
 have_long_double=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -11152,13 +11487,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -11172,78 +11508,24 @@
   have_long_double=yes
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $have_long_double" >&5
-echo "${ECHO_T}$have_long_double" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $have_long_double" >&5
+$as_echo "$have_long_double" >&6; }
 if test "$have_long_double" = yes ; then
-{ echo "$as_me:$LINENO: checking for long double" >&5
-echo $ECHO_N "checking for long double... $ECHO_C" >&6; }
-if test "${ac_cv_type_long_double+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef long double ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_long_double=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_long_double=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5
-echo "${ECHO_T}$ac_cv_type_long_double" >&6; }
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long double" >&5
-echo $ECHO_N "checking size of long double... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of long double" >&5
+$as_echo_n "checking size of long double... " >&6; }
 if test "${ac_cv_sizeof_long_double+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -11254,11 +11536,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -11271,13 +11552,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -11291,11 +11573,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -11308,20 +11589,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -11335,7 +11617,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -11345,11 +11627,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long double))) < 0)];
 test_array [0] = 0
 
   ;
@@ -11362,13 +11643,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -11382,11 +11664,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -11399,20 +11680,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -11426,7 +11708,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -11446,11 +11728,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long double ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -11463,20 +11744,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -11487,11 +11769,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_long_double=$ac_lo;;
 '') if test "$ac_cv_type_long_double" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long double)
+$as_echo "$as_me: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long_double=0
    fi ;;
@@ -11504,9 +11788,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef long double ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (long double)); }
+static unsigned long int ulongval () { return (long int) (sizeof (long double)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -11516,20 +11799,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (long double))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (long double))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (long double))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -11542,43 +11827,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_long_double=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_long_double" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long double)
+$as_echo "$as_me: error: cannot compute sizeof (long double)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_long_double=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5
+$as_echo "$ac_cv_sizeof_long_double" >&6; }
 
 
 
@@ -11590,8 +11880,8 @@
 fi
 
 
-{ echo "$as_me:$LINENO: checking for _Bool support" >&5
-echo $ECHO_N "checking for _Bool support... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for _Bool support" >&5
+$as_echo_n "checking for _Bool support... " >&6; }
 have_c99_bool=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -11614,98 +11904,45 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_C99_BOOL 1
-_ACEOF
-
-  have_c99_bool=yes
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $have_c99_bool" >&5
-echo "${ECHO_T}$have_c99_bool" >&6; }
-if test "$have_c99_bool" = yes ; then
-{ echo "$as_me:$LINENO: checking for _Bool" >&5
-echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; }
-if test "${ac_cv_type__Bool+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef _Bool ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type__Bool=yes
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_C99_BOOL 1
+_ACEOF
+
+  have_c99_bool=yes
+
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type__Bool=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
-echo "${ECHO_T}$ac_cv_type__Bool" >&6; }
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $have_c99_bool" >&5
+$as_echo "$have_c99_bool" >&6; }
+if test "$have_c99_bool" = yes ; then
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of _Bool" >&5
-echo $ECHO_N "checking size of _Bool... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of _Bool" >&5
+$as_echo_n "checking size of _Bool... " >&6; }
 if test "${ac_cv_sizeof__Bool+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -11716,11 +11953,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef _Bool ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -11733,13 +11969,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -11753,11 +11990,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef _Bool ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -11770,20 +12006,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -11797,7 +12034,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -11807,11 +12044,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef _Bool ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) < 0)];
 test_array [0] = 0
 
   ;
@@ -11824,13 +12060,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -11844,11 +12081,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef _Bool ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -11861,20 +12097,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -11888,7 +12125,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -11908,11 +12145,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef _Bool ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -11925,20 +12161,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -11949,11 +12186,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof__Bool=$ac_lo;;
 '') if test "$ac_cv_type__Bool" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (_Bool)
+$as_echo "$as_me: error: cannot compute sizeof (_Bool)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof__Bool=0
    fi ;;
@@ -11966,9 +12205,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef _Bool ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (_Bool)); }
+static unsigned long int ulongval () { return (long int) (sizeof (_Bool)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -11978,20 +12216,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (_Bool))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (_Bool))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (_Bool))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -12004,43 +12244,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof__Bool=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type__Bool" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (_Bool)
+$as_echo "$as_me: error: cannot compute sizeof (_Bool)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof__Bool=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5
-echo "${ECHO_T}$ac_cv_sizeof__Bool" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5
+$as_echo "$ac_cv_sizeof__Bool" >&6; }
 
 
 
@@ -12051,12 +12296,13 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for uintptr_t" >&5
-echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5
+$as_echo_n "checking for uintptr_t... " >&6; }
 if test "${ac_cv_type_uintptr_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_uintptr_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12066,14 +12312,11 @@
         #include <stdint.h>
         #endif
 
-typedef uintptr_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
+if (sizeof (uintptr_t))
+       return 0;
   ;
   return 0;
 }
@@ -12084,55 +12327,33 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_uintptr_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_uintptr_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
-echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; }
-if test $ac_cv_type_uintptr_t = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_UINTPTR_T 1
-_ACEOF
-
-{ echo "$as_me:$LINENO: checking for uintptr_t" >&5
-echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_uintptr_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-typedef uintptr_t ac__type_new_;
+#ifdef HAVE_STDINT_H
+        #include <stdint.h>
+        #endif
+
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
+if (sizeof ((uintptr_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -12143,38 +12364,52 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_uintptr_t=yes
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_uintptr_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_uintptr_t=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
-echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
+$as_echo "$ac_cv_type_uintptr_t" >&6; }
+if test "x$ac_cv_type_uintptr_t" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of uintptr_t" >&5
-echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of uintptr_t" >&5
+$as_echo_n "checking size of uintptr_t... " >&6; }
 if test "${ac_cv_sizeof_uintptr_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -12185,11 +12420,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -12202,13 +12436,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -12222,11 +12457,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -12239,20 +12473,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -12266,7 +12501,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -12276,11 +12511,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) < 0)];
 test_array [0] = 0
 
   ;
@@ -12293,13 +12527,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -12313,11 +12548,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -12330,20 +12564,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -12357,7 +12592,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -12377,11 +12612,10 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef uintptr_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -12394,20 +12628,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -12418,11 +12653,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_uintptr_t=$ac_lo;;
 '') if test "$ac_cv_type_uintptr_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (uintptr_t)
+$as_echo "$as_me: error: cannot compute sizeof (uintptr_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_uintptr_t=0
    fi ;;
@@ -12435,9 +12672,8 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef uintptr_t ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (uintptr_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (uintptr_t)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -12447,20 +12683,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (uintptr_t))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (uintptr_t))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (uintptr_t))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -12473,43 +12711,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_uintptr_t=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_uintptr_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (uintptr_t)
+$as_echo "$as_me: error: cannot compute sizeof (uintptr_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_uintptr_t=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5
+$as_echo "$ac_cv_sizeof_uintptr_t" >&6; }
 
 
 
@@ -12523,10 +12766,10 @@
 
 
 # Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
-{ echo "$as_me:$LINENO: checking size of off_t" >&5
-echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
 if test "${ac_cv_sizeof_off_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_sizeof_off_t=4
@@ -12553,29 +12796,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_off_t=`cat conftestval`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_sizeof_off_t=0
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -12583,16 +12829,16 @@
 
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_OFF_T $ac_cv_sizeof_off_t
 _ACEOF
 
 
-{ echo "$as_me:$LINENO: checking whether to enable large file support" >&5
-echo $ECHO_N "checking whether to enable large file support... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether to enable large file support" >&5
+$as_echo_n "checking whether to enable large file support... " >&6; }
 if test "$have_long_long" = yes -a \
 	"$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
 	"$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
@@ -12601,18 +12847,18 @@
 #define HAVE_LARGEFILE_SUPPORT 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 # AC_CHECK_SIZEOF() doesn't include <time.h>.
-{ echo "$as_me:$LINENO: checking size of time_t" >&5
-echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5
+$as_echo_n "checking size of time_t... " >&6; }
 if test "${ac_cv_sizeof_time_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_sizeof_time_t=4
@@ -12639,29 +12885,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_time_t=`cat conftestval`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_sizeof_time_t=0
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -12669,8 +12918,8 @@
 
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5
+$as_echo "$ac_cv_sizeof_time_t" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_TIME_T $ac_cv_sizeof_time_t
@@ -12687,8 +12936,8 @@
 elif test "$ac_cv_pthread" = "yes"
 then CC="$CC -pthread"
 fi
-{ echo "$as_me:$LINENO: checking for pthread_t" >&5
-echo $ECHO_N "checking for pthread_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for pthread_t" >&5
+$as_echo_n "checking for pthread_t... " >&6; }
 have_pthread_t=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -12711,34 +12960,35 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   have_pthread_t=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $have_pthread_t" >&5
-echo "${ECHO_T}$have_pthread_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $have_pthread_t" >&5
+$as_echo "$have_pthread_t" >&6; }
 if test "$have_pthread_t" = yes ; then
   # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
-  { echo "$as_me:$LINENO: checking size of pthread_t" >&5
-echo $ECHO_N "checking size of pthread_t... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking size of pthread_t" >&5
+$as_echo_n "checking size of pthread_t... " >&6; }
   if test "${ac_cv_sizeof_pthread_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_sizeof_pthread_t=4
@@ -12765,29 +13015,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_pthread_t=`cat conftestval`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_sizeof_pthread_t=0
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -12795,8 +13048,8 @@
 
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_pthread_t" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5
+$as_echo "$ac_cv_sizeof_pthread_t" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t
@@ -12841,8 +13094,8 @@
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
 esac
 
-{ echo "$as_me:$LINENO: checking for --enable-framework" >&5
-echo $ECHO_N "checking for --enable-framework... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --enable-framework" >&5
+$as_echo_n "checking for --enable-framework... " >&6; }
 if test "$enable_framework"
 then
 	BASECFLAGS="$BASECFLAGS -fno-common -dynamic"
@@ -12853,15 +13106,15 @@
 #define WITH_NEXT_FRAMEWORK 1
 _ACEOF
 
-	{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-{ echo "$as_me:$LINENO: checking for dyld" >&5
-echo $ECHO_N "checking for dyld... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for dyld" >&5
+$as_echo_n "checking for dyld... " >&6; }
 case $ac_sys_system/$ac_sys_release in
   Darwin/*)
 
@@ -12869,12 +13122,12 @@
 #define WITH_DYLD 1
 _ACEOF
 
-  	{ echo "$as_me:$LINENO: result: always on for Darwin" >&5
-echo "${ECHO_T}always on for Darwin" >&6; }
+  	{ $as_echo "$as_me:$LINENO: result: always on for Darwin" >&5
+$as_echo "always on for Darwin" >&6; }
   	;;
   *)
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 	;;
 esac
 
@@ -12886,8 +13139,8 @@
 
 # SO is the extension of shared libraries `(including the dot!)
 # -- usually .so, .sl on HP-UX, .dll on Cygwin
-{ echo "$as_me:$LINENO: checking SO" >&5
-echo $ECHO_N "checking SO... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking SO" >&5
+$as_echo_n "checking SO... " >&6; }
 if test -z "$SO"
 then
 	case $ac_sys_system in
@@ -12912,8 +13165,9 @@
         echo '====================================================================='
 	sleep 10
 fi
-{ echo "$as_me:$LINENO: result: $SO" >&5
-echo "${ECHO_T}$SO" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $SO" >&5
+$as_echo "$SO" >&6; }
+
 
 cat >>confdefs.h <<_ACEOF
 #define SHLIB_EXT "$SO"
@@ -12923,8 +13177,8 @@
 # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
 # (Shared libraries in this instance are shared modules to be loaded into
 # Python, as opposed to building Python itself as a shared library.)
-{ echo "$as_me:$LINENO: checking LDSHARED" >&5
-echo $ECHO_N "checking LDSHARED... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking LDSHARED" >&5
+$as_echo_n "checking LDSHARED... " >&6; }
 if test -z "$LDSHARED"
 then
 	case $ac_sys_system/$ac_sys_release in
@@ -13026,13 +13280,13 @@
 	*)	LDSHARED="ld";;
 	esac
 fi
-{ echo "$as_me:$LINENO: result: $LDSHARED" >&5
-echo "${ECHO_T}$LDSHARED" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $LDSHARED" >&5
+$as_echo "$LDSHARED" >&6; }
 BLDSHARED=${BLDSHARED-$LDSHARED}
 # CCSHARED are the C *flags* used to create objects to go into a shared
 # library (module) -- this is only needed for a few systems
-{ echo "$as_me:$LINENO: checking CCSHARED" >&5
-echo $ECHO_N "checking CCSHARED... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking CCSHARED" >&5
+$as_echo_n "checking CCSHARED... " >&6; }
 if test -z "$CCSHARED"
 then
 	case $ac_sys_system/$ac_sys_release in
@@ -13067,12 +13321,12 @@
 	atheos*) CCSHARED="-fPIC";;
 	esac
 fi
-{ echo "$as_me:$LINENO: result: $CCSHARED" >&5
-echo "${ECHO_T}$CCSHARED" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $CCSHARED" >&5
+$as_echo "$CCSHARED" >&6; }
 # LINKFORSHARED are the flags passed to the $(CC) command that links
 # the python executable -- this is only needed for a few systems
-{ echo "$as_me:$LINENO: checking LINKFORSHARED" >&5
-echo $ECHO_N "checking LINKFORSHARED... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking LINKFORSHARED" >&5
+$as_echo_n "checking LINKFORSHARED... " >&6; }
 if test -z "$LINKFORSHARED"
 then
 	case $ac_sys_system/$ac_sys_release in
@@ -13127,13 +13381,13 @@
 		LINKFORSHARED='-Wl,-E -N 2048K';;
 	esac
 fi
-{ echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5
-echo "${ECHO_T}$LINKFORSHARED" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5
+$as_echo "$LINKFORSHARED" >&6; }
 
 
 
-{ echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5
-echo $ECHO_N "checking CFLAGSFORSHARED... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5
+$as_echo_n "checking CFLAGSFORSHARED... " >&6; }
 if test ! "$LIBRARY" = "$LDLIBRARY"
 then
 	case $ac_sys_system in
@@ -13145,8 +13399,8 @@
 		CFLAGSFORSHARED='$(CCSHARED)'
 	esac
 fi
-{ echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5
-echo "${ECHO_T}$CFLAGSFORSHARED" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5
+$as_echo "$CFLAGSFORSHARED" >&6; }
 
 # SHLIBS are libraries (except -lc and -lm) to link to the python shared
 # library (with --enable-shared).
@@ -13157,22 +13411,22 @@
 # don't need to link LIBS explicitly. The default should be only changed
 # on systems where this approach causes problems.
 
-{ echo "$as_me:$LINENO: checking SHLIBS" >&5
-echo $ECHO_N "checking SHLIBS... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking SHLIBS" >&5
+$as_echo_n "checking SHLIBS... " >&6; }
 case "$ac_sys_system" in
 	*)
 		SHLIBS='$(LIBS)';;
 esac
-{ echo "$as_me:$LINENO: result: $SHLIBS" >&5
-echo "${ECHO_T}$SHLIBS" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $SHLIBS" >&5
+$as_echo "$SHLIBS" >&6; }
 
 
 # checks for libraries
 
-{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
@@ -13204,33 +13458,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dl_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dl_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDL 1
 _ACEOF
@@ -13240,10 +13498,10 @@
 fi
 	# Dynamic linking for SunOS/Solaris and SYSV
 
-{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
 if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldld  $LIBS"
@@ -13275,33 +13533,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dld_shl_load=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dld_shl_load=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDLD 1
 _ACEOF
@@ -13311,12 +13573,12 @@
 fi
 	# Dynamic linking for HP-UX
 
-# only check for sem_ini if thread support is requested
+# only check for sem_init if thread support is requested
 if test "$with_threads" = "yes" -o -z "$with_threads"; then
-    { echo "$as_me:$LINENO: checking for library containing sem_init" >&5
-echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for library containing sem_init" >&5
+$as_echo_n "checking for library containing sem_init... " >&6; }
 if test "${ac_cv_search_sem_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
@@ -13354,26 +13616,30 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_search_sem_init=$ac_res
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
   if test "${ac_cv_search_sem_init+set}" = set; then
@@ -13388,8 +13654,8 @@
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5
-echo "${ECHO_T}$ac_cv_search_sem_init" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5
+$as_echo "$ac_cv_search_sem_init" >&6; }
 ac_res=$ac_cv_search_sem_init
 if test "$ac_res" != no; then
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
@@ -13401,10 +13667,10 @@
 fi
 
 # check if we need libintl for locale functions
-{ echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5
-echo $ECHO_N "checking for textdomain in -lintl... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5
+$as_echo_n "checking for textdomain in -lintl... " >&6; }
 if test "${ac_cv_lib_intl_textdomain+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
@@ -13436,33 +13702,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_intl_textdomain=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_intl_textdomain=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_textdomain" >&6; }
-if test $ac_cv_lib_intl_textdomain = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5
+$as_echo "$ac_cv_lib_intl_textdomain" >&6; }
+if test "x$ac_cv_lib_intl_textdomain" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define WITH_LIBINTL 1
@@ -13473,8 +13743,8 @@
 
 # checks for system dependent C++ extensions support
 case "$ac_sys_system" in
-	AIX*)	{ echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5
-echo $ECHO_N "checking for genuine AIX C++ extensions support... $ECHO_C" >&6; }
+	AIX*)	{ $as_echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5
+$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; }
 		cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -13496,43 +13766,47 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 cat >>confdefs.h <<\_ACEOF
 #define AIX_GENUINE_CPLUSPLUS 1
 _ACEOF
 
-			     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+			     { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext;;
 	*) ;;
 esac
 
 # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
-{ echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5
-echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5
+$as_echo_n "checking for t_open in -lnsl... " >&6; }
 if test "${ac_cv_lib_nsl_t_open+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
@@ -13564,40 +13838,44 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_nsl_t_open=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_nsl_t_open=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_t_open" >&6; }
-if test $ac_cv_lib_nsl_t_open = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5
+$as_echo "$ac_cv_lib_nsl_t_open" >&6; }
+if test "x$ac_cv_lib_nsl_t_open" = x""yes; then
   LIBS="-lnsl $LIBS"
 fi
  # SVR4
-{ echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
-echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
 if test "${ac_cv_lib_socket_socket+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket $LIBS $LIBS"
@@ -13629,56 +13907,60 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_socket_socket=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_socket_socket=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; }
-if test $ac_cv_lib_socket_socket = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = x""yes; then
   LIBS="-lsocket $LIBS"
 fi
  # SVR4 sockets
 
-{ echo "$as_me:$LINENO: checking for --with-libs" >&5
-echo $ECHO_N "checking for --with-libs... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-libs" >&5
+$as_echo_n "checking for --with-libs... " >&6; }
 
 # Check whether --with-libs was given.
 if test "${with_libs+set}" = set; then
   withval=$with_libs;
-{ echo "$as_me:$LINENO: result: $withval" >&5
-echo "${ECHO_T}$withval" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $withval" >&5
+$as_echo "$withval" >&6; }
 LIBS="$withval $LIBS"
 
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 # Check for use of the system libffi library
-{ echo "$as_me:$LINENO: checking for --with-system-ffi" >&5
-echo $ECHO_N "checking for --with-system-ffi... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-system-ffi" >&5
+$as_echo_n "checking for --with-system-ffi... " >&6; }
 
 # Check whether --with-system_ffi was given.
 if test "${with_system_ffi+set}" = set; then
@@ -13686,14 +13968,14 @@
 fi
 
 
-{ echo "$as_me:$LINENO: result: $with_system_ffi" >&5
-echo "${ECHO_T}$with_system_ffi" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $with_system_ffi" >&5
+$as_echo "$with_system_ffi" >&6; }
 
 # Determine if signalmodule should be used.
 
 
-{ echo "$as_me:$LINENO: checking for --with-signal-module" >&5
-echo $ECHO_N "checking for --with-signal-module... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-signal-module" >&5
+$as_echo_n "checking for --with-signal-module... " >&6; }
 
 # Check whether --with-signal-module was given.
 if test "${with_signal_module+set}" = set; then
@@ -13704,8 +13986,8 @@
 if test -z "$with_signal_module"
 then with_signal_module="yes"
 fi
-{ echo "$as_me:$LINENO: result: $with_signal_module" >&5
-echo "${ECHO_T}$with_signal_module" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $with_signal_module" >&5
+$as_echo "$with_signal_module" >&6; }
 
 if test "${with_signal_module}" = "yes"; then
 	USE_SIGNAL_MODULE=""
@@ -13719,22 +14001,22 @@
 
 USE_THREAD_MODULE=""
 
-{ echo "$as_me:$LINENO: checking for --with-dec-threads" >&5
-echo $ECHO_N "checking for --with-dec-threads... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-dec-threads" >&5
+$as_echo_n "checking for --with-dec-threads... " >&6; }
 
 
 # Check whether --with-dec-threads was given.
 if test "${with_dec_threads+set}" = set; then
   withval=$with_dec_threads;
-{ echo "$as_me:$LINENO: result: $withval" >&5
-echo "${ECHO_T}$withval" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $withval" >&5
+$as_echo "$withval" >&6; }
 LDLAST=-threads
 if test "${with_thread+set}" != set; then
    with_thread="$withval";
 fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -13747,8 +14029,8 @@
 
 
 
-{ echo "$as_me:$LINENO: checking for --with-threads" >&5
-echo $ECHO_N "checking for --with-threads... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-threads" >&5
+$as_echo_n "checking for --with-threads... " >&6; }
 
 # Check whether --with-threads was given.
 if test "${with_threads+set}" = set; then
@@ -13767,8 +14049,8 @@
 if test -z "$with_threads"
 then with_threads="yes"
 fi
-{ echo "$as_me:$LINENO: result: $with_threads" >&5
-echo "${ECHO_T}$with_threads" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $with_threads" >&5
+$as_echo "$with_threads" >&6; }
 
 
 if test "$with_threads" = "no"
@@ -13834,8 +14116,8 @@
     # According to the POSIX spec, a pthreads implementation must
     # define _POSIX_THREADS in unistd.h. Some apparently don't
     # (e.g. gnu pth with pthread emulation)
-    { echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5
-echo $ECHO_N "checking for _POSIX_THREADS in unistd.h... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5
+$as_echo_n "checking for _POSIX_THREADS in unistd.h... " >&6; }
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -13857,25 +14139,25 @@
 fi
 rm -f conftest*
 
-    { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
-echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
+    { $as_echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
+$as_echo "$unistd_defines_pthreads" >&6; }
 
     cat >>confdefs.h <<\_ACEOF
 #define _REENTRANT 1
 _ACEOF
 
     if test "${ac_cv_header_cthreads_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for cthreads.h" >&5
-echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5
+$as_echo_n "checking for cthreads.h... " >&6; }
 if test "${ac_cv_header_cthreads_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5
-echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5
+$as_echo "$ac_cv_header_cthreads_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking cthreads.h usability" >&5
-echo $ECHO_N "checking cthreads.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking cthreads.h usability" >&5
+$as_echo_n "checking cthreads.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -13891,32 +14173,33 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking cthreads.h presence" >&5
-echo $ECHO_N "checking cthreads.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking cthreads.h presence" >&5
+$as_echo_n "checking cthreads.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -13930,51 +14213,52 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: cthreads.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: cthreads.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: cthreads.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: cthreads.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cthreads.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: cthreads.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cthreads.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: cthreads.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to http://www.python.org/python-bugs ##
@@ -13983,18 +14267,18 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for cthreads.h" >&5
-echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5
+$as_echo_n "checking for cthreads.h... " >&6; }
 if test "${ac_cv_header_cthreads_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_header_cthreads_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5
-echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5
+$as_echo "$ac_cv_header_cthreads_h" >&6; }
 
 fi
-if test $ac_cv_header_cthreads_h = yes; then
+if test "x$ac_cv_header_cthreads_h" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14013,17 +14297,17 @@
 else
 
     if test "${ac_cv_header_mach_cthreads_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5
-echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5
+$as_echo_n "checking for mach/cthreads.h... " >&6; }
 if test "${ac_cv_header_mach_cthreads_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5
-echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5
+$as_echo "$ac_cv_header_mach_cthreads_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5
-echo $ECHO_N "checking mach/cthreads.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5
+$as_echo_n "checking mach/cthreads.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14039,32 +14323,33 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5
-echo $ECHO_N "checking mach/cthreads.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5
+$as_echo_n "checking mach/cthreads.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14078,51 +14363,52 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mach/cthreads.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: mach/cthreads.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mach/cthreads.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: mach/cthreads.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: mach/cthreads.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: mach/cthreads.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to http://www.python.org/python-bugs ##
@@ -14131,18 +14417,18 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5
-echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5
+$as_echo_n "checking for mach/cthreads.h... " >&6; }
 if test "${ac_cv_header_mach_cthreads_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_header_mach_cthreads_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5
-echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5
+$as_echo "$ac_cv_header_mach_cthreads_h" >&6; }
 
 fi
-if test $ac_cv_header_mach_cthreads_h = yes; then
+if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14159,13 +14445,13 @@
     THREADOBJ="Python/thread.o"
 else
 
-    { echo "$as_me:$LINENO: checking for --with-pth" >&5
-echo $ECHO_N "checking for --with-pth... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for --with-pth" >&5
+$as_echo_n "checking for --with-pth... " >&6; }
 
 # Check whether --with-pth was given.
 if test "${with_pth+set}" = set; then
-  withval=$with_pth; { echo "$as_me:$LINENO: result: $withval" >&5
-echo "${ECHO_T}$withval" >&6; }
+  withval=$with_pth; { $as_echo "$as_me:$LINENO: result: $withval" >&5
+$as_echo "$withval" >&6; }
                   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14178,16 +14464,16 @@
                   LIBS="-lpth $LIBS"
                   THREADOBJ="Python/thread.o"
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
     # Just looking for pthread_create in libpthread is not enough:
     # on HP/UX, pthread.h renames pthread_create to a different symbol name.
     # So we really have to include pthread.h, and then link.
     _libs=$LIBS
     LIBS="$LIBS -lpthread"
-    { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14212,21 +14498,24 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
-    { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+    { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
     cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14234,15 +14523,15 @@
     posix_threads=yes
     THREADOBJ="Python/thread.o"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
     LIBS=$_libs
-    { echo "$as_me:$LINENO: checking for pthread_detach" >&5
-echo $ECHO_N "checking for pthread_detach... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for pthread_detach" >&5
+$as_echo_n "checking for pthread_detach... " >&6; }
 if test "${ac_cv_func_pthread_detach+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -14295,32 +14584,36 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_pthread_detach=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_pthread_detach=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5
-echo "${ECHO_T}$ac_cv_func_pthread_detach" >&6; }
-if test $ac_cv_func_pthread_detach = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5
+$as_echo "$ac_cv_func_pthread_detach" >&6; }
+if test "x$ac_cv_func_pthread_detach" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14330,17 +14623,17 @@
 else
 
     if test "${ac_cv_header_atheos_threads_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for atheos/threads.h" >&5
-echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5
+$as_echo_n "checking for atheos/threads.h... " >&6; }
 if test "${ac_cv_header_atheos_threads_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5
-echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5
+$as_echo "$ac_cv_header_atheos_threads_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5
-echo $ECHO_N "checking atheos/threads.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5
+$as_echo_n "checking atheos/threads.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14356,32 +14649,33 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5
-echo $ECHO_N "checking atheos/threads.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5
+$as_echo_n "checking atheos/threads.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14395,51 +14689,52 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: atheos/threads.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: atheos/threads.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: atheos/threads.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: atheos/threads.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: atheos/threads.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: atheos/threads.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to http://www.python.org/python-bugs ##
@@ -14448,18 +14743,18 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for atheos/threads.h" >&5
-echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5
+$as_echo_n "checking for atheos/threads.h... " >&6; }
 if test "${ac_cv_header_atheos_threads_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_header_atheos_threads_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5
-echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5
+$as_echo "$ac_cv_header_atheos_threads_h" >&6; }
 
 fi
-if test $ac_cv_header_atheos_threads_h = yes; then
+if test "x$ac_cv_header_atheos_threads_h" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14472,10 +14767,10 @@
     THREADOBJ="Python/thread.o"
 else
 
-    { echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5
-echo $ECHO_N "checking for pthread_create in -lpthreads... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5
+$as_echo_n "checking for pthread_create in -lpthreads... " >&6; }
 if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthreads  $LIBS"
@@ -14507,33 +14802,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_pthreads_pthread_create=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_pthreads_pthread_create=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5
-echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_create" >&6; }
-if test $ac_cv_lib_pthreads_pthread_create = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14543,10 +14842,10 @@
     THREADOBJ="Python/thread.o"
 else
 
-    { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5
-echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5
+$as_echo_n "checking for pthread_create in -lc_r... " >&6; }
 if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lc_r  $LIBS"
@@ -14578,33 +14877,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_c_r_pthread_create=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_c_r_pthread_create=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
-echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; }
-if test $ac_cv_lib_c_r_pthread_create = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14614,10 +14917,10 @@
     THREADOBJ="Python/thread.o"
 else
 
-    { echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5
-echo $ECHO_N "checking for __pthread_create_system in -lpthread... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5
+$as_echo_n "checking for __pthread_create_system in -lpthread... " >&6; }
 if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthread  $LIBS"
@@ -14649,33 +14952,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_pthread___pthread_create_system=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_pthread___pthread_create_system=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread___pthread_create_system" >&6; }
-if test $ac_cv_lib_pthread___pthread_create_system = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5
+$as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; }
+if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14685,10 +14992,10 @@
     THREADOBJ="Python/thread.o"
 else
 
-    { echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5
-echo $ECHO_N "checking for pthread_create in -lcma... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5
+$as_echo_n "checking for pthread_create in -lcma... " >&6; }
 if test "${ac_cv_lib_cma_pthread_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcma  $LIBS"
@@ -14720,33 +15027,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_cma_pthread_create=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_cma_pthread_create=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5
-echo "${ECHO_T}$ac_cv_lib_cma_pthread_create" >&6; }
-if test $ac_cv_lib_cma_pthread_create = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5
+$as_echo "$ac_cv_lib_cma_pthread_create" >&6; }
+if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14773,6 +15084,7 @@
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
@@ -14784,10 +15096,10 @@
 
 
 
-    { echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5
-echo $ECHO_N "checking for usconfig in -lmpc... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5
+$as_echo_n "checking for usconfig in -lmpc... " >&6; }
 if test "${ac_cv_lib_mpc_usconfig+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmpc  $LIBS"
@@ -14819,33 +15131,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_mpc_usconfig=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_mpc_usconfig=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5
-echo "${ECHO_T}$ac_cv_lib_mpc_usconfig" >&6; }
-if test $ac_cv_lib_mpc_usconfig = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5
+$as_echo "$ac_cv_lib_mpc_usconfig" >&6; }
+if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14857,10 +15173,10 @@
 
 
     if test "$posix_threads" != "yes"; then
-      { echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5
-echo $ECHO_N "checking for thr_create in -lthread... $ECHO_C" >&6; }
+      { $as_echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5
+$as_echo_n "checking for thr_create in -lthread... " >&6; }
 if test "${ac_cv_lib_thread_thr_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lthread  $LIBS"
@@ -14892,33 +15208,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_thread_thr_create=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_thread_thr_create=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5
-echo "${ECHO_T}$ac_cv_lib_thread_thr_create" >&6; }
-if test $ac_cv_lib_thread_thr_create = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5
+$as_echo "$ac_cv_lib_thread_thr_create" >&6; }
+if test "x$ac_cv_lib_thread_thr_create" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define WITH_THREAD 1
 _ACEOF
@@ -14971,10 +15291,10 @@
 		       ;;
       esac
 
-      { echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5
-echo $ECHO_N "checking if PTHREAD_SCOPE_SYSTEM is supported... $ECHO_C" >&6; }
+      { $as_echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5
+$as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; }
       if test "${ac_cv_pthread_system_supported+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_pthread_system_supported=no
@@ -15004,29 +15324,32 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_pthread_system_supported=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_pthread_system_supported=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -15034,8 +15357,8 @@
 
 fi
 
-      { echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5
-echo "${ECHO_T}$ac_cv_pthread_system_supported" >&6; }
+      { $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5
+$as_echo "$ac_cv_pthread_system_supported" >&6; }
       if test "$ac_cv_pthread_system_supported" = "yes"; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -15046,11 +15369,11 @@
 
 for ac_func in pthread_sigmask
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -15103,35 +15426,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
  case $ac_sys_system in
         CYGWIN*)
@@ -15151,18 +15481,18 @@
 # Check for enable-ipv6
 
 
-{ echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5
-echo $ECHO_N "checking if --enable-ipv6 is specified... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5
+$as_echo_n "checking if --enable-ipv6 is specified... " >&6; }
 # Check whether --enable-ipv6 was given.
 if test "${enable_ipv6+set}" = set; then
   enableval=$enable_ipv6;  case "$enableval" in
   no)
-       { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
        ipv6=no
        ;;
-  *)   { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  *)   { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
        cat >>confdefs.h <<\_ACEOF
 #define ENABLE_IPV6 1
 _ACEOF
@@ -15173,8 +15503,8 @@
 else
 
   if test "$cross_compiling" = yes; then
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
   ipv6=no
 
 else
@@ -15202,41 +15532,44 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
   ipv6=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
   ipv6=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 
 if test "$ipv6" = "yes"; then
-	{ echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5
-echo $ECHO_N "checking if RFC2553 API is available... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5
+$as_echo_n "checking if RFC2553 API is available... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -15260,26 +15593,27 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 		ipv6=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 		ipv6=no
 fi
 
@@ -15301,8 +15635,8 @@
 ipv6trylibc=no
 
 if test "$ipv6" = "yes"; then
-	{ echo "$as_me:$LINENO: checking ipv6 stack type" >&5
-echo $ECHO_N "checking ipv6 stack type... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking ipv6 stack type" >&5
+$as_echo_n "checking ipv6 stack type... " >&6; }
 	for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
 	do
 		case $i in
@@ -15458,8 +15792,8 @@
 			break
 		fi
 	done
-	{ echo "$as_me:$LINENO: result: $ipv6type" >&5
-echo "${ECHO_T}$ipv6type" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: $ipv6type" >&5
+$as_echo "$ipv6type" >&6; }
 fi
 
 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
@@ -15478,8 +15812,8 @@
 	fi
 fi
 
-{ echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5
-echo $ECHO_N "checking for OSX 10.5 SDK or later... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5
+$as_echo_n "checking for OSX 10.5 SDK or later... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -15501,13 +15835,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -15517,22 +15852,22 @@
 #define HAVE_OSX105_SDK 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 # Check for --with-doc-strings
-{ echo "$as_me:$LINENO: checking for --with-doc-strings" >&5
-echo $ECHO_N "checking for --with-doc-strings... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-doc-strings" >&5
+$as_echo_n "checking for --with-doc-strings... " >&6; }
 
 # Check whether --with-doc-strings was given.
 if test "${with_doc_strings+set}" = set; then
@@ -15551,12 +15886,12 @@
 _ACEOF
 
 fi
-{ echo "$as_me:$LINENO: result: $with_doc_strings" >&5
-echo "${ECHO_T}$with_doc_strings" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $with_doc_strings" >&5
+$as_echo "$with_doc_strings" >&6; }
 
 # Check for Python-specific malloc support
-{ echo "$as_me:$LINENO: checking for --with-tsc" >&5
-echo $ECHO_N "checking for --with-tsc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-tsc" >&5
+$as_echo_n "checking for --with-tsc... " >&6; }
 
 # Check whether --with-tsc was given.
 if test "${with_tsc+set}" = set; then
@@ -15568,20 +15903,20 @@
 #define WITH_TSC 1
 _ACEOF
 
-    { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+    { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 # Check for Python-specific malloc support
-{ echo "$as_me:$LINENO: checking for --with-pymalloc" >&5
-echo $ECHO_N "checking for --with-pymalloc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-pymalloc" >&5
+$as_echo_n "checking for --with-pymalloc... " >&6; }
 
 # Check whether --with-pymalloc was given.
 if test "${with_pymalloc+set}" = set; then
@@ -15600,12 +15935,12 @@
 _ACEOF
 
 fi
-{ echo "$as_me:$LINENO: result: $with_pymalloc" >&5
-echo "${ECHO_T}$with_pymalloc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $with_pymalloc" >&5
+$as_echo "$with_pymalloc" >&6; }
 
 # Check for --with-wctype-functions
-{ echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5
-echo $ECHO_N "checking for --with-wctype-functions... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5
+$as_echo_n "checking for --with-wctype-functions... " >&6; }
 
 # Check whether --with-wctype-functions was given.
 if test "${with_wctype_functions+set}" = set; then
@@ -15617,14 +15952,14 @@
 #define WANT_WCTYPE_FUNCTIONS 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -15637,11 +15972,11 @@
 
 for ac_func in dlopen
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -15694,35 +16029,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -15732,8 +16074,8 @@
 # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic
 # loading of modules.
 
-{ echo "$as_me:$LINENO: checking DYNLOADFILE" >&5
-echo $ECHO_N "checking DYNLOADFILE... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking DYNLOADFILE" >&5
+$as_echo_n "checking DYNLOADFILE... " >&6; }
 if test -z "$DYNLOADFILE"
 then
 	case $ac_sys_system/$ac_sys_release in
@@ -15757,8 +16099,8 @@
 	;;
 	esac
 fi
-{ echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5
-echo "${ECHO_T}$DYNLOADFILE" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5
+$as_echo "$DYNLOADFILE" >&6; }
 if test "$DYNLOADFILE" != "dynload_stub.o"
 then
 
@@ -15771,16 +16113,16 @@
 # MACHDEP_OBJS can be set to platform-specific object files needed by Python
 
 
-{ echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5
-echo $ECHO_N "checking MACHDEP_OBJS... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5
+$as_echo_n "checking MACHDEP_OBJS... " >&6; }
 if test -z "$MACHDEP_OBJS"
 then
 	MACHDEP_OBJS=$extra_machdep_objs
 else
 	MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs"
 fi
-{ echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5
-echo "${ECHO_T}MACHDEP_OBJS" >&6; }
+{ $as_echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5
+$as_echo "MACHDEP_OBJS" >&6; }
 
 # checks for library functions
 
@@ -15879,11 +16221,11 @@
  sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
  truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll wcsxfrm _getpty
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -15936,35 +16278,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -15973,8 +16322,8 @@
 
 # For some functions, having a definition is not sufficient, since
 # we want to take their address.
-{ echo "$as_me:$LINENO: checking for chroot" >&5
-echo $ECHO_N "checking for chroot... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for chroot" >&5
+$as_echo_n "checking for chroot... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -15996,13 +16345,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16012,20 +16362,20 @@
 #define HAVE_CHROOT 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for link" >&5
-echo $ECHO_N "checking for link... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for link" >&5
+$as_echo_n "checking for link... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16047,13 +16397,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16063,20 +16414,20 @@
 #define HAVE_LINK 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for symlink" >&5
-echo $ECHO_N "checking for symlink... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for symlink" >&5
+$as_echo_n "checking for symlink... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16098,13 +16449,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16114,20 +16466,20 @@
 #define HAVE_SYMLINK 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for fchdir" >&5
-echo $ECHO_N "checking for fchdir... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for fchdir" >&5
+$as_echo_n "checking for fchdir... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16149,13 +16501,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16165,20 +16518,20 @@
 #define HAVE_FCHDIR 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for fsync" >&5
-echo $ECHO_N "checking for fsync... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for fsync" >&5
+$as_echo_n "checking for fsync... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16200,13 +16553,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16216,20 +16570,20 @@
 #define HAVE_FSYNC 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for fdatasync" >&5
-echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for fdatasync" >&5
+$as_echo_n "checking for fdatasync... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16251,13 +16605,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16267,20 +16622,20 @@
 #define HAVE_FDATASYNC 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for epoll" >&5
-echo $ECHO_N "checking for epoll... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for epoll" >&5
+$as_echo_n "checking for epoll... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16302,13 +16657,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16318,20 +16674,20 @@
 #define HAVE_EPOLL 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for kqueue" >&5
-echo $ECHO_N "checking for kqueue... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for kqueue" >&5
+$as_echo_n "checking for kqueue... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16356,13 +16712,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16372,14 +16729,14 @@
 #define HAVE_KQUEUE 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -16390,8 +16747,8 @@
 # address to avoid compiler warnings and potential miscompilations
 # because of the missing prototypes.
 
-{ echo "$as_me:$LINENO: checking for ctermid_r" >&5
-echo $ECHO_N "checking for ctermid_r... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for ctermid_r" >&5
+$as_echo_n "checking for ctermid_r... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16416,13 +16773,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16432,21 +16790,21 @@
 #define HAVE_CTERMID_R 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-{ echo "$as_me:$LINENO: checking for flock" >&5
-echo $ECHO_N "checking for flock... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for flock" >&5
+$as_echo_n "checking for flock... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16471,13 +16829,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16487,21 +16846,21 @@
 #define HAVE_FLOCK 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-{ echo "$as_me:$LINENO: checking for getpagesize" >&5
-echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for getpagesize" >&5
+$as_echo_n "checking for getpagesize... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16526,13 +16885,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -16542,14 +16902,14 @@
 #define HAVE_GETPAGESIZE 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -16559,10 +16919,10 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_TRUE+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$TRUE"; then
   ac_cv_prog_TRUE="$TRUE" # Let the user override the test.
@@ -16575,7 +16935,7 @@
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_TRUE="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -16586,11 +16946,11 @@
 fi
 TRUE=$ac_cv_prog_TRUE
 if test -n "$TRUE"; then
-  { echo "$as_me:$LINENO: result: $TRUE" >&5
-echo "${ECHO_T}$TRUE" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $TRUE" >&5
+$as_echo "$TRUE" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -16599,10 +16959,10 @@
 test -n "$TRUE" || TRUE="/bin/true"
 
 
-{ echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5
-echo $ECHO_N "checking for inet_aton in -lc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5
+$as_echo_n "checking for inet_aton in -lc... " >&6; }
 if test "${ac_cv_lib_c_inet_aton+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lc  $LIBS"
@@ -16634,40 +16994,44 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_c_inet_aton=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_c_inet_aton=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5
-echo "${ECHO_T}$ac_cv_lib_c_inet_aton" >&6; }
-if test $ac_cv_lib_c_inet_aton = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5
+$as_echo "$ac_cv_lib_c_inet_aton" >&6; }
+if test "x$ac_cv_lib_c_inet_aton" = x""yes; then
   $ac_cv_prog_TRUE
 else
 
-{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5
-echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5
+$as_echo_n "checking for inet_aton in -lresolv... " >&6; }
 if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
@@ -16699,33 +17063,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_resolv_inet_aton=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_resolv_inet_aton=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5
-echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; }
-if test $ac_cv_lib_resolv_inet_aton = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5
+$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; }
+if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBRESOLV 1
 _ACEOF
@@ -16740,14 +17108,16 @@
 
 # On Tru64, chflags seems to be present, but calling it will
 # exit Python
-{ echo "$as_me:$LINENO: checking for chflags" >&5
-echo $ECHO_N "checking for chflags... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for chflags" >&5
+$as_echo_n "checking for chflags... " >&6; }
 if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
+$as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -16772,50 +17142,55 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CHFLAGS 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 
-{ echo "$as_me:$LINENO: checking for lchflags" >&5
-echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for lchflags" >&5
+$as_echo_n "checking for lchflags... " >&6; }
 if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
+$as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -16840,37 +17215,40 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_LCHFLAGS 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -16885,10 +17263,10 @@
 	;;
 esac
 
-{ echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5
-echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5
+$as_echo_n "checking for inflateCopy in -lz... " >&6; }
 if test "${ac_cv_lib_z_inflateCopy+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lz  $LIBS"
@@ -16920,33 +17298,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_z_inflateCopy=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_z_inflateCopy=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5
-echo "${ECHO_T}$ac_cv_lib_z_inflateCopy" >&6; }
-if test $ac_cv_lib_z_inflateCopy = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5
+$as_echo "$ac_cv_lib_z_inflateCopy" >&6; }
+if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_ZLIB_COPY 1
@@ -16962,8 +17344,8 @@
 	;;
 esac
 
-{ echo "$as_me:$LINENO: checking for hstrerror" >&5
-echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for hstrerror" >&5
+$as_echo_n "checking for hstrerror... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16988,39 +17370,43 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_HSTRERROR 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
-{ echo "$as_me:$LINENO: checking for inet_aton" >&5
-echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for inet_aton" >&5
+$as_echo_n "checking for inet_aton... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17048,39 +17434,43 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_INET_ATON 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
-{ echo "$as_me:$LINENO: checking for inet_pton" >&5
-echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for inet_pton" >&5
+$as_echo_n "checking for inet_pton... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17108,13 +17498,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -17124,22 +17515,22 @@
 #define HAVE_INET_PTON 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 # On some systems, setgroups is in unistd.h, on others, in grp.h
-{ echo "$as_me:$LINENO: checking for setgroups" >&5
-echo $ECHO_N "checking for setgroups... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for setgroups" >&5
+$as_echo_n "checking for setgroups... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17167,13 +17558,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -17183,14 +17575,14 @@
 #define HAVE_SETGROUPS 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -17201,11 +17593,11 @@
 
 for ac_func in openpty
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -17258,42 +17650,49 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 else
-  { echo "$as_me:$LINENO: checking for openpty in -lutil" >&5
-echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for openpty in -lutil" >&5
+$as_echo_n "checking for openpty in -lutil... " >&6; }
 if test "${ac_cv_lib_util_openpty+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lutil  $LIBS"
@@ -17325,42 +17724,46 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_util_openpty=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_util_openpty=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5
-echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6; }
-if test $ac_cv_lib_util_openpty = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5
+$as_echo "$ac_cv_lib_util_openpty" >&6; }
+if test "x$ac_cv_lib_util_openpty" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_OPENPTY 1
 _ACEOF
  LIBS="$LIBS -lutil"
 else
-  { echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5
-echo $ECHO_N "checking for openpty in -lbsd... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5
+$as_echo_n "checking for openpty in -lbsd... " >&6; }
 if test "${ac_cv_lib_bsd_openpty+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
@@ -17392,33 +17795,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_bsd_openpty=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_bsd_openpty=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5
-echo "${ECHO_T}$ac_cv_lib_bsd_openpty" >&6; }
-if test $ac_cv_lib_bsd_openpty = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5
+$as_echo "$ac_cv_lib_bsd_openpty" >&6; }
+if test "x$ac_cv_lib_bsd_openpty" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_OPENPTY 1
 _ACEOF
@@ -17435,11 +17842,11 @@
 
 for ac_func in forkpty
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -17492,42 +17899,49 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 else
-  { echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5
-echo $ECHO_N "checking for forkpty in -lutil... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5
+$as_echo_n "checking for forkpty in -lutil... " >&6; }
 if test "${ac_cv_lib_util_forkpty+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lutil  $LIBS"
@@ -17559,42 +17973,46 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_util_forkpty=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_util_forkpty=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5
-echo "${ECHO_T}$ac_cv_lib_util_forkpty" >&6; }
-if test $ac_cv_lib_util_forkpty = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5
+$as_echo "$ac_cv_lib_util_forkpty" >&6; }
+if test "x$ac_cv_lib_util_forkpty" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_FORKPTY 1
 _ACEOF
  LIBS="$LIBS -lutil"
 else
-  { echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5
-echo $ECHO_N "checking for forkpty in -lbsd... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5
+$as_echo_n "checking for forkpty in -lbsd... " >&6; }
 if test "${ac_cv_lib_bsd_forkpty+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
@@ -17626,33 +18044,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_bsd_forkpty=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_bsd_forkpty=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5
-echo "${ECHO_T}$ac_cv_lib_bsd_forkpty" >&6; }
-if test $ac_cv_lib_bsd_forkpty = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5
+$as_echo "$ac_cv_lib_bsd_forkpty" >&6; }
+if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_FORKPTY 1
 _ACEOF
@@ -17671,11 +18093,11 @@
 
 for ac_func in memmove
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -17728,35 +18150,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -17772,11 +18201,11 @@
 
 for ac_func in fseek64 fseeko fstatvfs ftell64 ftello statvfs
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -17829,35 +18258,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -17869,11 +18305,11 @@
 
 for ac_func in dup2 getcwd strdup
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -17926,35 +18362,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 else
@@ -17971,11 +18414,11 @@
 
 for ac_func in getpgrp
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18028,35 +18471,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18079,13 +18529,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -18097,7 +18548,7 @@
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -18111,11 +18562,11 @@
 
 for ac_func in setpgrp
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18168,35 +18619,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18219,13 +18677,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -18237,7 +18696,7 @@
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -18251,11 +18710,11 @@
 
 for ac_func in gettimeofday
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18308,35 +18767,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18359,20 +18825,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -18389,8 +18856,8 @@
 done
 
 
-{ echo "$as_me:$LINENO: checking for major" >&5
-echo $ECHO_N "checking for major... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for major" >&5
+$as_echo_n "checking for major... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18422,44 +18889,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_DEVICE_MACROS 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 # On OSF/1 V5.1, getaddrinfo is available, but a define
 # for [no]getaddrinfo in netdb.h.
-{ echo "$as_me:$LINENO: checking for getaddrinfo" >&5
-echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5
+$as_echo_n "checking for getaddrinfo... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18488,26 +18959,29 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-{ echo "$as_me:$LINENO: checking getaddrinfo bug" >&5
-echo $ECHO_N "checking getaddrinfo bug... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+{ $as_echo "$as_me:$LINENO: checking getaddrinfo bug" >&5
+$as_echo_n "checking getaddrinfo bug... " >&6; }
 if test "$cross_compiling" = yes; then
-  { echo "$as_me:$LINENO: result: buggy" >&5
-echo "${ECHO_T}buggy" >&6; }
+  { $as_echo "$as_me:$LINENO: result: buggy" >&5
+$as_echo "buggy" >&6; }
 buggygetaddrinfo=yes
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -18610,48 +19084,52 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  { echo "$as_me:$LINENO: result: good" >&5
-echo "${ECHO_T}good" >&6; }
+  { $as_echo "$as_me:$LINENO: result: good" >&5
+$as_echo "good" >&6; }
 buggygetaddrinfo=no
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ echo "$as_me:$LINENO: result: buggy" >&5
-echo "${ECHO_T}buggy" >&6; }
+{ $as_echo "$as_me:$LINENO: result: buggy" >&5
+$as_echo "buggy" >&6; }
 buggygetaddrinfo=yes
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 buggygetaddrinfo=yes
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
@@ -18671,11 +19149,11 @@
 
 for ac_func in getnameinfo
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18728,35 +19206,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -18764,10 +19249,10 @@
 
 
 # checks for structures
-{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
 if test "${ac_cv_header_time+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18794,20 +19279,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_header_time=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_header_time=no
@@ -18815,8 +19301,8 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
 if test $ac_cv_header_time = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -18825,10 +19311,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
-echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
 if test "${ac_cv_struct_tm+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18844,7 +19330,7 @@
 {
 struct tm tm;
 				     int *p = &tm.tm_sec;
- 				     return !p;
+				     return !p;
   ;
   return 0;
 }
@@ -18855,20 +19341,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_struct_tm=time.h
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_struct_tm=sys/time.h
@@ -18876,8 +19363,8 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
-echo "${ECHO_T}$ac_cv_struct_tm" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
 if test $ac_cv_struct_tm = sys/time.h; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -18886,10 +19373,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
-echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
+$as_echo_n "checking for struct tm.tm_zone... " >&6; }
 if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18917,20 +19404,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -18959,20 +19447,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_tm_tm_zone=no
@@ -18983,9 +19472,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
-echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; }
-if test $ac_cv_member_struct_tm_tm_zone = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
+$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; }
+if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_TM_TM_ZONE 1
@@ -19001,10 +19490,10 @@
 _ACEOF
 
 else
-  { echo "$as_me:$LINENO: checking whether tzname is declared" >&5
-echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5
+$as_echo_n "checking whether tzname is declared... " >&6; }
 if test "${ac_cv_have_decl_tzname+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19031,20 +19520,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_tzname=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_have_decl_tzname=no
@@ -19052,9 +19542,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5
-echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; }
-if test $ac_cv_have_decl_tzname = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5
+$as_echo "$ac_cv_have_decl_tzname" >&6; }
+if test "x$ac_cv_have_decl_tzname" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_TZNAME 1
@@ -19070,10 +19560,10 @@
 fi
 
 
-  { echo "$as_me:$LINENO: checking for tzname" >&5
-echo $ECHO_N "checking for tzname... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for tzname" >&5
+$as_echo_n "checking for tzname... " >&6; }
 if test "${ac_cv_var_tzname+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19100,31 +19590,35 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_var_tzname=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_var_tzname=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
-echo "${ECHO_T}$ac_cv_var_tzname" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
+$as_echo "$ac_cv_var_tzname" >&6; }
   if test $ac_cv_var_tzname = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -19134,10 +19628,10 @@
   fi
 fi
 
-{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5
-echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5
+$as_echo_n "checking for struct stat.st_rdev... " >&6; }
 if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19162,20 +19656,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_rdev=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -19201,20 +19696,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_rdev=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_stat_st_rdev=no
@@ -19225,9 +19721,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; }
-if test $ac_cv_member_struct_stat_st_rdev = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5
+$as_echo "$ac_cv_member_struct_stat_st_rdev" >&6; }
+if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_RDEV 1
@@ -19236,10 +19732,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
-echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
+$as_echo_n "checking for struct stat.st_blksize... " >&6; }
 if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19264,20 +19760,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_blksize=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -19303,20 +19800,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_blksize=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_stat_st_blksize=no
@@ -19327,9 +19825,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; }
-if test $ac_cv_member_struct_stat_st_blksize = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
+$as_echo "$ac_cv_member_struct_stat_st_blksize" >&6; }
+if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
@@ -19338,10 +19836,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5
-echo $ECHO_N "checking for struct stat.st_flags... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5
+$as_echo_n "checking for struct stat.st_flags... " >&6; }
 if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19366,20 +19864,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_flags=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -19405,20 +19904,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_flags=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_stat_st_flags=no
@@ -19429,9 +19929,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_flags" >&6; }
-if test $ac_cv_member_struct_stat_st_flags = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5
+$as_echo "$ac_cv_member_struct_stat_st_flags" >&6; }
+if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_FLAGS 1
@@ -19440,10 +19940,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5
-echo $ECHO_N "checking for struct stat.st_gen... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5
+$as_echo_n "checking for struct stat.st_gen... " >&6; }
 if test "${ac_cv_member_struct_stat_st_gen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19468,20 +19968,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_gen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -19507,20 +20008,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_gen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_stat_st_gen=no
@@ -19531,9 +20033,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_gen" >&6; }
-if test $ac_cv_member_struct_stat_st_gen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5
+$as_echo "$ac_cv_member_struct_stat_st_gen" >&6; }
+if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_GEN 1
@@ -19542,10 +20044,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5
-echo $ECHO_N "checking for struct stat.st_birthtime... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5
+$as_echo_n "checking for struct stat.st_birthtime... " >&6; }
 if test "${ac_cv_member_struct_stat_st_birthtime+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19570,20 +20072,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_birthtime=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -19609,20 +20112,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_birthtime=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_stat_st_birthtime=no
@@ -19633,9 +20137,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_birthtime" >&6; }
-if test $ac_cv_member_struct_stat_st_birthtime = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5
+$as_echo "$ac_cv_member_struct_stat_st_birthtime" >&6; }
+if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
@@ -19644,10 +20148,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5
-echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5
+$as_echo_n "checking for struct stat.st_blocks... " >&6; }
 if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19672,20 +20176,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_blocks=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -19711,20 +20216,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_stat_st_blocks=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_stat_st_blocks=no
@@ -19735,9 +20241,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6; }
-if test $ac_cv_member_struct_stat_st_blocks = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5
+$as_echo "$ac_cv_member_struct_stat_st_blocks" >&6; }
+if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLOCKS 1
@@ -19759,10 +20265,10 @@
 
 
 
-{ echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5
-echo $ECHO_N "checking for time.h that defines altzone... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5
+$as_echo_n "checking for time.h that defines altzone... " >&6; }
 if test "${ac_cv_header_time_altzone+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19785,20 +20291,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_header_time_altzone=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_header_time_altzone=no
@@ -19807,8 +20314,8 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5
-echo "${ECHO_T}$ac_cv_header_time_altzone" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5
+$as_echo "$ac_cv_header_time_altzone" >&6; }
 if test $ac_cv_header_time_altzone = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -19818,8 +20325,8 @@
 fi
 
 was_it_defined=no
-{ echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether sys/select.h and sys/time.h may both be included... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19845,13 +20352,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -19865,20 +20373,20 @@
   was_it_defined=yes
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $was_it_defined" >&5
-echo "${ECHO_T}$was_it_defined" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5
+$as_echo "$was_it_defined" >&6; }
 
-{ echo "$as_me:$LINENO: checking for addrinfo" >&5
-echo $ECHO_N "checking for addrinfo... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for addrinfo" >&5
+$as_echo_n "checking for addrinfo... " >&6; }
 if test "${ac_cv_struct_addrinfo+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19902,20 +20410,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_struct_addrinfo=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_struct_addrinfo=no
@@ -19924,8 +20433,8 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5
-echo "${ECHO_T}$ac_cv_struct_addrinfo" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5
+$as_echo "$ac_cv_struct_addrinfo" >&6; }
 if test $ac_cv_struct_addrinfo = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -19934,10 +20443,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for sockaddr_storage" >&5
-echo $ECHO_N "checking for sockaddr_storage... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for sockaddr_storage" >&5
+$as_echo_n "checking for sockaddr_storage... " >&6; }
 if test "${ac_cv_struct_sockaddr_storage+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19962,20 +20471,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_struct_sockaddr_storage=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_struct_sockaddr_storage=no
@@ -19984,8 +20494,8 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5
-echo "${ECHO_T}$ac_cv_struct_sockaddr_storage" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5
+$as_echo "$ac_cv_struct_sockaddr_storage" >&6; }
 if test $ac_cv_struct_sockaddr_storage = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -19997,10 +20507,10 @@
 # checks for compiler characteristics
 
 
-{ echo "$as_me:$LINENO: checking whether char is unsigned" >&5
-echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether char is unsigned" >&5
+$as_echo_n "checking whether char is unsigned... " >&6; }
 if test "${ac_cv_c_char_unsigned+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -20025,20 +20535,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_c_char_unsigned=no
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_c_char_unsigned=yes
@@ -20046,8 +20557,8 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5
-echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5
+$as_echo "$ac_cv_c_char_unsigned" >&6; }
 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
   cat >>confdefs.h <<\_ACEOF
 #define __CHAR_UNSIGNED__ 1
@@ -20055,10 +20566,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
 if test "${ac_cv_c_const+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -20130,20 +20641,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_c_const=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_c_const=no
@@ -20151,20 +20663,20 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
 if test $ac_cv_c_const = no; then
 
 cat >>confdefs.h <<\_ACEOF
-#define const
+#define const /**/
 _ACEOF
 
 fi
 
 
 works=no
-{ echo "$as_me:$LINENO: checking for working volatile" >&5
-echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5
+$as_echo_n "checking for working volatile... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20186,37 +20698,38 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   works=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 cat >>confdefs.h <<\_ACEOF
-#define volatile
+#define volatile /**/
 _ACEOF
 
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $works" >&5
-echo "${ECHO_T}$works" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $works" >&5
+$as_echo "$works" >&6; }
 
 works=no
-{ echo "$as_me:$LINENO: checking for working signed char" >&5
-echo $ECHO_N "checking for working signed char... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for working signed char" >&5
+$as_echo_n "checking for working signed char... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20238,37 +20751,38 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   works=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 cat >>confdefs.h <<\_ACEOF
-#define signed
+#define signed /**/
 _ACEOF
 
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $works" >&5
-echo "${ECHO_T}$works" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $works" >&5
+$as_echo "$works" >&6; }
 
 have_prototypes=no
-{ echo "$as_me:$LINENO: checking for prototypes" >&5
-echo $ECHO_N "checking for prototypes... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for prototypes" >&5
+$as_echo_n "checking for prototypes... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20290,13 +20804,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -20310,19 +20825,19 @@
   have_prototypes=yes
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $have_prototypes" >&5
-echo "${ECHO_T}$have_prototypes" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $have_prototypes" >&5
+$as_echo "$have_prototypes" >&6; }
 
 works=no
-{ echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5
-echo $ECHO_N "checking for variable length prototypes and stdarg.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5
+$as_echo_n "checking for variable length prototypes and stdarg.h... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20354,13 +20869,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -20374,19 +20890,19 @@
   works=yes
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $works" >&5
-echo "${ECHO_T}$works" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $works" >&5
+$as_echo "$works" >&6; }
 
 # check for socketpair
-{ echo "$as_me:$LINENO: checking for socketpair" >&5
-echo $ECHO_N "checking for socketpair... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for socketpair" >&5
+$as_echo_n "checking for socketpair... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20411,13 +20927,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -20427,22 +20944,22 @@
 #define HAVE_SOCKETPAIR 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 # check if sockaddr has sa_len member
-{ echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5
-echo $ECHO_N "checking if sockaddr has sa_len member... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5
+$as_echo_n "checking if sockaddr has sa_len member... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20466,37 +20983,38 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOCKADDR_SA_LEN 1
 _ACEOF
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 va_list_is_array=no
-{ echo "$as_me:$LINENO: checking whether va_list is an array" >&5
-echo $ECHO_N "checking whether va_list is an array... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether va_list is an array" >&5
+$as_echo_n "checking whether va_list is an array... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20524,20 +21042,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -20551,17 +21070,17 @@
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $va_list_is_array" >&5
-echo "${ECHO_T}$va_list_is_array" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $va_list_is_array" >&5
+$as_echo "$va_list_is_array" >&6; }
 
 # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
 
 
 
-{ echo "$as_me:$LINENO: checking for gethostbyname_r" >&5
-echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for gethostbyname_r" >&5
+$as_echo_n "checking for gethostbyname_r... " >&6; }
 if test "${ac_cv_func_gethostbyname_r+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -20614,39 +21133,43 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_gethostbyname_r=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_gethostbyname_r=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5
-echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6; }
-if test $ac_cv_func_gethostbyname_r = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5
+$as_echo "$ac_cv_func_gethostbyname_r" >&6; }
+if test "x$ac_cv_func_gethostbyname_r" = x""yes; then
 
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_GETHOSTBYNAME_R 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5
-echo $ECHO_N "checking gethostbyname_r with 6 args... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5
+$as_echo_n "checking gethostbyname_r with 6 args... " >&6; }
   OLD_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
   cat >conftest.$ac_ext <<_ACEOF
@@ -20680,13 +21203,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -20701,18 +21225,18 @@
 #define HAVE_GETHOSTBYNAME_R_6_ARG 1
 _ACEOF
 
-    { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+    { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-    { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-    { echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5
-echo $ECHO_N "checking gethostbyname_r with 5 args... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5
+$as_echo_n "checking gethostbyname_r with 5 args... " >&6; }
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20744,13 +21268,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -20765,18 +21290,18 @@
 #define HAVE_GETHOSTBYNAME_R_5_ARG 1
 _ACEOF
 
-      { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+      { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-      { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-      { echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5
-echo $ECHO_N "checking gethostbyname_r with 3 args... $ECHO_C" >&6; }
+      { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+      { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5
+$as_echo_n "checking gethostbyname_r with 3 args... " >&6; }
       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20806,13 +21331,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -20827,16 +21353,16 @@
 #define HAVE_GETHOSTBYNAME_R_3_ARG 1
 _ACEOF
 
-        { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-        { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+        { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -20856,11 +21382,11 @@
 
 for ac_func in gethostbyname
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -20913,35 +21439,42 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -20960,10 +21493,10 @@
 # (none yet)
 
 # Linux requires this for correct f.p. operations
-{ echo "$as_me:$LINENO: checking for __fpu_control" >&5
-echo $ECHO_N "checking for __fpu_control... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for __fpu_control" >&5
+$as_echo_n "checking for __fpu_control... " >&6; }
 if test "${ac_cv_func___fpu_control+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -21016,39 +21549,43 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func___fpu_control=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func___fpu_control=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5
-echo "${ECHO_T}$ac_cv_func___fpu_control" >&6; }
-if test $ac_cv_func___fpu_control = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5
+$as_echo "$ac_cv_func___fpu_control" >&6; }
+if test "x$ac_cv_func___fpu_control" = x""yes; then
   :
 else
 
-{ echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5
-echo $ECHO_N "checking for __fpu_control in -lieee... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5
+$as_echo_n "checking for __fpu_control in -lieee... " >&6; }
 if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lieee  $LIBS"
@@ -21080,33 +21617,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_ieee___fpu_control=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_ieee___fpu_control=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5
-echo "${ECHO_T}$ac_cv_lib_ieee___fpu_control" >&6; }
-if test $ac_cv_lib_ieee___fpu_control = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5
+$as_echo "$ac_cv_lib_ieee___fpu_control" >&6; }
+if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBIEEE 1
 _ACEOF
@@ -21120,8 +21661,8 @@
 
 
 # Check for --with-fpectl
-{ echo "$as_me:$LINENO: checking for --with-fpectl" >&5
-echo $ECHO_N "checking for --with-fpectl... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-fpectl" >&5
+$as_echo_n "checking for --with-fpectl... " >&6; }
 
 # Check whether --with-fpectl was given.
 if test "${with_fpectl+set}" = set; then
@@ -21133,14 +21674,14 @@
 #define WANT_SIGFPE_HANDLER 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -21150,53 +21691,53 @@
 Darwin) ;;
 *) LIBM=-lm
 esac
-{ echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5
-echo $ECHO_N "checking for --with-libm=STRING... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5
+$as_echo_n "checking for --with-libm=STRING... " >&6; }
 
 # Check whether --with-libm was given.
 if test "${with_libm+set}" = set; then
   withval=$with_libm;
 if test "$withval" = no
 then LIBM=
-     { echo "$as_me:$LINENO: result: force LIBM empty" >&5
-echo "${ECHO_T}force LIBM empty" >&6; }
+     { $as_echo "$as_me:$LINENO: result: force LIBM empty" >&5
+$as_echo "force LIBM empty" >&6; }
 elif test "$withval" != yes
 then LIBM=$withval
-     { echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5
-echo "${ECHO_T}set LIBM=\"$withval\"" >&6; }
-else { { echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5
-echo "$as_me: error: proper usage is --with-libm=STRING" >&2;}
+     { $as_echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5
+$as_echo "set LIBM=\"$withval\"" >&6; }
+else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5
+$as_echo "$as_me: error: proper usage is --with-libm=STRING" >&2;}
    { (exit 1); exit 1; }; }
 fi
 else
-  { echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5
-echo "${ECHO_T}default LIBM=\"$LIBM\"" >&6; }
+  { $as_echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5
+$as_echo "default LIBM=\"$LIBM\"" >&6; }
 fi
 
 
 # check for --with-libc=...
 
-{ echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5
-echo $ECHO_N "checking for --with-libc=STRING... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5
+$as_echo_n "checking for --with-libc=STRING... " >&6; }
 
 # Check whether --with-libc was given.
 if test "${with_libc+set}" = set; then
   withval=$with_libc;
 if test "$withval" = no
 then LIBC=
-     { echo "$as_me:$LINENO: result: force LIBC empty" >&5
-echo "${ECHO_T}force LIBC empty" >&6; }
+     { $as_echo "$as_me:$LINENO: result: force LIBC empty" >&5
+$as_echo "force LIBC empty" >&6; }
 elif test "$withval" != yes
 then LIBC=$withval
-     { echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5
-echo "${ECHO_T}set LIBC=\"$withval\"" >&6; }
-else { { echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5
-echo "$as_me: error: proper usage is --with-libc=STRING" >&2;}
+     { $as_echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5
+$as_echo "set LIBC=\"$withval\"" >&6; }
+else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5
+$as_echo "$as_me: error: proper usage is --with-libc=STRING" >&2;}
    { (exit 1); exit 1; }; }
 fi
 else
-  { echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5
-echo "${ECHO_T}default LIBC=\"$LIBC\"" >&6; }
+  { $as_echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5
+$as_echo "default LIBC=\"$LIBC\"" >&6; }
 fi
 
 
@@ -21207,12 +21748,103 @@
 LIBS_SAVE=$LIBS
 LIBS="$LIBS $LIBM"
 
+# Detect whether system arithmetic is subject to x87-style double
+# rounding issues.  The result of this test has little meaning on non
+# IEEE 754 platforms.  On IEEE 754, test should return 1 if rounding
+# mode is round-to-nearest and double rounding issues are present, and
+# 0 otherwise.  See http://bugs.python.org/issue2937 for more info.
+{ $as_echo "$as_me:$LINENO: checking for x87-style double rounding" >&5
+$as_echo_n "checking for x87-style double rounding... " >&6; }
+if test "${ac_cv_x87_double_rounding+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+if test "$cross_compiling" = yes; then
+  ac_cv_x87_double_rounding=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdlib.h>
+#include <math.h>
+int main() {
+    volatile double x, y, z;
+    /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
+    x = 0.99999999999999989; /* 1-2**-53 */
+    y = 1./x;
+    if (y != 1.)
+        exit(0);
+    /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */
+    x = 1e16;
+    y = 2.99999;
+    z = x + y;
+    if (z != 1e16+4.)
+        exit(0);
+    /* both tests show evidence of double rounding */
+    exit(1);
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_x87_double_rounding=no
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_x87_double_rounding=yes
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5
+$as_echo "$ac_cv_x87_double_rounding" >&6; }
+if test "$ac_cv_x87_double_rounding" = yes
+then
+
+cat >>confdefs.h <<\_ACEOF
+#define X87_DOUBLE_ROUNDING 1
+_ACEOF
+
+fi
+
+
 # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
 # -0. on some architectures.
-{ echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5
-echo $ECHO_N "checking whether tanh preserves the sign of zero... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5
+$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; }
 if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
 
 if test "$cross_compiling" = yes; then
@@ -21243,37 +21875,40 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_tanh_preserves_zero_sign=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_tanh_preserves_zero_sign=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5
-echo "${ECHO_T}$ac_cv_tanh_preserves_zero_sign" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5
+$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; }
 if test "$ac_cv_tanh_preserves_zero_sign" = yes
 then
 
@@ -21284,13 +21919,20 @@
 fi
 
 
-for ac_func in hypot
+
+
+
+
+
+
+
+for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -21343,65 +21985,187 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether isinf is declared" >&5
+$as_echo_n "checking whether isinf is declared... " >&6; }
+if test "${ac_cv_have_decl_isinf+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <math.h>
+
+int
+main ()
+{
+#ifndef isinf
+  (void) isinf;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_isinf=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_have_decl_isinf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5
+$as_echo "$ac_cv_have_decl_isinf" >&6; }
+if test "x$ac_cv_have_decl_isinf" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISINF 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISINF 0
+_ACEOF
+
+
+fi
+{ $as_echo "$as_me:$LINENO: checking whether isnan is declared" >&5
+$as_echo_n "checking whether isnan is declared... " >&6; }
+if test "${ac_cv_have_decl_isnan+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <math.h>
+
+int
+main ()
+{
+#ifndef isnan
+  (void) isnan;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  eval "$as_ac_var=yes"
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_isnan=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+	ac_cv_have_decl_isnan=no
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
-  case " $LIBOBJS " in
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
- ;;
-esac
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-done
-
-
-
-
-
-
-
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5
+$as_echo "$ac_cv_have_decl_isnan" >&6; }
+if test "x$ac_cv_have_decl_isnan" = x""yes; then
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISNAN 1
+_ACEOF
 
 
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISNAN 0
+_ACEOF
 
 
-for ac_func in acosh asinh atanh copysign expm1 finite isinf isnan log1p
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ $as_echo "$as_me:$LINENO: checking whether isfinite is declared" >&5
+$as_echo_n "checking whether isfinite is declared... " >&6; }
+if test "${ac_cv_have_decl_isfinite+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -21409,101 +22173,81 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
+#include <math.h>
 
 int
 main ()
 {
-return $ac_func ();
+#ifndef isfinite
+  (void) isfinite;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  eval "$as_ac_var=yes"
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_isfinite=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
+	ac_cv_have_decl_isfinite=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5
+$as_echo "$ac_cv_have_decl_isfinite" >&6; }
+if test "x$ac_cv_have_decl_isfinite" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISFINITE 1
+_ACEOF
+
+
+else
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_DECL_ISFINITE 0
 _ACEOF
 
+
 fi
-done
+
 
 
 LIBS=$LIBS_SAVE
 
 # check for wchar.h
 if test "${ac_cv_header_wchar_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for wchar.h" >&5
-echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for wchar.h" >&5
+$as_echo_n "checking for wchar.h... " >&6; }
 if test "${ac_cv_header_wchar_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5
-echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5
+$as_echo "$ac_cv_header_wchar_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking wchar.h usability" >&5
-echo $ECHO_N "checking wchar.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking wchar.h usability" >&5
+$as_echo_n "checking wchar.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21519,32 +22263,33 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking wchar.h presence" >&5
-echo $ECHO_N "checking wchar.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking wchar.h presence" >&5
+$as_echo_n "checking wchar.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21558,51 +22303,52 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: wchar.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: wchar.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: wchar.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: wchar.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: wchar.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: wchar.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: wchar.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: wchar.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## ------------------------------------------------ ##
 ## Report this to http://www.python.org/python-bugs ##
@@ -21611,18 +22357,18 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for wchar.h" >&5
-echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for wchar.h" >&5
+$as_echo_n "checking for wchar.h... " >&6; }
 if test "${ac_cv_header_wchar_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_header_wchar_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5
-echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5
+$as_echo "$ac_cv_header_wchar_h" >&6; }
 
 fi
-if test $ac_cv_header_wchar_h = yes; then
+if test "x$ac_cv_header_wchar_h" = x""yes; then
 
 
 cat >>confdefs.h <<\_ACEOF
@@ -21641,69 +22387,14 @@
 # determine wchar_t size
 if test "$wchar_h" = yes
 then
-  { echo "$as_me:$LINENO: checking for wchar_t" >&5
-echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_wchar_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <wchar.h>
-
-typedef wchar_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_wchar_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_wchar_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5
-echo "${ECHO_T}$ac_cv_type_wchar_t" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
+  # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of wchar_t" >&5
-echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5
+$as_echo_n "checking size of wchar_t... " >&6; }
 if test "${ac_cv_sizeof_wchar_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -21715,11 +22406,10 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -21732,13 +22422,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -21753,11 +22444,10 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -21770,20 +22460,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -21797,7 +22488,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -21808,11 +22499,10 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) < 0)];
 test_array [0] = 0
 
   ;
@@ -21825,13 +22515,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -21846,11 +22537,10 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -21863,20 +22553,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -21890,7 +22581,7 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -21911,11 +22602,10 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-   typedef wchar_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -21928,20 +22618,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -21952,11 +22643,13 @@
 case $ac_lo in
 ?*) ac_cv_sizeof_wchar_t=$ac_lo;;
 '') if test "$ac_cv_type_wchar_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (wchar_t)
+$as_echo "$as_me: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_wchar_t=0
    fi ;;
@@ -21970,9 +22663,8 @@
 /* end confdefs.h.  */
 #include <wchar.h>
 
-   typedef wchar_t ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (wchar_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (wchar_t)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -21982,20 +22674,22 @@
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (wchar_t))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (wchar_t))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (wchar_t))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -22008,43 +22702,48 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_wchar_t=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_wchar_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (wchar_t)
+$as_echo "$as_me: error: cannot compute sizeof (wchar_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_wchar_t=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5
+$as_echo "$ac_cv_sizeof_wchar_t" >&6; }
 
 
 
@@ -22055,8 +22754,8 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5
-echo $ECHO_N "checking for UCS-4 tcl... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5
+$as_echo_n "checking for UCS-4 tcl... " >&6; }
 have_ucs4_tcl=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -22083,13 +22782,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -22103,24 +22803,24 @@
   have_ucs4_tcl=yes
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5
-echo "${ECHO_T}$have_ucs4_tcl" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5
+$as_echo "$have_ucs4_tcl" >&6; }
 
 # check whether wchar_t is signed or not
 if test "$wchar_h" = yes
 then
   # check whether wchar_t is signed or not
-  { echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5
-echo $ECHO_N "checking whether wchar_t is signed... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5
+$as_echo_n "checking whether wchar_t is signed... " >&6; }
   if test "${ac_cv_wchar_t_signed+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
 
   if test "$cross_compiling" = yes; then
@@ -22147,41 +22847,44 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_wchar_t_signed=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_wchar_t_signed=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 fi
 
-  { echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5
-echo "${ECHO_T}$ac_cv_wchar_t_signed" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5
+$as_echo "$ac_cv_wchar_t_signed" >&6; }
 fi
 
-{ echo "$as_me:$LINENO: checking what type to use for str" >&5
-echo $ECHO_N "checking what type to use for str... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking what type to use for str" >&5
+$as_echo_n "checking what type to use for str... " >&6; }
 
 # Check whether --with-wide-unicode was given.
 if test "${with_wide_unicode+set}" = set; then
@@ -22227,53 +22930,199 @@
 #define HAVE_USABLE_WCHAR_T 1
 _ACEOF
 
-  cat >>confdefs.h <<\_ACEOF
-#define PY_UNICODE_TYPE wchar_t
-_ACEOF
+  cat >>confdefs.h <<\_ACEOF
+#define PY_UNICODE_TYPE wchar_t
+_ACEOF
+
+elif test "$ac_cv_sizeof_short" = "$unicode_size"
+then
+     PY_UNICODE_TYPE="unsigned short"
+     cat >>confdefs.h <<\_ACEOF
+#define PY_UNICODE_TYPE unsigned short
+_ACEOF
+
+elif test "$ac_cv_sizeof_long" = "$unicode_size"
+then
+     PY_UNICODE_TYPE="unsigned long"
+     cat >>confdefs.h <<\_ACEOF
+#define PY_UNICODE_TYPE unsigned long
+_ACEOF
+
+else
+     PY_UNICODE_TYPE="no type found"
+fi
+{ $as_echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5
+$as_echo "$PY_UNICODE_TYPE" >&6; }
+
+# check for endianness
+
+ { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+	       not a universal capable compiler
+	     #endif
+	     typedef int dummy;
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+	# Check for potential -arch flags.  It is not universal unless
+	# there are some -arch flags.  Note that *ppc* also matches
+	# ppc64.  This check is also rather less than ideal.
+	case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in  #(
+	  *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
+	esac
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+	     #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+		     && LITTLE_ENDIAN)
+	      bogus endian macros
+	     #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+		#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+		 not big endian
+		#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_c_bigendian=no
+fi
 
-elif test "$ac_cv_sizeof_short" = "$unicode_size"
-then
-     PY_UNICODE_TYPE="unsigned short"
-     cat >>confdefs.h <<\_ACEOF
-#define PY_UNICODE_TYPE unsigned short
-_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-elif test "$ac_cv_sizeof_long" = "$unicode_size"
-then
-     PY_UNICODE_TYPE="unsigned long"
-     cat >>confdefs.h <<\_ACEOF
-#define PY_UNICODE_TYPE unsigned long
-_ACEOF
 
-else
-     PY_UNICODE_TYPE="no type found"
 fi
-{ echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5
-echo "${ECHO_T}$PY_UNICODE_TYPE" >&6; }
 
-# check for endianness
-{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # See if sys/param.h defines the BYTE_ORDER macro.
-cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/param.h>
+#include <limits.h>
 
 int
 main ()
 {
-#if  ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
-	&& BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
- bogus endian macros
-#endif
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+	      bogus endian macros
+	     #endif
 
   ;
   return 0;
@@ -22285,33 +23134,33 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-cat >conftest.$ac_ext <<_ACEOF
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+	 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/param.h>
+#include <limits.h>
 
 int
 main ()
 {
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
+#ifndef _BIG_ENDIAN
+		 not big endian
+		#endif
 
   ;
   return 0;
@@ -22323,20 +23172,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_c_bigendian=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_c_bigendian=no
@@ -22344,29 +23194,44 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	# It does not; compile a test program.
-if test "$cross_compiling" = yes; then
-  # try to guess the endianness by grepping values into an object file
-  ac_cv_c_bigendian=unknown
-  cat >conftest.$ac_ext <<_ACEOF
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then
+  # Try to guess by grepping values from an object file.
+	 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+short int ascii_mm[] =
+		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+		short int ascii_ii[] =
+		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+		int use_ascii (int i) {
+		  return ascii_mm[i] + ascii_ii[i];
+		}
+		short int ebcdic_ii[] =
+		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+		short int ebcdic_mm[] =
+		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+		int use_ebcdic (int i) {
+		  return ebcdic_mm[i] + ebcdic_ii[i];
+		}
+		extern int foo;
+
 int
 main ()
 {
- _ascii (); _ebcdic ();
+return use_ascii (foo) == use_ebcdic (foo);
   ;
   return 0;
 }
@@ -22377,30 +23242,31 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
-  ac_cv_c_bigendian=yes
-fi
-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-  if test "$ac_cv_c_bigendian" = unknown; then
-    ac_cv_c_bigendian=no
-  else
-    # finding both strings is unlikely to happen, but who knows?
-    ac_cv_c_bigendian=unknown
-  fi
-fi
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+	      ac_cv_c_bigendian=yes
+	    fi
+	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+	      if test "$ac_cv_c_bigendian" = unknown; then
+		ac_cv_c_bigendian=no
+	      else
+		# finding both strings is unlikely to happen, but who knows?
+		ac_cv_c_bigendian=unknown
+	      fi
+	    fi
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -22419,14 +23285,14 @@
 main ()
 {
 
-  /* Are we little or big endian?  From Harbison&Steele.  */
-  union
-  {
-    long int l;
-    char c[sizeof (long int)];
-  } u;
-  u.l = 1;
-  return u.c[sizeof (long int) - 1] == 1;
+	     /* Are we little or big endian?  From Harbison&Steele.  */
+	     union
+	     {
+	       long int l;
+	       char c[sizeof (long int)];
+	     } u;
+	     u.l = 1;
+	     return u.c[sizeof (long int) - 1] == 1;
 
   ;
   return 0;
@@ -22438,63 +23304,70 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_bigendian=no
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_c_bigendian=yes
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
+    fi
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
-case $ac_cv_c_bigendian in
-  yes)
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+;; #(
+   no)
+      ;; #(
+   universal)
 
 cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
+#define AC_APPLE_UNIVERSAL_BUILD 1
 _ACEOF
- ;;
-  no)
-     ;;
-  *)
-    { { echo "$as_me:$LINENO: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+
+     ;; #(
+   *)
+     { { $as_echo "$as_me:$LINENO: error: unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+$as_echo "$as_me: error: unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
    { (exit 1); exit 1; }; } ;;
-esac
+ esac
 
 
 # Check whether right shifting a negative integer extends the sign bit
 # or fills with zeros (like the Cray J90, according to Tim Peters).
-{ echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5
-echo $ECHO_N "checking whether right shift extends the sign bit... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5
+$as_echo_n "checking whether right shift extends the sign bit... " >&6; }
 if test "${ac_cv_rshift_extends_sign+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
 
 if test "$cross_compiling" = yes; then
@@ -22519,37 +23392,40 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_rshift_extends_sign=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_rshift_extends_sign=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5
-echo "${ECHO_T}$ac_cv_rshift_extends_sign" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5
+$as_echo "$ac_cv_rshift_extends_sign" >&6; }
 if test "$ac_cv_rshift_extends_sign" = no
 then
 
@@ -22560,10 +23436,10 @@
 fi
 
 # check for getc_unlocked and related locking functions
-{ echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5
-echo $ECHO_N "checking for getc_unlocked() and friends... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5
+$as_echo_n "checking for getc_unlocked() and friends... " >&6; }
 if test "${ac_cv_have_getc_unlocked+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
@@ -22592,32 +23468,36 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_have_getc_unlocked=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_have_getc_unlocked=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5
-echo "${ECHO_T}$ac_cv_have_getc_unlocked" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5
+$as_echo "$ac_cv_have_getc_unlocked" >&6; }
 if test "$ac_cv_have_getc_unlocked" = yes
 then
 
@@ -22635,8 +23515,8 @@
 # library.  NOTE: Keep the precedence of listed libraries synchronised
 # with setup.py.
 py_cv_lib_readline=no
-{ echo "$as_me:$LINENO: checking how to link readline libs" >&5
-echo $ECHO_N "checking how to link readline libs... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking how to link readline libs" >&5
+$as_echo_n "checking how to link readline libs... " >&6; }
 for py_libtermcap in "" ncursesw ncurses curses termcap; do
   if test -z "$py_libtermcap"; then
     READLINE_LIBS="-lreadline"
@@ -22672,26 +23552,30 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   py_cv_lib_readline=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
   if test $py_cv_lib_readline = yes; then
@@ -22701,11 +23585,11 @@
 # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts
 #AC_SUBST([READLINE_LIBS])
 if test $py_cv_lib_readline = no; then
-  { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
+  { $as_echo "$as_me:$LINENO: result: none" >&5
+$as_echo "none" >&6; }
 else
-  { echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5
-echo "${ECHO_T}$READLINE_LIBS" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5
+$as_echo "$READLINE_LIBS" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_LIBREADLINE 1
@@ -22714,10 +23598,10 @@
 fi
 
 # check for readline 2.1
-{ echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5
-echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5
+$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; }
 if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lreadline $READLINE_LIBS $LIBS"
@@ -22749,33 +23633,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_readline_rl_callback_handler_install=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_readline_rl_callback_handler_install=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5
-echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_handler_install" >&6; }
-if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5
+$as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; }
+if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_RL_CALLBACK 1
@@ -22798,20 +23686,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   have_readline=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   have_readline=no
@@ -22842,10 +23731,10 @@
 fi
 
 # check for readline 4.0
-{ echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5
-echo $ECHO_N "checking for rl_pre_input_hook in -lreadline... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5
+$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; }
 if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lreadline $READLINE_LIBS $LIBS"
@@ -22877,33 +23766,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_readline_rl_pre_input_hook=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_readline_rl_pre_input_hook=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5
-echo "${ECHO_T}$ac_cv_lib_readline_rl_pre_input_hook" >&6; }
-if test $ac_cv_lib_readline_rl_pre_input_hook = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5
+$as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; }
+if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_RL_PRE_INPUT_HOOK 1
@@ -22913,10 +23806,10 @@
 
 
 # also in 4.0
-{ echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5
-echo $ECHO_N "checking for rl_completion_display_matches_hook in -lreadline... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5
+$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; }
 if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lreadline $READLINE_LIBS $LIBS"
@@ -22948,33 +23841,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_readline_rl_completion_display_matches_hook=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_readline_rl_completion_display_matches_hook=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5
-echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; }
-if test $ac_cv_lib_readline_rl_completion_display_matches_hook = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5
+$as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; }
+if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1
@@ -22984,10 +23881,10 @@
 
 
 # check for readline 4.2
-{ echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5
-echo $ECHO_N "checking for rl_completion_matches in -lreadline... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5
+$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; }
 if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lreadline $READLINE_LIBS $LIBS"
@@ -23019,33 +23916,37 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_readline_rl_completion_matches=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_readline_rl_completion_matches=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5
-echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_matches" >&6; }
-if test $ac_cv_lib_readline_rl_completion_matches = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5
+$as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; }
+if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_RL_COMPLETION_MATCHES 1
@@ -23068,20 +23969,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   have_readline=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   have_readline=no
@@ -23114,10 +24016,10 @@
 # End of readline checks: restore LIBS
 LIBS=$LIBS_no_readline
 
-{ echo "$as_me:$LINENO: checking for broken nice()" >&5
-echo $ECHO_N "checking for broken nice()... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for broken nice()" >&5
+$as_echo_n "checking for broken nice()... " >&6; }
 if test "${ac_cv_broken_nice+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
 
 if test "$cross_compiling" = yes; then
@@ -23145,37 +24047,40 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_broken_nice=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_broken_nice=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5
-echo "${ECHO_T}$ac_cv_broken_nice" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5
+$as_echo "$ac_cv_broken_nice" >&6; }
 if test "$ac_cv_broken_nice" = yes
 then
 
@@ -23185,8 +24090,8 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for broken poll()" >&5
-echo $ECHO_N "checking for broken poll()... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for broken poll()" >&5
+$as_echo_n "checking for broken poll()... " >&6; }
 if test "$cross_compiling" = yes; then
   ac_cv_broken_poll=no
 else
@@ -23228,35 +24133,38 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_broken_poll=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_broken_poll=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
-{ echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5
-echo "${ECHO_T}$ac_cv_broken_poll" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5
+$as_echo "$ac_cv_broken_poll" >&6; }
 if test "$ac_cv_broken_poll" = yes
 then
 
@@ -23269,10 +24177,10 @@
 # Before we can test tzset, we need to check if struct tm has a tm_zone
 # (which is not required by ISO C or UNIX spec) and/or if we support
 # tzname[]
-{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
-echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
+$as_echo_n "checking for struct tm.tm_zone... " >&6; }
 if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -23300,20 +24208,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -23342,20 +24251,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_tm_tm_zone=no
@@ -23366,9 +24276,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
-echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; }
-if test $ac_cv_member_struct_tm_tm_zone = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
+$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; }
+if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_TM_TM_ZONE 1
@@ -23384,10 +24294,10 @@
 _ACEOF
 
 else
-  { echo "$as_me:$LINENO: checking whether tzname is declared" >&5
-echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5
+$as_echo_n "checking whether tzname is declared... " >&6; }
 if test "${ac_cv_have_decl_tzname+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -23414,20 +24324,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_tzname=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_have_decl_tzname=no
@@ -23435,9 +24346,9 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5
-echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; }
-if test $ac_cv_have_decl_tzname = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5
+$as_echo "$ac_cv_have_decl_tzname" >&6; }
+if test "x$ac_cv_have_decl_tzname" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_TZNAME 1
@@ -23453,10 +24364,10 @@
 fi
 
 
-  { echo "$as_me:$LINENO: checking for tzname" >&5
-echo $ECHO_N "checking for tzname... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for tzname" >&5
+$as_echo_n "checking for tzname... " >&6; }
 if test "${ac_cv_var_tzname+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -23483,31 +24394,35 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_var_tzname=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_var_tzname=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
-echo "${ECHO_T}$ac_cv_var_tzname" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
+$as_echo "$ac_cv_var_tzname" >&6; }
   if test $ac_cv_var_tzname = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -23519,10 +24434,10 @@
 
 
 # check tzset(3) exists and works like we expect it to
-{ echo "$as_me:$LINENO: checking for working tzset()" >&5
-echo $ECHO_N "checking for working tzset()... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for working tzset()" >&5
+$as_echo_n "checking for working tzset()... " >&6; }
 if test "${ac_cv_working_tzset+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
 
 if test "$cross_compiling" = yes; then
@@ -23605,37 +24520,40 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_working_tzset=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_working_tzset=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5
-echo "${ECHO_T}$ac_cv_working_tzset" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5
+$as_echo "$ac_cv_working_tzset" >&6; }
 if test "$ac_cv_working_tzset" = yes
 then
 
@@ -23646,10 +24564,10 @@
 fi
 
 # Look for subsecond timestamps in struct stat
-{ echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5
-echo $ECHO_N "checking for tv_nsec in struct stat... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5
+$as_echo_n "checking for tv_nsec in struct stat... " >&6; }
 if test "${ac_cv_stat_tv_nsec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -23675,20 +24593,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_stat_tv_nsec=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_stat_tv_nsec=no
@@ -23697,8 +24616,8 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5
-echo "${ECHO_T}$ac_cv_stat_tv_nsec" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5
+$as_echo "$ac_cv_stat_tv_nsec" >&6; }
 if test "$ac_cv_stat_tv_nsec" = yes
 then
 
@@ -23709,10 +24628,10 @@
 fi
 
 # Look for BSD style subsecond timestamps in struct stat
-{ echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5
-echo $ECHO_N "checking for tv_nsec2 in struct stat... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5
+$as_echo_n "checking for tv_nsec2 in struct stat... " >&6; }
 if test "${ac_cv_stat_tv_nsec2+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -23738,20 +24657,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_stat_tv_nsec2=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_stat_tv_nsec2=no
@@ -23760,8 +24680,8 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5
-echo "${ECHO_T}$ac_cv_stat_tv_nsec2" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5
+$as_echo "$ac_cv_stat_tv_nsec2" >&6; }
 if test "$ac_cv_stat_tv_nsec2" = yes
 then
 
@@ -23772,10 +24692,10 @@
 fi
 
 # On HP/UX 11.0, mvwdelch is a block with a return statement
-{ echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5
-echo $ECHO_N "checking whether mvwdelch is an expression... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5
+$as_echo_n "checking whether mvwdelch is an expression... " >&6; }
 if test "${ac_cv_mvwdelch_is_expression+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -23801,20 +24721,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_mvwdelch_is_expression=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_mvwdelch_is_expression=no
@@ -23823,8 +24744,8 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5
-echo "${ECHO_T}$ac_cv_mvwdelch_is_expression" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5
+$as_echo "$ac_cv_mvwdelch_is_expression" >&6; }
 
 if test "$ac_cv_mvwdelch_is_expression" = yes
 then
@@ -23835,10 +24756,10 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5
-echo $ECHO_N "checking whether WINDOW has _flags... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5
+$as_echo_n "checking whether WINDOW has _flags... " >&6; }
 if test "${ac_cv_window_has_flags+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -23864,20 +24785,21 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_window_has_flags=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_window_has_flags=no
@@ -23886,8 +24808,8 @@
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5
-echo "${ECHO_T}$ac_cv_window_has_flags" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5
+$as_echo "$ac_cv_window_has_flags" >&6; }
 
 
 if test "$ac_cv_window_has_flags" = yes
@@ -23899,8 +24821,8 @@
 
 fi
 
-{ echo "$as_me:$LINENO: checking for is_term_resized" >&5
-echo $ECHO_N "checking for is_term_resized... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for is_term_resized" >&5
+$as_echo_n "checking for is_term_resized... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23922,13 +24844,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -23938,21 +24861,21 @@
 #define HAVE_CURSES_IS_TERM_RESIZED 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-{ echo "$as_me:$LINENO: checking for resize_term" >&5
-echo $ECHO_N "checking for resize_term... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for resize_term" >&5
+$as_echo_n "checking for resize_term... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23974,13 +24897,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -23990,21 +24914,21 @@
 #define HAVE_CURSES_RESIZE_TERM 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-{ echo "$as_me:$LINENO: checking for resizeterm" >&5
-echo $ECHO_N "checking for resizeterm... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for resizeterm" >&5
+$as_echo_n "checking for resizeterm... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24026,13 +24950,14 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -24042,61 +24967,63 @@
 #define HAVE_CURSES_RESIZETERM 1
 _ACEOF
 
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-{ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5
-echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for /dev/ptmx" >&5
+$as_echo_n "checking for /dev/ptmx... " >&6; }
 
 if test -r /dev/ptmx
 then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_DEV_PTMX 1
 _ACEOF
 
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-{ echo "$as_me:$LINENO: checking for /dev/ptc" >&5
-echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for /dev/ptc" >&5
+$as_echo_n "checking for /dev/ptc... " >&6; }
 
 if test -r /dev/ptc
 then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_DEV_PTC 1
 _ACEOF
 
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5
-echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for %zd printf() format support" >&5
+$as_echo_n "checking for %zd printf() format support... " >&6; }
 if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
+$as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -24145,47 +25072,51 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define PY_FORMAT_SIZE_T "z"
 _ACEOF
 
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 
-{ echo "$as_me:$LINENO: checking for socklen_t" >&5
-echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5
+$as_echo_n "checking for socklen_t... " >&6; }
 if test "${ac_cv_type_socklen_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_socklen_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -24200,14 +25131,53 @@
 #endif
 
 
-typedef socklen_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (socklen_t))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+
+int
+main ()
+{
+if (sizeof ((socklen_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -24218,30 +25188,39 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_socklen_t=yes
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_socklen_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_socklen_t=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
-echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; }
-if test $ac_cv_type_socklen_t = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
+$as_echo "$ac_cv_type_socklen_t" >&6; }
+if test "x$ac_cv_type_socklen_t" = x""yes; then
   :
 else
 
@@ -24252,8 +25231,8 @@
 fi
 
 
-{ echo "$as_me:$LINENO: checking for broken mbstowcs" >&5
-echo $ECHO_N "checking for broken mbstowcs... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for broken mbstowcs" >&5
+$as_echo_n "checking for broken mbstowcs... " >&6; }
 if test "$cross_compiling" = yes; then
   ac_cv_broken_mbstowcs=no
 else
@@ -24279,35 +25258,38 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_broken_mbstowcs=no
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_broken_mbstowcs=yes
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
-{ echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5
-echo "${ECHO_T}$ac_cv_broken_mbstowcs" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5
+$as_echo "$ac_cv_broken_mbstowcs" >&6; }
 if test "$ac_cv_broken_mbstowcs" = yes
 then
 
@@ -24317,6 +25299,32 @@
 
 fi
 
+# Check for --with-computed-gotos
+{ $as_echo "$as_me:$LINENO: checking for --with-computed-gotos" >&5
+$as_echo_n "checking for --with-computed-gotos... " >&6; }
+
+# Check whether --with-computed-gotos was given.
+if test "${with_computed_gotos+set}" = set; then
+  withval=$with_computed_gotos;
+if test "$withval" != no
+then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_COMPUTED_GOTOS 1
+_ACEOF
+
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
 
 
 for h in `(cd $srcdir;echo Python/thread_*.h)`
@@ -24326,15 +25334,15 @@
 
 
 SRCDIRS="Parser Grammar Objects Python Modules Mac"
-{ echo "$as_me:$LINENO: checking for build directories" >&5
-echo $ECHO_N "checking for build directories... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for build directories" >&5
+$as_echo_n "checking for build directories... " >&6; }
 for dir in $SRCDIRS; do
     if test ! -d $dir; then
         mkdir $dir
     fi
 done
-{ echo "$as_me:$LINENO: result: done" >&5
-echo "${ECHO_T}done" >&6; }
+{ $as_echo "$as_me:$LINENO: result: done" >&5
+$as_echo "done" >&6; }
 
 # generate output files
 ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config"
@@ -24366,11 +25374,12 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
       *) $as_unset $ac_var ;;
       esac ;;
     esac
@@ -24403,12 +25412,12 @@
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
     test "x$cache_file" != "x/dev/null" &&
-      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -24424,7 +25433,7 @@
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
   ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -24436,12 +25445,14 @@
 
 
 
+
 : ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -24454,7 +25465,7 @@
 SHELL=\${CONFIG_SHELL-$SHELL}
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
@@ -24464,7 +25475,7 @@
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -24486,17 +25497,45 @@
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
   else
-    PATH_SEPARATOR=:
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
   fi
-  rm -f conf$$.sh
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 # Support unset when possible.
@@ -24512,8 +25551,6 @@
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
@@ -24536,7 +25573,7 @@
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   { (exit 1); exit 1; }
 fi
 
@@ -24549,17 +25586,10 @@
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-  fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
 
 # Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
@@ -24581,7 +25611,7 @@
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
@@ -24632,7 +25662,7 @@
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
@@ -24660,7 +25690,6 @@
 *)
   ECHO_N='-n';;
 esac
-
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -24673,19 +25702,22 @@
   rm -f conf$$.dir/conf$$.file
 else
   rm -f conf$$.dir
-  mkdir conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s='ln -s'
-  # ... but there are two gotchas:
-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-  # In both cases, we have to default to `cp -p'.
-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
@@ -24710,10 +25742,10 @@
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
 	case $1 in
-        -*)set "./$1";;
+	-*)set "./$1";;
 	esac;
 	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
 	???[sx]*):;;*)false;;esac;fi
@@ -24736,7 +25768,7 @@
 # values after options handling.
 ac_log="
 This file was extended by python $as_me 3.1, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -24749,29 +25781,39 @@
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<_ACEOF
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
+config_files="`echo $ac_config_files`"
+config_headers="`echo $ac_config_headers`"
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
 
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [FILE]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-  -q, --quiet      do not print progress messages
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-		   instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
-		   instantiate the configuration header FILE
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
 
 Configuration files:
 $config_files
@@ -24782,24 +25824,24 @@
 Report bugs to <bug-autoconf at gnu.org>."
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
 python config.status 3.1
-configured by $0, generated by GNU Autoconf 2.61,
-  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2008 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
 ac_pwd='$ac_pwd'
 srcdir='$srcdir'
 INSTALL='$INSTALL'
+test -n "\$AWK" || AWK=awk
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
 ac_need_defaults=:
 while test $# != 0
 do
@@ -24821,30 +25863,36 @@
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    echo "$ac_cs_version"; exit ;;
+    $as_echo "$ac_cs_version"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    { echo "$as_me: error: ambiguous option: $1
+    { $as_echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; };;
   --help | --hel | -h )
-    echo "$ac_cs_usage"; exit ;;
+    $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { echo "$as_me: error: unrecognized option: $1
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; } ;;
 
@@ -24863,30 +25911,32 @@
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  CONFIG_SHELL=$SHELL
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
   export CONFIG_SHELL
-  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  exec "\$@"
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 exec 5>>config.log
 {
   echo
   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
 ## Running $as_me. ##
 _ASBOX
-  echo "$ac_log"
+  $as_echo "$ac_log"
 } >&5
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
 # Handling of arguments.
 for ac_config_target in $ac_config_targets
@@ -24900,8 +25950,8 @@
     "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;;
     "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;;
 
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 done
@@ -24941,222 +25991,145 @@
   (umask 077 && mkdir "$tmp")
 } ||
 {
-   echo "$me: cannot create a temporary directory in ." >&2
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
 if test -n "$CONFIG_FILES"; then
 
-_ACEOF
 
+ac_cr='
+'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
 
 
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
-  cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-VERSION!$VERSION$ac_delim
-SOVERSION!$SOVERSION$ac_delim
-CONFIG_ARGS!$CONFIG_ARGS$ac_delim
-UNIVERSALSDK!$UNIVERSALSDK$ac_delim
-ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim
-PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim
-PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim
-PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim
-PYTHONFRAMEWORKPREFIX!$PYTHONFRAMEWORKPREFIX$ac_delim
-PYTHONFRAMEWORKINSTALLDIR!$PYTHONFRAMEWORKINSTALLDIR$ac_delim
-FRAMEWORKINSTALLFIRST!$FRAMEWORKINSTALLFIRST$ac_delim
-FRAMEWORKINSTALLLAST!$FRAMEWORKINSTALLLAST$ac_delim
-FRAMEWORKALTINSTALLFIRST!$FRAMEWORKALTINSTALLFIRST$ac_delim
-FRAMEWORKALTINSTALLLAST!$FRAMEWORKALTINSTALLLAST$ac_delim
-FRAMEWORKUNIXTOOLSPREFIX!$FRAMEWORKUNIXTOOLSPREFIX$ac_delim
-MACHDEP!$MACHDEP$ac_delim
-SGI_ABI!$SGI_ABI$ac_delim
-CONFIGURE_MACOSX_DEPLOYMENT_TARGET!$CONFIGURE_MACOSX_DEPLOYMENT_TARGET$ac_delim
-EXPORT_MACOSX_DEPLOYMENT_TARGET!$EXPORT_MACOSX_DEPLOYMENT_TARGET$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-CXX!$CXX$ac_delim
-MAINCC!$MAINCC$ac_delim
-CPP!$CPP$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-BUILDEXEEXT!$BUILDEXEEXT$ac_delim
-LIBRARY!$LIBRARY$ac_delim
-LDLIBRARY!$LDLIBRARY$ac_delim
-DLLLIBRARY!$DLLLIBRARY$ac_delim
-BLDLIBRARY!$BLDLIBRARY$ac_delim
-LDLIBRARYDIR!$LDLIBRARYDIR$ac_delim
-INSTSONAME!$INSTSONAME$ac_delim
-RUNSHARED!$RUNSHARED$ac_delim
-LINKCC!$LINKCC$ac_delim
-RANLIB!$RANLIB$ac_delim
-AR!$AR$ac_delim
-SVNVERSION!$SVNVERSION$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-LN!$LN$ac_delim
-OPT!$OPT$ac_delim
-BASECFLAGS!$BASECFLAGS$ac_delim
-UNIVERSAL_ARCH_FLAGS!$UNIVERSAL_ARCH_FLAGS$ac_delim
-OTHER_LIBTOOL_OPT!$OTHER_LIBTOOL_OPT$ac_delim
-LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim
-SO!$SO$ac_delim
-LDSHARED!$LDSHARED$ac_delim
-BLDSHARED!$BLDSHARED$ac_delim
-CCSHARED!$CCSHARED$ac_delim
-LINKFORSHARED!$LINKFORSHARED$ac_delim
-CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim
-SHLIBS!$SHLIBS$ac_delim
-USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim
-_ACEOF
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
    { (exit 1); exit 1; }; }
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
 done
+rm -f conf$$subs.sh
 
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
-  ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
 
+  print line
+}
 
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  cat >conf$$subs.sed <<_ACEOF
-SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim
-USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim
-LDLAST!$LDLAST$ac_delim
-THREADOBJ!$THREADOBJ$ac_delim
-DLINCLDIR!$DLINCLDIR$ac_delim
-DYNLOADFILE!$DYNLOADFILE$ac_delim
-MACHDEP_OBJS!$MACHDEP_OBJS$ac_delim
-TRUE!$TRUE$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-HAVE_GETHOSTBYNAME_R_6_ARG!$HAVE_GETHOSTBYNAME_R_6_ARG$ac_delim
-HAVE_GETHOSTBYNAME_R_5_ARG!$HAVE_GETHOSTBYNAME_R_5_ARG$ac_delim
-HAVE_GETHOSTBYNAME_R_3_ARG!$HAVE_GETHOSTBYNAME_R_3_ARG$ac_delim
-HAVE_GETHOSTBYNAME_R!$HAVE_GETHOSTBYNAME_R$ac_delim
-HAVE_GETHOSTBYNAME!$HAVE_GETHOSTBYNAME$ac_delim
-LIBM!$LIBM$ac_delim
-LIBC!$LIBC$ac_delim
-THREADHEADERS!$THREADHEADERS$ac_delim
-SRCDIRS!$SRCDIRS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACAWK
 _ACEOF
-
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then
-    break
-  elif $ac_last_try; then
-    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
    { (exit 1); exit 1; }; }
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
-  ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
 _ACEOF
 
-
 # VPATH may cause trouble with some makes, so we remove $(srcdir),
 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
@@ -25172,19 +26145,133 @@
 }'
 fi
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 fi # test -n "$CONFIG_FILES"
 
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
 
-for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    "
+shift
+for ac_tag
 do
   case $ac_tag in
   :[FHLC]) ac_mode=$ac_tag; continue;;
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
    { (exit 1); exit 1; }; };;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
@@ -25213,26 +26300,38 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
    { (exit 1); exit 1; }; };;
       esac
-      ac_file_inputs="$ac_file_inputs $ac_f"
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
     # use $as_me), people would be surprised to read:
     #    /* config.h.  Generated by config.status.  */
-    configure_input="Generated from "`IFS=:
-	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
-      { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
     fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin";;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
     esac
     ;;
   esac
@@ -25242,7 +26341,7 @@
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
 	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
+$as_echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -25268,7 +26367,7 @@
     as_dirs=
     while :; do
       case $as_dir in #(
-      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
       *) as_qdir=$as_dir;;
       esac
       as_dirs="'$as_qdir' $as_dirs"
@@ -25277,7 +26376,7 @@
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
 	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -25298,17 +26397,17 @@
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
   ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -25348,12 +26447,13 @@
   esac
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # If the template does not know about datarootdir, expand it.
 # FIXME: This hack should be removed a few years after 2.60.
 ac_datarootdir_hack=; ac_datarootdir_seen=
 
-case `sed -n '/datarootdir/ {
+ac_sed_dataroot='
+/datarootdir/ {
   p
   q
 }
@@ -25362,13 +26462,14 @@
 /@infodir@/p
 /@localedir@/p
 /@mandir@/p
-' $ac_file_inputs` in
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   ac_datarootdir_hack='
   s&@datadir@&$datadir&g
   s&@docdir@&$docdir&g
@@ -25382,15 +26483,16 @@
 # Neutralize VPATH when `$srcdir' = `.'.
 # Shell code in configure.ac might set extrasub.
 # FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
 $extrasub
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
+s|@configure_input@|$ac_sed_conf_input|;t t
 s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
 s&@srcdir@&$ac_srcdir&;t t
 s&@abs_srcdir@&$ac_abs_srcdir&;t t
 s&@top_srcdir@&$ac_top_srcdir&;t t
@@ -25400,119 +26502,58 @@
 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
   { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined." >&2;}
 
   rm -f "$tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out"; rm -f "$tmp/out";;
-  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
-  esac
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
  ;;
   :H)
   #
   # CONFIG_HEADER
   #
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status.  If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless.  But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
-ac_dB='\\)[	 (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
-  sed -n '
-	t rset
-	:rset
-	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
-	t ok
-	d
-	:ok
-	s/[\\&,]/\\&/g
-	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
-	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
-  ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[	 #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
-  # Write a here document:
-    cat >>$CONFIG_STATUS <<_ACEOF
-    # First, check the format of the line:
-    cat >"\$tmp/defines.sed" <<\\CEOF
-/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
-/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
-b
-:def
-_ACEOF
-  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
-  echo 'CEOF
-    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
-  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
-  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
-  grep . conftest.tail >/dev/null || break
-  rm -f conftest.defines
-  mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
   if test x"$ac_file" != x-; then
-    echo "/* $configure_input  */" >"$tmp/config.h"
-    cat "$ac_result" >>"$tmp/config.h"
-    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
-      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      rm -f $ac_file
-      mv "$tmp/config.h" $ac_file
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
-    echo "/* $configure_input  */"
-    cat "$ac_result"
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
   fi
-  rm -f "$tmp/out12"
  ;;
 
 
@@ -25526,6 +26567,11 @@
 chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
 
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
@@ -25547,6 +26593,10 @@
   # would make configure fail if this is the last instruction.
   $ac_cs_success || { (exit 1); exit 1; }
 fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
 
 
 echo "creating Modules/Setup"

Modified: python/branches/py3k-issue1717/configure.in
==============================================================================
--- python/branches/py3k-issue1717/configure.in	(original)
+++ python/branches/py3k-issue1717/configure.in	Sun Jan 25 21:08:20 2009
@@ -387,7 +387,7 @@
             AC_HELP_STRING(--without-gcc,never use gcc),
 [
 	case $withval in
-	no)	CC=cc
+	no)	CC=${CC:-cc}
 		without_gcc=yes;;
 	yes)	CC=gcc
 		without_gcc=no;;
@@ -693,6 +693,12 @@
 	  BLDLIBRARY='-L. -lpython$(VERSION)'
 	  RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
 	  ;;
+    Darwin*)
+    	LDLIBRARY='libpython$(VERSION).dylib'
+	BLDLIBRARY='-L. -lpython$(VERSION)'
+	RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
+	;;
+
   esac
 else # shared is disabled
   case $ac_sys_system in
@@ -1527,6 +1533,7 @@
 	sleep 10
 fi
 AC_MSG_RESULT($SO)
+
 AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
 # LDSHARED is the ld *command* used to create shared library
 # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
@@ -3049,6 +3056,44 @@
 LIBS_SAVE=$LIBS
 LIBS="$LIBS $LIBM"
 
+# Detect whether system arithmetic is subject to x87-style double
+# rounding issues.  The result of this test has little meaning on non
+# IEEE 754 platforms.  On IEEE 754, test should return 1 if rounding
+# mode is round-to-nearest and double rounding issues are present, and
+# 0 otherwise.  See http://bugs.python.org/issue2937 for more info.
+AC_MSG_CHECKING(for x87-style double rounding)
+AC_CACHE_VAL(ac_cv_x87_double_rounding, [
+AC_TRY_RUN([
+#include <stdlib.h>
+#include <math.h>
+int main() {
+    volatile double x, y, z;
+    /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
+    x = 0.99999999999999989; /* 1-2**-53 */
+    y = 1./x;
+    if (y != 1.)
+        exit(0);
+    /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */
+    x = 1e16;
+    y = 2.99999;
+    z = x + y;
+    if (z != 1e16+4.)
+        exit(0);
+    /* both tests show evidence of double rounding */
+    exit(1);
+}
+],
+ac_cv_x87_double_rounding=no,
+ac_cv_x87_double_rounding=yes,
+ac_cv_x87_double_rounding=no)])
+AC_MSG_RESULT($ac_cv_x87_double_rounding)
+if test "$ac_cv_x87_double_rounding" = yes
+then
+  AC_DEFINE(X87_DOUBLE_ROUNDING, 1,
+  [Define if arithmetic is subject to x87-style double rounding issue])
+fi
+
+
 # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
 # -0. on some architectures.
 AC_MSG_CHECKING(whether tanh preserves the sign of zero)
@@ -3075,9 +3120,8 @@
   [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
 fi
 
-AC_REPLACE_FUNCS(hypot)
-
-AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p)
+AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p])
+AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
 
 LIBS=$LIBS_SAVE
 
@@ -3616,6 +3660,22 @@
    wide chars that would be converted.])
 fi
 
+# Check for --with-computed-gotos
+AC_MSG_CHECKING(for --with-computed-gotos)
+AC_ARG_WITH(computed-gotos,
+            AC_HELP_STRING(--with-computed-gotos,
+                           Use computed gotos / threaded dispatch in evaluation loop (not available on all compilers)),
+[
+if test "$withval" != no
+then 
+  AC_DEFINE(USE_COMPUTED_GOTOS, 1,
+  [Define if you want to use computed gotos in ceval.c.]) 
+  AC_MSG_RESULT(yes)
+else AC_MSG_RESULT(no)
+fi],
+[AC_MSG_RESULT(no)])
+
+
 AC_SUBST(THREADHEADERS)
 
 for h in `(cd $srcdir;echo Python/thread_*.h)`

Modified: python/branches/py3k-issue1717/pyconfig.h.in
==============================================================================
--- python/branches/py3k-issue1717/pyconfig.h.in	(original)
+++ python/branches/py3k-issue1717/pyconfig.h.in	Sun Jan 25 21:08:20 2009
@@ -5,6 +5,9 @@
 #define Py_PYCONFIG_H
 
 
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
 /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
    support for AIX C++ shared extension modules. */
 #undef AIX_GENUINE_CPLUSPLUS
@@ -58,6 +61,10 @@
 /* Define to 1 if you have the <bluetooth.h> header file. */
 #undef HAVE_BLUETOOTH_H
 
+/* Define if mbstowcs(NULL, "text", 0) does not return the number of wide
+   chars that would be converted. */
+#undef HAVE_BROKEN_MBSTOWCS
+
 /* Define if nice() returns success/failure instead of the new priority. */
 #undef HAVE_BROKEN_NICE
 
@@ -112,6 +119,18 @@
 /* Define if you have the 'resize_term' function. */
 #undef HAVE_CURSES_RESIZE_TERM
 
+/* Define to 1 if you have the declaration of `isfinite', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ISFINITE
+
+/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
+   */
+#undef HAVE_DECL_ISINF
+
+/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
+   */
+#undef HAVE_DECL_ISNAN
+
 /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
    */
 #undef HAVE_DECL_TZNAME
@@ -312,12 +331,6 @@
 /* Define to 1 if you have the <io.h> header file. */
 #undef HAVE_IO_H
 
-/* Define to 1 if you have the `isinf' function. */
-#undef HAVE_ISINF
-
-/* Define to 1 if you have the `isnan' function. */
-#undef HAVE_ISNAN
-
 /* Define to 1 if you have the `kill' function. */
 #undef HAVE_KILL
 
@@ -357,7 +370,7 @@
 /* Define to 1 if you have the <libintl.h> header file. */
 #undef HAVE_LIBINTL_H
 
-/* Define to 1 if you have the `readline' library (-lreadline). */
+/* Define if you have the readline library (-lreadline). */
 #undef HAVE_LIBREADLINE
 
 /* Define to 1 if you have the `resolv' library (-lresolv). */
@@ -800,10 +813,6 @@
 /* Define to 1 if you have the `wcsxfrm' function. */
 #undef HAVE_WCSXFRM
 
-/* Define if mbstowcs(NULL, "text", 0) does not return the number of 
-   wide chars that would be converted */
-#undef HAVE_BROKEN_MBSTOWCS
-
 /* Define if tzset() actually switches the local timezone in a meaningful way.
    */
 #undef HAVE_WORKING_TZSET
@@ -943,6 +952,31 @@
 /* Define to 1 if your <sys/time.h> declares `struct tm'. */
 #undef TM_IN_SYS_TIME
 
+/* Define if you want to use computed gotos in ceval.c. */
+#undef USE_COMPUTED_GOTOS
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
 /* Define if a va_list is an array of some kind */
 #undef VA_LIST_IS_ARRAY
 
@@ -980,17 +1014,21 @@
 /* Define to profile with the Pentium timestamp counter */
 #undef WITH_TSC
 
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
-
-/* Define to 1 if on AIX 3.
-   System headers sometimes define this.
-   We just want to avoid a redefinition error message.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
 #endif
 
+/* Define if arithmetic is subject to x87-style double rounding issue */
+#undef X87_DOUBLE_ROUNDING
+
 /* Define on OpenBSD to activate all library features */
 #undef _BSD_SOURCE
 
@@ -1009,15 +1047,25 @@
 /* This must be defined on some systems to enable large file support. */
 #undef _LARGEFILE_SOURCE
 
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
 /* Define on NetBSD to activate all library features */
 #undef _NETBSD_SOURCE
 
 /* Define _OSF_SOURCE to get the makedev macro. */
 #undef _OSF_SOURCE
 
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
 /* Define to activate features from IEEE Stds 1003.1-2001 */
 #undef _POSIX_C_SOURCE
 
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
 /* Define if you have POSIX threads, and your system does not define that. */
 #undef _POSIX_THREADS
 

Modified: python/branches/py3k-issue1717/setup.py
==============================================================================
--- python/branches/py3k-issue1717/setup.py	(original)
+++ python/branches/py3k-issue1717/setup.py	Sun Jan 25 21:08:20 2009
@@ -1063,9 +1063,12 @@
             if macros.get('HAVE_SEM_OPEN', False):
                 multiprocessing_srcs.append('_multiprocessing/semaphore.c')
 
-        exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
-                                 define_macros=list(macros.items()),
-                                 include_dirs=["Modules/_multiprocessing"]))
+        if sysconfig.get_config_var('WITH_THREAD'):
+            exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
+                                    define_macros=list(macros.items()),
+                                    include_dirs=["Modules/_multiprocessing"]))
+        else:
+            missing.append('_multiprocessing')
         # End multiprocessing
 
         # Platform-specific libraries


More information about the Python-checkins mailing list